mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 01:04:09 +08:00
EKF: Add protection for undefined GPS antenna array heading offset
This commit is contained in:
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.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
|
||||
if (collect_gps(time_usec, gps)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user