MAVROS and QGroundControl at the same time on the same machine

#1

Hello,

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 ?

Matt

#2

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.

#3

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

#4

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/mavproxy.py --master=/dev/ttyACM0 --baudrate 57600 --out udp:127.0.0.1:14540 --out udp:127.0.0.1:14550

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@127.0.0.1

Hope this helps

matt

#5

Thanks, I will try asap ! :slight_smile:

#6

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

sim_vehicle.py -L RATBeach --console

Using the above, we see that the mavproxy runs with the following configuration
“mavproxy.py” “–master” “tcp:127.0.0.1:5760” “–sitl” “127.0.0.1:5501” “–out” “127.0.0.1:14550” “–out” “127.0.0.1:14551” “–console”

The mavros can be connected as follows

roslaunch mavros apm.launch fcu_url:=udp://0.0.0.0:14550@

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.

#7

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

However, I suggest using mavlink-router

1 Like
#8

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

roslaunch mavros apm.launch fcu_url:=udp://127.0.0.1:14550@

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

matt