/fmu/out/battery_status on PX4v1.14

Hi,

I am running PX4 v1.14. am using the uXRCE-DDS client to talk to the flight controller using ROS. However I see that the /fmu/out/battery_status topic is not available. When I look at the .yaml file for version 1.14 I see that it is not there. However I see that this topic is present on version 1.15 on its dds_topics.yaml file

Is there a way for me to recompile px4 v1.14 to include this topic? I was confused when reading this on: uXRCE-DDS (PX4-ROS 2/DDS Bridge) | PX4 User Guide (v1.14)

If you’re creating or modifying uORB messages you must manually update the messages in your workspace from your PX4 source tree. Generally this means that you would update dds_topics.yaml (opens new window), clone the interface package, and then manually synchronize it by copying the new/modified message definitions from PX4-Autopilot/msg (opens new window)to its msg folders. Assuming that PX4-Autopilot is in your home directory ~, while px4_msgs is in ~/px4_ros_com/src/, then the command might be:

rm ~/px4_ros_com/src/px4_msgs/msg/*.msg
cp ~/PX4-Autopilot/mgs/*.msg ~/px4_ros_com/src/px4_msgs/msg/

My questions are

  1. What is the interface package?
  2. If I am using a px4_msgs message battery_status (Which is included in version 1.14 of px4_msg, do I need to do manually update the messages in the workspace since all the other topics are using px4_msgs? This is really not a custom message I am creating, I just want my flight controller to say the topic.

Is the only way to get this message upgrading to v1.15?

The solution was provided to me via the discord community (Thank you guys so much).

The solution is to just add

  • topic: /fmu/out/battery_status
    type: px4_msgs::msg::BatteryStatus

to the dds_topics file in PX4-Autopilot/src/modules/uxrce_dds_client/dds_topics.yaml at release/1.14 · PX4/PX4-Autopilot · GitHub

Then you need to go into the PX4-Autopilot directory and do

make clean
make px4_sitl

This remakes the px4 firmware (for the simulator) to include the battery message. I believe this process would be the same for making a custom firmware to put on a physical drone