I have trying to add a slam camera to a pixhawk 6C via ROS2 using the px4_ros2::LocalPositionMeasurementInterface but it does not work as expected. For simplicity I have start using the simulator gazabo and more to verify my setup.
I am using the main branch (v1.16) and start the simulater using ‘make px4_sitl gz_500’.
The gazabo simulation starts up and I can communicate to the drone using QGroundControl. I then start the MicroXRCEAgent to connect to the PX4 client up. A connection is made and all seems to work.I then try to run the offboard example from px4_ros_com, ros2 ‘run px4_ros_com offboard_control’ and it does work. The drone takes off in the simulator.
I then try out the example_local_navigation from px4-ros2-interface-lib. It does compile, starts up but nothing happens. What am i missing? I would have expected to find some updated values in the QGroundControl→Analyze tool→MAVLink inspector in the ODOMETRY but the ODOMETRY is not even present. I have set the EKF2_EV_CTRL and other based n the guide Visual Inertial Odometry (VIO) | PX4 Guide (main)
I think I am close, very close. One idea, should the ros2 translation node be started. My gees is no.
I inspected listener vehicle_local_position and listener vehicle_local_odometry. The odometry is updated from the example_local_navigation_cpp. I expected that the submitted data would substitute the GPS but it does not. In the QGroundControl the fmu in “Not Ready”.
The data generated in the example_local_navigation_cpp is:
I have added count++ to see that “something” is updated in the odometry data in the pxh console. It does update in odometry date. It does not seems to make any change to the TOPIC: vehicle_local_position data.
Minor update. I have tried to use make px4_sitl gz_x500_vision and that works with the settings above. I when tried to run the offboard example and it did take off.
So I assume that the parameters is OK but “something” is missing in the example_local_navigation_cpp. That “something” is set when running the xx_vision. I would assumed that the example_local_navigation_cpp and vision should do the same thing.