Position setpoint not set before/during takeoff

Hi, I’ve noticed that when moving the vehicle after initialization but prior to takeoff it will always try to return to the position it was initialized at, instead of where the takeoff command was triggered. So basically I put the drone down, let Pixhawk initialize, then when everything is running and ready to fly I move the drone say a meter to the left, then when I trigger a takeoff command the drone will fly 1 meter back to the right. Is this expected behavior? It happens every time in all directions. It looks like there is a “home” position at 0,0 that the drone is trying to fly back to, but there is little documentation regarding any such mechanism so it’s hard to debug. For reference I am controlling the drone through mavlink using only VIO without a GPS.

It looks like I am able to replicate this in SITL if I move the model a short enough distance that it doesn’t cause the position estimate to fail and reset. Upon takeoff the drone will immediately tilt and travel in the direction it was originally located at.

How are you landing again? Do you use the RTL/return mode? Or are you commanding it using offboard control?

It would also be helpful if you can upload a log to logs.px4.io and link it here. Best is if you start the log from boot using the param SDLOG_MODE.

Hi Julian,

This happens during the first flight after boot, as well as in subsequent flights. To answer your question I land by entering the land flight mode, either through mavlink or using commander land in the shell (tested using both). I have a log here, unfortunately it was set to start after arm, I can collect it from boot if need be: https://review.px4.io/plot_app?log=a15d9457-1ab1-4c2f-baee-30f668b91319 As you can see during takeoff the position setpoints go towards 0,0 rather than locking on to wherever the drone takes off from.

Also for reference I am using version 1.11.3