Closed 1091205886 closed 1 year ago
Could you please describe the problem you met in detail? The code you provided is also hard to see the difference.
1: the problem is that the odometry is moving forword and the map is getting bigger and bigger, the ikd-tree can not delete the old points, I check the problem is from the funciton lasermap_fov_segment().
2: the key different is that I insert the code below into the function
`std::vector
retain = retain || (dist >= 5);
mov_dist_.push_back(dist);
} if(!retain) return ;`
Thanks for your attention. However, this is not a bug. We design to do so.
In our design, we won't move our map when the odometry does not approach the edge of the local map. This is to achieve a lower frequency of map moving to guarantee high real-time performance. The high memory efficiency of kd-Tree is able to handle a map of over 2km, as described in the paper. For the methodology of our map region management, please check the mapping section in our T-RO paper.
I try to decrease the parameter cube_side_length in launch to 50, and ikdtree.Delete_Point_Boxes(cub_needrm)
always return 0, that means even the local map is small, it cannot delete the old points.
I try to decrease the parameter cube_side_length in launch to 50, and
ikdtree.Delete_Point_Boxes(cub_needrm)
always return 0, that means even the local map is small, it cannot delete the old points.
How do you setup your detection range? Does it meet the requirements in the paper?
the det_range in yaml is set to 100.0
the det_range in yaml is set to 100.0
Please notice that the map size should be at least two times the detection range. Otherwise, it is impossible for the map region to move. Please carefully and thoroughly read our paper before you change the parameters. Please do not imagine the working principle and guess what we have done.
suggest use this code to displace the function lasermap_fov_segment(): `void lasermap_fov_segment() { cub_needrm.clear(); kdtree_delete_counter = 0; kdtree_delete_time = 0.0;
pointBodyToWorld(XAxisPoint_body, XAxisPoint_world); V3D pos_LiD = pos_lid; if (!Localmap_Initialized){ for (int i = 0; i < 3; i++){ LocalMap_Points.vertex_min[i] = pos_LiD(i) - cube_len / 2.0; LocalMap_Points.vertex_max[i] = pos_LiD(i) + cube_len / 2.0; } Localmap_Initialized = true; return; } float dist_to_map_edge[3][2]; bool need_move = false; for (int i = 0; i < 3; i++){ dist_to_map_edge[i][0] = fabs(pos_LiD(i) - LocalMap_Points.vertex_min[i]); dist_to_map_edge[i][1] = fabs(pos_LiD(i) - LocalMap_Points.vertex_max[i]); if (dist_to_map_edge[i][0] <= MOV_THRESHOLD DET_RANGE || dist_to_map_edge[i][1] <= MOV_THRESHOLD DET_RANGE) need_move = true; } if (!need_move) return; BoxPointType New_LocalMap_Points, tmp_boxpoints; New_LocalMap_Points = LocalMap_Points; //float mov_dist = max((cube_len - 2.0 MOV_THRESHOLD DET_RANGE) 0.5 0.9, double(DET_RANGE * (MOV_THRESHOLD -1)));
}`