Mid-Flight LOITER in MAVProxy

Hi everyone,

I’m testing mid-flight LOITER commands in MAVProxy with ArduCopter SITL.

  • Flight mode: GUIDED

  • Altitude: ~23m

  • Drone is moving toward a target coordinate (-35.35950257, 149.15846077) at ~10 m/s

    When I issue:

    message COMMAND_LONG 0 0 17 0 0 0 0 0 0 0 0
    

    after running the module load message command, I’ve noticed that speed and altitude drops abruptly, and in motors disarm,

    I see the following in MAVproxy console

    Got COMMAND_ACK: NAV_LOITER_UNLIM: ACCEPTED
    Mode LOITER
    height 14
    AP: SIM Hit ground at 2.489885 m/s
    Flight battery 30 percent
    AP: Disarming motors
    DISARMED

    I’d like to ask:

    1. When do you issue a LOITER command mid-flight safely?

    2. Do you reduce speed before sending the command?

    3. **What behavior do you observe in SITL or real hardware when sending NAV_LOITER_UNLIM at different speeds/altitudes?

      Reference article:** Get and Set FlightMode — Dev documentation

    Any insights or best practices would be really helpful.

    Thanks!

When the drone goes to loiter mode it is taking RC input. If you don’t have an RC input setup the drone will see the throttle channel as minimum value and start a descent until it hits the ground.

Oh, I was also going to do something like this soon. I have a drone with optical flow (and no GPS) and am in the process of making my drone autonomous and would have liked to takeoff in loiter because flow hold caused wobbles. I also don’t have any RC configured. So what is the way to do this?

OK, then how to resolve this issue?

Loiter mode is for pilot control. If you’re doing everything from MavProxy or a GCS then just use guided mode or auto mode. Once the drone reaches it’s intended point in guided it will just hover there until you tell it to do something else.

RC_OPTIONS = 1

save - disarm (if still armed) and try again

if still lost altitude

restart MissionPlanner and try again

should be good :slightly_smiling_face:

guided_nogps and sent set_attitude_targets is one way

Yeah I learned Guided mode uses the same control loops as loiter. So now I’m using Guided by setting an ekf origin and so I can also send position and velocity targets