Reinitialize global and storage maps with odometery#187
Open
david-yan wants to merge 2 commits intoKumarRobotics:masterfrom
Open
Reinitialize global and storage maps with odometery#187david-yan wants to merge 2 commits intoKumarRobotics:masterfrom
david-yan wants to merge 2 commits intoKumarRobotics:masterfrom
Conversation
XuRobotics
reviewed
Feb 12, 2023
| range_x: 25.0 # range of the map in x-axis (high impact on memory and computation usage, recommended value: 40) | ||
| range_y: 25.0 # range of the map in x-axis (high impact on memory and computation usage, recommended value: 40) | ||
| range_x: 50.0 # range of the map in x-axis (high impact on memory and computation usage, recommended value: 40) | ||
| range_y: 50.0 # range of the map in x-axis (high impact on memory and computation usage, recommended value: 40) |
Collaborator
There was a problem hiding this comment.
Please revert to default values (25)
XuRobotics
reviewed
Feb 12, 2023
| // Reset global and storage maps if the robot is far from the map centers | ||
| const auto diff = lidar_position_odom - global_center; | ||
| const auto distance = diff.norm(); | ||
| const auto threshold = std::min(global_map_dim_d_x_, global_map_dim_d_x_) / 40; |
Collaborator
There was a problem hiding this comment.
Dividing by 40 will make the update small. Maybe we should make this threshold a parameter in the mapper YAML file, maybe name it something like map_reinit_distance, and make the default value -1 (which means no reinitialization at all).
| const auto threshold = std::min(global_map_dim_d_x_, global_map_dim_d_x_) / 40; | ||
| ROS_INFO("[Mapper]: distance is %.2lf, threshold is %.2lf", distance, threshold); | ||
| if (distance > threshold) { | ||
| ROS_INFO("[Mapper]: resetting global and storage map"); |
Collaborator
There was a problem hiding this comment.
Please add a TODO here stating that we need to publish a stopping policy state trigger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
** Description **
Re-initializes the global and storage maps after the odometer position is sufficiently far from the center of the global map.
** Tests **

Tested that the maps were re-initialized using logs and the simulation. For some reason after the maps are re-initialized, the ground is filled with yellow patches.
Also attempted to more efficiently re-initialize the maps using

allocate(), however this would result in a lay of blue and purple voxels on the top.