Browse Source

Rover: add arm/disarm to ch7 switch

mission-4.1.18
Randy Mackay 7 years ago
parent
commit
b4a779aec3
  1. 2
      APMrover2/Parameters.cpp
  2. 9
      APMrover2/control_modes.cpp
  3. 3
      APMrover2/defines.h

2
APMrover2/Parameters.cpp

@ -129,7 +129,7 @@ const AP_Param::Info Rover::var_info[] = {
// @Param: CH7_OPTION // @Param: CH7_OPTION
// @DisplayName: Channel 7 option // @DisplayName: Channel 7 option
// @Description: What to do use channel 7 for // @Description: What to do use channel 7 for
// @Values: 0:Nothing,1:SaveWaypoint,2:LearnCruiseSpeed // @Values: 0:Nothing,1:SaveWaypoint,2:LearnCruiseSpeed,3:ArmDisarm
// @User: Standard // @User: Standard
GSCALAR(ch7_option, "CH7_OPTION", CH7_OPTION), GSCALAR(ch7_option, "CH7_OPTION", CH7_OPTION),

9
APMrover2/control_modes.cpp

@ -189,6 +189,15 @@ void Rover::read_aux_switch()
cruise_learn_complete(); cruise_learn_complete();
} }
break; break;
// arm or disarm the motors
case CH7_ARM_DISARM:
if (aux_ch7 == AUX_SWITCH_HIGH) {
arm_motors(AP_Arming::RUDDER);
} else if (aux_ch7 == AUX_SWITCH_LOW) {
disarm_motors();
}
break;
} }
} }

3
APMrover2/defines.h

@ -17,7 +17,8 @@
enum ch7_option { enum ch7_option {
CH7_DO_NOTHING = 0, CH7_DO_NOTHING = 0,
CH7_SAVE_WP = 1, CH7_SAVE_WP = 1,
CH7_LEARN_CRUISE = 2 CH7_LEARN_CRUISE = 2,
CH7_ARM_DISARM = 3
}; };
// HIL enumerations // HIL enumerations

Loading…
Cancel
Save