0
$\begingroup$

Rosanswers logo

Hi there.

I'm working on a project to simulate a robot arm. I have a URDF file that I'm able to open and view in RVIZ using the following .launch file. Note: the URDF was created by the Solidworks to URDF exporter.

<launch>
  <arg name="model" default="$(find arm_9)/urdf/arm_9.urdf"/>
  <arg name="gui" default="true" />
  <arg name="rvizconfig" default="$(find arm_9)/rviz/urdf.rviz" />

  <param name="robot_description" command="$(find xacro)/xacro.py $(arg model)" />
  <param name="use_gui" value="$(arg gui)"/>

  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
</launch>

Now the problem is that my joint controls aren't showing up in the joint_state_publisher GUI. I'm thinking this might be a problem with my URDF file but I'm just not sure. Can someone see what I'm doing wrong or missing? (URDF below)

Thanks, Marten

<robot
  name="arm_9">
  <link
    name="base_link">
    <inertial>
      <origin
        xyz="0.012628 -0.0010831 1.2639E-05"
        rpy="0 0 0" />
      <mass
        value="0.04292" />
      <inertia
        ixx="0"
        ixy="0"
        ixz="0"
        iyy="0"
        iyz="0"
        izz="0" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://arm_9/meshes/base_link.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.79216 0.81961 0.93333 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://arm_9/meshes/base_link.STL" />
      </geometry>
    </collision>
  </link>
  <link
    name="link1">
    <inertial>
      <origin
        xyz="-0.0040853 0.015183 0.00048152"
        rpy="0 0 0" />
      <mass
        value="1.032E-06" />
      <inertia
        ixx="1.3689E-10"
        ixy="8.8115E-12"
        ixz="2.8271E-13"
        iyy="2.19E-11"
        iyz="2.9087E-11"
        izz="1.1724E-10" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://arm_9/meshes/link1.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.75294 0.75294 0.75294 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://arm_9/meshes/link1.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="joint1"
    type="revolute">
    <origin
      xyz="0 0 0"
      rpy="3.1416 0.24397 -1.5242E-17" />
    <parent
      link="base_link" />
    <child
      link="link1" />
    <axis
      xyz="0 1 0" />
    <limit
      lower="1.5707"
      upper="1.5707"
      effort="0"
      velocity="0" />
  </joint>
  <link
    name="link2">
    <inertial>
      <origin
        xyz="7.15019130346397E-18 -0.00107933891070364 0.0398728855217944"
        rpy="0 0 0" />
      <mass
        value="0.0858412346403649" />
      <inertia
        ixx="6.37185065847932E-05"
        ixy="2.71577475637228E-23"
        ixz="-2.95580748526777E-08"
        iyy="6.37186641971459E-05"
        iyz="-9.21422603035335E-18"
        izz="1.58951413447898E-10" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://arm_9/meshes/link2.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.752941176470588 0.752941176470588 0.752941176470588 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://arm_9/meshes/link2.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="joint2"
    type="revolute">
    <origin
      xyz="0 0.042734 0"
      rpy="-1.5708 0.24397 7.0515E-17" />
    <parent
      link="link1" />
    <child
      link="link2" />
    <axis
      xyz="0 1 0" />
    <limit
      lower="1.5707"
      upper="1.5707"
      effort="0"
      velocity="0" />
  </joint>
  <link
    name="link3">
    <inertial>
      <origin
        xyz="-0.0456880092439777 -0.00105451780168707 0.00987412514443009"
        rpy="0 0 0" />
      <mass
        value="0.0439263973577538" />
      <inertia
        ixx="3.42720602046462E-08"
        ixy="-2.86398834585464E-08"
        ixz="1.52988429722026E-07"
        iyy="7.42028815444667E-07"
        iyz="6.1797904418667E-09"
        izz="7.1027866093725E-07" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://arm_9/meshes/link3.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.752941176470588 0.752941176470588 0.752941176470588 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://arm_9/meshes/link3.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="joint3"
    type="revolute">
    <origin
      xyz="0 0 0.079746"
      rpy="0 1.3582 0" />
    <parent
      link="link2" />
    <child
      link="link3" />
    <axis
      xyz="0 1 0" />
    <limit
      lower="1.5707"
      upper="1.5707"
      effort="0"
      velocity="0" />
  </joint>
  <link
    name="link4">
    <inertial>
      <origin
        xyz="-0.0410748884985929 -0.000783585563262759 0.0119820142107647"
        rpy="0 0 0" />
      <mass
        value="0.0429209529097554" />
      <inertia
        ixx="7.626420583499E-11"
        ixy="-4.76906864645279E-11"
        ixz="8.79612998167175E-11"
        iyy="2.35969766726476E-10"
        iyz="1.39566613716297E-11"
        izz="2.02126906016958E-10" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://arm_9/meshes/link4.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.752941176470588 0.752941176470588 0.752941176470588 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://arm_9/meshes/link4.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="joint4"
    type="revolute">
    <origin
      xyz="-0.058649 0 0.012659"
      rpy="0 0.21258 0" />
    <parent
      link="link3" />
    <child
      link="link4" />
    <axis
      xyz="0 1 0" />
    <limit
      lower="1.5707"
      upper="1.5707"
      effort="0"
      velocity="0" />
  </joint>
  <link
    name="link5">
    <inertial>
      <origin
        xyz="-0.00240938892690458 0.00514536996377175 -0.0582516220818473"
        rpy="0 0 0" />
      <mass
        value="0.0575254656345783" />
      <inertia
        ixx="2.0502358422632E-05"
        ixy="-9.44127620924359E-07"
        ixz="8.86372768779622E-07"
        iyy="0.000105712917910796"
        iyz="4.85345245675892E-06"
        izz="9.13484674325623E-05" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://arm_9/meshes/link5.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.752941176470588 0.752941176470588 0.752941176470588 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://arm_9/meshes/link5.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="joint5"
    type="revolute">
    <origin
      xyz="-0.04 -0.00079625 -0.00064577"
      rpy="-1.5708 -6.5052E-17 -1.5708" />
    <parent
      link="link4" />
    <child
      link="link5" />
    <axis
      xyz="0 0 1" />
    <limit
      lower="3.1416"
      upper="3.1416"
      effort="0"
      velocity="0" />
  </joint>
</robot>

Originally posted by lolwuz on ROS Answers with karma: 13 on 2018-05-20

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

So I think I "Solved" my problem. The Joint_state_publisher doesn't support Revolute type joints.

it very much does support revolute joints.

I believe the issue here is the following (taken from joint1):

  lower="1.5707"
  upper="1.5707"

It doesn't make much sense to me to have joints with a limit that is identical for both the lower and upper limit. This essentially means that the joint cannot move (or rotate in this case).

I haven't checked, but I wouldn't be surprised if joint_state_publisher filters out joints that have limits configured like that.


Edit: speculating, but I believe I can think of where the confusion comes from: the lower and upper attributes of the limit element do not specify a negative and positive limit necessarily. If that was the case, setting both to 1 (fi) would translate into a limit of [-1, 1]. That is not how this works.

Instead, you have to specify whether either limit is negative or positive. So if your joint1 has a limit of half a pi in both directions, you'd need to have lower="-1.5707" and upper="1.5707".

It would also be perfectly valid to have both upper and lower set to positive values, such as lower="1" and upper="2". In such a case it would just mean that the joint does not allow any negative joint angles, and that all rotations are limited to be between 1 and 2 radians.


Originally posted by gvdhoorn with karma: 86574 on 2018-05-20

This answer was ACCEPTED on the original site

Post score: 5


Original comments

Comment by lolwuz on 2018-05-20:
You are absolutely right. Many thanks for your clear explanation! Really appreciate it.

Comment by himty on 2020-12-06:
omg I made an account just to thank you. I've searched around for so long. This also caused rostopic echo joint_states to not display these revolute joints

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.