From d2de2981220ac0b08d2f0f1018f7d0ee467c4c71 Mon Sep 17 00:00:00 2001 From: Ltxx <55067345+Tartistbz@users.noreply.github.com> Date: Sun, 27 Sep 2026 07:12:55 +0800 Subject: [PATCH] fix(uxrce_dds): align SITL namespace prefix (#28338) * fix(uxrce_dds): align SITL namespace prefix Use the same uav_ namespace prefix for SITL multi-instance startup and UXRCE_DDS_NS_IDX fallback. This keeps simulation and hardware topic names consistent without changing the existing hardware default. Assisted-by: OpenAI Codex: GPT-5 * docs(uxrce): update uxrce_dds docs * docs(release): update `main` release page --------- Signed-off-by: Beniamino Pozzan Co-authored-by: Beniamino Pozzan --- ROMFS/px4fmu_common/init.d-posix/rcS | 4 ++-- docs/en/releases/main.md | 2 +- docs/en/ros2/multi_vehicle.md | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d-posix/rcS b/ROMFS/px4fmu_common/init.d-posix/rcS index 880bc2261b2..989f2a640ed 100644 --- a/ROMFS/px4fmu_common/init.d-posix/rcS +++ b/ROMFS/px4fmu_common/init.d-posix/rcS @@ -297,8 +297,8 @@ navigator start uxrce_dds_ns="" if [ "$px4_instance" -ne "0" ] then - # for multi intances setup, add namespace prefix - uxrce_dds_ns="-n px4_$px4_instance" + # for multi instances setup, add namespace prefix + uxrce_dds_ns="-n uav_$px4_instance" fi if [ "${PX4_UXRCE_DDS_NS+x}" ]; then # Override, as variable is set (empty or not) diff --git a/docs/en/releases/main.md b/docs/en/releases/main.md index b9ce3a9adef..f678e61021f 100644 --- a/docs/en/releases/main.md +++ b/docs/en/releases/main.md @@ -90,7 +90,7 @@ Please continue reading for [upgrade instructions](#upgrade-guide). ### uXRCE-DDS / Zenoh / ROS 2 -- TBD +- (uXRCE-DDS): SITL multi vehicle automatic namespace prefix is now `uav_{px4_instance}` and it is aligned with the behaviour of `UXRCE_DDS_NS_IDX`. ([PX4-Autopilot#28338](https://github.com/PX4/PX4-Autopilot/pull/28338)) ### MAVLink diff --git a/docs/en/ros2/multi_vehicle.md b/docs/en/ros2/multi_vehicle.md index d35c4da995e..16d2fc66ee8 100644 --- a/docs/en/ros2/multi_vehicle.md +++ b/docs/en/ros2/multi_vehicle.md @@ -23,10 +23,10 @@ param set UXRCE_DDS_KEY $((px4_instance+1)) By doing so, `UXRCE_DDS_KEY` will always coincide with [MAV_SYS_ID](../advanced_config/parameter_reference.md#MAV_SYS_ID). ::: -Moreover, when `px4_instance` is greater than zero, a unique ROS 2 [namespace prefix](../middleware/uxrce_dds.md#customizing-the-namespace) in the form `px4_$px4_instance` is added: +Moreover, when `px4_instance` is greater than zero, a unique ROS 2 [namespace prefix](../middleware/uxrce_dds.md#customizing-the-namespace) in the form `uav_$px4_instance` is added: ```sh -uxrce_dds_ns="-n px4_$px4_instance" +uxrce_dds_ns="-n uav_$px4_instance" ``` ::: info @@ -42,7 +42,7 @@ The default client configuration in simulation is summarized as follows: | ------------------ | -------------- | ---------------- | --------------------- | | not provided | 0 | `px4_instance+1` | none | | provided | 0 | `px4_instance+1` | `PX4_UXRCE_DDS_NS` | -| not provided | >0 | `px4_instance+1` | `px4_${px4_instance}` | +| not provided | >0 | `px4_instance+1` | `uav_${px4_instance}` | | provided | >0 | `px4_instance+1` | `PX4_UXRCE_DDS_NS` | ## Adjusting `VehicleCommand` routing fields