Skip to content

Commit

Permalink
RTL activates Gripper
Browse files Browse the repository at this point in the history
  • Loading branch information
lthall committed Jul 3, 2023
1 parent 05f4e85 commit cba29ce
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ArduCopter/mode_rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,32 @@ void ModeRTL::run(bool disarm_on_land)
return;
}

if (_state_complete) {
switch (_state) {
case SubMode::STARTING:
break;
case SubMode::INITIAL_CLIMB:
if (g2.gripper.enabled() && g2.gripper.grabbed()){
g2.gripper.release();
gcs().send_text(MAV_SEVERITY_INFO, "Gripper Released");
}
break;
case SubMode::RETURN_HOME:
break;
case SubMode::LOITER_AT_HOME:
break;
case SubMode::FINAL_DESCENT:
// do nothing
break;
case SubMode::LAND:
if (g2.gripper.enabled() && g2.gripper.released()){
g2.gripper.grab();
gcs().send_text(MAV_SEVERITY_INFO, "Gripper Grabbed");
}
break;
}
}

// check if we need to move to next state
if (_state_complete) {
switch (_state) {
Expand Down

0 comments on commit cba29ce

Please sign in to comment.