mirror of
https://github.com/SHC-ASTRA/rover-ros2.git
synced 2026-02-11 09:20:40 +00:00
Fixes for string splitting
This commit is contained in:
@@ -162,7 +162,7 @@ class SerialRelay(Node):
|
|||||||
|
|
||||||
def recordAngleFeedback(self, msg):
|
def recordAngleFeedback(self, msg):
|
||||||
# Angle feedbacks
|
# Angle feedbacks
|
||||||
parts = msg.split(",")
|
parts = msg.data.split(",")
|
||||||
if len(parts) >= 7:
|
if len(parts) >= 7:
|
||||||
# Extract the angles from the string
|
# Extract the angles from the string
|
||||||
angles_in = parts[3:7]
|
angles_in = parts[3:7]
|
||||||
@@ -195,7 +195,7 @@ class SerialRelay(Node):
|
|||||||
|
|
||||||
def recordBusVoltage(self, msg):
|
def recordBusVoltage(self, msg):
|
||||||
# Bus Voltage feedbacks
|
# Bus Voltage feedbacks
|
||||||
parts = msg.split(",")
|
parts = msg.data.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]
|
||||||
@@ -209,7 +209,7 @@ class SerialRelay(Node):
|
|||||||
|
|
||||||
def recordMotorFeedback(self, msg):
|
def recordMotorFeedback(self, msg):
|
||||||
# Motor voltage/current/temperature feedback
|
# Motor voltage/current/temperature feedback
|
||||||
parts = msg.split(",")
|
parts = msg.data.split(",")
|
||||||
if len(parts) >= 7:
|
if len(parts) >= 7:
|
||||||
# Extract the voltage/current/temperature from the string
|
# Extract the voltage/current/temperature from the string
|
||||||
values_in = parts[3:7]
|
values_in = parts[3:7]
|
||||||
|
|||||||
Reference in New Issue
Block a user