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
- custom_on_configure()¶
- property robot: kompass.config.RobotConfig¶
- property run_type: kompass.config.ComponentRunType¶
- property inputs_keys: List[kompass.components.defaults.TopicsKeys]¶
- property outputs_keys: List[kompass.components.defaults.TopicsKeys]¶
- inputs(**kwargs)¶
- outputs(**kwargs)¶
- set_input(**kwargs) bool¶
- set_output(**kwargs) bool¶
- config_from_file(config_file: str)¶
- property odom_tf_listener: Optional[ros_sugar.tf.TFListener]¶
- property scan_tf_listener: ros_sugar.tf.TFListener¶
- property depth_tf_listener: ros_sugar.tf.TFListener¶
- property pc_tf_listener: ros_sugar.tf.TFListener¶
- get_transform_listener(**kwargs) ros_sugar.tf.TFListener¶
- in_topic_name(key: Union[str, kompass.components.defaults.TopicsKeys]) Union[str, List[str], None]¶
- out_topic_name(key: Union[str, kompass.components.defaults.TopicsKeys]) Union[str, List[str], None]¶
- get_in_topic(key: Union[str, kompass.components.defaults.TopicsKeys]) Union[kompass.components.ros.Topic, List[kompass.components.ros.Topic], None]¶
- get_out_topic(key: Union[str, kompass.components.defaults.TopicsKeys]) Union[kompass.components.ros.Topic, List[kompass.components.ros.Topic], None]¶
- get_callback(key: Union[str, kompass.components.defaults.TopicsKeys], idx: int = 0) Optional[kompass.callbacks.GenericCallback]¶
- get_publisher(key: Union[str, kompass.components.defaults.TopicsKeys], idx: int = 0) ros_sugar.io.Publisher¶
- callbacks_inputs_check(inputs_to_check: Optional[List[str]] = None, inputs_to_exclude: Optional[List[str]] = None) bool¶