mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
RC_Channel: moved LANDING_GEAR to common library
This commit is contained in:
parent
fa1fc004bf
commit
7fad72dacf
@ -32,6 +32,7 @@ extern const AP_HAL::HAL& hal;
|
|||||||
#include <AC_Avoidance/AC_Avoid.h>
|
#include <AC_Avoidance/AC_Avoid.h>
|
||||||
#include <AC_Sprayer/AC_Sprayer.h>
|
#include <AC_Sprayer/AC_Sprayer.h>
|
||||||
#include <AP_Gripper/AP_Gripper.h>
|
#include <AP_Gripper/AP_Gripper.h>
|
||||||
|
#include <AP_LandingGear/AP_LandingGear.h>
|
||||||
|
|
||||||
const AP_Param::GroupInfo RC_Channel::var_info[] = {
|
const AP_Param::GroupInfo RC_Channel::var_info[] = {
|
||||||
// @Param: MIN
|
// @Param: MIN
|
||||||
@ -438,6 +439,7 @@ void RC_Channel::init_aux_function(const aux_func_t ch_option, const aux_switch_
|
|||||||
case DO_NOTHING:
|
case DO_NOTHING:
|
||||||
case CLEAR_WP:
|
case CLEAR_WP:
|
||||||
case COMPASS_LEARN:
|
case COMPASS_LEARN:
|
||||||
|
case LANDING_GEAR:
|
||||||
break;
|
break;
|
||||||
case GRIPPER:
|
case GRIPPER:
|
||||||
case SPRAYER:
|
case SPRAYER:
|
||||||
@ -650,6 +652,25 @@ void RC_Channel::do_aux_function(const aux_func_t ch_option, const aux_switch_po
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LANDING_GEAR: {
|
||||||
|
AP_LandingGear *lg = AP_LandingGear::instance();
|
||||||
|
if (lg == nullptr) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (ch_flag) {
|
||||||
|
case LOW:
|
||||||
|
lg->set_position(AP_LandingGear::LandingGear_Deploy);
|
||||||
|
break;
|
||||||
|
case MIDDLE:
|
||||||
|
// nothing
|
||||||
|
break;
|
||||||
|
case HIGH:
|
||||||
|
lg->set_position(AP_LandingGear::LandingGear_Retract);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
gcs().send_text(MAV_SEVERITY_INFO, "Invalid channel option (%u)", ch_option);
|
gcs().send_text(MAV_SEVERITY_INFO, "Invalid channel option (%u)", ch_option);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user