Skip to content

Instantly share code, notes, and snippets.

@HemaZ
Created June 3, 2020 17:22
Show Gist options
  • Save HemaZ/1f9277be93cb991ef7124c68c117831b to your computer and use it in GitHub Desktop.
Save HemaZ/1f9277be93cb991ef7124c68c117831b to your computer and use it in GitHub Desktop.
def on_new_messages(self, messages):
if 'brake' in messages:
print("Braking signal received...")
print(messages['brake'].data)
brake_action = messages['brake'].data
if brake_action:
self.cm.DVA_write(self.brake_quant, 1)
else:
self.cm.DVA_write(self.brake_quant, 0)
if 'steer_sign' in messages:
print("Steering message received..")
print("steering value " + str(messages['steer_sign'].data))
self.cm.DVA_write(self.steer_quant, messages['steer_sign'].data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment