mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-24 08:44:08 -04:00
Plane: move handling of MAV_CMD_DO_GRIPPER up
This commit is contained in:
parent
b0aeec4b6a
commit
2cdcca2841
@ -1163,31 +1163,6 @@ void GCS_MAVLINK_Plane::handleMessage(mavlink_message_t* msg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if GRIPPER_ENABLED == ENABLED
|
|
||||||
case MAV_CMD_DO_GRIPPER:
|
|
||||||
// param1 : gripper number (ignored)
|
|
||||||
// param2 : action (0=release, 1=grab). See GRIPPER_ACTIONS enum.
|
|
||||||
if(!plane.g2.gripper.enabled()) {
|
|
||||||
result = MAV_RESULT_FAILED;
|
|
||||||
} else {
|
|
||||||
result = MAV_RESULT_ACCEPTED;
|
|
||||||
switch ((uint8_t)packet.param2) {
|
|
||||||
case GRIPPER_ACTION_RELEASE:
|
|
||||||
plane.g2.gripper.release();
|
|
||||||
gcs().send_text(MAV_SEVERITY_INFO, "Gripper Released");
|
|
||||||
break;
|
|
||||||
case GRIPPER_ACTION_GRAB:
|
|
||||||
plane.g2.gripper.grab();
|
|
||||||
gcs().send_text(MAV_SEVERITY_INFO, "Gripper Grabbed");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
result = MAV_RESULT_FAILED;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
result = handle_command_long_message(packet);
|
result = handle_command_long_message(packet);
|
||||||
break;
|
break;
|
||||||
|
@ -57,5 +57,4 @@ LIBRARIES += AP_Landing
|
|||||||
LIBRARIES += AP_Beacon
|
LIBRARIES += AP_Beacon
|
||||||
LIBRARIES += PID
|
LIBRARIES += PID
|
||||||
LIBRARIES += AP_Soaring
|
LIBRARIES += AP_Soaring
|
||||||
LIBRARIES += AP_Gripper
|
|
||||||
LIBRARIES += AP_Devo_Telem
|
LIBRARIES += AP_Devo_Telem
|
||||||
|
@ -31,7 +31,6 @@ def build(bld):
|
|||||||
'AP_Beacon',
|
'AP_Beacon',
|
||||||
'PID',
|
'PID',
|
||||||
'AP_Soaring',
|
'AP_Soaring',
|
||||||
'AP_Gripper',
|
|
||||||
'AP_Devo_Telem',
|
'AP_Devo_Telem',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user