mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-22 00:10:35 +08:00
rcS-posix: use ROS_DOMAIN_ID to set XRCE_DDS_DOM_ID
set XRCE_DDS_KEY to MAV_SYS_ID to avoid collisions Signed-off-by: Beniamino Pozzan <beniamino.pozzan@phd.unipd.it>
This commit is contained in:
committed by
Daniel Agar
parent
a11cced4b2
commit
89a00f9505
@@ -129,6 +129,7 @@ fi
|
|||||||
# multi-instance setup
|
# multi-instance setup
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
param set MAV_SYS_ID $((px4_instance+1))
|
param set MAV_SYS_ID $((px4_instance+1))
|
||||||
|
param set XRCE_DDS_KEY $((px4_instance+1))
|
||||||
|
|
||||||
if [ $AUTOCNF = yes ]
|
if [ $AUTOCNF = yes ]
|
||||||
then
|
then
|
||||||
@@ -268,8 +269,7 @@ navigator start
|
|||||||
microdds_ns=""
|
microdds_ns=""
|
||||||
if [ "$px4_instance" -ne "0" ]
|
if [ "$px4_instance" -ne "0" ]
|
||||||
then
|
then
|
||||||
# Assign new xrce dds key based on instance number and set default namespace
|
# for multi intances setup, add namespace prefix
|
||||||
param set XRCE_DDS_KEY ${px4_instance}
|
|
||||||
microdds_ns="-n px4_$px4_instance"
|
microdds_ns="-n px4_$px4_instance"
|
||||||
fi
|
fi
|
||||||
if [ -n "$PX4_MICRODDS_NS" ]
|
if [ -n "$PX4_MICRODDS_NS" ]
|
||||||
@@ -277,6 +277,13 @@ then
|
|||||||
# Override namespace if environment variable is defined
|
# Override namespace if environment variable is defined
|
||||||
microdds_ns="-n $PX4_MICRODDS_NS"
|
microdds_ns="-n $PX4_MICRODDS_NS"
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$ROS_DOMAIN_ID" ]
|
||||||
|
then
|
||||||
|
# Match XRCE_DDS_DOM_ID with ROS_DOMAIN_ID, if defined
|
||||||
|
param set XRCE_DDS_DOM_ID $ROS_DOMAIN_ID
|
||||||
|
else
|
||||||
|
param set XRCE_DDS_DOM_ID 0
|
||||||
|
fi
|
||||||
microdds_client start -t udp -h 127.0.0.1 -p 8888 $microdds_ns
|
microdds_client start -t udp -h 127.0.0.1 -p 8888 $microdds_ns
|
||||||
|
|
||||||
if param greater -s MNT_MODE_IN -1
|
if param greater -s MNT_MODE_IN -1
|
||||||
|
|||||||
Reference in New Issue
Block a user