|
|
|
@ -10,13 +10,6 @@ extern const AP_HAL::HAL& hal;
@@ -10,13 +10,6 @@ extern const AP_HAL::HAL& hal;
|
|
|
|
|
|
|
|
|
|
const AP_Param::GroupInfo AP_LandingGear::var_info[] PROGMEM = { |
|
|
|
|
|
|
|
|
|
// @Param: CTL_TYPE
|
|
|
|
|
// @DisplayName: Landing Gear Control Method(relay or servo)
|
|
|
|
|
// @Description: Type of signal used to control the landing gear system
|
|
|
|
|
// @Values: 0:First Relay,1:Second Relay,2:Third Relay,3:Fourth Relay,10:Servo
|
|
|
|
|
// @User: Standard
|
|
|
|
|
AP_GROUPINFO("CTL_TYPE", 0, AP_LandingGear, _control_type, AP_LANDINGGEAR_TRIGGER_TYPE_SERVO), |
|
|
|
|
|
|
|
|
|
// @Param: SERVO_RTRACT
|
|
|
|
|
// @DisplayName: Landing Gear Servo Retracted PWM Value
|
|
|
|
|
// @Description: Servo PWM value when landing gear is retracted
|
|
|
|
@ -24,7 +17,7 @@ const AP_Param::GroupInfo AP_LandingGear::var_info[] PROGMEM = {
@@ -24,7 +17,7 @@ const AP_Param::GroupInfo AP_LandingGear::var_info[] PROGMEM = {
|
|
|
|
|
// @Units: pwm
|
|
|
|
|
// @Increment: 1
|
|
|
|
|
// @User: Standard
|
|
|
|
|
AP_GROUPINFO("SERVO_RTRACT", 1, AP_LandingGear, _servo_retract_pwm, AP_LANDINGGEAR_SERVO_RETRACT_PWM_DEFAULT), |
|
|
|
|
AP_GROUPINFO("SERVO_RTRACT", 0, AP_LandingGear, _servo_retract_pwm, AP_LANDINGGEAR_SERVO_RETRACT_PWM_DEFAULT), |
|
|
|
|
|
|
|
|
|
// @Param: SERVO_DEPLOY
|
|
|
|
|
// @DisplayName: Landing Gear Servo Deployed PWM Value
|
|
|
|
@ -33,7 +26,7 @@ const AP_Param::GroupInfo AP_LandingGear::var_info[] PROGMEM = {
@@ -33,7 +26,7 @@ const AP_Param::GroupInfo AP_LandingGear::var_info[] PROGMEM = {
|
|
|
|
|
// @Units: pwm
|
|
|
|
|
// @Increment: 1
|
|
|
|
|
// @User: Standard
|
|
|
|
|
AP_GROUPINFO("SERVO_DEPLOY", 2, AP_LandingGear, _servo_deploy_pwm, AP_LANDINGGEAR_SERVO_DEPLOY_PWM_DEFAULT), |
|
|
|
|
AP_GROUPINFO("SERVO_DEPLOY", 1, AP_LandingGear, _servo_deploy_pwm, AP_LANDINGGEAR_SERVO_DEPLOY_PWM_DEFAULT), |
|
|
|
|
|
|
|
|
|
AP_GROUPEND |
|
|
|
|
}; |
|
|
|
@ -46,14 +39,10 @@ void AP_LandingGear::enable(bool on_off)
@@ -46,14 +39,10 @@ void AP_LandingGear::enable(bool on_off)
|
|
|
|
|
|
|
|
|
|
/// deploy - deploy landing gear
|
|
|
|
|
void AP_LandingGear::deploy() |
|
|
|
|
{
|
|
|
|
|
if (_control_type == AP_LANDINGGEAR_TRIGGER_TYPE_SERVO) { |
|
|
|
|
// move servo to deployed position
|
|
|
|
|
RC_Channel_aux::set_radio(RC_Channel_aux::k_landing_gear_control, _servo_deploy_pwm); |
|
|
|
|
}else if (_control_type <= AP_LANDINGGEAR_TRIGGER_TYPE_RELAY_3) { |
|
|
|
|
// set relay off
|
|
|
|
|
_relay.off(_control_type); |
|
|
|
|
}
|
|
|
|
|
{ |
|
|
|
|
// set servo PWM to deployed position
|
|
|
|
|
RC_Channel_aux::set_radio(RC_Channel_aux::k_landing_gear_control, _servo_deploy_pwm); |
|
|
|
|
|
|
|
|
|
// set deployed flag
|
|
|
|
|
_deployed = true;
|
|
|
|
|
} |
|
|
|
@ -61,13 +50,9 @@ void AP_LandingGear::deploy()
@@ -61,13 +50,9 @@ void AP_LandingGear::deploy()
|
|
|
|
|
/// retract - retract landing gear
|
|
|
|
|
void AP_LandingGear::retract() |
|
|
|
|
{
|
|
|
|
|
if (_control_type == AP_LANDINGGEAR_TRIGGER_TYPE_SERVO) { |
|
|
|
|
// move servo to retracted position
|
|
|
|
|
RC_Channel_aux::set_radio(RC_Channel_aux::k_landing_gear_control, _servo_retract_pwm); |
|
|
|
|
}else if (_control_type <= AP_LANDINGGEAR_TRIGGER_TYPE_RELAY_3) { |
|
|
|
|
// set relay on
|
|
|
|
|
_relay.on(_control_type); |
|
|
|
|
} |
|
|
|
|
// set servo PWM to retracted position
|
|
|
|
|
RC_Channel_aux::set_radio(RC_Channel_aux::k_landing_gear_control, _servo_retract_pwm); |
|
|
|
|
|
|
|
|
|
// reset deployed flag
|
|
|
|
|
_deployed = false;
|
|
|
|
|
} |
|
|
|
|