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

boundIndex的参数和物理含义? #62

Closed
fishZeng opened this issue Jun 1, 2023 · 0 comments
Closed

boundIndex的参数和物理含义? #62

fishZeng opened this issue Jun 1, 2023 · 0 comments

Comments

@fishZeng
Copy link

fishZeng commented Jun 1, 2023

在grid_map.h文件中,定义了地图范围和xyz方向的voxel数量
Eigen::Vector3d map_min_boundary_, map_max_boundary_; // map range in position
Eigen::Vector3i map_voxel_num_; // map range in index
toAddress可以输入一个三维坐标来确定index
inline int GridMap::toAddress(const Eigen::Vector3i& id) {
return id(0) * mp_.map_voxel_num_(1) * mp_.map_voxel_num_(2) + id(1) * mp_.map_voxel_num_(2) + id(2);
}
之后的boundIndex参数应该是各个方向的voxel数量,然后与map_voxel_num_进行比较。但是在isUnknow函数当中传入的是一个三维坐标,并用boundIndex对传入的坐标进行了修改,这一段的逻辑应该如何理解?
inline void GridMap::boundIndex(Eigen::Vector3i& id){
Eigen::Vector3i id1;
id1(0) = max(min(id(0), mp_.map_voxel_num_(0) - 1), 0);
id1(1) = max(min(id(1), mp_.map_voxel_num_(1) - 1), 0);
id1(2) = max(min(id(2), mp_.map_voxel_num_(2) - 1), 0);
id = id1;
}
inline bool GridMap::isUnknown(const Eigen::Vector3i& id) {
Eigen::Vector3i id1 = id;
boundIndex(id1);
return md_.occupancy_buffer_[toAddress(id1)] < mp_.clamp_min_log_ - 1e-3;
}

@fishZeng fishZeng closed this as completed Jun 1, 2023
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

No branches or pull requests

1 participant