Fix the motor server

This commit is contained in:
Piv
2019-11-28 08:03:28 +10:30
parent 10e45f5b45
commit 7793f808ea

View File

@@ -19,13 +19,13 @@ class MotorServicer(motorService_pb2_grpc.CarControlServicer):
self.servo = servo
self._timer = None
def SetThrottle(self, request_iterator, context):
def SetThrottle(self, request, context):
# gRPC streams currently don't work between python and android.
# If we don't get a response every 3 seconds, stop the car.
throttleFailed = False
print('Setting throttle to: ' + str(throttleRequest.throttle))
print('Setting throttle to: ' + str(request.throttle))
self.set_timeout(3)
throttleFailed = self.motor.set_throttle(throttleRequest.throttle)
throttleFailed = self.motor.set_throttle(request.throttle)
return motorService_pb2.ThrottleResponse(throttleSet = throttleFailed)
def SetSteering(self, request, context):