zugaldia / android-robocar

Build your own robocar, remote-controlled or autonomous, with Android Things.
BSD 2-Clause "Simplified" License
94 stars 21 forks source link

Implemented api to set speed on left side and right side independently. #22

Closed hsalameh closed 7 years ago

hsalameh commented 7 years ago

Implemented api to set speed on left side and right side independently. Valid values are -255 (going backward) to 255 (going forward). endpoint: POST: /api/speed To set speed to max, json= { "left": 255 , "right": 255 } To stop motors, json = { "left": 0 , "right": 0 }

hsalameh commented 7 years ago

@zugaldia not sure why circleci is giving this compiler error:

/home/ubuntu/android-robocar/mobile/app/src/main/java/com/zugaldia/robocar/mobile/MainActivity.java:38: error: MainActivity is not abstract and does not override abstract method onSpeed(RobocarSpeed) in RequestListener

Building 74% > :app:compileDebugJavaWithJavacpublic class MainActivity extends AppCompatActivity

It compiles and works just fine on my side. Any idea?

zugaldia commented 7 years ago

@hsalameh Love where this PR is going.

I found the issue. It wasn't with the Robocar app, but with the companion mobile app on https://github.com/zugaldia/android-robocar/tree/master/mobile. It didn't have onSpeed() implemented. I just did on https://github.com/zugaldia/android-robocar/pull/22/commits/05d08f9914352b698ba892548163402f3f14cee9.

hsalameh commented 7 years ago

@zugaldia That makes a lot of sense now! :) I did not notice the "mobile" in the path of the error message and thought it was in the IOT app. Thanks for fixing it 👍

zugaldia commented 7 years ago

@hsalameh Great job, can't wait to play with this this weekend!