Skip to content

Commit

Permalink
ShipOps: Fix lidar payload trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
lthall committed Jul 11, 2024
1 parent 0ef7b71 commit ebaf97e
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions ArduCopter/mode_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1299,27 +1299,27 @@ void PayloadPlace::run_vertical_control()
const auto &wp_nav = copter.wp_nav;
const auto &pos_control = copter.pos_control;

if (!within_rangefinder_release_range()) {
// reset timer
switch (state) {
case State::Descent_Start:
case State::Descent_Measure:
rangefinder_drop_alt_time_ms = now_ms;
} else if (now_ms - rangefinder_drop_alt_time_ms < rangefinder_drop_check_duration_ms) {
switch (state) {
case State::Descent_Start:
case State::Descent_Measure:
// do nothing on this loop
break;
case State::Descent_Test:
break;
case State::Descent_Test:
if (!within_rangefinder_release_range()) {
// reset timer
rangefinder_drop_alt_time_ms = now_ms;
} else if (now_ms - rangefinder_drop_alt_time_ms > rangefinder_drop_check_duration_ms) {
gcs().send_text(MAV_SEVERITY_INFO, "%s rangefinder trigger", prefix_str);
state = State::Release;
break;
case State::Release:
case State::Releasing:
case State::Delay:
case State::Ascent_Start:
case State::Ascent:
case State::Done:
break;
}
break;
case State::Release:
case State::Releasing:
case State::Delay:
case State::Ascent_Start:
case State::Ascent:
case State::Done:
break;
}

switch (state) {
Expand Down

0 comments on commit ebaf97e

Please sign in to comment.