Dear all,
I am struggling with the MicroXRCE-DDS Client not being able to create some of the DDS (ROS2) topics.
The behavior is inconsistent : it is not always the same topics that fail and the number of failed topics is not consistent also. An example of the Autopilot output :
INFO [px4] instance: 1
______ __ __ ___
| ___ \ \ \ / / / |
| |_/ / \ V / / /| |
| __/ / \ / /_| |
| | / /^\ \ \___ |
\_| \/ \/ |_/
px4 starting.
INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 1
env SYS_AUTOSTART: 4001
INFO [param] selected parameter default file parameters.bson
INFO [param] importing from 'parameters.bson'
INFO [parameters] BSON document size 460 bytes, decoded 460 bytes (INT32:17, FLOAT:6)
INFO [param] selected parameter backup file parameters_backup.bson
+ MAV_SYS_ID: curr: 12 -> new: 2
+ UXRCE_DDS_KEY: curr: 12 -> new: 2
INFO [dataman] data manager file './dataman' size is 7866640 bytes
INFO [init] gazebo already running world: multicopter
INFO [init] PX4_GZ_MODEL_POSE set, spawning at: -0,-1.00000000000000000000,0.5,0,0,0,0
INFO [lockstep_scheduler] setting initial absolute time to 9014000 us
INFO [gz_bridge] world: multicopter, model name: px4vision_lidar_1, simulation model: px4vision_lidar
INFO [gz_bridge] Requested Model Position: -0,-1.00000000000000000000,0.5,0,0,0,0
INFO [commander] LED: open /dev/led0 failed (22)
WARN [health_and_arming_checks] Preflight Fail: ekf2 missing data
WARN [health_and_arming_checks] Preflight Fail: Compass Sensor 0 missing
INFO [tone_alarm] home set
INFO [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18571 remote port 14550
INFO [tone_alarm] notify negative
INFO [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14581 remote port 14541
INFO [mavlink] mode: Onboard, data rate: 4000 B/s on udp port 14281 remote port 14031
INFO [mavlink] mode: Gimbal, data rate: 400000 B/s on udp port 13031 remote port 13281
INFO [logger] logger started (mode=all)
INFO [logger] Start file log (type: full)
INFO [logger] [logger] ./log/2023-09-25/12_13_08.ulg
INFO [logger] Opened full log file: ./log/2023-09-25/12_13_08.ulg
INFO [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
INFO [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
INFO [px4] Startup script returned successfully
ERROR [uxrce_dds_client] create entities failed: rt/px4_1/fmu/in/vehicle_visual_odometry 0 0 255
ERROR [uxrce_dds_client] create entities failed: rt/px4_1/fmu/in/vehicle_command 255 255 255
ERROR [uxrce_dds_client] create entities failed: rt/px4_1/fmu/in/vehicle_trajectory_bezier 255 255 255
INFO [commander] e[32mReady for takeoff!e[0m
ERROR [uxrce_dds_client] create entities failed: rt/px4_1/fmu/in/vehicle_trajectory_waypoint 255 255 255
INFO [uxrce_dds_client] synchronized with time offset 0 us
INFO [uxrce_dds_client] successfully created rt/px4_1/fmu/out/failsafe_flags data writer, topic id: 80
ERROR [uxrce_dds_client] create entities failed: rt/px4_1/fmu/out/position_setpoint_triplet, topic: 0 publisher: 0 datawriter:
ERROR [uxrce_dds_client] create entities failed: rt/px4_1/fmu/out/sensor_combined, topic: 255 publisher: 255 datawriter: 255
ERROR [uxrce_dds_client] create entities failed: rt/px4_1/fmu/out/timesync_status, topic: 255 publisher: 255 datawriter: 255
ERROR [uxrce_dds_client] create entities failed: rt/px4_1/fmu/out/vehicle_attitude, topic: 255 publisher: 255 datawriter: 255
ERROR [uxrce_dds_client] create entities failed: rt/px4_1/fmu/out/vehicle_control_mode, topic: 255 publisher: 255 datawriter:
ERROR [uxrce_dds_client] create entities failed: rt/px4_1/fmu/out/vehicle_global_position, topic: 255 publisher: 255 datawrite
ERROR [uxrce_dds_client] create entities failed: rt/px4_1/fmu/out/vehicle_gps_position, topic: 255 publisher: 255 datawriter:
ERROR [uxrce_dds_client] create entities failed: rt/px4_1/fmu/out/vehicle_local_position, topic: 255 publisher: 255 datawriter
INFO [uxrce_dds_client] successfully created rt/px4_1/fmu/out/vehicle_odometry data writer, topic id: 225
INFO [uxrce_dds_client] successfully created rt/px4_1/fmu/out/vehicle_status data writer, topic id: 230
This error message is logged from this line in the MicroXRCE-DDS Client encapsulated in the PX4 Autopilot. Is it possible that the 1 second timeout is too small in this line ?
Some notes : I am running the SITL version of the px4, with an instance number > 0, and the Agent is started with MicroXRCEAgent udp4 -p 8888.
These two processes are running inside a Linux network namespace (which should change nothing).
The number of failed topics is lower when there is a low number of PX4 instance (e.g. 1 instance). When I increase the number of instances simulated, the instances 2, 3, 4, etc. have a higher number of failed topics.
Could someone please help me investigate this issue ? This is a problem for ROS2 offboard control, as some very important topics (/px4_1/fmu/in/trajectory_setpoint, for instance) could be missing.