Error with intializing controllers

asked 2022-02-18 08:07:54 -0600

SHURIMA gravatar image

updated 2022-02-18 08:13:48 -0600

Hello everyone, I'm trying to program a 4 dof robot arm. When I launch the launch file for the robot arm I get this error. I think that it might be due to some syntax/wrong variable but I can't seem to find the error.

Error for world launch file terminal:

[INFO] [1645192888.285816, 534.875000]: Loading controller: joint_state_controller
[INFO] [1645192888.307878, 534.896000]: Loading controller: z_position_controller
[INFO] [1645192888.377289, 534.961000]: Loading controller: arm_joint_1_controller
[ERROR] [1645192889.462640, 536.023000]: Failed to load arm_joint_1_controller
[INFO] [1645192889.465488, 536.024000]: Loading controller: arm_joint_2_controller
[ERROR] [1645192890.545491, 537.010000]: Failed to load arm_joint_2_controller
[INFO] [1645192890.549476, 537.010000]: Loading controller: arm_joint_3_controller
[ERROR] [1645192891.622708, 538.077000]: Failed to load arm_joint_3_controller
[INFO] [1645192891.625424, 538.080000]: Controller Spawner: Loaded controllers: joint_state_controller, z_position_controller
[INFO] [1645192891.631629, 538.086000]: Started controllers: joint_state_controller, z_position_controller

Error for control launch file terminal:

  [ERROR] [1645192359.417858982, 19.977000000]: Exception thrown while initializing controller 'arm_joint_1_controller'.
    Could not find resource 'arm_joint_1' in 'hardware_interface::EffortJointInterface'.
    [ERROR] [1645192359.418231972, 19.977000000]: Initializing controller 'arm_joint_1_controller' failed
    [ERROR] [1645192360.506970857, 21.041000000]: Exception thrown while initializing controller 'arm_joint_2_controller'.
    Could not find resource 'arm_joint_2' in 'hardware_interface::EffortJointInterface'.
    [ERROR] [1645192360.507157036, 21.041000000]: Initializing controller 'arm_joint_2_controller' failed
    [ERROR] [1645192361.593157783, 22.080000000]: Exception thrown while initializing controller 'arm_joint_3_controller'.
    Could not find resource 'arm_joint_3' in 'hardware_interface::EffortJointInterface'.
    [ERROR] [1645192361.594642459, 22.081000000]: Initializing controller 'arm_joint_3_controller' failed

Here is my code:

Xacro file for defining robot arm:

<?xml version='1.0'?>
<robot name='arm' xmlns:xacro='http://www.ros.org/wiki/xacro'>
  <xacro:include filename="$(find arm)/arm_description/urdf/arm.gazebo" />

<!--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_$(trans_linknum)">
      <type>transmission_interface/SimpleTransmission</type>
      <joint name="arm_joint_${trans_linknum}"> ...
(more)
edit retag flag offensive close merge delete

Comments

There are complete simulations you can install using apt. You'd be better off taking guidance from a working simulation that someone else has already debugged, for example, the ur5 robot arm. You could start here:

http://wiki.ros.org/ur_gazebo

The convention is to put the word description in the ros package name which contains the urdf & xacro files. These will be installed in the /opt/ros/ tree.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-02-18 10:55:09 -0600 )edit

Your arm transmission macro contains typos ("(" vs. "{"). It's worth going over your file carefully to make sure there aren't other such mistakes.

tryan gravatar image tryan  ( 2022-02-18 13:21:50 -0600 )edit