Controller#

Local planning and control is essential for any mobile robot in real-world applications to deal with unexpected situations while tracking the global trajectory.

Controller is used for path tracking and control around dynamic obstacles during navigation.

Available Run Types#

Set from ControllerConfig class or directly from Controller ‘run_type’ property.

Timed

Compute a new control command periodically if all inputs are available

ActionServer

Offers a ControlPath ROS action and continuously computes a new control once an action request is received until goal point is reached

Inputs:#

Key Name

Allowed Types

Number

Default

plan

nav_msgs.msg.Path

1

Topic(name="/plan", msg_type="Path")

location

nav_msgs.msg.Odometry, geometry_msgs.msg.PoseStamped, geometry_msgs.msg.Pose

1

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

sensor_data

sensor_msgs.msg.LaserScan, sensor_msgs.msg.PointCloud2

1

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

local_map

nav_msgs.msg.OccupancyGrid

1

Topic(name="/local_map/occupancy_layer", msg_type="OccupancyGrid")

vision_tracking

automatika_embodied_agents.msg.Trackings, automatika_embodied_agents.msg.Detections2D

1

None, Should be provided to use the vision target tracking

Tip

Provide a ‘vision_tracking’ input topic to the controller to activate the creation of the a vision-based target following action server. See this example for more details.

Outputs:#

Key Name

Allowed Types

Number

Default

command

geometry_msgs.msg.Twist

1

Topic(name="/control", msg_type="Twist")

multi_command

kompass_interfaces.msg.TwistArray

1

Topic(name="/control_list", msg_type="TwistArray")

interpolation

nav_msgs.msg.Path

1

Topic(name="/interpolated_path", msg_type="Path")

local_plan

nav_msgs.msg.Path

1

Topic(name="/local_path", msg_type="Path")

tracked_point

nav_msgs.msg.Odometry, geometry_msgs.msg.PoseStamped, geometry_msgs.msg.Poseautomatika_embodied_agents.msg.Detection2D

1

Topic(name="/tracked_point", msg_type="PoseStamped")

Available Algorithms:#

  • Stanley (pure follower)

  • DVZ (Deformable Virtual Zone)

  • DWA (Dynamic Window Approach)

  • VisionFollower (Vision target following controller)

Configuration Parameters:#

See ControllerConfig

Usage Example:#

    from kompass.components import ControllerConfig, Controller
    from kompass.topic import Topic

    # Setup custom configuration
    my_config = ControllerConfig(loop_rate=10.0)

    # Init a controller object
    my_controller = Controller(component_name="controller", config=my_config)

    # Change an input
    my_controller.inputs(plan=Topic(name='/global_path', msg_type='Path'))

    # Change run type (default "Timed")
    my_controller.run_type = "ActionServer"

    # Change plugin
    my_controller.plugin = 'DWA'