Battery Monitor¶
- defadd_voltage
- defhw_kill_cb
- defpublish_voltage
Monitors the battery voltage measured by the 4 motors on Navigator, publishing a moving average of these measurements to /battery_monitor at a regular interval.
The average voltage across all of the four motors.
None
if no reading has occurred yet.- Type
Optional[float]
The most recent 1000 voltage readings. Each reading is from a separate motor.
- Type
List[float]
Whether a hardware kill was raised.
- Type
A publisher to the
/battery_monitor
topic. Published by thepublish_voltage()
method.- Type
rospy.Publisher
This is the callback function for feedback from all four motors.
It appends the new readings to the end of the list and ensures that the list stays under 1000 entries.
- Parameters
feedback (Feedback) – The feedback from one of the motors.
status (Status) – The status of the motor.
Serves as a callback when a hardware kill is activated.
- Parameters
msg (Alarm) – The alarm message that activated the hardware kill.
Publishes the average voltage across all four thrusters to the
battery_voltage
node as a standard Float32 message and runs the voltage_check.Currently runs every second.