Browse Source

AP_NavEKF_Source; pre_arm_check may skip position checks

zr-v5.1
Randy Mackay 4 years ago committed by Andrew Tridgell
parent
commit
8ecac27777
  1. 5
      libraries/AP_NavEKF/AP_NavEKF_Source.cpp
  2. 3
      libraries/AP_NavEKF/AP_NavEKF_Source.h

5
libraries/AP_NavEKF/AP_NavEKF_Source.cpp

@ -299,7 +299,8 @@ void AP_NavEKF_Source::mark_configured_in_storage() @@ -299,7 +299,8 @@ void AP_NavEKF_Source::mark_configured_in_storage()
}
// returns false if we fail arming checks, in which case the buffer will be populated with a failure message
bool AP_NavEKF_Source::pre_arm_check(char *failure_msg, uint8_t failure_msg_len) const
// requires_position should be true if horizontal position configuration should be checked
bool AP_NavEKF_Source::pre_arm_check(bool requires_position, char *failure_msg, uint8_t failure_msg_len) const
{
auto &dal = AP::dal();
bool baro_required = false;
@ -314,6 +315,7 @@ bool AP_NavEKF_Source::pre_arm_check(char *failure_msg, uint8_t failure_msg_len) @@ -314,6 +315,7 @@ bool AP_NavEKF_Source::pre_arm_check(char *failure_msg, uint8_t failure_msg_len)
// check source params are valid
for (uint8_t i=0; i<AP_NAKEKF_SOURCE_SET_MAX; i++) {
if (requires_position) {
// check posxy
switch ((SourceXY)_source_set[i].posxy.get()) {
case SourceXY::NONE:
@ -400,6 +402,7 @@ bool AP_NavEKF_Source::pre_arm_check(char *failure_msg, uint8_t failure_msg_len) @@ -400,6 +402,7 @@ bool AP_NavEKF_Source::pre_arm_check(char *failure_msg, uint8_t failure_msg_len)
hal.util->snprintf(failure_msg, failure_msg_len, "Check EK3_SRC%d_VELZ", (int)i+1);
return false;
}
}
// check yaw
switch ((SourceYaw)_source_set[i].yaw.get()) {

3
libraries/AP_NavEKF/AP_NavEKF_Source.h

@ -90,7 +90,8 @@ public: @@ -90,7 +90,8 @@ public:
void mark_configured_in_storage();
// returns false if we fail arming checks, in which case the buffer will be populated with a failure message
bool pre_arm_check(char *failure_msg, uint8_t failure_msg_len) const;
// requires_position should be true if horizontal position configuration should be checked
bool pre_arm_check(bool requires_position, char *failure_msg, uint8_t failure_msg_len) const;
// return true if ext nav is enabled on any source
bool ext_nav_enabled(void) const;

Loading…
Cancel
Save