mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 03:03:33 +08:00
Revert "q_estimator: correctly handle loss of external yaw estimation"
This commit is contained in:
committed by
Kabir Mohammed
parent
075c836dfb
commit
6257037924
@@ -361,20 +361,15 @@ void AttitudeEstimatorQ::task_main()
|
||||
// Hence Rvis must be transposed having (Rwr)' * Vw
|
||||
// Rrw * Vw = vn. This way we have consistency
|
||||
_vision_hdg = Rvis.transpose() * v;
|
||||
|
||||
// vision external heading usage (ATT_EXT_HDG_M 1)
|
||||
if (_ext_hdg_mode == 1) {
|
||||
// Check for timeouts on data
|
||||
_ext_hdg_good = vision.timestamp > 0 && (hrt_elapsed_time(&vision.timestamp) < 500000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// vision external heading usage (ATT_EXT_HDG_M 1)
|
||||
if (_ext_hdg_mode == 1) {
|
||||
// Check for timeouts on data
|
||||
uint64_t time_topic;
|
||||
if (orb_stat(_vision_odom_sub, &time_topic)) {
|
||||
/* error getting last topic publication time */
|
||||
time_topic = 0;
|
||||
}
|
||||
_ext_hdg_good = time_topic > 0 && (hrt_elapsed_time(&time_topic) < 500000);
|
||||
}
|
||||
|
||||
|
||||
bool mocap_updated = false;
|
||||
orb_check(_mocap_odom_sub, &mocap_updated);
|
||||
@@ -398,19 +393,15 @@ void AttitudeEstimatorQ::task_main()
|
||||
// Hence Rmoc must be transposed having (Rwr)' * Vw
|
||||
// Rrw * Vw = vn. This way we have consistency
|
||||
_mocap_hdg = Rmoc.transpose() * v;
|
||||
|
||||
// Motion Capture external heading usage (ATT_EXT_HDG_M 2)
|
||||
if (_ext_hdg_mode == 2) {
|
||||
// Check for timeouts on data
|
||||
_ext_hdg_good = mocap.timestamp > 0 && (hrt_elapsed_time(&mocap.timestamp) < 500000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Motion Capture external heading usage (ATT_EXT_HDG_M 2)
|
||||
if (_ext_hdg_mode == 2) {
|
||||
// Check for timeouts on data
|
||||
uint64_t time_topic;
|
||||
if (orb_stat(_mocap_odom_sub, &time_topic)) {
|
||||
/* error getting last topic publication time */
|
||||
time_topic = 0;
|
||||
}
|
||||
_ext_hdg_good = time_topic > 0 && (hrt_elapsed_time(&time_topic) < 500000);
|
||||
}
|
||||
|
||||
bool gpos_updated = false;
|
||||
orb_check(_global_pos_sub, &gpos_updated);
|
||||
@@ -750,4 +741,4 @@ int attitude_estimator_q_main(int argc, char *argv[])
|
||||
|
||||
warnx("unrecognized command");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user