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 #419 by calculating transformed x/y in image-based maps #421

Merged
merged 3 commits into from
Feb 10, 2022

Conversation

codebot
Copy link
Contributor

@codebot codebot commented Feb 8, 2022

In image-based maps (which almost everyone is currently using), there was some ambiguity about what the x(m) and y(m) properties panel meant when a vertex was selected. Due to long-ago historical reasons, it was simply dividing the pixel coordinate by the calculated scale of the floorplan image. This works fine for single-level worlds, but it caused problems in multi-level worlds, because the x(m) and y(m) coordinates were in meters relative to the corner of that level's floorplan image. Typically, multi-floor maps require some translation (guided by fiducials) to align the floorplan images, and this translation was not incorporated into the vertex properties panel.

This PR fixes this, so that the x(m) and y(m) coordinates are now in the metric frame of the reference level. This should coincide with what appears in the generated navigation graph and simulation model.

For reasons I haven't fully chased down at the moment, they seem to be a few centimeters difference in some of the large test maps I've tried. I need to more closely compare the C++ implementation of level-alignment (as used in the Traffic Editor GUI) and the Python implementation that is used during navigation-graph and simulation-model generation. But this fix as-is should be close enough to unblock some current work.

It should also be noted that the gradual migration to global coordinates (latitude/longitude) in traffic-editor maps will eliminate problems like this 😄

Signed-off-by: Morgan Quigley [email protected]

@codebot codebot self-assigned this Feb 8, 2022
@codebot
Copy link
Contributor Author

codebot commented Feb 8, 2022

This PR should fix #419 and #391

Signed-off-by: Morgan Quigley <[email protected]>
@codebot
Copy link
Contributor Author

codebot commented Feb 8, 2022

Tested and fixes the issue in this multi-level world. Also tested against the maps in rmf_demos_maps and it seems to work as expected: no changes to behavior in the single-level worlds, and seems to behave reasonably in the multi-world demo maps.

@codebot codebot requested a review from Yadunund February 8, 2022 07:03
Yadunund
Yadunund previously approved these changes Feb 8, 2022
Copy link
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

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

The changes look good! Just had a comment for my curiosity.

rmf_traffic_editor/gui/editor.cpp Outdated Show resolved Hide resolved
Copy link
Member

@Yadunund Yadunund left a comment

Choose a reason for hiding this comment

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

Thanks for addressing that!

@Yadunund Yadunund merged commit 0617de4 into main Feb 10, 2022
@Yadunund Yadunund deleted the bug/fully_transform_vertex_point_in_properties_pane branch February 10, 2022 05:52
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