Offboard switching back to takeoff mode for unknown reason

So I’m creating a mavlink C++ library and trying to do nice offboard control, and I’m running into a weird issue. I added some extra print statements in the PX4 commander module so you can see what is going on:

INFO  [commander] home: 47.6414680, -122.1401672, 122.14
INFO  [tone_alarm] home_set
INFO  [mavlink] partner IP: 127.0.0.1
INFO  [tone_alarm] neutral
WARN  [commander] VEHICLE_CMD_DO_SET_MODE mode=16, 0, 0
INFO  [tone_alarm] positive
INFO  [commander] home: 47.6414680, -122.1401671, 121.80
INFO  [tone_alarm] positive
INFO  [commander] home: 47.6414680, -122.1401671, 121.80
INFO  [tone_alarm] arming
WARN  [commander] Takeoff command received
INFO  [tone_alarm] positive
INFO  [commander] Takeoff detected
WARN  [commander] VEHICLE_CMD_DO_SET_MODE mode=135, 0, 0
INFO  [tone_alarm] positive
WARN  [commander] commander: offboard signal regained
INFO  [tone_alarm] positive
INFO  [tone_alarm] positive
WARN  [navigator] Already higher than takeoff altitude
WARN  [commander] commander: offboard signal lost
WARN  [commander] commander: offboard signal regained
INFO  [tone_alarm] positive
WARN  [navigator] global position timeout

So you can see that I take off, then loiter (mode 135), then I start my offboard control to move the drone to a location on the map. You see the commander reporting “offboard signal regained” to confirm offboard mode is happening. So it flies all the way out there perfectly and hovers on the spot, so I try to switch to some velocity control to move the drone in a circle, but every time (100% repro), as soon as I do that you see the navigator say “WARN [navigator] Already higher than takeoff altitude” which means someone bailed on offboard, and re-activated the takeoff navigation state and it is only after that that the command reports offboard signal lost. So I’m trying to track down why the navigator is stealing offboard control away. I thought it was the commander that made that decision. Oh, and this only happens once, if I try my Orbit command again, it works fine.

I’m on the latest PX4 master branch and this testing offboard in SITL ekf2 mode.

1 Like

I have same issue and I got this msg on outdoor and then copters altitude drastically gets lower

I’ve never seen this issue in SITL LPE mode. but in outdoor(EKF2) I’m getting it pretty often

did you solve this issue?