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

Stick to the global utm_zone_ when transforming gps to UTM #627

Merged
merged 4 commits into from
Apr 12, 2021

Conversation

Timple
Copy link
Contributor

@Timple Timple commented Feb 23, 2021

Fixes #222 partly.

It doesn't handle multiple UTM zones but at least sticks to the initial one. Preventing the jump in position.

For the actual multiple UTM solution #309 would need to be solved.

@Timple Timple force-pushed the support-multiple-utm-zones branch from 33519ed to 35980a0 Compare February 25, 2021 08:03
NavsatConversions::LLtoUTM(latitude, longitude, cartesian_y, cartesian_x, utm_zone_tmp);
int zone_tmp;
bool nortp_tmp;
GeographicLib::UTMUPS::Forward(latitude, longitude, zone_tmp, nortp_tmp, cartesian_x, cartesian_y, utm_zone_);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we keep using LLtoUTM here? Doesn't your other PR just wrap to the GeographicLib call anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the confusion.

I started on the other PR. But since that makes the whole conversion functions almost empty, one might as well use the functions directly, removing all custom functions. Actually I would want to remove the whole conversions file in this PR. But I don't know who might be using it.

The reason that this is also needed is because the library uses a boolean northp instead of string parsing the utm_zone_ variable. It's much easier to track the boolean than to keep the information in a string and encode/decode that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, sounds good. As I said in the other PR, we'll remove that file for ROS2 Galactic onward.

src/navsat_transform.cpp Show resolved Hide resolved
@Timple
Copy link
Contributor Author

Timple commented Mar 22, 2021

Clarifying note:

As the diff shows, instead of std::string utm_zone_ there are now two variables int utm_zone_ and bool northp_. This is inline with the definition in the geographiclib.

These two variables where first 'combined' in a string and had to be encoded/decoded

@ayrton04
Copy link
Collaborator

@Timple, would you mind rebasing and fixing the conflict? Thanks.

@Timple Timple force-pushed the support-multiple-utm-zones branch from 40b359a to dc7146b Compare April 12, 2021 09:14
@Timple
Copy link
Contributor Author

Timple commented Apr 12, 2021

Done

@ayrton04
Copy link
Collaborator

Thank you for the tests. It makes me feel better about not having a live robot with a GPS for testing. :-/

@ayrton04 ayrton04 merged commit ec31ae8 into cra-ros-pkg:noetic-devel Apr 12, 2021
@Timple
Copy link
Contributor Author

Timple commented Apr 12, 2021

I actually created the test first, because that was initially less work than dragging the live robot outside :)

@Timple
Copy link
Contributor Author

Timple commented May 28, 2021

Would it be possible to get a melodic and noetic release with this fix/feature?

@ayrton04
Copy link
Collaborator

ayrton04 commented Jun 3, 2021

Yes, will bloom this today.

@ayrton04
Copy link
Collaborator

ayrton04 commented Jun 3, 2021

@Timple, do you need this to go into melodic as well?

@Timple
Copy link
Contributor Author

Timple commented Jun 3, 2021

Yes please, we're migrating to Noetic, but the actual machine is still on melodic.

@ayrton04
Copy link
Collaborator

ayrton04 commented Jun 3, 2021

OK, will cherry-pick this change.

@ayrton04
Copy link
Collaborator

ayrton04 commented Jun 3, 2021

Does that mean you also want this in melodic?

5eec32b

@Timple
Copy link
Contributor Author

Timple commented Jun 3, 2021

Yes to both. Simulator is already on Noetic while actual machine is Melodic.

edit: I now realize melodic has it's own branch without this patch. If this is too much hassle we can simply build from source until the migration is finished. One more reason to push for Noetic 🙂

@ayrton04
Copy link
Collaborator

ayrton04 commented Jun 3, 2021

OK. I'll just go back through the recent noetic commits and find anything that should be backported. Thanks.

ayrton04 pushed a commit that referenced this pull request Jun 3, 2021
* Stick to the global utm_zone_ when transforming gps to UTM
@ayrton04
Copy link
Collaborator

ayrton04 commented Jun 4, 2021

@Timple, if you have some time, would you mind trying out the melodic-devel branch? I cherry-picked the commits I believe we needed. If it works as you'd expect, I'll release it.

@Timple
Copy link
Contributor Author

Timple commented Jun 4, 2021

Yup, seems to work!

@Timple
Copy link
Contributor Author

Timple commented Jul 1, 2021

Should I also port this to the ROS2 branch?

And a subtle ping for the bloom release 🙂

@ayrton04
Copy link
Collaborator

ayrton04 commented Jul 1, 2021

Bloom release was done a few weeks ago. Did they do a sync recently?

EDIT: Melodic, too.

@Timple
Copy link
Contributor Author

Timple commented Jul 1, 2021

Ow, whups. I only looked at the latest entry in https://github.com/cra-ros-pkg/robot_localization/blob/noetic-devel/CHANGELOG.rst

But the last version is not on top it seems...

@ayrton04
Copy link
Collaborator

ayrton04 commented Jul 8, 2021

Odd! I'll correct that in the next one.

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.

Handle crossing of UTM zone boundaries
2 participants