feat: add brake mode to core

This commit is contained in:
David
2025-05-24 16:03:33 +00:00
parent 6b0ea58e95
commit f34ef88d6c

View File

@@ -172,12 +172,15 @@ class SerialRelay(Node):
def send_controls(self, msg):
#can_relay_tovic,core,19, left_stick, right_stick
if(msg.turn_to_enable):
command = "can_relay_tovic,core,41," + msg.turn_to + ',' + msg.turn_to_timeout + '\n'
command = "can_relay_tovic,core,41," + str(msg.turn_to) + ',' + str(msg.turn_to_timeout) + '\n'
else:
command = "can_relay_tovic,core,19," + self.scale_duty(msg.left_stick, msg.max_speed) + ',' + self.scale_duty(msg.right_stick, msg.max_speed) + '\n'
self.send_cmd(command)
# Brake mode
command = "can_relay_tovic,core,18," + str(int(msg.brake)) + '\n'
self.send_cmd(command)
#print(f"[Sys] Relaying: {command}")
def send_cmd(self, msg):
if self.launch_mode == 'anchor':