Closed tothgl closed 1 year ago
Good catch, this is probably something @kriskozak will want to know about.
FYI, I forked the repo and checked in the code changes and test cases I made on the "PR644" branch. I can create a pull request if desired.
We're always happy for pull requests.
I made my changes to version 2.14.2 which was the version released with kinetic and noetic. It looks like master and 2.15.0 have a lot of changes (none to the two files I changed) and I haven't been able to get either of them to compile yet. Are they targeted for ROS2? Should my pull request be against 2.14.2 or master (or something else)?
Right now, we're releasing ROS1 based on the master branch, and ROS2 based on the ros2-devel branch. Sorry for the confusion about the releases, but so far we've been trying to release both versions out of one repo.
If you can apply the fix to whichever branch you feel most comfortable with, we can port it over to the other branch.
Good catch, this is probably something @kriskozak will want to know about.
Thanks for the heads up. The issue at 180 degrees is not a surprise, and I don't recall exactly, but it may have been known of previously and ignored because there aren't many practical applications that would trigger the issue. Given that there is a simple fix, though, it makes sense to just fix it.
Out of curiosity @tothgl, what led you to discover this issue, and does it involve a boat :-)?
While we're at it, I'll note that there will also be issues with this Cartesian mapping near the poles, but I don't think there is a similarly simple fix for that.
Okay, this is now fixed in the ROS1 branch, and we just need to bring it into the ros2-devel
branch. Thank you for the good PR addressing this.
@kriskosak No, I'm afraid there was no boat involved nor did I get to go to Fiji :-) I was just writing test cases for a gps driver using the worst cases I could think of. I thought about the pole issue and didn't have any ideas for that either. I wanted to let the issue go, but it kept nagging at me...
It is now fixed in ROS 2 as well.
If the local xy origin and the current location are on opposite sides of the longitude 180/-180 line, the function LocalXyWgs84Util::ToLocalXY() calculates the position difference the long way around the globe instead of the short distance across the 180 degree boundary.