handle manual error

This commit is contained in:
Siwat Sirichai 2022-11-09 23:15:28 +07:00
parent 77094dfa53
commit ab3a4477c7
1 changed files with 6 additions and 5 deletions

View File

@ -46,11 +46,12 @@ class lcd:
if component_id == 2 and press_type == '00':
x = self.nextion.get_attribute("joystick.x")
y = self.nextion.get_attribute("joystick.y")
speed = 100 - (y - 60) / (205 - 60) * 200
turn = (x - 5) / (150 - 5) * 200 - 100
print(f"Setting speed to {speed} and turn angle to {turn}")
if not self.motion.is_roaming():
self.motion.drive_skew(speed,turn)
if x is not None and y is not None:
speed = 100 - (y - 60) / (205 - 60) * 200
turn = (x - 5) / (150 - 5) * 200 - 100
print(f"Setting speed to {speed} and turn angle to {turn}")
if not self.motion.is_roaming():
self.motion.drive_skew(speed,turn)
def _sensor_screen_updator(self):
while True:
self.nextion.send_command(