Ask Your Question
0

joint_state_controller loaded but failed to start

asked 2020-03-02 06:12:14 -0500

John999991 gravatar image

Dear all, i am having a situation where I have managed to load the joint_state_controller as well as the velocity controllers for the 4 joints of my robot, but, while spawning them i get:

[INFO] [1583148364.122978, 0.000000]: Loading controller: joint_state_controller
[INFO] [1583148364.137343, 27.471000]: Loading controller: FRJ_velocity_controller
[INFO] [1583148364.224540, 27.544000]: Loading controller: FLJ_velocity_controller
[INFO] [1583148364.282939, 27.590000]: Loading controller: BLJ_velocity_controller
[INFO] [1583148364.347087, 27.639000]: Loading controller: BRJ_velocity_controller
[INFO] [1583148364.423555, 27.701000]: Controller Spawner: Loaded controllers: joint_state_controller, FRJ_velocity_controller, FLJ_velocity_controller, BLJ_velocity_controller, BRJ_velocity_controller
[ERROR] [1583148364.426532, 27.703000]: Failed to start controllers: joint_state_controller, FRJ_velocity_controller, FLJ_velocity_controller, BLJ_velocity_controller, BRJ_velocity_controller

Please note that if I replace velocity with position controllers, I am able to load joint_state_controller as well as postion controllers for my 4 joints.

My robot_control launch is:

<launch>

   <param name="robot_description" textfile="$(find robot)/urdf/robot.urdf" />
   <arg name="gui" default="False" />
   <param name="use_gui" value="$(arg gui)"/>
   <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" ></node>
   <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />


<!-- Show in Rviz-->
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find robot)/urdf.rviz"/>


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

  <!-- convert joint states to TF transforms for rviz, etc -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen" ns="/robot">
    <remap from="/joint_states" to="/robot/joint_states" />
  </node>

<!-- load the controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/robot" args="joint_state_controller FRJ_velocity_controller FLJ_velocity_controller BLJ_velocity_controller BRJ_velocity_controller"/>

</launch>

My robot_control.yaml is:

robot:  
  # Publish all joint states -----------------------------------
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 20  

  # # Position Controllers ---------------------------------------
  # FLJ_position_controller:
  #   type: effort_controllers/JointPositionController
  #   joint: FLJ
  #   pid: {p: 1.0, i: 1.0, d: 0.0}
  # FRJ_position_controller:
  #   type: effort_controllers/JointPositionController
  #   joint: FRJ
  #   pid: {p: 1.0, i: 1.0, d: 0.0}

  # BLJ_position_controller:
  #   type: effort_controllers/JointPositionController
  #   joint: BLJ
  #   pid: {p: 1.0, i: 1.0, d: 0.0}

  # BRJ_position_controller:
  #   type: effort_controllers/JointPositionController
  #   joint: BRJ
  #   pid: {p: 1.0, i: 1.0, d: 0.0}


   #Velocity Controllers ---------------------------------------
  FRJ_velocity_controller:
    type: effort_controllers/JointVelocityController
    joint: FRJ
    pid: {p: 1.0, i: 1.0, d: 0.0}

  FLJ_velocity_controller:
    type: effort_controllers/JointVelocityController
    joint: FRJ
    pid: {p: 1.0, i: 1.0, d: 0.0}

  BRJ_velocity_controller:
    type: effort_controllers/JointVelocityController
    joint: BRJ
    pid: {p: 1.0, i: 1.0, d: 0.0}

  BLJ_velocity_controller:
    type: effort_controllers/JointVelocityController
    joint: BLJ
    pid: {p: 1.0, i: 1.0, d: 0.0}

The URDF for the model is:

<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- |    This document was autogenerated by xacro from robot.xacro                    | -->
<!-- |    EDITING THIS FILE BY HAND IS NOT RECOMMENDED                                 | -->
<!-- =================================================================================== -->
<robot name="robot" xmlns:xacro="http://www.ros.org/wiki/xacro">
  <!--This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com) 
     Commit Version: 1.5.1-0-g916b5db  Build Version: 1.5.7152.31018
     For ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-02 18:18:43 -0500

John999991 gravatar image

updated 2020-03-02 18:19:41 -0500

To answer my own question: The problem seed to be in the robot_control.yaml where I should change

type: effort_controllers/JointVelocityController to

type: velocity_controllers/JointVelocityController

edit flag offensive delete link more

Comments

For future questions: what you showed was not the actual error message. That was most likely (quite) some lines earlier.

Without the actual error message, this was impossible to answer.

gvdhoorn gravatar image gvdhoorn  ( 2020-03-03 03:40:45 -0500 )edit

Please let me check. I am almost sure i copy pasted the portion that indicates the problem, but I may have missed something. Thank you for noticing.

John999991 gravatar image John999991  ( 2020-03-03 04:55:27 -0500 )edit

ok Mistery solved. The error message I initially posted, was from the terminal running the robot_control.launch. But, while initilizing the controller, Gazebo terminal through an exception which I didn't see (it was on the other TAB of the command window) which was:

[ WARN] [1583237428.195313318, 8.827000000]: Resource conflict on [FRJ].  Controllers = [FRJ_velocity_controller, FLJ_velocity_controller, ]
[ERROR] [1583237428.195387541, 8.827000000]: Could not switch controllers, due to resource conflict
John999991 gravatar image John999991  ( 2020-03-03 06:13:57 -0500 )edit

The way I figure out the solution was through the help of a website (maybe it was a solution here) that was posting the code to initialize the velocity controllers in .yaml and I noticed that I was initializing wrong type of controllers all this time.

John999991 gravatar image John999991  ( 2020-03-03 06:33:48 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-03-02 06:12:14 -0500

Seen: 228 times

Last updated: Mar 02 '20