kompass.components.mapper#
Module Contents#
Classes#
LocalMapperConfig parameters |
|
This component is responsible for generating this local map during the navigation. |
API#
- class kompass.components.mapper.LocalMapperConfig#
Bases:
kompass.config.ComponentConfigLocalMapperConfig parameters
- class kompass.components.mapper.LocalMapper(*, component_name: str, config_file: Optional[str] = None, config: Optional[kompass.components.mapper.LocalMapperConfig] = None, inputs: Optional[Dict[str, kompass.components.ros.Topic]] = None, outputs: Optional[Dict[str, kompass.components.ros.Topic]] = None, **kwargs)#
Bases:
kompass.components.component.ComponentThis component is responsible for generating this local map during the navigation.
Note
Supported sensor input is either ONE LaserScan topic or up to 11 PointCloud2 topics. Multiple point clouds (e.g. front + back 3D lidars) are fused into a single occupancy grid: each sensor’s mount transform is applied inside the core and free space is carved from each sensor’s own origin
Available Run Types
Set directly from LocalMapper ‘run_type’ property.
Timed
Produces a local map periodically if all inputs are available
Inputs
Key
Description
Accepted Types
Number of Topics
Default Value
location
Robot current location
Odometry, PoseWithCovariance, Pose1
Topic(name="/odom", msg_type="Odometry")sensor_data
Direct sensor input
LaserScan, PointCloud21 to 11
Topic(name="/scan", msg_type="LaserScan")Outputs
Key
Description
Accepted Types
Default Value
local_map
Local occupancy map
OccupancyGridTopic(name="/scan", msg_type="LaserScan")Usage Example:
from kompass.components import LocalMapper, LocalMapperConfig from kompass_core.mapping import MapConfig as MapperConfig # Select map parameters map_params = MapperConfig(width=5.0, height=5.0, resolution=0.2) # 5mX5m map with 0.2m/cell resolution # Setup custom component configuration my_config = LocalMapperConfig(loop_rate=10.0, map_params=map_params) # Init a mapper my_mapper = LocalMapper(component_name="mapper", config=my_config)
- init_variables()#
Overwrites the init variables method called at Node init
- publish_data()#
Publish layers and obstacles mapped from LocalMapper
- custom_on_configure()#
- property robot: kompass.config.RobotConfig#
- property robot_geometry_type: kompass_core.models.RobotGeometry.Type#
- property robot_ctrl_limits: kompass_core.models.RobotCtrlLimits#
- 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]#
- transform_inputs_to(topic_key: kompass.components.defaults.TopicsKeys, goal_frame: str, static_tf: bool = False) None#
- input_tf_listener(topic_key: kompass.components.defaults.TopicsKeys, goal_frame: str, static_tf: bool = False, idx: int = 0) Optional[ros_sugar.tf.TFListener]#
- resolve_input_tf(topic_key: kompass.components.defaults.TopicsKeys, goal_frame: Optional[str] = None, idx: int = 0) Tuple[bool, Optional[tf2_ros.TransformStamped]]#
- wait_input_tf(topic_key: kompass.components.defaults.TopicsKeys, idx: int = 0, timeout: Optional[float] = None, static_tf: bool = True) Optional[ros_sugar.tf.TFListener]#
- wait_sensor_config(topic_key: kompass.components.defaults.TopicsKeys, idx: int = 0, timeout: Optional[float] = None) Optional[kompass_cpp.types.SensorConfig]#
- 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#