kompass.components.map_server¶
Module Contents¶
Classes¶
MapServer component configuration parameters |
|
MapServer component used for reading and converting map data from file to serve a global map. Supports both 2D maps with a YAML file and 3D maps with PCD files. |
API¶
- class kompass.components.map_server.MapServerConfig¶
Bases:
kompass.config.ComponentConfigMapServer component configuration parameters
Name
Type, Default
Description
map_file_read_rate
float,0.0Rate to read and convert the map data from file. If zero, converts once.
pc_publish_row
bool,TruePublish the row point cloud data read from the file. Only applicable if input is
.pcdfile.pc_frame
Optional[str],NoneFrame ID to use when publishing the point cloud data. If
None, uses the world frame.map_file_path
Optional[str],NonePath to the map file.
custom_map_frame
Optional[str],NoneCustom frame ID for the map.
grid_resolution
float,0.05Resolution of the occupancy grid if generating from point cloud.
z_ground_limit
float,0.01Points below this height value are considered ground. Used only for point cloud input.
- class kompass.components.map_server.MapServer(component_name: str, config_file: Optional[str] = None, config: Optional[kompass.components.map_server.MapServerConfig] = None, outputs: Optional[Dict[str, kompass.components.ros.Topic]] = None, **kwargs)¶
Bases:
kompass.components.component.ComponentMapServer component used for reading and converting map data from file to serve a global map. Supports both 2D maps with a YAML file and 3D maps with PCD files.
Outputs:
Key Name
Allowed Types
Number
Default
global_map
1
Topic(name="/map", msg_type="OccupancyGrid")- Global map generated from input data.spatial_sensor
1, optional
Topic(name="/row_point_cloud", msg_type="PointCloud2")- Row point cloud data for visualization or further processing.Available Services:
Save2dMapToFile: Saves the 2D map to a file (YAML format).
Save3dMapToFile: Saves the 3D map to a file (PCD format).
Usage Example:
from kompass.components import MapServerConfig, MapServer from kompass.ros import Topic # Setup custom configuration my_config = MapServerConfig( map_file_read_rate=5.0, map_file_path="/path/to/your/map.pcd", grid_resolution=0.1, pc_publish_row=False, ) # Init a MapServer object my_map_server = MapServer(component_name="map_server", config=my_config)
- init_variables()¶
Overwrites the init variables method called at Node init
- create_all_timers()¶
Create all node timers
- create_all_services()¶
Creates all node services
- destroy_all_timers()¶
Destroys all node timers
- destroy_all_services()¶
Destroys all node services
- convert_map_from_file() bool¶
Convert the map from file to OccupancyGrid message