Connection to SITL vehicle not working QGC with ROS commands

Hi everyone, I am having trouble connecting QGC to a px4 SITL vehicle.

I am running the commands under ros: “roslaunch px4 mavros_posix_sitl.launch” and trying to connect to the vehicle in QGroundControl so that I can fly some missions. The app stays on “waiting for vehicle connection”.

What I have tried so far: changing SYS ID number, adding user defined Comm Links, changing gcs_url parameter in the .launch file.

Note that the “MAVLink Inspector” shows mavlink messages coming from a vehicle, but connection is not working.

When running the make commands: “make px4_sitl gazebo” from the root PX4 directory, the connection to QGC is automatically made. How can I replicate this behaviour using the ros command I am using?

I am quite new to PX4 so apologies if I have missed something. My goal is to fly a drone in a custom world environment and test some algorithms with ROS.

Have you been able to find a solution for this? I am new to using px4 & would appreciate some help in case you have this setup going. Thanks in advance!

I had exactly the same problem after changing MAV_COMP_ID in QGC. Even after rebuilding PX4-Autopilot, this parameter remained the same and I couldn’t change it back to it’s original value as I couldn’t connect to SITL vehicule in QGC.
After reading the logs, it seems, SITL uses parameters stored in ~/.ros/eeprom/. The solution was to delete this parameter file and rebuild PX4-Autopilot :

make distclean
DONT_RUN=1 make px4_sitl_default gazebo

I am having the exact same issue - it looks like when running:
roslaunch mavros mavros_posix_sitl.launch
It doesn’t launch the MavLink - so QGC can’t connect.

Can you not have ROS and MavLink running at the same time?

Are there any specific instructions on using MavRos with QGC? I can’t find anything, and being new to this world, its a bit overwhelming.