MAVROS and QGroundControl at the same time on the same machine


I am using a Pixhawk Mini directly link with USB on my computer running ROS Indigo. I would want to be able to use QGroundControl in parallel, however I am not confident to do so. First I run:
rosrun mavros mavros_node _fcu_url:=/dev/ttyACM0:921600 _gcs_url:=udp://@localhost

But when I run QGroundControl, my previous node crash:
[ERROR] [1507420985.478197815]: serial0: receive: End of file
terminate called after throwing an instance of ‘std::system_error’
what(): Resource deadlock avoided
Aborted (core dumped)

In QGroundControl, I edit link configuration settings in Comm Links by adding :
UDP type on Listening Port 14550. So my questions are:
It is possible to connect both MAVROS and QGroundControl at the same time ? If so how ?
And It is possible to force QGroundControl to connect to a specific at startup ?


Finally, I fixed problem by using mavproxy.
But i am still curious to know how to force QGC to connect to specific adress at start up.

Hey ! can you be more specific ? how did you get both qgc and mavros running at the same time?

Assuming that you are connected on /dev/ttyACM0 port for instance,
Run first mavproxy connected on that port and open two outputs on local ports for example:

python /usr/local/bin/ --master=/dev/ttyACM0 --baudrate 57600 --out udp: --out udp:

Be sure to set the right baudrate on your Pixhawk: SERIALx_BAUD with APM.

Then, on one side, you can connect QGS on 14540 port by adding new UDP connexion. On the other side you connect your mavros node:

rosrun mavros mavros_node _fcu_url:=udp://14550@

Hope this helps


1 Like

Thanks, I will try asap ! :slight_smile:

Hey @matt
Trying to run QGC and MavROS at the same time on the same machine to perform SITL testing. In performing SITL testing, we can use the following -L RATBeach --console

Using the above, we see that the mavproxy runs with the following configuration
“” “–master” “tcp:” “–sitl” “” “–out” “” “–out” “” “–console”

The mavros can be connected as follows

roslaunch mavros apm.launch fcu_url:=udp://

The problem is with QGC connection. I have tried to connect it on different port but after sometimes, the mavros shows “ON: Lost connection, HEARTBEAT timed out.”.

I appreciated your guidance and help in this regard.

@matt It is good to hear that you were able to solve the problem with mavproxy

However, I suggest using mavlink-router

1 Like

@barain, try to set the exact adress when launching mavros:

roslaunch mavros apm.launch fcu_url:=udp://

Also, verify that your comm links is properly set in qgroundcontrol