Map Server

Static global map management and 3D-to-2D projection.

The MapServer is the source of ground-truth for the navigation system. It reads static map files, processes them, and publishes the global OccupancyGrid required by the Planner and Localization components.

Unlike standard ROS2 map servers, the Kompass Map Server supports native 3D Point Cloud (PCD) files, automatically slicing and projecting them into 2D navigable grids based on configurable height limits.

Key Features

The Map Server handles the lifecycle of map data from disk to network.

  • Multi-Format Support - YAML & PCD. Seamlessly reads standard 2D map files (.yaml + image) OR 3D point cloud files (.pcd).

  • Map Persistence - Save Services. Supports saving current 2D or 3D map data to disk via Save2dMapToFile and Save3dMapToFile services.

  • Auto Frame Handling - TF Compatibility. Configurable reference frames ensuring the map aligns correctly with your robot’s specific TF tree.

  • Frequency Control - The MapServer can be configured to control how often map data is read and converted. The rate of map updates can be controlled by the map_file_read_rate parameter, ensuring that map data is refreshed periodically or only when necessary.

See also

Check the full configuration parameters of the MapServer in the MapServerConfig

Interface

Outputs

The Map Server publishes the processed grid and optionally the raw cloud for visualization.

Key Name

Allowed Types

Number

Default

map

nav_msgs.msg.OccupancyGrid

1

/map

sensor_data

sensor_msgs.msg.PointCloud2

1, optional

/row_point_cloud

Usage Example

from kompass.components import MapServer, MapServerConfig

# 1. Configuration
my_config = MapServerConfig(
    # Path to a 3D Point Cloud file
    map_file_path="/path/to/environment.pcd",

    # Process at 5Hz (only needed if map changes or for initial load)
    map_file_read_rate=5.0,

    # Resolution for the generated 2D grid (meters/cell)
    grid_resolution=0.1,

    # Disable raw cloud publishing to save bandwidth
    pc_publish_row=False
)

# 2. Instantiate
my_map_server = MapServer(component_name="map_server", config=my_config)

See Next

Once the map is served, the Planner uses it to calculate global paths.

Configure the Planner →