Failed to Load Controller

Hi,
I am trying out “add ros_control to ur5 manipulator robot” quiz and I have successfully completed the first part of the quiz where I used the

controllers of the type:
position_controllers/JointPositionController.

In the 2nd part of the quiz I made my new package called project_controller, and followed all the steps that were covered in the earlier chapters and finally did a catkin_make with 0 errors.

Using rospack plugins gives me the following output:

rospack plugins --attrib=plugin controller_interface | grep project_controller
project_controller /home/user/catkin_ws/src/project_controller/controller_plugins.xml

But when I try to use this controller with the ur5 it fails to load it, I tested the same controller by changing the .yaml and launch files and they work perfectly fine with the rrbot.

my_controller.yaml (I tried it out with only one joint)

 ur5:
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50  

  shoulder_lift_joint_position_controller:
    type: project_controller/PositionController
    joint: shoulder_lift_joint
    pid: {p: 100.0, i: 0.01, d: 10.0}

my launch file: (for only one joint)

<launch>

  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam file="$(find project_controller)/config/my_controller.yaml" command="load"/>

  <!-- load the controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
	output="screen" ns="/ur5" args="joint_state_controller shoulder_lift_joint_position_controller"/>
	      
 <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen">
    <remap from="/joint_states" to="/ur5/joint_states" />
  </node>

</launch> 

Any help or suggestions on how to solve this would be highly appreciated.
TIA

Hello @textzip,

Do you get any error messages?

Hi @albertoezquerro , When I try to run the final launch file, the joint with the custom controller fails, other than that I did not encounter any errors.

output for `roslaunch proejct_controller quiz_control_custom.launch`
roslaunch project_controller quiz_control_custom.launch... logging to /home/user/.ros/log/a072b0de-4e68-11eb-b871-0242ac190007/roslaunch-13_xterm-1280.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://13_xterm:46153/

SUMMARY
========

PARAMETERS
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /ur5/elbow_joint_position_controller/joint: elbow_joint
 * /ur5/elbow_joint_position_controller/pid/d: 10.0
 * /ur5/elbow_joint_position_controller/pid/i: 0.01
 * /ur5/elbow_joint_position_controller/pid/p: 100.0
 * /ur5/elbow_joint_position_controller/type: position_controll...
 * /ur5/joint_state_controller/publish_rate: 50
 * /ur5/joint_state_controller/type: joint_state_contr...
 * /ur5/shoulder_lift_joint_position_controller/joint: shoulder_lift_joint
 * /ur5/shoulder_lift_joint_position_controller/pid/d: 10.0
 * /ur5/shoulder_lift_joint_position_controller/pid/i: 0.01
 * /ur5/shoulder_lift_joint_position_controller/pid/p: 100.0
 * /ur5/shoulder_lift_joint_position_controller/type: project_controlle...
 * /ur5/shoulder_pan_joint_position_controller/joint: shoulder_pan_joint
 * /ur5/shoulder_pan_joint_position_controller/pid/d: 10.0
 * /ur5/shoulder_pan_joint_position_controller/pid/i: 0.01
 * /ur5/shoulder_pan_joint_position_controller/pid/p: 100.0
 * /ur5/shoulder_pan_joint_position_controller/type: position_controll...
 * /ur5/wrist_1_joint_position_controller/joint: wrist_1_joint
 * /ur5/wrist_1_joint_position_controller/pid/d: 10.0
 * /ur5/wrist_1_joint_position_controller/pid/i: 0.01
 * /ur5/wrist_1_joint_position_controller/pid/p: 100.0
 * /ur5/wrist_1_joint_position_controller/type: position_controll...
 * /ur5/wrist_2_joint_position_controller/joint: wrist_2_joint
 * /ur5/wrist_2_joint_position_controller/pid/d: 10.0
 * /ur5/wrist_2_joint_position_controller/pid/i: 0.01
 * /ur5/wrist_2_joint_position_controller/pid/p: 100.0
 * /ur5/wrist_2_joint_position_controller/type: position_controll...
 * /ur5/wrist_3_joint_position_controller/joint: wrist_3_joint
 * /ur5/wrist_3_joint_position_controller/pid/d: 10.0
 * /ur5/wrist_3_joint_position_controller/pid/i: 0.01
 * /ur5/wrist_3_joint_position_controller/pid/p: 100.0
 * /ur5/wrist_3_joint_position_controller/type: position_controll...

NODES
  /ur5/
    controller_spawner (controller_manager/spawner)
  /
    robot_state_publisher (robot_state_publisher/robot_state_publisher)

ROS_MASTER_URI=http://13_simulation:11311

process[ur5/controller_spawner-1]: started with pid [1289]
process[robot_state_publisher-2]: started with pid [1290]
[INFO] [1609749735.490732, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
[INFO] [1609749735.497430, 0.000000]: Controller Spawner: Waiting for service controller_manager/switch_controller
[INFO] [1609749735.501107, 0.000000]: Controller Spawner: Waiting for service controller_manager/unload_controller
[INFO] [1609749735.505093, 0.000000]: Loading controller: joint_state_controller
[INFO] [1609749735.530526, 45.253000]: Loading controller: shoulder_pan_joint_position_controller
[INFO] [1609749735.574081, 45.296000]: Loading controller: shoulder_lift_joint_position_controller
[ERROR] [1609749736.580323, 46.302000]: Failed to load shoulder_lift_joint_position_controller
[INFO] [1609749736.581062, 46.303000]: Loading controller: elbow_joint_position_controller
[INFO] [1609749736.603331, 46.325000]: Loading controller: wrist_1_joint_position_controller
[INFO] [1609749736.622679, 46.344000]: Loading controller: wrist_2_joint_position_controller
[INFO] [1609749736.637369, 46.358000]: Loading controller: wrist_3_joint_position_controller
[INFO] [1609749736.654641, 46.376000]: Controller Spawner: Loaded controllers: joint_state_controller, shoulder_pan_joint_position_controller, elbow_joint_position_controller, wrist_1_joint_position_controller, wrist_2_joint_position_controller, wrist_3_joint_position_controller
[INFO] [1609749736.659352, 46.381000]: Started controllers: joint_state_controller, shoulder_pan_joint_position_controller, elbow_joint_position_controller, wrist_1_joint_position_controller, wrist_2_joint_position_controller, wrist_3_joint_position_controller

TIA

Hello @textzip,

Can you please send me the package you are using to aezquerro@theconstructsim.com? I’ll test it manually.

Best,

1 Like

same problem here. I will send you the package, please