Fixes erronous grid shift ordering: use [dy,dx] for cp.roll axes #120
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.
This is a fix specifically for how cp.roll is being used. (This intentionally excludes my other orientation fix (transpose on publish, polygon x/y., which fixes the rotation of the whole elevation grid.)
Problem: As the robot moves, the entire elevation layer creeps diagonally and stretches features.
Cause: cp.roll(..., axis=(1,2)) expects shifts as [rows(y), cols(x)]. Code used [dx, dy] inside the methods "move" and "move_to".
Fix: Pass [dy, dx] as argument to shift_map_xy instead of [dx, dy].
Evidence: before fix, map shifts diagonally on each update call. Origin of the whole elevation_map_raw becomes gradually shifted and features gets stretched into ridges as a result. After fix, map remains anchored to map frame and features are accurately captured where they are. Origin of elevation_map_raw remains consistent with base_link.
Both pictures are taken at exactly 10.0 seconds of simulation time, without and with fix respectively.
Before:

After:
