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

Controlling two joints simultaneously

asked 2014-07-25 15:49:20 -0600

clarkeaa gravatar image


I am using the Kuka Youbot arm ( ). When running the youbot_driver, several topics are created including a topic called "arm_1/gripper_controller/position_command" which takes the message type "brics_actuator/JointPositions." However, the gripper consists of two separate joints: one for the left finger, and one for the right finger. If I try to input a command using rostopic pub, I will have to specify which finger I want to move, either "gripper_finger_joint_l" or "gripper_finger_joint_r." This is a problem because i want the gripper to open or close by moving both fingers simultaneously. How can I do this? At first, I thought that I would try to add a "mimic" tag in the URDF but apparently this is no longer supported. What other options do I have for controlling both gripper joints at the same time?

My ultimate goal is to create an action server that takes something like "control_msgs/GripperCommandAction" with the opening width specified, and it will just open or close to that width.

Thank you, -Adrian

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-07-26 04:46:29 -0600

McMurdo gravatar image

The message brics_actuator/JointPositions has:

brics_actuator/JointValue[] positions

This is a list of JointValue variables.

This means you can 'push back' the values for two joints and you will get both joints moving. JointValue looks like this:

time timeStamp
string joint_uri
string unit
float64 value

Create two separate JointValue variables and fill them up with the stuff for both joints. Create a 'goal' message with JointPositions. Then, push them unto goal.positions.


I hope that helps. Have a great day ahead!

edit flag offensive delete link more


Thanks for the response. However I am not sure what you mean by "push back." So I would create something like: first_finger = timeStamp1, joint_uri1, unit1, value1, and second_finger = timeStamp2, joint_uri2, unit2, value2?

clarkeaa gravatar image clarkeaa  ( 2014-07-26 12:56:11 -0600 )edit

first_finger_value has type brics_actuator/JointValue. So does second_finger_value. Then you can set the timeStamp, joint_uri, unit (optional) and value inside it. Then use the method push_back exactly as described above. push_back is a method on an STL container. Please google for it.

McMurdo gravatar image McMurdo  ( 2014-07-26 14:34:14 -0600 )edit

Thank you, this makes sense.

clarkeaa gravatar image clarkeaa  ( 2014-07-28 11:00:58 -0600 )edit

Does it work?

McMurdo gravatar image McMurdo  ( 2014-07-28 11:36:32 -0600 )edit

It does not work, but I think it is because there is no action server defined for gripper control. The youbot driver has a built in arm trajectory action but not gripper control. I don't think I can use action servers with gripper control unfortunately...

clarkeaa gravatar image clarkeaa  ( 2014-07-29 09:37:40 -0600 )edit

But you should be able to get the arm/fingers to move by publishing on a topic.

McMurdo gravatar image McMurdo  ( 2014-07-29 10:55:51 -0600 )edit

Should I publish the goal directly onto the topic "arm_1/gripper_controller/position_command?"

clarkeaa gravatar image clarkeaa  ( 2014-07-29 11:16:31 -0600 )edit

That is how you have done it using rostopic pub. It is the same thing. :-)

McMurdo gravatar image McMurdo  ( 2014-07-29 13:17:22 -0600 )edit

Question Tools

1 follower


Asked: 2014-07-25 15:49:20 -0600

Seen: 501 times

Last updated: Jul 26 '14