|
19 | 19 | from rclpy.time import Time |
20 | 20 | from ros2_numpy import numpify |
21 | 21 | from sensor_msgs.msg import Imu, JointState |
22 | | -from std_msgs.msg import Bool |
| 22 | +from std_msgs.msg import Bool, Float32 |
23 | 23 | from std_srvs.srv import SetBool |
24 | | -from livelybot_msg.msg import PowerDetect |
25 | 24 |
|
26 | 25 | from bitbots_hcm import hcm_dsd |
27 | 26 | from bitbots_hcm.hcm_dsd.hcm_blackboard import HcmBlackboard |
@@ -78,7 +77,7 @@ def __init__(self, use_sim_time, simulation_active, visualization_active): |
78 | 77 | self.hcm_deactivated = False |
79 | 78 |
|
80 | 79 | # Create subscribers |
81 | | - self.node.create_subscription(PowerDetect, "power_detect_state", self.power_detect_cb, 1) |
| 80 | + self.node.create_subscription(Float32, "battery_voltage", self.voltage_cb, 1) |
82 | 81 | self.node.create_subscription(Bool, "hcm_deactivate", self.deactivate_cb, 1) |
83 | 82 | self.node.create_subscription(DiagnosticArray, "diagnostics_agg", self.diag_cb, 1) |
84 | 83 | self.node.create_subscription(Bool, "game_controller/stop_msg", self.stop_cb, 1) |
@@ -142,9 +141,9 @@ def set_manual_penalize_mode_callback(self, req: ManualPenalize.Request, resp: M |
142 | 141 | resp.success = True |
143 | 142 | return resp |
144 | 143 |
|
145 | | - def power_detect_cb(self, msg: PowerDetect): |
146 | | - """Recives data send by the battery management system.""" |
147 | | - self.blackboard.battery_voltage = msg.voltage |
| 144 | + def voltage_cb(self, msg: Float32): |
| 145 | + """Receives data sent by the battery management system.""" |
| 146 | + self.blackboard.battery_voltage = msg.data |
148 | 147 |
|
149 | 148 | def diag_cb(self, msg: DiagnosticArray): |
150 | 149 | """Updates the diagnostic state.""" |
|
0 commit comments