From f2c71a887448935c6f3294dd60b1d17d37237374 Mon Sep 17 00:00:00 2001 From: Beniamino Pozzan Date: Wed, 7 Dec 2022 07:53:52 -0800 Subject: [PATCH] microdds_client: added environment variable for defining namespace Signed-off-by: Beniamino Pozzan --- ROMFS/px4fmu_common/init.d-posix/rcS | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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