Skip to content

Commit

Permalink
Copter: Payload Place: Change PLDP_RNG_MIN to PLDP_RNG_MAX
Browse files Browse the repository at this point in the history
  • Loading branch information
lthall committed Mar 3, 2024
1 parent d6df142 commit 882970c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ArduCopter/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ const AP_Param::GroupInfo ParametersG2::var_info2[] = {
// @Units: m
// @Range: 0 100
// @User: Standard
AP_GROUPINFO("PLDP_RNG_MIN", 2, ParametersG2, pldp_range_finder_minimum_m, 0.0),
AP_GROUPINFO("PLDP_RNG_MAX", 2, ParametersG2, pldp_range_finder_maximum_m, 0.0),

// @Param: PLDP_DELAY
// @DisplayName: Payload Place climb delay
Expand Down
2 changes: 1 addition & 1 deletion ArduCopter/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ class ParametersG2 {

// payload place parameters
AP_Float pldp_thrust_placed_fraction;
AP_Float pldp_range_finder_minimum_m;
AP_Float pldp_range_finder_maximum_m;
AP_Float pldp_delay_s;
AP_Float pldp_descent_speed_ms;
};
Expand Down
4 changes: 2 additions & 2 deletions ArduCopter/mode_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1301,13 +1301,13 @@ void PayloadPlace::run()
// thrust is above minimum threshold
place_start_time_ms = now_ms;
break;
} else if (is_positive(g2.pldp_range_finder_minimum_m)) {
} else if (is_positive(g2.pldp_range_finder_maximum_m)) {
if (!copter.rangefinder_state.enabled) {
// abort payload place because rangefinder is not enabled
state = State::Ascent_Start;
gcs().send_text(MAV_SEVERITY_WARNING, "%s PLDP_RNG_MIN set and rangefinder not enabled", prefix_str);
break;
} else if (copter.rangefinder_alt_ok() && (copter.rangefinder_state.glitch_count == 0) && (copter.rangefinder_state.alt_cm > g2.pldp_range_finder_minimum_m * 100.0)) {
} else if (copter.rangefinder_alt_ok() && (copter.rangefinder_state.glitch_count == 0) && (copter.rangefinder_state.alt_cm > g2.pldp_range_finder_maximum_m * 100.0)) {
// range finder altitude is above minimum
place_start_time_ms = now_ms;
break;
Expand Down

0 comments on commit 882970c

Please sign in to comment.