mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 01:33:33 +08:00
EKF: Add protection for undefined GPS antenna array heading offset
This commit is contained in:
committed by
Paul Riseborough
parent
d1f3f4c916
commit
6847acb72e
@@ -221,7 +221,11 @@ void EstimatorInterface::setGpsData(uint64_t time_usec, struct gps_message *gps)
|
|||||||
gps_sample_new.hgt = (float)gps->alt * 1e-3f;
|
gps_sample_new.hgt = (float)gps->alt * 1e-3f;
|
||||||
|
|
||||||
gps_sample_new.yaw = gps->yaw;
|
gps_sample_new.yaw = gps->yaw;
|
||||||
_gps_yaw_offset = gps->yaw_offset;
|
if (ISFINITE(gps->yaw_offset)) {
|
||||||
|
_gps_yaw_offset = gps->yaw_offset;
|
||||||
|
} else {
|
||||||
|
_gps_yaw_offset = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
// Only calculate the relative position if the WGS-84 location of the origin is set
|
// Only calculate the relative position if the WGS-84 location of the origin is set
|
||||||
if (collect_gps(time_usec, gps)) {
|
if (collect_gps(time_usec, gps)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user