Merge remote-tracking branch 'origin/Depth-Control'

This commit is contained in:
Rustom Jehangir 2016-03-15 16:57:09 -07:00
commit 59e6f6f83b
4 changed files with 5 additions and 5 deletions

View File

@ -32,8 +32,8 @@ const AP_Param::Info Sub::var_info[] = {
// @Param: SURFACE_DEPTH
// @DisplayName: Depth reading at surface
// @Description: The depth the external pressure sensor will read when the vehicle is considered at the surface (in meters)
// @Range: -0.05 -1.0
// @Description: The depth the external pressure sensor will read when the vehicle is considered at the surface (in centimeters)
// @Range: -5.0 -100.0
// @User: Standard
GSCALAR(surface_depth, "SURFACE_DEPTH", SURFACE_DEPTH_DEFAULT),

View File

@ -77,7 +77,7 @@
#endif
#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

View File

@ -129,7 +129,7 @@ void Sub::althold_run()
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) {
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 {
pos_control.set_alt_target_from_climb_rate_ff(target_climb_rate, G_Dt, false);

View File

@ -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
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) {
// bottom criteria met - increment the counter and check if we've triggered