mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-23 00:58:37 -04:00
Copter: Impliment mavlink landing gear control
Uses MAV_CMD_AIRFRAME_CONFIGURATION to retract and deploy landing gear
This commit is contained in:
parent
837903a2bf
commit
3c76ec492b
@ -1080,6 +1080,23 @@ void GCS_MAVLINK_Copter::handleMessage(mavlink_message_t* msg)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
case MAV_CMD_AIRFRAME_CONFIGURATION: {
|
||||||
|
// Param 1: Select which gear, not used in ArduPilot
|
||||||
|
// Param 2: 0 = Deploy, 1 = Retract
|
||||||
|
// For safety, anything other than 1 will deploy
|
||||||
|
switch ((uint8_t)packet.param2) {
|
||||||
|
case 1:
|
||||||
|
copter.landinggear.set_position(AP_LandingGear::LandingGear_Retract);
|
||||||
|
result = MAV_RESULT_ACCEPTED;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
copter.landinggear.set_position(AP_LandingGear::LandingGear_Deploy);
|
||||||
|
result = MAV_RESULT_ACCEPTED;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Solo user presses Fly button */
|
/* Solo user presses Fly button */
|
||||||
case MAV_CMD_SOLO_BTN_FLY_CLICK: {
|
case MAV_CMD_SOLO_BTN_FLY_CLICK: {
|
||||||
result = MAV_RESULT_ACCEPTED;
|
result = MAV_RESULT_ACCEPTED;
|
||||||
|
Loading…
Reference in New Issue
Block a user