# joint_state_publisher not showing joint sliders for URDF

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">
<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
</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
</geometry>
</collision>
<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
</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
</geometry>
</collision>
<joint
name="joint1"
type="revolute">
<origin
xyz="0 0 0"
rpy="3.1416 0.24397 -1.5242E-17" />
<parent
<child
<axis
xyz="0 1 0" />
<limit
lower="1.5707"
upper="1.5707"
effort="0"
velocity="0" />
</joint>
<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
</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
</geometry>
</collision>
<joint
name="joint2"
type="revolute">
<origin
xyz="0 0.042734 0"
rpy="-1.5708 0.24397 7.0515E-17" />
<parent
<child
link="link2 ...
edit retag close merge delete

Sort by » oldest newest most voted

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.

more

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

( 2018-05-20 17:12:53 -0600 )edit