kompass.components.mapper#

Module Contents#

Classes#

LocalMapperConfig

LocalMapperConfig parameters

LocalMapper

This component is responsible for generating this local map during the navigation.

API#

class kompass.components.mapper.LocalMapperConfig#

Bases: kompass.config.ComponentConfig

LocalMapperConfig 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.Component

This component is responsible for generating this local map during the navigation.

Note

Current implementation supports LaserScan sensor data to create an Occupancy Grid local map. PointCloud and semantic information will be supported in an upcoming release

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, Pose

1

Topic(name="/odom", msg_type="Odometry")

sensor_data

Direct sensor input

LaserScan

1

Topic(name="/scan", msg_type="LaserScan")

Outputs

Key

Description

Accepted Types

Default Value

local_map

Local occupancy map

OccupancyGrid

Topic(name="/scan", msg_type="LaserScan")

Usage Example:

    from kompass_core.mapping import LocalMapperConfig
    from kompass.components import LocalMapper, 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) 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]]#
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#