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

Using Grid/MaxObstacleHeight with OctoMap is not working as expected with ray tracing #1350

Open
matlabbe opened this issue Oct 5, 2024 · 0 comments
Labels

Comments

@matlabbe
Copy link
Member

matlabbe commented Oct 5, 2024

Refer to this discussion: introlab/rtabmap_ros#1194 (comment)

The issue is that points over the obstacle threshold won't be used for ray tracing, so some dynamic obstacles even smaller than max obstacle height may still remain in the OctoMap after it is gone. We should handle Grid/MinGroundHeight and Grid/MaxObstacleHeight differently if both Grid/3D and Grid/RayTracing are enabled. We should not filter the cloud like this:

// filter ground/obstacles zone
if(minGroundHeight_ != 0.0f || maxObstacleHeight_ != 0.0f)
{
indices = util3d::passThrough(cloud, indices, "z",
minGroundHeight_!=0.0f?minGroundHeight_:std::numeric_limits<int>::min(),
maxObstacleHeight_>0.0f?maxObstacleHeight_:std::numeric_limits<int>::max());
UDEBUG("indices after max obstacles height filtering = %d", (int)indices->size());

Instead, forward Grid/MinGroundHeight and Grid/MaxObstacleHeight to OctoMap and treat them like Grid/RangeMax parameter, so that ray tracing can clear obstacles for which the background is seen outside the obstacle volume.
if(rangeMaxSqrd > 0.0f)
{
octomap::point3d v(pt.x - cellSize - sensorOrigin.x(), pt.y - cellSize - sensorOrigin.y(), pt.z - cellSize - sensorOrigin.z());
if(v.norm_sq() > rangeMaxSqrd)
{
// compute new point to max range
v.normalize();
v*=rangeMax_;
point = sensorOrigin + v;
ignoreOccupiedCell=true;
}
}

@matlabbe matlabbe changed the title Using Grid/MaxObstacleHeight with OctoMap not working as expected with ray tracing Using Grid/MaxObstacleHeight with OctoMap is not working as expected with ray tracing Oct 5, 2024
@matlabbe matlabbe added the bug label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant