Skip to content

Commit 7f56954

Browse files
feat: allow PX4_UXRCE_DDS_NS override with empty sting (PX4#24921)
1 parent d24893a commit 7f56954

File tree

1 file changed

+9
-4
lines changed
  • ROMFS/px4fmu_common/init.d-posix

1 file changed

+9
-4
lines changed

ROMFS/px4fmu_common/init.d-posix/rcS

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,15 @@ then
295295
# for multi intances setup, add namespace prefix
296296
uxrce_dds_ns="-n px4_$px4_instance"
297297
fi
298-
if [ -n "$PX4_UXRCE_DDS_NS" ]
299-
then
300-
# Override namespace if environment variable is defined
301-
uxrce_dds_ns="-n $PX4_UXRCE_DDS_NS"
298+
if [ "${PX4_UXRCE_DDS_NS+x}" ]; then
299+
# Override, as variable is set (empty or not)
300+
if [ -n "$PX4_UXRCE_DDS_NS" ]; then
301+
# Override namespace if environment variable is non-empty
302+
uxrce_dds_ns="-n $PX4_UXRCE_DDS_NS"
303+
else
304+
# Clear namespace if variable is empty
305+
uxrce_dds_ns=""
306+
fi
302307
fi
303308
if [ -n "$ROS_DOMAIN_ID" ]
304309
then

0 commit comments

Comments
 (0)