controller type 'position_controllers/JointTrajectoryController' does not exist.
I try to follow a tutorial in the "Programming Robots with ROS" book. In this tutorial I want to show and move my own robot model in Gazebo. The URDF description loads correctly in Gazebo, the model is shown. Then I extended the URDF by dynamics and ros_control. When I launch the configuration, there are errors from gazebo_ros_control, that my controller could not be loaded.
controller type 'position_controllers/JointTrajectoryController' does not exist.
In the Doc of JointTrajectoryController http://wiki.ros.org/joint_trajectory_... in the minimal description, position interface is written, that type: "position_controllers/JointTrajectoryController"
should be used. In my case this leads to the above error.
My controller definition:
arm_controller:
type: "position_controllers/JointTrajectoryController"
joints:
- hip
- shoulder
- elbow
- wrist
rosservice call controller_manager/list_controller_types
types:
- diff_drive_controller/DiffDriveController
- joint_state_controller/JointStateController
- position_controllers/JointGroupPositionController
- position_controllers/JointPositionController
base_classes:
- controller_interface::ControllerBase
- controller_interface::ControllerBase
- controller_interface::ControllerBase
- controller_interface::ControllerBase
There it shows position_controllers only with JointPositionController. In this case my arm_controller is not found.
<launch>
<include file="$(find gazebo_ros)/launch/empty_world.launch"/>
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -model my robot"/>
<rosparam file="$(find myrobot)/controllers.yaml" command="load"/>
<node name="controller_spawner" pkg="controller_manager" type="spawner" args="arm_controller" output="scre en"/>
</launch>
My Environment:
- Ubuntu focal
- ROS - noetic
Which is the correct way to follow, to bring my robot to life?
rostopic list
should show my arm_controller. But it is not loaded.
Think I got it to work. I changed JointTrajectoryController to JointGroupPositionController. /arm_controller is now loaded and a topic /arm_controller/command is visible. Now I must see, how I can get functionality of the JointTrajectoryController.