ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Two joints for one link

asked 2011-11-05 02:25:17 -0500

Rikki gravatar image

updated 2011-11-11 06:53:02 -0500

I´m buliding a URDF robot. The gripper need to connect two links to another link. Anybody know any way to connect two joins to the same link in different points?

Thanks guys!!

(and sorry for my english)

image description

This is the joint that contains the tag <mimic>:

  <joint name="gripper_cuerpo_a_biela_der" type="revolute"> 
<parent link="gripper_cuerpo"/>
<child link="gripper_biela_der"/>    
<origin rpy="0 0 0" xyz="0.014 0 0.021"/>
<axis xyz="0 -1 0"/>
<limit lower="0.0" upper="0.548" velocity="0.5" effort="1000"/>
<mimic joint="gripper_cuerpo_a_biela_izq" multiplier="1" offset="0"/> 

and this is the error in the terminal:

riqui@riqui:~/ros_workspace/modelquad/modelvisual/robots$ roslaunch modelquad display_gripper_rviz.launch model:=gripper.urdf gui:=true

process[joint_state_publisher-1]: started with pid [7100] process[robot_state_publisher-2]: started with pid [7101] process[rviz-3]: started with pid [7102] Traceback (most recent call last): File "/home/riqui/ros/stacks/urdf_tools/joint_state_publisher/joint_state_publisher", line 209, in <module> jsp.loop() File "/home/riqui/ros/stacks/urdf_tools/joint_state_publisher/joint_state_publisher", line 108, in loop baseval = self.free_joints[parent]['value'] KeyError: ''

edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted

answered 2011-11-08 06:35:31 -0500

David Lu gravatar image

updated 2011-11-18 04:09:21 -0500

In some situations, you can use the <mimic> tag to force the joint angles to be the same. I've labeled three joints below. A is independently driven, B is set to always have the same angle as A, and C has negative A's value. I think this assumes that these links form a parallelogram.

Depending on what version of JointStatePublisher you're using, the visualization should work automatically if you have the mimic tags set up.


Edit: The syntax (although not documented anywhere) is

<mimic joint="gripper_cuerpo_a_biela_izq" multiplier="1" offset="0"/>

Re-edit: OP had the correct syntax to begin with. I've pushed a new version of urdf_python that clears up the disconnect.

edit flag offensive delete link more


OK!! Tomorrow I will work in this using the <mimic> tag (It´s 22:00 in Spain and I have to dinner :) ). 1 million thanks for help me!
Rikki gravatar image Rikki  ( 2011-11-08 06:55:01 -0500 )edit
Hi David! I've downloaded and your urdf_tools stack (which contains the jointstatepublisher with <mimic>). I've checked that my gripper.urdf still operates ok in RVIZ with the new jointstatepublisher, but that fails when include <mimic> in my URDF. I post above the mimic-joint and the error.
Rikki gravatar image Rikki  ( 2011-11-11 06:16:02 -0500 )edit
I am trying that the left-first link mimic to the right-first link. THANKS DAVID
Rikki gravatar image Rikki  ( 2011-11-11 06:54:23 -0500 )edit
Rikki - Can you please send me ( or post your whole URDF?
David Lu gravatar image David Lu  ( 2011-11-11 06:57:19 -0500 )edit
Nevermind, see my edit above.
David Lu gravatar image David Lu  ( 2011-11-11 07:01:52 -0500 )edit
OK! It's works perfect! Thanks David Lu!!
Rikki gravatar image Rikki  ( 2011-11-18 07:33:19 -0500 )edit
This works perfect! Thanks David Lu!!
Rikki gravatar image Rikki  ( 2011-11-18 07:35:41 -0500 )edit

The mimic tag, as discussed here, works great when using David Lu's joint_state_publisher simulator. However when using real joint state data from a physical robot, the mimic tag does not appear to work. Are there pre-built ways to mimic real joint data, or do I need to write this node myself?

Dave Coleman gravatar image Dave Coleman  ( 2012-03-06 10:48:31 -0500 )edit

answered 2011-11-06 10:22:17 -0500

David Lu gravatar image

If I understand you correctly, I'm guessing you have two links (A and B), with some common ancestor link X, to some fourth link Y, where Y closes the loop. Unfortuantely, one limitation of URDF is its inability represent graphs with URDF. It can only represent trees, i.e. Y cannot have two parents, A and B.

edit flag offensive delete link more


Yes this is exactly my problem. After read your answer I've found the limitations and this is true, so I have very bad luck :(. Do you know any solution for this? I´m reading about the TF package but maybe it has the same limitation, what do you think? Thank you very much David!
Rikki gravatar image Rikki  ( 2011-11-08 04:57:37 -0500 )edit
(I dont have karma for post a image)
Rikki gravatar image Rikki  ( 2011-11-08 05:09:39 -0500 )edit
It depends what you're trying to do in the end. If you're just making a visualization, you don't have to close the loop, you can just leave it unattached. As long as all the joint angles are set properly, it will look right. However, if you want to do something fancier, then it gets a bit tougher.
David Lu gravatar image David Lu  ( 2011-11-08 05:13:34 -0500 )edit
Yes, It's not a simple visualization. I need the model for simulate it in Gazebo and 3D navigation. Then, is it not possible ? what I need? I post a image where you can see the problematic joint (Now I have karma :) ). Thanks!!
Rikki gravatar image Rikki  ( 2011-11-08 05:52:04 -0500 )edit

answered 2020-09-20 20:18:56 -0500

@Rikki - I know this is an old post, but does anyone happen to have the URDF file for this gripper?

Thanks! Scott

edit flag offensive delete link more

answered 2011-11-06 07:34:14 -0500

makokal gravatar image

You can use a fixed joint as a dummy to connect one of the links, or just an 'active' joint should work as well. See the reference for more info.

edit flag offensive delete link more


I don´t understand your answer, but if I connect the second joint the first joint don´t work. What is a dummy? (I am student with a free proyect using ROS, and I am little lost even) Thanks very much for answering.
Rikki gravatar image Rikki  ( 2011-11-08 05:19:56 -0500 )edit

Question Tools



Asked: 2011-11-05 02:25:17 -0500

Seen: 5,107 times

Last updated: Nov 18 '11