In an attempt to make a flight plan that will make it over a mountain peak and land in a valley, I have defined the following plan to command Ardupilot to loiter to a certain high altitude, traverse to another waypoint, then loiter safely down to another low altitude:
#define WP_RADIUS 30 // What is the minimum distance to reach a waypoint?
#define LOITER_RADIUS 60 // How close to Loiter?
#define HOLD_CURRENT_ALT 0 // 1 = hold the current altitude, 0 = use the defined altitude to for RTL
#define ALT_TO_HOLD 100float mission[][5] = {
{WAYPOINT,0,528,49.9630094,-119.378643},
{LOITER_TURNS,1,1500,49.963037,-119.3742228},
{CONDITION_CHANGE_ALT,0,1500,1000,0},
{DO_JUMP,7,0,49,0},
{LOITER_TIME,5,1500,49.963037,-119.3730211},
{DO_JUMP,2,0,100,0},{WAYPOINT,0,1500,49.9585921,-119.3729353},
{LOITER_TURNS,1,1500,49.9585921,-119.3743086},
{CONDITION_CHANGE_ALT,0,528,1000,0},
{DO_JUMP,13,0,49,0},
{LOITER_TIME,5,528,49.9585645,-119.3757248},
{DO_JUMP,8,0,49,0},
{WAYPOINT,0,528,49.9583989,-119.3808317},
{RETURN_TO_LAUNCH,0,528,49.9629542,-119.3808746},
};
The first part works (loiter to altitude) perfectly, but the problem is as soon it reaches the second part (waypoint #7) Ardupilot just returns to launch without descending at all, as if it thinks it has already descended and should continue on.
Have I messed up the flight plan, or is this a bug by chance?