Skip to content

Commit

Permalink
Making altitude NaN if in 2D fix mode
Browse files Browse the repository at this point in the history
  • Loading branch information
danthony06 committed May 9, 2024
1 parent e6ee597 commit 93d2edd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gpsd_client/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,14 @@ namespace gpsd_client
#endif
fix.latitude = p->fix.latitude;
fix.longitude = p->fix.longitude;
fix.altitude = p->fix.altitude;
if (p->fix.mode == MODE_3D)
{
fix.altitude = p->fix.altitude;
}
else
{
fix.altitude = std::nan("");
}
fix.track = p->fix.track;
fix.speed = p->fix.speed;
fix.climb = p->fix.climb;
Expand Down

0 comments on commit 93d2edd

Please sign in to comment.