Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why is my robot arm not moving in gazebo or rviz?

I'm trying to simulate an ABB4600 robot in gazebo using the joint_position_controllers. I can successfully spawn the robot into an empty world and load the controllers. However, when I try to command one of the joints to a desired angle, the robot does not move in the gazebo simulation. I checked rviz as well and the robot likewise does not move in rviz. I've attached the xacro file for the robot and the launch/config files I'm using for the controller. I'd greatly appreciate any help!

Xacro File:

 <?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">
  <xacro:macro name="abb_irb4600_60_205" params="prefix">
     <!-- Import Gazebo elements, including Gazebo colors -->
  <!-- <xacro:include filename="$(find abb_irb4600_support)/urdf/irb4600_60_205.gazebo" /> -->
    <!-- link list -->
    <link name="${prefix}base_link">
      <inertial>
            <mass value="1.634" />
            <origin xyz="0.027 0 -0.067" rpy="0 -0 0" />
            <inertia ixx="0.002" ixy="0" ixz="0" iyy="0.007" iyz="0" izz="0.008" />
        </inertial>
      <collision name="collision">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/collision/base_link.stl"/>
        </geometry>
      </collision>
      <visual name="visual">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/visual/base_link.stl"/>
        </geometry>
        <material name="yellow">
          <color rgba="1 1 0 1"/>
        </material>
      </visual>
    </link>
    <link name="${prefix}link_1">
      <inertial>
            <mass value="1.634" />
            <origin xyz="0.027 0 -0.067" rpy="0 -0 0" />
            <inertia ixx="0.002" ixy="0" ixz="0" iyy="0.007" iyz="0" izz="0.008" />
        </inertial>
      <collision name="collision">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/collision/link_1.stl"/>
        </geometry>
      </collision>
      <visual name="visual">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/visual/link_1.stl"/>
        </geometry>
        <material name="yellow"/>
      </visual>
    </link>
    <link name="${prefix}link_2">
      <inertial>
            <mass value="1.634" />
            <origin xyz="0.027 0 -0.067" rpy="0 -0 0" />
            <inertia ixx="0.002" ixy="0" ixz="0" iyy="0.007" iyz="0" izz="0.008" />
        </inertial>
      <collision name="collision">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/collision/link_2.stl"/>
        </geometry>
      </collision>
      <visual name="visual">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/visual/link_2.stl"/>
        </geometry>
        <material name="yellow"/>
      </visual>
    </link>
    <link name="${prefix}link_3">
      <inertial>
            <mass value="1.634" />
            <origin xyz="0.027 0 -0.067" rpy="0 -0 0" />
            <inertia ixx="0.002" ixy="0" ixz="0" iyy="0.007" iyz="0" izz="0.008" />
        </inertial>
      <collision name="collision">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/collision/link_3.stl"/>
        </geometry>
      </collision>
      <visual name="visual">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/visual/link_3.stl"/>
        </geometry>
        <material name="yellow"/>
      </visual>
    </link>
    <link name="${prefix}link_4">
      <inertial>
            <mass value="1.634" />
            <origin xyz="0.027 0 -0.067" rpy="0 -0 0" />
            <inertia ixx="0.002" ixy="0" ixz="0" iyy="0.007" iyz="0" izz="0.008" />
        </inertial>
      <collision name="collision">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/collision/link_4.stl"/>
        </geometry>
      </collision>
      <visual name="visual">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/visual/link_4.stl"/>
        </geometry>
        <material name="yellow"/>
      </visual>
    </link>
    <link name="${prefix}link_5">
      <inertial>
            <mass value="1.634" />
            <origin xyz="0.027 0 -0.067" rpy="0 -0 0" />
            <inertia ixx="0.002" ixy="0" ixz="0" iyy="0.007" iyz="0" izz="0.008" />
        </inertial>
      <collision name="collision">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/collision/link_5.stl"/>
        </geometry>
      </collision>
      <visual name="visual">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/visual/link_5.stl"/>
        </geometry>
        <material name="yellow"/>
      </visual>
    </link>
    <link name="${prefix}link_6">
      <inertial>
            <mass value="1.634" />
            <origin xyz="0.027 0 -0.067" rpy="0 -0 0" />
            <inertia ixx="0.002" ixy="0" ixz="0" iyy="0.007" iyz="0" izz="0.008" />
        </inertial>
      <collision name="collision">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/collision/link_6.stl"/>
        </geometry>
      </collision>
      <visual name="visual">
        <geometry>
          <mesh filename="package://abb_irb4600_support/meshes/irb4600_60_205/visual/link_6.stl"/>
        </geometry>
        <material name="yellow"/>
      </visual>
    </link>
    <link name="${prefix}tool0"/>
    <!-- end of link list -->

<!--     <link name="${prefix}sander">
      <visual>
        <origin xyz="0 0 0" rpy="0 0 0" />
        <geometry>
          <mesh filename="package://abb_irb2600_support/meshes/tools/orbital_sander_bin.stl" />
        </geometry>
        <material name="">
          <color rgba="0.5 0.5 0.5 1" />
        </material>
      </visual>
      <collision>
        <origin xyz="0 0 0" rpy="0 0 0" />
        <geometry>
          <mesh filename="package://abb_irb2600_support/meshes/tools/orbital_sander_bin.stl" />
        </geometry>
      </collision>
    </link> -->

    <!-- joint list -->
    <!-- "${prefix}joint_1"> -->
    <joint type="revolute" name="joint_1">
      <origin xyz="0 0 0.495" rpy="0 0 0"/>
      <axis xyz="0 0 1"/>
      <parent link="${prefix}base_link"/>
      <child link="${prefix}link_1"/>
      <limit effort="0" lower="-3.141" upper="3.141" velocity="3.054"/>
    </joint>
    <joint type="revolute" name="joint_2">
      <origin xyz="0.175 0 0" rpy="0 0 0"/>
      <axis xyz="0 1 0"/>
      <parent link="${prefix}link_1"/>
      <child link="${prefix}link_2"/>
      <limit effort="0" lower="-1.570" upper="2.617" velocity="3.054"/>
    </joint>
    <joint type="revolute" name="joint_3">
      <origin xyz="0 0 0.9" rpy="0 0 0"/>
      <axis xyz="0 1 0"/>
      <parent link="${prefix}link_2"/>
      <child link="${prefix}link_3"/>
      <limit effort="0" lower="-3.141" upper="1.308" velocity="3.054"/>
    </joint>
    <joint type="revolute" name="joint_4">
      <origin xyz="0 0 0.175" rpy="0 0 0"/>
      <axis xyz="1 0 0"/>
      <parent link="${prefix}link_3"/>
      <child link="${prefix}link_4"/>
      <limit effort="0" lower="-6.981" upper="6.981" velocity="4.363"/>
    </joint>
    <joint type="revolute" name="joint_5">
      <origin xyz="0.960 0 0 " rpy="0 0 0"/>
      <axis xyz="0 1 0"/>
      <parent link="${prefix}link_4"/>
      <child link="${prefix}link_5"/>
      <limit effort="0" lower="-2.181" upper="2.094" velocity="4.363"/>
    </joint>
    <joint type="revolute" name="joint_6">
      <origin xyz="0.135 0 0 " rpy="0 0 0"/>
      <axis xyz="1 0 0"/>
      <parent link="${prefix}link_5"/>
      <child link="${prefix}link_6"/>
      <limit effort="0" lower="-6.981" upper="6.981" velocity="6.283"/>
    </joint>
    <joint type="fixed" name="$joint_6-tool0">
      <parent link="${prefix}link_6"/>
      <child link="${prefix}tool0"/>
      <origin xyz="0 0 0" rpy="0 1.57079632679 0"/>
    </joint>
    <!-- end of joint list -->
<!--     <joint name="${prefix}tool0-sander" type="fixed">
      <origin xyz="0 0 0" rpy="0 0 0" />
      <parent link="${prefix}tool0" />
      <child link="${prefix}sander" />
    </joint> -->

    <!-- ROS base_link to ABB World Coordinates transform -->
    <link name="${prefix}base" />
    <joint name="${prefix}base_link-base" type="fixed">
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <parent link="${prefix}base_link"/>
      <child link="${prefix}base"/>
    </joint>

    <link name="world"/>
<!--     <joint name="base_link-world" type="fixed">
      <origin rpy="-0.296706 0 0" xyz="0 0 0"/>
      <parent link="world"/>
      <child link="${prefix}base_link"/>
    </joint> -->
    <joint name="base_link-world" type="fixed">
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <parent link="world"/>
      <child link="${prefix}base_link"/>
    </joint>

    <transmission name="transmission1">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint_1">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor1">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="transmission2">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint_2">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor2">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="transmission3">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint_3">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor3">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="transmission4">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint_4">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor4">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="transmission5">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint_5">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor5">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="transmission6">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint_6">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor6">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <gazebo>
  <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    <robotNamespace>/abb</robotNamespace>
  </plugin>
  </gazebo>

  </xacro:macro>
</robot>

YAML File:

    abb:
  # Publish all joint states -----------------------------------
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50  

  # Position Controllers ---------------------------------------
  joint_1_position_controller:
    type: effort_controllers/JointPositionController
    joint: joint_1
    pid: {p: 100.0, i: 0.01, d: 10.0}
  joint_2_position_controller:
    type: effort_controllers/JointPositionController
    joint: joint_2
    pid: {p: 100.0, i: 0.01, d: 10.0}
  joint_3_position_controller:
    type: effort_controllers/JointPositionController
    joint: joint_3
    pid: {p: 100.0, i: 0.01, d: 10.0}
  joint_4_position_controller:
    type: effort_controllers/JointPositionController
    joint: joint_4
    pid: {p: 100.0, i: 0.01, d: 10.0}
  joint_5_position_controller:
    type: effort_controllers/JointPositionController
    joint: joint_5
    pid: {p: 100.0, i: 0.01, d: 10.0}
  joint_6_position_controller:
    type: effort_controllers/JointPositionController
    joint: joint_6
    pid: {p: 100.0, i: 0.01, d: 10.0}

Launch File:

<launch>

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

  <!-- load the controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/abb" args="joint_1_position_controller joint_2_position_controller joint_3_position_controller joint_4_position_controller joint_5_position_controller joint_6_position_controller joint_state_controller"/>

  <!-- 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">
    <remap from="/joint_states" to="/abb/joint_states" />
  </node>

</launch>