Sub: Fix units for surface depth

This commit is contained in:
jaxxzer 2016-03-14 19:51:53 -04:00 committed by Andrew Tridgell
parent 9fabd7ced7
commit 0c73ad5f4b
3 changed files with 3 additions and 3 deletions

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