Browse Source

AP_NavEKF3: eliminate GCS_MAVLINK::send_statustext_all

mission-4.1.18
Peter Barker 8 years ago committed by Francisco Ferreira
parent
commit
93e09c51d3
  1. 4
      libraries/AP_NavEKF3/AP_NavEKF3.cpp
  2. 16
      libraries/AP_NavEKF3/AP_NavEKF3_Control.cpp
  3. 8
      libraries/AP_NavEKF3/AP_NavEKF3_MagFusion.cpp
  4. 2
      libraries/AP_NavEKF3/AP_NavEKF3_Measurements.cpp
  5. 2
      libraries/AP_NavEKF3/AP_NavEKF3_OptFlowFusion.cpp
  6. 2
      libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp
  7. 2
      libraries/AP_NavEKF3/AP_NavEKF3_VehicleStatus.cpp
  8. 10
      libraries/AP_NavEKF3/AP_NavEKF3_core.cpp

4
libraries/AP_NavEKF3/AP_NavEKF3.cpp

@ -664,7 +664,7 @@ bool NavEKF3::InitialiseFilter(void) @@ -664,7 +664,7 @@ bool NavEKF3::InitialiseFilter(void)
// check if there is enough memory to create the EKF cores
if (hal.util->available_memory() < sizeof(NavEKF3_core)*num_cores + 4096) {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "NavEKF3: not enough memory");
gcs().send_text(MAV_SEVERITY_CRITICAL, "NavEKF3: not enough memory");
_enable.set(0);
return false;
}
@ -673,7 +673,7 @@ bool NavEKF3::InitialiseFilter(void) @@ -673,7 +673,7 @@ bool NavEKF3::InitialiseFilter(void)
core = new NavEKF3_core[num_cores];
if (core == nullptr) {
_enable.set(0);
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "NavEKF3: allocation failed");
gcs().send_text(MAV_SEVERITY_CRITICAL, "NavEKF3: allocation failed");
return false;
}

16
libraries/AP_NavEKF3/AP_NavEKF3_Control.cpp

@ -305,7 +305,7 @@ void NavEKF3_core::setAidingMode() @@ -305,7 +305,7 @@ void NavEKF3_core::setAidingMode()
switch (PV_AidingMode) {
case AID_NONE:
// We have ceased aiding
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_WARNING, "EKF3 IMU%u stopped aiding",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_WARNING, "EKF3 IMU%u stopped aiding",(unsigned)imu_index);
// When not aiding, estimate orientation & height fusing synthetic constant position and zero velocity measurement to constrain tilt errors
posTimeout = true;
velTimeout = true;
@ -327,7 +327,7 @@ void NavEKF3_core::setAidingMode() @@ -327,7 +327,7 @@ void NavEKF3_core::setAidingMode()
case AID_RELATIVE:
// We are doing relative position navigation where velocity errors are constrained, but position drift will occur
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u started relative aiding",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u started relative aiding",(unsigned)imu_index);
if (readyToUseOptFlow()) {
// Reset time stamps
flowValidMeaTime_ms = imuSampleTime_ms;
@ -346,14 +346,14 @@ void NavEKF3_core::setAidingMode() @@ -346,14 +346,14 @@ void NavEKF3_core::setAidingMode()
// We are commencing aiding using GPS - this is the preferred method
posResetSource = GPS;
velResetSource = GPS;
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u is using GPS",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u is using GPS",(unsigned)imu_index);
} else if (readyToUseRangeBeacon()) {
// We are commencing aiding using range beacons
posResetSource = RNGBCN;
velResetSource = DEFAULT;
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u is using range beacons",(unsigned)imu_index);
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u initial pos NE = %3.1f,%3.1f (m)",(unsigned)imu_index,(double)receiverPos.x,(double)receiverPos.y);
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u initial beacon pos D offset = %3.1f (m)",(unsigned)imu_index,(double)bcnPosOffsetNED.z);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u is using range beacons",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u initial pos NE = %3.1f,%3.1f (m)",(unsigned)imu_index,(double)receiverPos.x,(double)receiverPos.y);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u initial beacon pos D offset = %3.1f (m)",(unsigned)imu_index,(double)bcnPosOffsetNED.z);
}
// clear timeout flags as a precaution to avoid triggering any additional transitions
@ -389,7 +389,7 @@ void NavEKF3_core::checkAttitudeAlignmentStatus() @@ -389,7 +389,7 @@ void NavEKF3_core::checkAttitudeAlignmentStatus()
Vector3f angleErrVarVec = calcRotVecVariances();
if ((angleErrVarVec.x + angleErrVarVec.y) < sq(0.05235f)) {
tiltAlignComplete = true;
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u tilt alignment complete\n",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u tilt alignment complete\n",(unsigned)imu_index);
}
}
@ -481,7 +481,7 @@ void NavEKF3_core::setOrigin() @@ -481,7 +481,7 @@ void NavEKF3_core::setOrigin()
// define Earth rotation vector in the NED navigation frame at the origin
calcEarthRateNED(earthRateNED, _ahrs->get_home().lat);
validOrigin = true;
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u Origin set to GPS",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u Origin set to GPS",(unsigned)imu_index);
}
// record a yaw reset event

8
libraries/AP_NavEKF3/AP_NavEKF3_MagFusion.cpp

@ -119,14 +119,14 @@ void NavEKF3_core::controlMagYawReset() @@ -119,14 +119,14 @@ void NavEKF3_core::controlMagYawReset()
// send initial alignment status to console
if (!yawAlignComplete) {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u initial yaw alignment complete\n",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u initial yaw alignment complete\n",(unsigned)imu_index);
}
// send in-flight yaw alignment status to console
if (finalResetRequest) {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u in-flight yaw alignment complete\n",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u in-flight yaw alignment complete\n",(unsigned)imu_index);
} else if (interimResetRequest) {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_WARNING, "EKF3 IMU%u ground mag anomaly, yaw re-aligned\n",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_WARNING, "EKF3 IMU%u ground mag anomaly, yaw re-aligned\n",(unsigned)imu_index);
}
// update the yaw reset completed status
@ -191,7 +191,7 @@ void NavEKF3_core::realignYawGPS() @@ -191,7 +191,7 @@ void NavEKF3_core::realignYawGPS()
initialiseQuatCovariances(angleErrVarVec);
// send yaw alignment information to console
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u yaw aligned to GPS velocity",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u yaw aligned to GPS velocity",(unsigned)imu_index);
// record the yaw reset event

2
libraries/AP_NavEKF3/AP_NavEKF3_Measurements.cpp

@ -237,7 +237,7 @@ void NavEKF3_core::readMagData() @@ -237,7 +237,7 @@ void NavEKF3_core::readMagData()
// if the magnetometer is allowed to be used for yaw and has a different index, we start using it
if (_ahrs->get_compass()->use_for_yaw(tempIndex) && tempIndex != magSelectIndex) {
magSelectIndex = tempIndex;
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u switching to compass %u",(unsigned)imu_index,magSelectIndex);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u switching to compass %u",(unsigned)imu_index,magSelectIndex);
// reset the timeout flag and timer
magTimeout = false;
lastHealthyMagTime_ms = imuSampleTime_ms;

2
libraries/AP_NavEKF3/AP_NavEKF3_OptFlowFusion.cpp

@ -676,7 +676,7 @@ void NavEKF3_core::FuseOptFlow() @@ -676,7 +676,7 @@ void NavEKF3_core::FuseOptFlow()
// notify first time only
if (!flowFusionActive) {
flowFusionActive = true;
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u fusing optical flow",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u fusing optical flow",(unsigned)imu_index);
}
// correct the covariance P = (I - K*H)*P
// take advantage of the empty columns in KH to reduce the

2
libraries/AP_NavEKF3/AP_NavEKF3_PosVelFusion.cpp

@ -1477,7 +1477,7 @@ void NavEKF3_core::FuseBodyVel() @@ -1477,7 +1477,7 @@ void NavEKF3_core::FuseBodyVel()
// notify first time only
if (!bodyVelFusionActive) {
bodyVelFusionActive = true;
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u fusing odometry",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u fusing odometry",(unsigned)imu_index);
}
// correct the covariance P = (I - K*H)*P
// take advantage of the empty columns in KH to reduce the

2
libraries/AP_NavEKF3/AP_NavEKF3_VehicleStatus.cpp

@ -84,7 +84,7 @@ bool NavEKF3_core::calcGpsGoodToAlign(void) @@ -84,7 +84,7 @@ bool NavEKF3_core::calcGpsGoodToAlign(void)
// capable of giving a vertical velocity
if (_ahrs->get_gps().status() >= AP_GPS::GPS_OK_FIX_3D) {
frontend->_fusionModeGPS.set(1);
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_WARNING, "EK3: Changed EK3_GPS_TYPE to 1");
gcs().send_text(MAV_SEVERITY_WARNING, "EK3: Changed EK3_GPS_TYPE to 1");
}
} else {
gpsVertVelFail = false;

10
libraries/AP_NavEKF3/AP_NavEKF3_core.cpp

@ -77,11 +77,11 @@ bool NavEKF3_core::setup_core(NavEKF3 *_frontend, uint8_t _imu_index, uint8_t _c @@ -77,11 +77,11 @@ bool NavEKF3_core::setup_core(NavEKF3 *_frontend, uint8_t _imu_index, uint8_t _c
lastInitFailReport_ms = AP_HAL::millis();
// provide an escalating series of messages
if (AP_HAL::millis() > 30000) {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_ERROR, "EKF3 waiting for GPS config data");
gcs().send_text(MAV_SEVERITY_ERROR, "EKF3 waiting for GPS config data");
} else if (AP_HAL::millis() > 15000) {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_WARNING, "EKF3 waiting for GPS config data");
gcs().send_text(MAV_SEVERITY_WARNING, "EKF3 waiting for GPS config data");
} else {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 waiting for GPS config data");
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 waiting for GPS config data");
}
}
return false;
@ -139,7 +139,7 @@ bool NavEKF3_core::setup_core(NavEKF3 *_frontend, uint8_t _imu_index, uint8_t _c @@ -139,7 +139,7 @@ bool NavEKF3_core::setup_core(NavEKF3 *_frontend, uint8_t _imu_index, uint8_t _c
if(!storedOutput.init(imu_buffer_length)) {
return false;
}
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u buffers, IMU=%u , OBS=%u , dt=%6.4f",(unsigned)imu_index,(unsigned)imu_buffer_length,(unsigned)obs_buffer_length,(double)dtEkfAvg);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u buffers, IMU=%u , OBS=%u , dt=%6.4f",(unsigned)imu_index,(unsigned)imu_buffer_length,(unsigned)obs_buffer_length,(double)dtEkfAvg);
return true;
}
@ -462,7 +462,7 @@ bool NavEKF3_core::InitialiseFilterBootstrap(void) @@ -462,7 +462,7 @@ bool NavEKF3_core::InitialiseFilterBootstrap(void)
// set to true now that states have be initialised
statesInitialised = true;
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_INFO, "EKF3 IMU%u initialised",(unsigned)imu_index);
gcs().send_text(MAV_SEVERITY_INFO, "EKF3 IMU%u initialised",(unsigned)imu_index);
return true;
}

Loading…
Cancel
Save