diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index 43630694bb..1bcdf974fe 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -260,13 +260,19 @@ fi navigator start # Try to start the microdds_client with UDP transport if module exists -if [ $px4_instance -eq 0 ] +microdds_ns="" +if [ "$px4_instance" -ne "0" ] then - microdds_client start -t udp -p 8888 -else + # Assign new xrce dds key based on instance number and set default namespace param set XRCE_DDS_KEY ${px4_instance} - microdds_client start -t udp -p 8888 -n "px4_$px4_instance" + microdds_ns="-n px4_$px4_instance" fi +if [ -n "$PX4_MICRODDS_NS" ] +then + # Override namespace if environment variable is defined + microdds_ns="-n $PX4_MICRODDS_NS" +fi +microdds_client start -t udp -p 8888 $microdds_ns if param greater -s MNT_MODE_IN -1 then