YJZLuckyBoy/liorf

GPS odometry not published if NavSatStatus equals 1 or 2

Opened this issue · 1 comments

lio94 commented

Hi, great work in making LIO-SAM work with 6DOF IMU and without depending on the robot_localization modules!

Just thought to make a small remark. I had trouble getting the GPS odometry topic published, and noticed that in line https://github.com/YJZLuckyBoy/liorf/blob/0ecccff3b1c1d96f72a8b02b3330a08d6425e2ba/src/mapOptmization.cpp#LL279C13-L279C19 there is a condition

        if (gpsMsg->status.status != 0)
            return;

This prevented in my case the GPS odometry from being published, since the custom NavSatFix message from my RTK GNSS setup encodes the states STATUS_SBAS_FIX and STATUS_GBAS_FIX to represent whether RTK fix is achieved or not.

Thus, it might be more generalizable to only neglect the GPS if the status is STATUS_NO_FIX:

        if (gpsMsg->status.status == -1)
            return;

You are right. however, considering that the status values of individual gnss devices are not in standard format, this condition needs to be modified according to your own gnss device status.