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 |
Interface¶
Inputs¶
Key Name |
Allowed Types |
Number |
Default |
|---|---|---|---|
plan |
1 |
|
|
location |
|
1 |
|
sensor_data |
1 |
|
|
local_map |
1 |
|
|
vision_detections |
|
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 |
1 |
|
|
multi_command |
1 |
|
|
interpolation |
1 |
|
|
local_plan |
1 |
|
|
tracked_point |
|
1 |
|
Algorithms¶
Kompass includes several production-ready control plugins suited for different environments.
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.
Front-Wheel Feedback Geometric path tracking controller. Uses the front axle as a reference point to minimize cross-track error. Best for Ackermann steering.
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.
Deformable Virtual Zone Reactive collision avoidance based on risk zones. Extremely fast and efficient for crowded dynamic environments.
Visual Servoing Steers the robot to keep a visual target (bounding box or keypoint) centered in the camera frame.
Depth-Aware Servoing Maintains a specific distance and orientation relative to the target using Depth/Pointcloud data. Perfect for “Follow Me” behaviors.
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.