Hi guys,
I am working on a VPS algorithm for geolocalization, comparing drone feed with satellite image with a mono camera downward facing, I get the estimated latitude/longitude, convert it to NED frame for PX4 and publish it to fmu/in/vehicle_visual_odometry at 28-30Hz. I am simply fusing horizontal position (x,y) data from my algorithm since yaw is very noisy.
After setting up these parameters -
param set EKF2_GPS_CTRL 0
param set EKF2_EV_CTRL 1 (fuse horizontal position only)
param set EKF2_HGT_REF Baro
param set EKF2_EV_DELAY 100
param set EKF2_EV_NOISE_MD 0
I take it off to a certain altitude, and then run the VPS script, and set up all the above parameters, assuming that the yaw will be handled internally by PX4 (IMU, Magnetometer,etc), but the drone starts drifting away and then goes completely haywire, I have attached an image of the same -
I am unable to understand the reason behind this. I have attached the function block, which publishes the estimated NED values to the fmu/in/vehicle_visual_odometry topic.
def fast_publish(self):
if self.last_ned is None:
return
north, east, down = self.last_ned
msg = VehicleOdometry()
now_us = int(time.monotonic() * 1e6)
msg.timestamp = now_us
msg.timestamp_sample = now_us
msg.pose_frame = VehicleOdometry.POSE_FRAME_NED
msg.position = [float(north), float(east), float(down)]
msg.q = [1.0, 0.0, 0.0, 0.0]
msg.velocity_frame = VehicleOdometry.VELOCITY_FRAME_NED
msg.velocity = [float('nan'), float('nan'), float('nan')]
msg.angular_velocity = [float('nan'), float('nan'), float('nan')]
msg.position_variance = [2.0, 2.0, 5.0]
msg.orientation_variance = [float('nan'), float('nan'), float('nan')]
msg.velocity_variance = [float('nan'), float('nan'), float('nan')]
msg.quality = 0
self.odom_publisher.publish(msg)
I have also ran a case, keeping GPS enabled and comparing the output from both VPS and GPS, and the normal motion are pretty accurate although yaw is highly drifty as expected.
Can someone help me out with this


