Fix Motor Server and python controller

This commit is contained in:
Piv
2019-11-14 20:48:46 +10:30
parent 5024796785
commit a968a4ce97
2 changed files with 18 additions and 22 deletions

View File

@@ -3,10 +3,10 @@ print("Connecting to pi")
import grpc
from concurrent import futures
import motorService_pb2_grpc
from motorService_pb2 import ThrottleRequest
from motorService_pb2 import SteeringRequest, ThrottleRequest
import time
throttle = 0
throttle = 0.1
timer = None
class ThrottleIterator:
@@ -27,8 +27,7 @@ class ThrottleIterator:
channel = grpc.insecure_channel('10.0.0.53:50051')
stub = motorService_pb2_grpc.CarControlStub(channel)
stub.SetThrottle(ThrottleIterator())
response = stub.SetThrottle(ThrottleIterator())
while True:
inp = int(input('Please enter a value for the throttle between -100 and 100'))
throttle = inp / 100
throttle = int(input('Please enter a value for the throttle between -100 and 100'))