feat: allow PX4_UXRCE_DDS_NS override with empty sting (#24921)

This commit is contained in:
Bastian Jäger 2025-05-31 21:55:10 +02:00 committed by GitHub
parent d24893a847
commit 7f569542a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -295,10 +295,15 @@ then
# for multi intances setup, add namespace prefix
uxrce_dds_ns="-n px4_$px4_instance"
fi
if [ -n "$PX4_UXRCE_DDS_NS" ]
then
# Override namespace if environment variable is defined
uxrce_dds_ns="-n $PX4_UXRCE_DDS_NS"
if [ "${PX4_UXRCE_DDS_NS+x}" ]; then
# Override, as variable is set (empty or not)
if [ -n "$PX4_UXRCE_DDS_NS" ]; then
# Override namespace if environment variable is non-empty
uxrce_dds_ns="-n $PX4_UXRCE_DDS_NS"
else
# Clear namespace if variable is empty
uxrce_dds_ns=""
fi
fi
if [ -n "$ROS_DOMAIN_ID" ]
then