ROS2 - PX4 - Gazebo - QGroundControl does not work

Primary goal: having a companion computer running ROS2 to be able to interface and command an FMU running PX4

Secondary goal: to develop & run ROS2 programs into a simulated environment (like gazebo) to have a cheaper learning process

My current situation:

  1. I follow all the steps from (ROS 2 User Guide (PX4-ROS 2 Bridge)):
    ROS 2 User Guide (PX4-ROS 2 Bridge) | PX4 User Guide

  2. I follow all the steps from here:
    Ubuntu Development Environment | PX4 User Guide

  3. I installed QgroundControl

  4. By downloading PX4 (following the steps presented above – git …) and running QgroundControl I get the PX4 version of: 1.14.0beta version

  5. Executing “make px4_sitl_rtps gazebo” - from the tutorial does not work and “micrortps_agent -t UDP” is not found

  6. But:

make px4_sitl gazebo
commander takeoff
commander land
   work flawlessly.
  1. Reading different documentation, I understand that the micrortps module, and thus all rtps targets have been removed, and now I have to use the microdds module.
  2. So, I installed microdds
  3. By running:
    ros2 launch px4_ros_com
    I get the error:
[INFO] [launch]: All log files can be found below /home/mdobrea/.ros/log/2023-01-07-00-48-52-317570-linuxhome-17935
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [micro-ros-agent udp4 --port 8888 -v -1]: process started with pid [17937]
[INFO] [sensor_combined_listener-2]: process started with pid [17940]
[sensor_combined_listener-2] 1673045332.716899 [33] sensor_com: selected interface "lo" is not multicast-capable: disabling multicast
[micro-ros-agent udp4 --port 8888 -v -1] /bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[micro-ros-agent udp4 --port 8888 -v -1] Error while starting IPvX agent!
[INFO] [micro-ros-agent udp4 --port 8888 -v -1]: process has finished cleanly [pid 17937]
  1. I followed the steps and also tested the example from:

It does not work – nothing happens. From QGroundControl, I set the offboard mode for PX4 -in this situation QGroundControl is loosing connection ang it is regaining connexion from second tio second.

SO, please, can you help me? Can someone show me the error? Or maybe post a complete and correct tutorial? Thank you!!!

Thanks for the nice write up of steps. I will try to reproduce this.

It looks like the updated docs have not been merged yet. They seem to be here: New PX4 - ROS2 Bridge Documentation update by akshata-01 · Pull Request #2094 · PX4/PX4-user_guide · GitHub

I followed the steps of this tutorial:

And once I had set the param COM_RCL_EXCEPT to 4, so that it ignores missing RC in offboard mode, I was able to switch the mode to offboard in QGC, and then arm it by clicking the “Ready to Fly” bar and then “Arm”.

Thank you very much for your help, mr. JulianOes

  1. I follow step by step the tutorial but it does not work
  2. In my case, previously, I installed micro-ros-agent through the snap:
$ snap install micro-ros-agent 

  1. At this point, I de-installed micro-ros-agent and installed it again as recommended in the tutorial pointed out by you – by building the micro_ros_agent.
  2. All is working OK up to the point when I try to list the topics:
$ ros2 topic list
  1. To be easier to you to help me to find the solution, I made a video showing the steps implied in checking what works and what doesn’t work. The link is here:

  1. So, my conclusion is that the bridge between ROS2 and PX4 does not work
  2. One of the potential problems is FastDDS – a prerequisite, according to the tutorial.
  3. In this regard, I follow all the steps presented in the Fast DDS Installation documentation
  4. To give you an insight:
$ java --version
openjdk 13.0.7 2021-04-20
OpenJDK Runtime Environment (build 13.0.7+5-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 13.0.7+5-Ubuntu-0ubuntu120.04, mixed mode)

$ gradle -v

Welcome to Gradle 7.6!

Here are the highlights of this release:
 - Added support for Java 19.
 - Introduced `--rerun` flag for individual task rerun.
 - Improved dependency block for test suites to be strongly typed.
 - Added a pluggable system for Java toolchains provisioning.

For more details see

Gradle 7.6

Build time:   2022-11-25 13:35:10 UTC
Revision:     daece9dbc5b79370cc8e4fd6fe4b2cd400e150a8

Kotlin:       1.7.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          13.0.7 (Private Build 13.0.7+5-Ubuntu-0ubuntu120.04)
OS:           Linux 5.15.0-56-generic amd64
  1. To build Fast DDS, I followed the steps:
$ git clone
$ cd foonathan_memory_vendor
$ mkdir build && cd build
$ cmake ..
$ sudo cmake --build . --target install


$ git clone --recursive -b v2.0.2 ~/FastDDS-2.0.2
$ cd ~/FastDDS-2.0.2
$ mkdir build && cd build

$ make -j$(nproc --all)
$ sudo make install
  1. All the previous steps were done without any problems.
  2. So, please, do you have any ideas???
  3. Thank you!

Hi @mdobrea , the tutorial is heavily outdated so you don’t need to manually install FastDDS or fastDDS_gen anymore. But it is quite weird that both agent and client show that the connection is established while ros2 topic list remains silent. You are using ubuntu20.04 and ros2 foxy right?
Try crating a workspace with the following repos:

    type: git
    version: master
    type: git
    version: main

In this way you will have the agent directly compiled in your environment

1 Like

Dear Benja,

I will do your idea in the evening.

Thank you!

Dear Mr. Benja,

I did do all you proposed previously to me. … but unfortunately nothing works. You have a video with my problem here (I’m using here Ubuntu 20.04 and ros2 galactic):

To be able to understand better the problem I upgraded a Ubuntu version 20.04 (on an another system - a laptop) to Ubuntu 22.04 and I installed ROS2 Humble, and all the packages including Micro-XRCE-DDS-Agent.

The problem is the same, I’m unable to list any topics from PX4 (through “ros2 topic list”). Moreover, “make px4_sitl gazebo” does not work, instead “make px4_sitl jmavsim” is working very well.

So, I conclude that due to the fact that on both installs (Ubuntu 20.04 + ros2 galactic & Ubuntu 22.04 + ros2 humble) I’m unable to get list of topics I miss a step. Please, do you have any idea?

I insist so much to make a functional chain on Ubuntu 20.04 and ros2 galactic mainly because I must to work on a NavQ Plus development board that has this configuration.

Thank you very much!!!

Oh you are using galactic!
Did you change the DDS implementation? Contrarily to foxy and humble galactic uses Cyclone DDS ad default, so it is normal that nothing works. Here a few references:

So, my suggestion is, follow the instruction to install and change the DDS implementation, than give another try to the workspace with only the Agent and the ros_msgs package.

From your video you are launching the agent from usr/local/bin, why? Can you make sure you are using the “right one” running which MicroXRCEAgent? The output should be your_ws_dir/install/microxrcedds_agent/bin/

make px4_sitl gazebo is no more :sweat_smile: since yesterday the new syntax is make px4_sitl gazebo_iris (you have to specify the model name). But it still does not explain why it is not working on humble… let’s see if on galactic it is solved for now.

1 Like

Hi, Benja! … and hi to everyone!

Only today, Sunday, I had time to get back to work … and I’m making progress! Installing and uninstalling packages (some with sense, some just to see what happens), reading documentation, blogs and other users’ posts I finally found the solution for Ubuntu 22.04 with ROS2 Humble: in the .bashrc I set the ROS_DOMAIN_ID and, in order to work, it required only to unset ROS_DOMAIN_ID.

But instead, the problem persists with Ubuntu 20.04 and ROS2 Galactic. So far I have not found what agent to use to mediate communication between PX4 (simulated in Gazebo) and ROS2. Do you (or anyone else) have any ideas? I would be deeply indebted to you if you could suggest a solution or a way forward. Thank you!

Did you changed the DDS implementation?

@mdobrea any progress with this? I have been facing a similar issue .with ROS2 foxy

Up to now, no progress! In this morning I changed the RMW from Cyclone DDS to Fast DDS but I was unable to get topics from PX4 simulated in Gazebo. On the evening, after 21.00 I will have more time to test other combination.

Hi @Benja @JulianOes ,is there a new documentation somewhere for this? I am trying to run multiple vehicle sim sitl using ros2-px4-gazebo and a bit confused now with what needs to be installed. what needs to be sourced etc.

Hi to everyone, especially for @Benja, @JulianOes and @returncode13, in order to solve the problems with ROS2 galactic and Gazebo you need to:

  • Replace the default RMW (that is Eclipse Cyclone DDS) with eProsima Fast DDS, by installing and setting the following variable “export RMW_IMPLEMENTATION=rmw_fastrtps_cpp” inside the .bashrc file,

  • You must set ROS_DOMAIN_ID environment variable to 0, and

  • Use the MicroXRCEAgent to make the bridge.

Thanks to all those who through their advice helped me to approach, step by step, to the solution of this problem! Thank you very much!