mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
Copter: Payload Place: Change PLDP_RNG_MIN to PLDP_RNG_MAX
This commit is contained in:
parent
cbe5cf8c81
commit
bc6d965bbc
@ -1176,13 +1176,13 @@ const AP_Param::GroupInfo ParametersG2::var_info2[] = {
|
|||||||
// @User: Standard
|
// @User: Standard
|
||||||
AP_GROUPINFO("PLDP_THRESH", 1, ParametersG2, pldp_thrust_placed_fraction, 0.9),
|
AP_GROUPINFO("PLDP_THRESH", 1, ParametersG2, pldp_thrust_placed_fraction, 0.9),
|
||||||
|
|
||||||
// @Param: PLDP_RNG_MIN
|
// @Param: PLDP_RNG_MAX
|
||||||
// @DisplayName: Payload Place minimum range finder altitude
|
// @DisplayName: Payload Place maximum range finder altitude
|
||||||
// @Description: Minimum range finder altitude in m to trigger payload touchdown, set to zero to disable.
|
// @Description: Maximum range finder altitude in m to trigger payload touchdown, set to zero to disable.
|
||||||
// @Units: m
|
// @Units: m
|
||||||
// @Range: 0 100
|
// @Range: 0 100
|
||||||
// @User: Standard
|
// @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
|
// @Param: PLDP_DELAY
|
||||||
// @DisplayName: Payload Place climb delay
|
// @DisplayName: Payload Place climb delay
|
||||||
|
@ -682,7 +682,7 @@ public:
|
|||||||
|
|
||||||
// payload place parameters
|
// payload place parameters
|
||||||
AP_Float pldp_thrust_placed_fraction;
|
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_delay_s;
|
||||||
AP_Float pldp_descent_speed_ms;
|
AP_Float pldp_descent_speed_ms;
|
||||||
};
|
};
|
||||||
|
@ -1301,14 +1301,14 @@ void PayloadPlace::run()
|
|||||||
// thrust is above minimum threshold
|
// thrust is above minimum threshold
|
||||||
place_start_time_ms = now_ms;
|
place_start_time_ms = now_ms;
|
||||||
break;
|
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) {
|
if (!copter.rangefinder_state.enabled) {
|
||||||
// abort payload place because rangefinder is not enabled
|
// abort payload place because rangefinder is not enabled
|
||||||
state = State::Ascent_Start;
|
state = State::Ascent_Start;
|
||||||
gcs().send_text(MAV_SEVERITY_WARNING, "%s PLDP_RNG_MIN set and rangefinder not enabled", prefix_str);
|
gcs().send_text(MAV_SEVERITY_WARNING, "%s PLDP_RNG_MAX set and rangefinder not enabled", prefix_str);
|
||||||
break;
|
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
|
// range finder altitude is above maximum
|
||||||
place_start_time_ms = now_ms;
|
place_start_time_ms = now_ms;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user