utiasSTARS / pykitti

Python tools for working with KITTI data.
MIT License
1.15k stars 239 forks source link

pose_from_oxts_packet method #24

Closed ClementPinard closed 6 years ago

ClementPinard commented 6 years ago

Hello, thanks for your implementation !

I have been looking at your code to get a pose vector from gps coordinates here : https://github.com/utiasSTARS/pykitti/blob/master/pykitti/utils.py#L63

At first the mercator projection made sense, but I wonder how off it can become compared to real XYZ data, i.e Earth Centered, Earth Fixed (ECEF) x-y-z values

I'd say that if you are not outrageously close to a pole it should not be a problem, especially because RTK data is at best 1cm precise.

So converting GPS to ECEF and then back to a rotated centered system is clearly overkill.

What I don't understand then is why having some complicated function as the one used in mercator projection ? if we compute the derivative of function used for ty , we get ... 1/cos(lat) which evens out the scale used in the first place. So the taylor expansion is the same as when we simply use ty = er * (lat - lat_0) (lat_0 is the latitude of first frame)

In addition, just using ty = er * (lat - lat_0) might seem more closely related to actual position because the error induced is the same when we got north or south, which is not the case for mercator which will expand lengths when going north and compress them for south.

The main point still remains that in German roads for KITTI we don't have north pole problems so why not use a simpler function for ty?

leeclemnet commented 6 years ago

That would be a question for the KITTI authors, as I don't know their exact reasoning behind using the Mercator projection instead of something else. The only reason pykitti does it this way is to be consistent with the MATLAB devkit at http://www.cvlibs.net/datasets/kitti/raw_data.php.