Cannot access the battery status topic of the px4 iris drone models (in the PX4-Autopilot firmware repository) in a ROS2 Gazebo simulation

Hello! I am creating a gazebo simulation with PX4 iris model drones and I want to access the information about the simulation drones’ battery status. I am using the PX4-Autopilot firmware, gazebo-classic 11 and ROS2 foxy running on ubuntu 20.04, and I am using the XRCE-DDS bridge for the client-agent communication. After spawning the drones in a gazebo world and running the ros2 topic list command, I can not see the battery status topic (I can see all of the other topics I need to use except the battery status topic). I have cloned and built the px4-msgs package and the BatteryStatus.msg is in the msg directory of the package. I was wondering if I need to may be add a battery gazebo plugin (if it exists) in the iris model sdf file, or if there is anything specific I need to do to access the battery status topic. Any help about this will be greatly appreciated. Thank you!

Hi @Terence-I
The set of topics that is bridged between ROS 2 and PX4 is defined by the dds_topics.yaml file. If you want to personalize the list depending on your needs you have to edit it and recompile. You can find additional instruction on the dedicated section on the documentation:

1 Like

Thank you so much for your help!!