Hello, I am trying to send obstacle_distance messages to my Pixhawk6X flight controller from a Nvidia Jetson Orin Nano companion computer connected via ethernet using ROS2 uORB messages. My intention is to then query these messages on my ground control station to display the LiDAR data. However, I am having issues getting PX4 to publish the obstacle_distance data.
I am not able to see the obstacle_distance topics in the MAVLink Inspector however I am able to see them using the listener command in the MAVLink console. I read that the publish revolved around the obstacle_distance_fused message, however when I use the listener with that message it indicates that it is never published.
I have tried the steps to activate the collision prevention such as setting CP_DIST to 1, and modifying the dds_topics.yaml to include the obstacle_distance_fused publication as described in: https://docs.px4.io/main/en/computer_vision/collision_prevention.html then re-flashed the Pixhawk with the custom firmware, and the result did not change. Note, I pulled the most recent repository changes on the main PX4 branch and was receiving missing parameters errors in QGC after re-flashing. It said I was missing the parameters: BAT1_V_LOAD_DROP, BAT2_V_LOAD_DROP, and COM_OBS_AVOID.
Is there anything else I should try, or steps that I am missing? Any help would be appreciated.
Although I just tried and it doesn’t appear to work. @Claudio-Chies could you take a look? Are the docs missing a step or did maybe something change that broke Collision Prevention?
Collision prevention in SITL, using the lidar airframes doesnt work, or using ros to publish the obstacle_distance message doesnt work?
I can have a look in the next few days
For my case, its that I cannot get px4 to publish the obstacle_distance_fused message. I am able to get the obstacle_distance published via a ros2 node on my Nvidia Jetson.
If there is an issue with the most recent release causing this, would there be an older release that I could use that we know works?
you should publish only the obstacle_distance and not obstacle_distance_fused.
see docs
The collision prevention in PX4 takes in all different sensors and measurements it has and fuses them into a combined ObstacleDistance message called obstacle_distance_fused
so if you have a 1d lidar pointing forward, and a companion computer with a 360 lidar publishing into obstacle_distance both would be merged into obstacle_distance_fused.
Yes I understand that aspect. My companion computer (Nvidia Jetson Orin Nano) is publishing the obstacle_distance topics as you described. The issue is that I am not seeing them on the MAVLink inspector within QGC. I saw on another discussion that it being displayed is directly associated with the obstacle_distance_fused message functionality, but when using the MAVLink console and doing “listener obstacle_distance_fused”, it says that it is never published.
The reason I need it to be published by PX4 is that I am trying to query and display that data via a MavLink command on my own Ground Control Station, and as of now am receiving no obstacle_distance messages when listening with MAVLink.
Hey @Claudio-Chies just a heads up Collision Prevention is currently broken. I tested with SITL using the 2D lidar model same as before, but no worky now. If you have some time maybe you could take a look? Thanks