Using VISION_POSITION_ESTIMATE to send uwb's positioning data to pixhawk

Hello everyone!

We are trying to achieve indoor autonomous flight in a drone we are developing. For this, we want to use Ultra-Wide Band (UWB) beacons. We are already able to track the location (not orientation) of an UWB beacon quite accurately. The next step for us is to have the Pixhawk (original Pixhawk, FMUv2, running PX4 v1.8.1) that we are using make use of this location. For this, we have set up a UP board with mavros, which sends the xy-data from the tracked UWB beacon to the Pixhawk over the /mavros/vision_pose/pose topic.

Pixhawk seems to have correctly received this location, as we saw in VISION_POSITION_ESTIMATE.
However, we can’t reliably LOCAL_POSITION_NED follow the ultra-wideband position: when the drone’s ground is stationary, the position is correct, but when we take off (using position control, for safety), the VISION_POSITION_ESTIMATE still receives the correct, but ekf2 fusion Local_position/pose data cannot follow the data published by vision_pose/pose
Set EKF2_AID_MASK to 8vision position fusion in qgc, EKF2_HGT_MODE to 2Range sensor, lidar gives height information,
EKF2_EV_DELAY is 23ms, EKF2_ACC_NOISE is 0.7, EKF2_GYR_NOISE is 0.03, my uwb is 9Hz or masquerading is 50Hz (the status_vision/pose is sent by timing regardless of the location information is not updated)

@LShikang do you have a log to show this? Or can you do listener estimator_status for more information during flight?

@Paul_Riseborough do you have an idea what is happening here?

Here is the log under static conditions:
Here is the position control:

Hm, could it be that the yaw of the drone is off and therefore the position estimate diverges? I see that the magnetic measurements correlate a lot with thrust meaning that you have interference from the motors/ESCs to the mag. The easiest is usually to use an external mag far away, e.g. the ones that come with the GPS.

According to what you said, I removed the magnetometer on the gps and used the magnetometer on the px4 alone. Since the x-axis of the UWB coordinate system has an angular difference from the north, the magnetic declination EKF2_MAG_DECL is corrected to 23.
It is worth mentioning that the /mavros/vision_pose/pose orientation we published is read from the orientation of the imu/data topic published by px4, and the z-axis value uses the distance data of the lidar pointing to the ground.

This is the log of our experiment yesterday, px4 uses gps magnetic compass and the coordinates have been corrected:

This is the experiment we did today, px4 removes the gps magnetic compass and the coordinates have been corrected:

I’m confused. My suggestion was to use a mag far away from power wiring, so to use the one on the GPS in the best case out on a GPS mast.

I’m not sure what to look at in your logs and what the problem is (if there is still a problem).

Anyone have any ideas?:slight_smile: @Nielesonimusso, @MarLi

Did you double check that the position data is correctly transformed from the UWB coordinate system to the NED coordinate system of the FCU?
Using the magnetometer indoors didn’t work for us due to interferences and dampening. We therefore use two UWB-Tags to determine the orientation of the UAV which works quite well.

In order to protect the magnetic compass from interference, we went to a more spacious place to do the test, but the effect was similar. We really use the NED frame.

Has this problem been finally solved?

I think you are also a Chinese developer. I am trying to use UWB for indoor positioning.

I’m Shikang’s classmate.
This problem has been solved.
Thanks ! @JulianOes @MarLi @boyiss

we found the delay of location by testing with optitrack .
At last ,we change the parameters of EKF .

Yeah, we spent months

change EKF2_EV_DELAY?