mirror of
https://github.com/SHC-ASTRA/rover-ros2.git
synced 2026-02-11 09:20:40 +00:00
fix: msg.split not msg.data.split
This commit is contained in:
@@ -165,7 +165,7 @@ class SerialRelay(Node):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def send_cmd(self, msg):
|
def send_cmd(self, msg: str):
|
||||||
if self.launch_mode == 'anchor': #if in anchor mode, send to anchor node to relay
|
if self.launch_mode == 'anchor': #if in anchor mode, send to anchor node to relay
|
||||||
output = String()
|
output = String()
|
||||||
output.data = msg
|
output.data = msg
|
||||||
@@ -174,7 +174,7 @@ class SerialRelay(Node):
|
|||||||
self.get_logger().info(f"[Arm to MCU] {msg}")
|
self.get_logger().info(f"[Arm to MCU] {msg}")
|
||||||
self.ser.write(bytes(msg, "utf8"))
|
self.ser.write(bytes(msg, "utf8"))
|
||||||
|
|
||||||
def anchor_feedback(self, msg):
|
def anchor_feedback(self, msg: String):
|
||||||
output = msg.data
|
output = msg.data
|
||||||
if output.startswith("can_relay_fromvic,arm,55"):
|
if output.startswith("can_relay_fromvic,arm,55"):
|
||||||
#pass
|
#pass
|
||||||
@@ -205,10 +205,10 @@ class SerialRelay(Node):
|
|||||||
self.socket_pub.publish(self.arm_feedback)
|
self.socket_pub.publish(self.arm_feedback)
|
||||||
self.digit_pub.publish(self.digit_feedback)
|
self.digit_pub.publish(self.digit_feedback)
|
||||||
|
|
||||||
def updateAngleFeedback(self, msg: String):
|
def updateAngleFeedback(self, msg: str):
|
||||||
# Angle feedbacks,
|
# Angle feedbacks,
|
||||||
#split the msg.data by commas
|
#split the msg.data by commas
|
||||||
parts = msg.data.split(",")
|
parts = msg.split(",")
|
||||||
|
|
||||||
if len(parts) >= 7:
|
if len(parts) >= 7:
|
||||||
# Extract the angles from the string
|
# Extract the angles from the string
|
||||||
@@ -241,9 +241,9 @@ class SerialRelay(Node):
|
|||||||
self.get_logger().info("Invalid angle feedback input format")
|
self.get_logger().info("Invalid angle feedback input format")
|
||||||
|
|
||||||
|
|
||||||
def updateBusVoltage(self, msg: String):
|
def updateBusVoltage(self, msg: str):
|
||||||
# Bus Voltage feedbacks
|
# Bus Voltage feedbacks
|
||||||
parts = msg.data.split(",")
|
parts = msg.split(",")
|
||||||
if len(parts) >= 7:
|
if len(parts) >= 7:
|
||||||
# Extract the voltage from the string
|
# Extract the voltage from the string
|
||||||
voltages_in = parts[3:7]
|
voltages_in = parts[3:7]
|
||||||
|
|||||||
Reference in New Issue
Block a user