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 |
Inputs¶
Key Name |
Allowed Types |
Number |
Default |
|---|---|---|---|
plan |
1 |
|
|
location |
|
1 |
|
sensor_data |
1 |
|
|
local_map |
1 |
|
|
vision_tracking |
|
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 |
1 |
|
|
multi_command |
1 |
|
|
interpolation |
1 |
|
|
local_plan |
1 |
|
|
tracked_point |
|
1 |
|
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'