Skip to content

Flight Modes Loiter

Arthur Benemann edited this page Mar 15, 2013 · 1 revision

Ardupilot uses a simple vector field navigation strategy for holding the orbit around a specific location. A user defined radius can be specified in the header file.

You can also "nudge" the aircraft manually in this mode. Throttle "nudging" occurs if the throttle stick is in the top 1/2 of the range and moves the airspeed or throttle setpoint up towards the upper limit proportional to the stick's position in the top 1/2 of the range. Normally you should have the throttle stick in the lower 1/2 of its range when using any "auto" mode.

[http://api.ning.com/files/lPtcJ8AiWjopWlqtnnYqnJUhR3iCQqQ4cjmFbx5Nr8khjtV3gGCbyWoPybr8cxgQHRSGKLsM5JFjhvk62EurxeUzIjI3kU6L/Loiter.png]

Details

Loiter radius is set by the Ground Control Station, the Waypoint_writer sketch, or other tools. Adjust this value slightly larger than your plane can safely turn. The default radius is 40 meters. Ardupilot will automatically Loiter above home after the Return To Launch command has reached home. If you want Ardupilot to Loiter over a specific point, use mission scripting.

Vector Fields

Vector fields are a complex topic, but essentially we are using them to offset the heading based on how close we are to the radius. If Ardupilot is at the radius, the heading will read 90° to the waypoint. Closer or farther away will give you a smaller offset angle. The code: if(LOITER){ if (wp_distance <= loiter_radius){ nav_bearing -= 90;//degrees

	}else if (wp_distance < (loiter_radius * 2)){
		power = -((wp_distance - (loiter_radius * 2)) / loiter_radius);
		power = constrain(power, 0, 1);
		nav_bearing -= power * 9000;
	}else{
		// deal with crosswinds in between waypoints
		update_crosstrack();
	}
}
Clone this wiki locally