Skip to content

Add ObstacleLayer to Represent Unmapped and Dynamic Obstacles in the Layered Costmap#85

Merged
JustusBraun merged 3 commits into
naturerobots:feature/dynamic-cost-updatesfrom
JustusBraun:feature/dynamic-cost-updates
Aug 17, 2025
Merged

Add ObstacleLayer to Represent Unmapped and Dynamic Obstacles in the Layered Costmap#85
JustusBraun merged 3 commits into
naturerobots:feature/dynamic-cost-updatesfrom
JustusBraun:feature/dynamic-cost-updates

Conversation

@JustusBraun

Copy link
Copy Markdown
Collaborator

This layer maps obstacles represented by PointCloud2 messages onto the mesh surface using raycasting. The vertices of the obstructed faces are added to the lethal vertex set and their cost is set to infinity. This enables replanning around dynamic and unmapped obstacles and dynamic obstacle avoidance (support depends on the controller plugin).

The layer uses lvr2's raycasting interfaces to cast rays. We use the embree backend if available, otherwise we fall back to the lvr2::BVHRaycaster implementation. I currently recommend to install embree4 before compiling the lvr2 project to enable the embree backend as it is much better optimized.

I have also added a method to the MeshMap to allow layers to access the shared tf buffer.

This layer maps obstacles represented by PointCloud2 messages onto the
mesh surface using raycasting. The vertices of the obstructed faces are
added to the lethal vertex set and their cost is set to infinity. This
enables replanning around dynamic and unmapped obstacles and dynamic
obstacle avoidance (support depends on the controller plugin).
@JustusBraun

Copy link
Copy Markdown
Collaborator Author

I moved the raycasting interface to the MeshMap so it can be shared across all plugins that access the MeshMap. I also changed the obstacle layer to use the robot's down axis in its local frame as the projection direction. The axis and the axis' reference frame are configurable via ROS parameters. They default to [0.0, 0.0, -1.0] in the frame given by the robot_frame parameter of the navigation stack.

@amock amock self-assigned this Aug 17, 2025
@JustusBraun
JustusBraun merged commit ee913e6 into naturerobots:feature/dynamic-cost-updates Aug 17, 2025
2 checks passed
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