mavlink / mavros

MAVLink to ROS gateway with proxy for Ground Control Station
Other
902 stars 993 forks source link

consumed_current in BATTERY_STATUS using mavros #1678

Closed itzmejawad closed 2 years ago

itzmejawad commented 2 years ago

Hi ..

I am able to get consumed_current value from BATTERY_STATUS mavlink message using PyMAVLink

msg = autopilot.recv_match(type="BATTERY_STATUS") print(msg)

output:-

BATTERY_STATUS {id : 0, battery_function : 0, type : 0, temperature : 32767, voltages : [47544, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535], current_battery : 70, current_consumed : 5616, energy_consumed : 9609, battery_remaining : 43, time_remaining : 0, charge_state : 0, voltages_ext : [0, 0, 0, 0], mode : 0, fault_bitmask : 0}

I tried the same with mavros

rostopic echo /mavros/battery

image

In this i don't see consumed_current

again.. i tried rostopic echo /mavlink/from

image

i believe msgid 147 is related to BATTERY_STATUS

but how can i decode this payload64

Need help!

Mavros: ?0.18.4? ROS: ?Kinetic? Ubuntu: ?18.04?

Autopilot type and version

[ x ] ArduPilot [ ] PX4

Version: ?4.0.5?

vooon commented 2 years ago

As you can see sensor_msgs/BatteryStatus do not have such fields. Mavros prefers to translate mavlink messages to existing ros interfaces.