mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-28 02:33:58 -04:00
Copter: Ch7/8 option to retract mount
-Define AUX_SWITCH_RETRACT_MOUNT in defines.h -Added 27=Retract Mount to Parameters.pde CH7 and CH8 -added int on CH7/8opt AUX_SWITCH_RETRACT_MOUNT -Added Case #if Mount == ENABLE to set mount mode made set_mode public in AP_Mount.h lib
This commit is contained in:
parent
4c3480796d
commit
e892b4cd04
@ -377,15 +377,13 @@ const AP_Param::Info var_info[] PROGMEM = {
|
||||
// @Param: CH7_OPT
|
||||
// @DisplayName: Channel 7 option
|
||||
// @Description: Select which function if performed when CH7 is above 1800 pwm
|
||||
// @Values: 0:Do Nothing, 2:Flip, 3:Simple Mode, 4:RTL, 5:Save Trim, 7:Save WP, 8:Multi Mode, 9:Camera Trigger, 10:Sonar, 11:Fence, 12:ResetToArmedYaw, 13:Super Simple Mode, 14:Acro Trainer, 16:Auto, 17:AutoTune, 18:Land, 19:EPM, 20:EKF, 21:Parachute Enable, 22:Parachute Release, 23:Parachute 3pos, 24:Auto Mission Reset, 25:AttCon Feed Forward, 26:AttCon Accel Limits
|
||||
// @User: Standard
|
||||
// @Values: 0:Do Nothing, 2:Flip, 3:Simple Mode, 4:RTL, 5:Save Trim, 7:Save WP, 8:Multi Mode, 9:Camera Trigger, 10:Sonar, 11:Fence, 12:ResetToArmedYaw, 13:Super Simple Mode, 14:Acro Trainer, 16:Auto, 17:AutoTune, 18:Land, 19:EPM, 20:EKF, 21:Parachute Enable, 22:Parachute Release, 23:Parachute 3pos, 24:Auto Mission Reset, 25:AttCon Feed Forward, 26:AttCon Accel Limits, 27:Retract Mount // @User: Standard
|
||||
GSCALAR(ch7_option, "CH7_OPT", CH7_OPTION),
|
||||
|
||||
// @Param: CH8_OPT
|
||||
// @DisplayName: Channel 8 option
|
||||
// @Description: Select which function if performed when CH8 is above 1800 pwm
|
||||
// @Values: 0:Do Nothing, 2:Flip, 3:Simple Mode, 4:RTL, 5:Save Trim, 7:Save WP, 8:Multi Mode, 9:Camera Trigger, 10:Sonar, 11:Fence, 12:ResetToArmedYaw, 13:Super Simple Mode, 14:Acro Trainer, 16:Auto, 17:AutoTune, 18:Land, 19:EPM, 20:EKF, 21:Parachute Enable, 22:Parachute Release, 23:Parachute 3pos, 24:Auto Mission Reset, 25:AttCon Feed Forward, 26:AttCon Accel Limits
|
||||
// @User: Standard
|
||||
// @Values: 0:Do Nothing, 2:Flip, 3:Simple Mode, 4:RTL, 5:Save Trim, 7:Save WP, 8:Multi Mode, 9:Camera Trigger, 10:Sonar, 11:Fence, 12:ResetToArmedYaw, 13:Super Simple Mode, 14:Acro Trainer, 16:Auto, 17:AutoTune, 18:Land, 19:EPM, 20:EKF, 21:Parachute Enable, 22:Parachute Release, 23:Parachute 3pos, 24:Auto Mission Reset, 25:AttCon Feed Forward, 26:AttCon Accel Limits, 27:Retract Mount // @User: Standard
|
||||
GSCALAR(ch8_option, "CH8_OPT", CH8_OPTION),
|
||||
|
||||
// @Param: ARMING_CHECK
|
||||
|
@ -112,6 +112,7 @@ static void init_aux_switches()
|
||||
case AUX_SWITCH_EKF:
|
||||
case AUX_SWITCH_PARACHUTE_ENABLE:
|
||||
case AUX_SWITCH_PARACHUTE_3POS: // we trust the vehicle will be disarmed so even if switch is in release position the chute will not release
|
||||
case AUX_SWITCH_RETRACT_MOUNT:
|
||||
case AUX_SWITCH_MISSIONRESET:
|
||||
case AUX_SWITCH_ATTCON_FEEDFWD:
|
||||
case AUX_SWITCH_ATTCON_ACCEL_LIM:
|
||||
@ -132,6 +133,7 @@ static void init_aux_switches()
|
||||
case AUX_SWITCH_EKF:
|
||||
case AUX_SWITCH_PARACHUTE_ENABLE:
|
||||
case AUX_SWITCH_PARACHUTE_3POS: // we trust the vehicle will be disarmed so even if switch is in release position the chute will not release
|
||||
case AUX_SWITCH_RETRACT_MOUNT:
|
||||
case AUX_SWITCH_MISSIONRESET:
|
||||
case AUX_SWITCH_ATTCON_FEEDFWD:
|
||||
case AUX_SWITCH_ATTCON_ACCEL_LIM:
|
||||
@ -425,6 +427,19 @@ static void do_aux_switch_function(int8_t ch_function, uint8_t ch_flag)
|
||||
// enable or disable accel limiting by restoring defaults
|
||||
attitude_control.accel_limiting(ch_flag == AUX_SWITCH_HIGH);
|
||||
break;
|
||||
|
||||
#if MOUNT == ENABLE
|
||||
case AUX_SWITCH_RETRACT_MOUNT:
|
||||
switch (ch_flag) {
|
||||
case AUX_SWITCH_HIGH:
|
||||
camera_mount.set_mode(MAV_MOUNT_MODE_RETRACT);
|
||||
break;
|
||||
case AUX_SWITCH_LOW:
|
||||
camera_mount.set_mode_to_default();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,6 +59,7 @@
|
||||
#define AUX_SWITCH_MISSIONRESET 24 // Reset auto mission to start from first command
|
||||
#define AUX_SWITCH_ATTCON_FEEDFWD 25 // enable/disable the roll and pitch rate feed forward
|
||||
#define AUX_SWITCH_ATTCON_ACCEL_LIM 26 // enable/disable the roll, pitch and yaw accel limiting
|
||||
#define AUX_SWITCH_RETRACT_MOUNT 27 // Retract Mount
|
||||
|
||||
// values used by the ap.ch7_opt and ap.ch8_opt flags
|
||||
#define AUX_SWITCH_LOW 0 // indicates auxiliar switch is in the low position (pwm <1200)
|
||||
|
Loading…
Reference in New Issue
Block a user