Stop using a grpc stream.
This commit is contained in:
@@ -20,16 +20,12 @@ class MotorServicer(motorService_pb2_grpc.CarControlServicer):
|
||||
self._timer = None
|
||||
|
||||
def SetThrottle(self, request_iterator, context):
|
||||
# gRPC streams currently don't work between python and android.
|
||||
# If we don't get a response every 3 seconds, stop the car.
|
||||
# This isn't a stream right now, however may change it to be so since we'll constantly
|
||||
# be sending values...
|
||||
throttleFailed = False
|
||||
for throttleRequest in request_iterator:
|
||||
print('Setting throttle to: ' + str(throttleRequest.throttle))
|
||||
self.set_timeout(3)
|
||||
throttleFailed = self.motor.set_throttle(throttleRequest.throttle)
|
||||
if not throttleFailed:
|
||||
break
|
||||
print('Setting throttle to: ' + str(throttleRequest.throttle))
|
||||
self.set_timeout(3)
|
||||
throttleFailed = self.motor.set_throttle(throttleRequest.throttle)
|
||||
return motorService_pb2.ThrottleResponse(throttleSet = throttleFailed)
|
||||
|
||||
def SetSteering(self, request, context):
|
||||
|
||||
Reference in New Issue
Block a user