mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
ArduCopter: add YAW_OVR_BEHAVE to allow control of when autopilot takes back control of yaw after pilot overrides it during a mission
This commit is contained in:
parent
0f7bb79d89
commit
56ceb230cb
@ -72,6 +72,7 @@ public:
|
||||
k_param_crosstrack_min_distance,
|
||||
k_param_rssi_pin,
|
||||
k_param_throttle_accel_enabled,
|
||||
k_param_yaw_override_behaviour,
|
||||
|
||||
// 65: AP_Limits Library
|
||||
k_param_limits = 65,
|
||||
@ -271,6 +272,7 @@ public:
|
||||
AP_Int8 battery_curr_pin;
|
||||
AP_Int8 rssi_pin;
|
||||
AP_Int8 throttle_accel_enabled; // enable/disable accel based throttle controller
|
||||
AP_Int8 yaw_override_behaviour; // controls when autopilot takes back normal control of yaw after pilot overrides
|
||||
|
||||
// Waypoints
|
||||
//
|
||||
|
@ -151,6 +151,13 @@ const AP_Param::Info var_info[] PROGMEM = {
|
||||
// @User: Standard
|
||||
GSCALAR(throttle_accel_enabled, "THR_ACC_ENABLE", 1),
|
||||
|
||||
// @Param: YAW_OVR_BEHAVE
|
||||
// @DisplayName: Yaw override behaviour
|
||||
// @Description: Controls when autopilot takes back normal control of yaw after pilot overrides
|
||||
// @Values: 0:At Next WP, 1:On Mission Restart
|
||||
// @User: Advanced
|
||||
GSCALAR(yaw_override_behaviour, "YAW_OVR_BEHAVE", YAW_OVERRIDE_BEHAVIOUR_AT_NEXT_WAYPOINT),
|
||||
|
||||
GSCALAR(waypoint_mode, "WP_MODE", 0),
|
||||
GSCALAR(command_total, "WP_TOTAL", 0),
|
||||
GSCALAR(command_index, "WP_INDEX", 0),
|
||||
|
@ -284,6 +284,11 @@ static void do_nav_wp()
|
||||
if((next_WP.options & WP_OPTION_ALT_REQUIRED) == false) {
|
||||
wp_verify_byte |= NAV_ALTITUDE;
|
||||
}
|
||||
|
||||
// reset control of yaw
|
||||
if( g.yaw_override_behaviour == YAW_OVERRIDE_BEHAVIOUR_AT_NEXT_WAYPOINT ) {
|
||||
set_yaw_mode(YAW_LOOK_AT_NEXT_WP);
|
||||
}
|
||||
}
|
||||
|
||||
// do_land - initiate landing procedure
|
||||
|
@ -192,6 +192,10 @@
|
||||
#define CIRCLE_MODE 3
|
||||
#define NO_NAV_MODE 4
|
||||
|
||||
// Yaw override behaviours - used for setting yaw_override_behaviour
|
||||
#define YAW_OVERRIDE_BEHAVIOUR_AT_NEXT_WAYPOINT 0 // auto pilot takes back yaw control at next waypoint
|
||||
#define YAW_OVERRIDE_BEHAVIOUR_AT_MISSION_RESTART 1 // auto pilot tkaes back control only when mission is restarted
|
||||
|
||||
// TOY mixing options
|
||||
#define TOY_LOOKUP_TABLE 0
|
||||
#define TOY_LINEAR_MIXER 1
|
||||
|
Loading…
Reference in New Issue
Block a user