$\color{white}\colorbox{FE9227}{Achieving complete mastery and unlocking endless possibilities!}$
$$▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100%
The controller_manager
provides a robot control mechanism and infrastructure to load, unload, start, and stop controllers. To use it, set configuration parameters in the controller.yaml
file, including an update rate and controller types. Use the controller_manager
spawner
node to load controllers into the simulation environment.
controller_manager
configurationThe controller_manager
provides a robot control mechanism represented by a hardware_interface::RobotHW
instance. The controller_manager
provides the infrastructure to load, unload, start, and stop controllers.
To use the controller_manager
, you have to set some configuration parameters in your controller.yaml
file. These configurations are declared before your joint controllers and will load in the controllers with their set types at a declared update rate. In the example below, we are loading in a joint_state_broadcaster
and a joint_trajectory_controller
.
controller_manager:
ros__parameters:
update_rate: 1000 #Hz
joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster
joint_trajectory_controller:
type: joint_trajectory_controller/JointTrajectoryController
The controller_manager
is declared first, and then the ros__parameters
tag is called to configure your controllers. Next, an update_rate
is declared to set how frequently you want the controller_manager
to be published.
Next, we declare the joint_state_broadcaster
to be of type joint_state_broadcaster/JointStateBroadcaster
.
After, we declare the joint_trajectory_controller
to be of type joint_trajectory_controller/JointTrajectoryController
.
These controllers will be further configured below, but these are the tags needed to load these controllers into your simulation environment.
After your controllers are set in your controllers.yaml
config, you can load your controllers into your simulation environment using the controller_manager
spawner
node.
joint_state_broadcaster = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broadcaster",
"--controller-manager", "/controller_manager"],
)
This file calls on the spawner
executable, and then passes the arguments through to set the controller name, then the --controller-manager
tag declares what the name of the controller_manager
node is.
<aside>
⚠️ This is where you would add the namespace of your robot if your robot namespace was set in your controllers.yaml
.
</aside>
<aside> 🎉 Congratulations on completing the Controller Manager course on Indro Robotics! Your knowledge and proficiency in implementing the Controller Manager package will greatly enhance your ability to manage and orchestrate controllers for robot systems, enabling precise control and coordination of robot movements. Keep up the excellent work, and may your mastery of the Controller Manager contribute to the success of your future robotic control endeavors!
</aside>