Gazebo | Ignition | Community
Ask Your Question

Get translation of prismatic joints through C++ API

asked 2015-03-28 14:43:51 -0500

Robocop87 gravatar image

Hi all,

I am making a ROS plugin for a cylindrical manipulator. I need to get the translation of the prismatic joint in order to report the position of the end effector. I looked through the Joint API ( and failed to see a function that would give me this information. I found GetAngle, but that is meaningless for a prismatic joint. The SliderJoint API didn't provide any help either. How do I get the translation of a prismatic joint through the C++ API?

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-03-28 18:33:40 -0500

chapulina gravatar image

updated 2015-03-28 18:37:32 -0500

The function is probably badly named, but I believe GetAngle for a prismatic joint returns the joint's displacement in meters. See this issue.

I did a quick test with the GUI. Insert the Simple Arm model and on the World tree, select the arm_wrist_lift_joint, which is prismatic. Expand axis1 and you'll see that the joint's lower and upper limits are -0.8 m and 0.1 m respectively. Now expand the joint control panel on the right and apply some forces to move this joint up and down, and you'll see the value of angle_0 go from one joint limit to the other.

image description

edit flag offensive delete link more


Great, thank you for your answer! I agree, badly named function.

Robocop87 gravatar imageRobocop87 ( 2015-03-29 21:32:17 -0500 )edit

One other question, the GetAngle function returns a math::Angle type which can be resolved to a number using math::Angle::Degree or math::Angle::Radian. If it is a prismatic joint, which do I use? I'll assume radian but I'm not sure.

Robocop87 gravatar imageRobocop87 ( 2015-03-30 10:50:18 -0500 )edit

Radian seems to be the one.

chapulina gravatar imagechapulina ( 2015-03-30 11:32:35 -0500 )edit
Login/Signup to Answer

Question Tools


Asked: 2015-03-28 14:43:51 -0500

Seen: 1,218 times

Last updated: Mar 28 '15