Controller

Motion control and dynamic obstacle avoidance.

The Controller is the real-time “pilot” of your robot. While the Planner looks ahead to find a global route, the Controller deals with the immediate reality — calculating velocity commands to follow the global path (path following) or a global target point (object following) while reacting to dynamic obstacles and adhering to kinematic constraints.

It supports modular Plugins allowing you to switch between different control strategies (e.g., Pure Pursuit vs DWA vs Visual Servoing) via configuration.

Available Run Types

The Controller typically runs at a high frequency (10Hz-50Hz) to ensure smooth motion.

Timed

Periodic Control Loop. Computes a new velocity command periodically if all necessary inputs are available.

Action Server

Goal Tracking. Offers a ControlPath ROS2 Action. Continuously computes control commands until the goal is reached or the action is preempted.

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 a vision-based target following action server. See the Vision Tracking tutorial 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.Pose, automatika_embodied_agents.msg.Detection2D

1

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

Algorithms

EMOS includes several production-ready control plugins suited for different environments:

  • Stanley — Geometric path tracking using the front axle as reference. Best for Ackermann steering.

  • DVZ — Deformable Virtual Zone. Reactive collision avoidance based on risk zones. Extremely fast for crowded dynamic environments.

  • DWA — Dynamic Window Approach. Sample-based collision avoidance with GPU support. Considers kinematics to find optimal velocity.

  • VisionFollower — Vision target following controller. Steers the robot to keep a visual target centered using RGB or depth data.

See the Algorithms Reference for detailed descriptions of each algorithm.

Usage Example

from kompass.components import Controller, ControllerConfig
from kompass.ros 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'