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 |
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 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 |
|
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'