Hello,I am running PX4 SITL instances on separate VMware nodes (Ubuntu) and trying to connect to both instances on the ground on another instance on the network. I am using either JMAVSim or Gazebo for simulation. The problem I am facing is that QGroundControl seems to treat both instances as the same drone, and I suspect that the system ID or something else should specify that they are different.I have tried the following methods to set unique system IDs for each PX4 SITL instance:
Modifying the SYSID_THISMAV parameter in the ROMFS/px4fmu_common/init.d-posix/rcS file for each instance.
Setting the MAV_SYS_ID environment variable before starting each PX4 SITL instance on the separate VMware nodes.
Changing the Mavlink ID from paramteres also didnt work since it needed reboot and after reboot the SITL it still shows as 1
Unfortunately, none of these methods worked, and QGroundControl still shows the system ID and MAVLink ID as 1 for both instances.I would appreciate any help or suggestions on how to manually change the MAVLink system ID for PX4 SITL instances running on different systems so that QGroundControl can recognize them as separate drones.
Thank you!
Thnks
If I understand correct, this command should be executed in the terminal:
export px4_instance 2
make px4_sitl gazebo
I did this but still doesnβt work. still, in parameters, MAV_SYS_ID shows as 1.
is there sth wrong?
can we manually hard code and change it from the startup code? or can we change the parameters that are auto-being loaded?
After trying different methods to set unique system IDs for each PX4 SITL instance on separate VMware nodes, the solution that worked was to modify the rcS file in the build version of the PX4-Autopilot directory. The file path is PX4-Autopilot/build/px4_sitl_default/etc/init.d-posix/rcS
, and the line to modify is param set MAV_SYS_ID $((px4_instance+1))
. You can manually set a different system ID by changing the value of MAV_SYS_ID to the desired number, for example, param set MAV_SYS_ID 2
you might be able to do that in a real drone. but in SITL I donβt think since you need to reboot the sitl after changing this parameter and next time it loads, it is gonna read from rcs file again in build directory