mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-24 00:33:56 -04:00
Plane: move handling of MAV_CMD_DO_GRIPPER up
This commit is contained in:
parent
b0aeec4b6a
commit
2cdcca2841
ArduPlane
@ -1162,31 +1162,6 @@ void GCS_MAVLINK_Plane::handleMessage(mavlink_message_t* msg)
|
||||
result = MAV_RESULT_ACCEPTED;
|
||||
}
|
||||
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:
|
||||
result = handle_command_long_message(packet);
|
||||
|
@ -57,5 +57,4 @@ LIBRARIES += AP_Landing
|
||||
LIBRARIES += AP_Beacon
|
||||
LIBRARIES += PID
|
||||
LIBRARIES += AP_Soaring
|
||||
LIBRARIES += AP_Gripper
|
||||
LIBRARIES += AP_Devo_Telem
|
||||
|
@ -31,7 +31,6 @@ def build(bld):
|
||||
'AP_Beacon',
|
||||
'PID',
|
||||
'AP_Soaring',
|
||||
'AP_Gripper',
|
||||
'AP_Devo_Telem',
|
||||
],
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user