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.

Run Types

The Controller typically runs at a high frequency (10Hz-50Hz) to ensure smooth motion. Set the run type directly from Controller ‘run_type’ property.

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.

Interface

Inputs

Key Name

Allowed Types

Number

Default

plan

nav_msgs.msg.Path

1

/plan

location

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

1

/odom (Odometry)

sensor_data

sensor_msgs.msg.LaserScan, sensor_msgs.msg.PointCloud2

1

/scan (LaserScan)

local_map

nav_msgs.msg.OccupancyGrid

1

/local_map/occupancy_layer

vision_detections

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, geometry_msgs.msg.TwistStamped

1

/control (Twist)

multi_command

kompass_interfaces.msg.TwistArray

1

/control_list

interpolation

nav_msgs.msg.Path

1

/interpolated_path

local_plan

nav_msgs.msg.Path

1

/local_path

tracked_point

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

1

/tracked_point (PoseStamped)

Algorithms

Kompass includes several production-ready control plugins suited for different environments.

PurePursuit

Path Tracking Geometric path tracking controller. Calculates the curvature to move the robot from its current position to a look-ahead point on the path.

Pure Pursuit
Stanley

Front-Wheel Feedback Geometric path tracking controller. Uses the front axle as a reference point to minimize cross-track error. Best for Ackermann steering.

Stanley Steering
DWA

Dynamic Window Approach (GPU Support) Sample-based collision avoidance. Considers robot kinematics to find the optimal velocity that progresses towards the goal without hitting obstacles.

DWA
DVZ

Deformable Virtual Zone Reactive collision avoidance based on risk zones. Extremely fast and efficient for crowded dynamic environments.

DVZ
VisionFollowerRGB

Visual Servoing Steers the robot to keep a visual target (bounding box or keypoint) centered in the camera frame.

Vision Follower (RGB)
VisionFollowerRGBD

Depth-Aware Servoing Maintains a specific distance and orientation relative to the target using Depth/Pointcloud data. Perfect for “Follow Me” behaviors.

Vision Follower (RGB-Depth)

Usage Example

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

# 1. Configuration
# Set the loop rate (Control frequency)
my_config = ControllerConfig(loop_rate=20.0)

# 2. Instantiate
# Select the plugin via the component definition or config
my_controller = Controller(component_name="controller", config=my_config)

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

# Change run type to an Action Server (for long-running goals)
my_controller.run_type = "ActionServer"

# Select the Algorithm Plugin
my_controller.algorithm = 'DWA'

See also

Discover the Controller’s detailed configuration options in the ControllerConfig

See Next

The Controller relies on the Drive Manager to translate these velocity commands into actual motor signals for your specific hardware.

Discover the Drive Manager →