Set_velocity_body and position drift

I’m switching from position mode into offboard mode, where companion computer sends “set_velocity_body” with mavsdk-python, like:

    await drone.offboard.set_velocity_body(
        VelocityBodyYawspeed(0.0, 0.0, -1.0, 60.0))

But, as soon as offboard mode starts, drone position starts to drift (x, y velocity setpoints are 0):
https://logs.px4.io/plot_app?log=43c5cba0-3d48-4ae2-83e5-120f34f4dcf4#Nav-Local-Position-X

Is PX4 supposed to use GPS-fused velocity estimate in this case to correct for wind? Or, GPS-fused velocity would not for wind corrections? Or, because it’s body reference frame, GPS is not used?

In short is it expected to have wind-related drift if setting set_velocity_body with 0 velocity setpoints?

1 Like

During velocity control it is normal to have small drifts as the velocity will never be truly zero even in the absence of wind. If you add wind this behavior will only get worse.

So if velocity estimate is not 0 (as measured by all sensors fused with EKF2), and setpoint is 0, would PX4 try to correct it by adjusting actuators?
As I understand, this should reduce drift?

yes it will, you will have less drift compared to an attitude control where you just keep the drone horizontal, but there will be drift nonetheless.