fix #419 by calculating transformed x/y in image-based maps #421
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In image-based maps (which almost everyone is currently using), there was some ambiguity about what the
x(m)
andy(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 thex(m)
andy(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)
andy(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]