Merge remote-tracking branch 'origin/Depth-Control'
This commit is contained in:
commit
59e6f6f83b
@ -32,8 +32,8 @@ const AP_Param::Info Sub::var_info[] = {
|
|||||||
|
|
||||||
// @Param: SURFACE_DEPTH
|
// @Param: SURFACE_DEPTH
|
||||||
// @DisplayName: Depth reading at surface
|
// @DisplayName: Depth reading at surface
|
||||||
// @Description: The depth the external pressure sensor will read when the vehicle is considered at the surface (in meters)
|
// @Description: The depth the external pressure sensor will read when the vehicle is considered at the surface (in centimeters)
|
||||||
// @Range: -0.05 -1.0
|
// @Range: -5.0 -100.0
|
||||||
// @User: Standard
|
// @User: Standard
|
||||||
GSCALAR(surface_depth, "SURFACE_DEPTH", SURFACE_DEPTH_DEFAULT),
|
GSCALAR(surface_depth, "SURFACE_DEPTH", SURFACE_DEPTH_DEFAULT),
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SURFACE_DEPTH_DEFAULT
|
#ifndef SURFACE_DEPTH_DEFAULT
|
||||||
# define SURFACE_DEPTH_DEFAULT -0.10 // pressure sensor reading 10cm depth means craft is considered surfaced
|
# define SURFACE_DEPTH_DEFAULT -10.0 // pressure sensor reading 10cm depth means craft is considered surfaced
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ void Sub::althold_run()
|
|||||||
pos_control.set_alt_target_from_climb_rate_ff(target_climb_rate, G_Dt, false);
|
pos_control.set_alt_target_from_climb_rate_ff(target_climb_rate, G_Dt, false);
|
||||||
} else if(pos_control.get_vel_target_z() > 0.0) {
|
} else if(pos_control.get_vel_target_z() > 0.0) {
|
||||||
pos_control.relax_alt_hold_controllers(0.0); // clear velocity and position targets, and integrator
|
pos_control.relax_alt_hold_controllers(0.0); // clear velocity and position targets, and integrator
|
||||||
pos_control.set_alt_target(g.surface_depth*100); // set alt target to the same depth that triggers the surface detector.
|
pos_control.set_alt_target(g.surface_depth); // set alt target to the same depth that triggers the surface detector.
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pos_control.set_alt_target_from_climb_rate_ff(target_climb_rate, G_Dt, false);
|
pos_control.set_alt_target_from_climb_rate_ff(target_climb_rate, G_Dt, false);
|
||||||
|
@ -21,7 +21,7 @@ void Sub::update_surface_and_bottom_detector()
|
|||||||
if (ap.depth_sensor_present) { // we can use the external pressure sensor for a very accurate and current measure of our z axis position
|
if (ap.depth_sensor_present) { // we can use the external pressure sensor for a very accurate and current measure of our z axis position
|
||||||
current_depth = barometer.get_altitude();
|
current_depth = barometer.get_altitude();
|
||||||
|
|
||||||
set_surfaced(current_depth > g.surface_depth); // If we are above surface depth, we are surfaced
|
set_surfaced(current_depth > g.surface_depth/100.0); // If we are above surface depth, we are surfaced
|
||||||
|
|
||||||
if(motors.limit.throttle_lower && vel_stationary) {
|
if(motors.limit.throttle_lower && vel_stationary) {
|
||||||
// bottom criteria met - increment the counter and check if we've triggered
|
// bottom criteria met - increment the counter and check if we've triggered
|
||||||
|
Loading…
Reference in New Issue
Block a user