mirror of https://github.com/ArduPilot/ardupilot
Sub: move handling of MAV_CMD_DO_GRIPPER up
This commit is contained in:
parent
955baa47c2
commit
32b8b86019
|
@ -990,29 +990,6 @@ void GCS_MAVLINK_Sub::handleMessage(mavlink_message_t* msg)
|
|||
// param4 : timeout (in seconds)
|
||||
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 (!sub.g2.gripper.enabled()) {
|
||||
result = MAV_RESULT_FAILED;
|
||||
} else {
|
||||
result = MAV_RESULT_ACCEPTED;
|
||||
switch ((uint8_t)packet.param2) {
|
||||
case GRIPPER_ACTION_RELEASE:
|
||||
sub.g2.gripper.release();
|
||||
break;
|
||||
case GRIPPER_ACTION_GRAB:
|
||||
sub.g2.gripper.grab();
|
||||
break;
|
||||
default:
|
||||
result = MAV_RESULT_FAILED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
result = handle_command_long_message(packet);
|
||||
break;
|
||||
|
|
|
@ -46,7 +46,6 @@ LIBRARIES += AP_Terrain
|
|||
LIBRARIES += AP_RPM
|
||||
LIBRARIES += AP_JSButton
|
||||
LIBRARIES += AP_LeakDetector
|
||||
LIBRARIES += AP_Gripper
|
||||
LIBRARIES += AP_Beacon
|
||||
LIBRARIES += AP_TemperatureSensor
|
||||
LIBRARIES += AP_Arming
|
||||
|
|
|
@ -18,7 +18,6 @@ def build(bld):
|
|||
'AP_LeakDetector',
|
||||
'AP_Motors',
|
||||
'AP_RCMapper',
|
||||
'AP_Gripper',
|
||||
'AP_Beacon',
|
||||
'AP_TemperatureSensor',
|
||||
'AP_Arming'
|
||||
|
|
Loading…
Reference in New Issue