Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix user UTM conversion and catch GeographicErr to not crash navsat_transfrom node #917

Open
wants to merge 2 commits into
base: jazzy-devel
Choose a base branch
from

Conversation

MCFurry
Copy link

@MCFurry MCFurry commented Feb 27, 2025

The service setUTM was introduced in ROS1 at first:
#627
And later also ported to ROS2:
#856

However, a small error was left here where the gpsFixCallback() does a forward conversion without specifying the utm-zone. So GeographicLib does the conversion based on lat/lon only.
In case the lat/lon in the gpsfix message are in a neighbouring zone, utm-coordinates for that other zone are calculated and when mapToLL() converts back with the saved utm_zone_, also incorrect lat/lon values are produced.

You can spot the difference here, where in the original introduction utm_zone_ was used:
https://github.com/cra-ros-pkg/robot_localization/pull/627/files#diff-e2f5adb2665b53274a429c05d5f267ae428aee0cb9e5fdb058f46cb3993a9617R636
But in the ROS2 port it dropped out:
https://github.com/cra-ros-pkg/robot_localization/pull/856/files#diff-e2f5adb2665b53274a429c05d5f267ae428aee0cb9e5fdb058f46cb3993a9617R668

Moreover, callers to mapToLL() are now also protected from crashing the node in case of an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants