Local Mapper¶
Real-time, ego-centric occupancy grid generation.
While the global map provides a static long-term view, the Local Mapper builds a dynamic, short-term map of the robot’s immediate surroundings based on real-time sensor data.
It captures moving obstacles (people, other robots) and temporary changes, serving as the primary input for the Controller to enable fast reactive navigation.
Core Algorithm¶
At its core, LocalMapper uses the Bresenham line drawing algorithm in C++ to efficiently update an occupancy grid from incoming LaserScan data. This approach ensures fast and accurate raycasting to determine free and occupied cells in the local grid.
To maximize performance and adaptability, the implementation supports both CPU and GPU execution:
SYCL GPU Acceleration - GPU acceleration is implemented using SYCL, making it vendor-agnostic—compatible with Nvidia, AMD, Intel, and any other GPGPU-capable devices.
Multi-Threaded CPU - , If no GPU is available, it automatically falls back to a highly optimized multi-threaded CPU implementation capable of handling dense scan rates or high-frequency updates.
Supported Data
Currently supports LaserScan and PointCloud2 data to create 2D Occupancy Grids. Support for 3D local maps and semantic layers is planned for an upcoming releases.
Interface¶
Inputs¶
Key Name |
Allowed Types |
Number |
Default |
|---|---|---|---|
sensor_data |
|
1 |
|
location |
|
1 |
|
Outputs¶
Key Name |
Allowed Types |
Number |
Default |
|---|---|---|---|
local_map |
|
1 |
|
Usage Example¶
from kompass_core.mapping import LocalMapperConfig, MapperConfig
from kompass.components import LocalMapper
# 1. Define Map Dimensions
# Create a 5m x 5m rolling window around the robot with 20cm resolution
map_params = MapperConfig(
width=5.0,
height=5.0,
resolution=0.2
)
# 2. Configure Component
my_config = LocalMapperConfig(
loop_rate=10.0, # Update at 10Hz
map_params=map_params
)
# 3. Instantiate
my_mapper = LocalMapper(component_name="mapper", config=my_config)
See Next¶
The Local Mapper feeds directly into the Controller for obstacle avoidance, while the Map Server provides the global context.
Real-Time Control Learn how to use the generated local map for dynamic obstacle avoidance.
Global Context Learn how to manage and serve the static global map.