diff options
author | Gary E. Miller <gem@rellim.com> | 2018-09-11 18:15:59 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-09-11 18:15:59 -0700 |
commit | a7dc77f0c6730f97e5dfbaefa70bfa3730caaeff (patch) | |
tree | b5871ac1f1548d6055e2edae704a7d9a5a6dda8d /gpsutils.c | |
parent | 9628f57fc93982fd22e2e71344d25f41914bbdfb (diff) | |
download | gpsd-a7dc77f0c6730f97e5dfbaefa70bfa3730caaeff.tar.gz |
ATT: centralize clearing of the attitude data.
This showed up a bug where rtcm3_unpack() was not clearing its
rtcm3 data, which is a union with the attitude data.
Diffstat (limited to 'gpsutils.c')
-rw-r--r-- | gpsutils.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -265,6 +265,28 @@ void gps_clear_fix(struct gps_fix_t *fixp) fixp->ecef.vAcc = NAN; } +void gps_clear_att(struct attitude_t *attp) +/* stuff an attitude structure with recognizable out-of-band values */ +{ + memset(attp, 0, sizeof(struct attitude_t)); + attp->pitch = NAN; + attp->roll = NAN; + attp->yaw = NAN; + attp->dip = NAN; + attp->mag_len = NAN; + attp->mag_x = NAN; + attp->mag_y = NAN; + attp->mag_z = NAN; + attp->acc_len = NAN; + attp->acc_x = NAN; + attp->acc_y = NAN; + attp->acc_z = NAN; + attp->gyro_x = NAN; + attp->gyro_y = NAN; + attp->temp = NAN; + attp->depth = NAN; +} + void gps_clear_dop( struct dop_t *dop) { dop->xdop = dop->ydop = dop->vdop = dop->tdop = dop->hdop = dop->pdop = |