ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Failure to load controllers

asked 2022-02-13 07:08:47 -0500

SHURIMA gravatar image

updated 2022-02-13 13:45:57 -0500

Mike Scheutzow gravatar image

Hello everyone, I have been working on joint rotation for a 4 DOF robotic arm. I have created my own URDF file for this with a launch and config file. However, there seems to be an error which prevents the controllers from being loaded properly. From what I've seen online this seems to be due to an error in the code. However, I have been unable to spot the error and thus need some help in doing so.

ROS_MASTER_URI=http://localhost:11311
process[arm_spawn-1]: started with pid [6392]
process[arm/controller_spawner-2]: started with pid [6393]
process[robot_state_publisher-3]: started with pid [6394]

[ERROR] [1644759931.868350017]: Could not find parameter robot_description on parameter server
[robot_state_publisher-3] process has died [pid 6394, exit code 1, cmd /opt/ros/melodic/lib/robot_state_publisher/robot_state_publisher /joint_states:=/arm/joint_states __name:=robot_state_publisher __log:=/home/gerald/.ros/log/7e2d6af2-8cd1-11ec-a4d5-08002702a3ad/robot_state_publisher-3.log].
log file: /home/gerald/.ros/log/7e2d6af2-8cd1-11ec-a4d5-08002702a3ad/robot_state_publisher-3*.log

Here is my urdf code:

<?xml version='1.0'?>
<robot name='arm' xmlns:xacro='http://www.ros.org/wiki/xacro'>


<!--Dimensions (blink = base link, link = arm link)-->
  <xacro:property name="base_l" value="1"/>
  <xacro:property name="base_b" value="1"/>
  <xacro:property name="base_h" value="0.1"/>

  <xacro:property name="blink_l" value="0.1"/>
  <xacro:property name="blink_b" value="0.1"/>
  <xacro:property name="blink_h" value="0.5"/>

  <xacro:property name="link_l" value="0.5"/>
  <xacro:property name="link_b" value="0.1"/>
  <xacro:property name="link_h" value="0.1"/>

  <xacro:property name="joint_thickness" value="0.1"/>


  <!--Defining link macro-->
  <xacro:macro name="link_properties" params="linknum">
    <link name="arm_link_${linknum}">
      <pose>0 0 0 0 0 0</pose>
      <inertial>
        <mass value="1.1"/>
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <inertia
          ixx = '0.011'
          ixy = '0'
          ixz = '0'
          iyy = '0.0225'
          iyz = '0'
          izz = '0.0135'
          />
      </inertial>

      <visual name='arm_link_${linknum}_visual'>
        <origin rpy="0 0 0" xyz="${link_l/2-joint_thickness*0.5} 0 0"/>
        <geometry>
          <box size="${link_l} ${link_b} ${link_h}"/>
        </geometry>
      </visual>

      <collision name='arm_link_${linknum}_collision'>
        <origin rpy="0 0 0" xyz="${link_l/2} 0 0"/>
        <geometry>
          <box size="${link_l-joint_thickness} ${link_b-joint_thickness} ${link_h}"/>
        </geometry>
      </collision>
    </link>
  </xacro:macro>


  <!--Defining transmission macro-->
  <xacro:macro name="arm_trans" params="trans_linknum">
    <transmission name="arm_trans">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="arm_joint_${trans_linknum}">
        <hardwareInterface>EffortJointInterface</hardwareInterface>
      </joint>
      <actuator name="arm_motor_1">
        <mechanicalReduction>1</mechanicalReduction>
        <hardwareInterface>EffortJointInterface</hardwareInterface>
      </actuator>
    </transmission>
  </xacro:macro>






<!--Code for everything-->
  <link name='arm_base'>
    <pose>0 0 0 0 0 0</pose>
    <inertial>
      <mass value="1001"/>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <inertia
        ixx = '166.11'
        ixy = '0'
        ixz = '0'
        iyy = '166.11'
        iyz = '0'
        izz = '166.01'
        />
    </inertial>

    <visual name='base_visual'>
      <origin rpy="0 0 0" xyz="0 0 ${base_h/2}"/>
      <geometry>
        <box size="${base_l} ${base_b} ${base_h}"/>
      </geometry>
    </visual>

    <collision ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2022-02-13 14:43:09 -0500

tryan gravatar image

updated 2022-02-13 14:45:40 -0500

The problem appears to be in your launch file based on the error: Could not find parameter robot_description on parameter server [robot_state_publisher-3] process has died This indicates that the robot_state_publisher node is looking for a parameter called robot_description but can't find it. Indeed, you have an arm_description parameter that contains your URDF information, while the robot_state_publisher wiki indicates that it expects that information in robot_description.

One solution is to change <param name="arm_description" ... to <param name="robot_description" ..., and the other option is to remap the parameter name in the robot_state_publisher:

<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="false" output="screen">
    <remap from="/joint_states" to="/arm/joint_states" />
    <remap from="robot_description" to="arm_description" />
</node>
edit flag offensive delete link more

Comments

Ok thanks I managed to solve the previous issue but now it returns a new error:

[arm_spawn-1] process has finished cleanly
log file: /home/gerald/.ros/log/7e122f3c-8ed7-11ec-8ab9-08002702a3ad/arm_spawn-1*.log
[WARN] [1644982451.136433, 719.737000]: Controller Spawner couldn't find the expected controller_manager ROS interface.
[arm/controller_spawner-2] process has finished cleanly
log file: /home/gerald/.ros/log/7e122f3c-8ed7-11ec-8ab9-08002702a3ad/arm-controller_spawner-2*.log
SHURIMA gravatar image SHURIMA  ( 2022-02-15 21:55:58 -0500 )edit

Are you running any other launch files?

tryan gravatar image tryan  ( 2022-02-16 19:17:30 -0500 )edit

I managed to fix the error. It was due to multiple syntax errors in different places. However now I have a problem with initializing the controllers... I modified some portions of the code so I started a new question. https://answers.ros.org/question/3963...

SHURIMA gravatar image SHURIMA  ( 2022-02-18 08:28:46 -0500 )edit
0

answered 2022-02-13 13:41:45 -0500

Mike Scheutzow gravatar image

What you have wrong conceptually is that you should have two urdf/xacro files: one for gazebo, and one for ROS. Each file contains different types of information about the robot arm.

The gazebo one contains physics-related properties like inertia and entries which load simulation models of the joints. None of this information is needed when using ROS on an actual physical robot, which is why it tends to be put in a separate file.

The ROS urdf/xacro file contains link and joint geometry information, collision primitives, and visualization info for rviz. This file is typically loaded into the /robot_description property on the parameter server using a node in your launch file. This property name might be prefixed by a namespace depending on how you have things set up.

You are missing the ROS xacro file, and missing the property-setting node in your launch file.

edit flag offensive delete link more

Comments

Helo Mike, I'm not really sure I understand what the additional ROS xacro file should contain. Doesn't the gazebo file already contain link and joint geometry information, collision primitives, and visualization? I'm not planning to use rviz so is the second file even needed?

SHURIMA gravatar image SHURIMA  ( 2022-02-15 21:54:33 -0500 )edit

If you have only one xacro file, you are going to put "gazebo stuff" in /robot_description. I've never seen anyone do that, and I would worry that it could break the ROS nodes that read that parameter.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-02-16 14:23:50 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-02-13 07:08:47 -0500

Seen: 193 times

Last updated: Feb 13 '22