mirror of
https://github.com/SHC-ASTRA/rover-ros2.git
synced 2026-02-11 09:20:40 +00:00
feat: add brake mode to core
This commit is contained in:
@@ -172,10 +172,13 @@ class SerialRelay(Node):
|
|||||||
def send_controls(self, msg):
|
def send_controls(self, msg):
|
||||||
#can_relay_tovic,core,19, left_stick, right_stick
|
#can_relay_tovic,core,19, left_stick, right_stick
|
||||||
if(msg.turn_to_enable):
|
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:
|
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'
|
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)
|
self.send_cmd(command)
|
||||||
|
|
||||||
#print(f"[Sys] Relaying: {command}")
|
#print(f"[Sys] Relaying: {command}")
|
||||||
|
|||||||
Reference in New Issue
Block a user