Skip to content

Commit

Permalink
Merge branch 'swri-robotics:ros2-devel' into improve_pkg_search
Browse files Browse the repository at this point in the history
  • Loading branch information
danthony06 committed May 9, 2024
2 parents 6d7636b + c3331a7 commit 5aca743
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions gpsd_client/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ namespace gpsd_client
}
#if GPSD_API_MAJOR_VERSION >= 10
#ifdef STATUS_FIX
if ((p->fix.status != STATUS_NO_FIX) && !(check_fix_by_variance_ && std::isnan(p->fix.epx)))
if (((p->fix.mode == MODE_2D) || (p->fix.mode == MODE_3D)) && !(check_fix_by_variance_ && std::isnan(p->fix.epx)))
#else
if ((p->fix.status != STATUS_NO_FIX) && !(check_fix_by_variance_ && std::isnan(p->fix.epx)))
if (((p->fix.mode == MODE_2D) || (p->fix.mode == MODE_3D)) && !(check_fix_by_variance_ && std::isnan(p->fix.epx)))
#endif
#else
if ((p->status != STATUS_NO_FIX) && !(check_fix_by_variance_ && std::isnan(p->fix.epx)))
if (((p->fix.mode == MODE_2D) || (p->fix.mode == MODE_3D)) && !(check_fix_by_variance_ && std::isnan(p->fix.epx)))
#endif
{
status.status = 0; // FIXME: gpsmm puts its constants in the global
Expand All @@ -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 5aca743

Please sign in to comment.