-
Notifications
You must be signed in to change notification settings - Fork 119
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
Reinitialize global and storage maps with odometery #187
base: master
Are you sure you want to change the base?
Reinitialize global and storage maps with odometery #187
Conversation
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert to default values (25)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, working properly, several comments need to be addressed
// 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a TODO here stating that we need to publish a stopping policy state trigger
** 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.