Browse Source

Sub: only update surface/bottom status when armed.

This will prevent unexpected messages during bench testing and
accelerometer calibration.
mission-4.1.18
Jacob Walser 9 years ago committed by Andrew Tridgell
parent
commit
70d58cd0bc
  1. 6
      ArduSub/surface_bottom_detector.cpp

6
ArduSub/surface_bottom_detector.cpp

@ -13,6 +13,12 @@ static float current_depth = 0; @@ -13,6 +13,12 @@ static float current_depth = 0;
// ToDo: doesn't need to be called this fast
void Sub::update_surface_and_bottom_detector()
{
if(!motors.armed()) { // only update when armed
set_surfaced(false);
set_bottomed(false);
return;
}
Vector3f velocity;
ahrs.get_velocity_NED(velocity);

Loading…
Cancel
Save