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

Reinitialize global and storage maps with odometery #187

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

david-yan
Copy link

** 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.
Screenshot from 2023-02-10 14-09-04

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.
Screenshot from 2023-02-10 15-38-32

@XuRobotics XuRobotics changed the title Reinitialize global and storage maps with odometer Reinitialize global and storage maps with odometery 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)
Copy link
Collaborator

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)

Copy link
Collaborator

@XuRobotics XuRobotics left a 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;
Copy link
Collaborator

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");
Copy link
Collaborator

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

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