Ask Your Question
0

joint_state_publisher not showing joint sliders for URDF

asked 2018-05-20 07:04:14 -0600

lolwuz gravatar image

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 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2018-05-20 11:47:52 -0600

gvdhoorn gravatar image

updated 2018-05-20 11:54:05 -0600

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.

edit flag offensive delete link more

Comments

You are absolutely right. Many thanks for your clear explanation! Really appreciate it.

lolwuz gravatar imagelolwuz ( 2018-05-20 17:12:53 -0600 )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: 2018-05-20 07:04:14 -0600

Seen: 135 times

Last updated: May 20 '18