Proportional steering angle - RoboCarEsslingen/SunfounderCodeFromUwe GitHub Wiki
To make steering proportional to control lever position change code from
if event.axis == 0: # this is the x axis
if event.value > thresSteerHigh:
tcpCliSock.send('right')
if event.value < thresSteerLow:
tcpCliSock.send('left')
to
if event.axis == 0: # this is the x axis
if event.value > thresSteerHigh:
tcpCliSock.send('right')
angle = int(100*abs(event.value))
data = tmp1 + str(angle)
print 'sendData = %s' % data
tcpCliSock.send(data) # Send the speed data to the server(Raspberry Pi)
if event.value < thresSteerLow:
tcpCliSock.send('left')
angle = int(-100*abs(event.value))
data = tmp1 + str(angle)
print 'sendData = %s' % data
tcpCliSock.send(data) # Send the speed data to the server(Raspberry Pi)