Need some help to use local position from ROS2

Sorry for the delay. I have done some further investigation and found some info in two threads.

It is the same problem I try to solve, like in 1 to 1. I also found this thread. Quite a lot off useful information but not a final recipe/hint.

It is a bit different since it is using the mocap method (external vision, not onboard). But there was some hints about various parameters.

What have I done:

Start MicroXRCEAgent udp4 -p 8888
Start make px4_sitl gz_x500
Start QGroundControl
Set
EKF2_EV_CTRL = 11
EKF2_GPS_CTRL = 0 (no GPS fusion
EKF2_HGT_REF = 3 (height reference coming from EV)

and SYS_HAS_GPS = 0

I have then cloned GitHub - Auterion/px4-ros2-interface-lib: Library to interface with PX4 from a companion computer using ROS 2 and build the example_local_navigatio_cpp applicaten and started it using
ros2 run example_local_navigation_cpp example_local_navigation

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:

static int count;
count++;
px4_ros2::LocalPositionMeasurement local_position_measurement {};
local_position_measurement.timestamp_sample = _node.get_clock()->now();
local_position_measurement.velocity_xy = Eigen::Vector2f {1.f, 2.f};
local_position_measurement.velocity_xy_variance = Eigen::Vector2f {0.3f, 0.4f};
local_position_measurement.position_z = 12.8f + count / 1000.f;
local_position_measurement.position_z_variance = 0.33F;
local_position_measurement.attitude_quaternion = Eigen::Quaternionf {0.1, -0.2, 0.3, 0.25};
local_position_measurement.attitude_variance = Eigen::Vector3f {0.2, 0.1, 0.05};

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.

So, what is missing? I think I am very close.