microdds_client: added environment variable for defining namespace

Signed-off-by: Beniamino Pozzan <beniamino.pozzan@phd.unipd.it>
This commit is contained in:
Beniamino Pozzan 2022-12-07 07:53:52 -08:00 committed by Daniel Agar
parent 5a2e41c4e4
commit f2c71a8874
1 changed files with 10 additions and 4 deletions

View File

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