I am currently working on exercise 6.2.1 in ROS2 Control Framework and have made some modifications to the description file (.xacro) and added a configuration file (.yaml). The launch file executes successfully, and the robot appears in the Gazebo simulation window.
However, I am unable to load the controller due to the following error: Could not contact service /controller_manager/load_controller. It seems there might be an issue with the ros2 controller manager service, as it does not appear in the list when I run ros2 service list.
Could this issue be related to the launch file? Should we make additional modifications to it?
Without much context, it would be difficult for us to help you with your issue.
Please post your launch, xacro and configuration files as markdown formatted code blocks so your issue can be solved quicker.
With the error that you posted, I am assuming that you have not started the ROS2 control node properly in your launch file.
Did you implement the Joint State Controller (JSC) properly in your config file? Are you starting the JSC properly in your launch file?
I am following the instructions provided in the notebook. We were asked to modify the description file and configuration file in the package named rrbot_unit5. After making these changes, the next steps are to execute the command ros2 launch spawn_robot spawn_rrbot.launch.py in Terminal 1 and then load the controller using ros2 control load_controller --set-state start forward_position_controller in Terminal 2. The launch file is located in a different package, spawn_robot, and there are no instructions indicating that we need to modify the launch file so I would assume no further work is required for the launch file?
I think you need to launch rrbot_controller_manager.launch.py before executing the ros2 control load_controller --set-state start forward_position_controller command.
So you will first launch the simulation (if not launched already). Then spawn the robot. Then start the controller manager launch file. Finally you will execute the load controller command.
Please try the above steps and let me know if that worked for you.