ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

So first, may I ask why you have gdb running? It shouldn't affect operations but it does not seem necessary.

Second, PX4 already has a process of launching a mavros connected gazebo simulation, documented here: https://dev.px4.io/en/simulation/ros_interface.html

Specifically, the mavros_posix_sitl.launch file seems exactly what you need, and has been verified to work. If you need to customize aspects you can simply change some of the Args going into that launch file.

At a glance I'd say your issue is probably two fold, an improperly setup fcu_url, resulting in mavros being unable to connect to launched px4 software. As well as the fact that the px4 software isn't launched in the first place. The SITL consists of three separate software components, the gazebo simulation, the mavros ROS node, and the px4 SITL node. It looks like you never launched the px4 SITL node, so mavros thus has nothing to connect to. If you did the px4 Nsh interface should show up on terminal as well.

<node name="sitl" pkg="px4" type="px4" output="screen"
    args="$(find px4) $(arg rcS)">
</node>

This is the relevant line in px4 's gazebo launch file that I think you missed.