Browse Source

Plane: mission library handles gripper

master
Peter Barker 6 years ago committed by Peter Barker
parent
commit
dc6a03f5e0
  1. 18
      ArduPlane/commands_logic.cpp
  2. 4
      Tools/autotest/arduplane.py

18
ArduPlane/commands_logic.cpp

@ -227,23 +227,6 @@ bool Plane::start_command(const AP_Mission::Mission_Command& cmd) @@ -227,23 +227,6 @@ bool Plane::start_command(const AP_Mission::Mission_Command& cmd)
cmd.content.do_engine_control.cold_start,
cmd.content.do_engine_control.height_delay_cm*0.01f);
break;
#if GRIPPER_ENABLED == ENABLED
case MAV_CMD_DO_GRIPPER: // Mission command to control gripper
switch (cmd.content.gripper.action) {
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:
// do nothing
break;
}
break;
#endif
default:
// unable to use the command, allow the vehicle to try the next command
@ -349,7 +332,6 @@ bool Plane::verify_command(const AP_Mission::Mission_Command& cmd) // Ret @@ -349,7 +332,6 @@ bool Plane::verify_command(const AP_Mission::Mission_Command& cmd) // Ret
case MAV_CMD_DO_MOUNT_CONTROL:
case MAV_CMD_DO_VTOL_TRANSITION:
case MAV_CMD_DO_ENGINE_CONTROL:
case MAV_CMD_DO_GRIPPER:
return true;
default:

4
Tools/autotest/arduplane.py

@ -668,6 +668,7 @@ class AutoTestPlane(AutoTest): @@ -668,6 +668,7 @@ class AutoTestPlane(AutoTest):
ex = None
try:
self.wp_load(os.path.join(testdir, "plane-gripper-mission.txt"))
self.mavproxy.send("wp set 1\n")
self.mavproxy.send('switch 1\n') # auto mode
self.wait_mode('AUTO')
self.wait_ready_to_arm()
@ -698,9 +699,6 @@ class AutoTestPlane(AutoTest): @@ -698,9 +699,6 @@ class AutoTestPlane(AutoTest):
self.set_rc(3, 1000)
self.set_rc(8, 1800)
self.run_test("Test Gripper mission items",
self.test_gripper_mission)
self.set_parameter("RC12_OPTION", 9)
self.reboot_sitl() # needed for RC12_OPTION to take effect

Loading…
Cancel
Save