Gazebo | Ignition | Community
Ask Your Question

What is an equivalent to Gazebo 9 function physics::Joint::Position() in Gazebo 7 for prismatic joint?

asked 2019-01-15 03:30:09 -0500

kumpakri gravatar image

updated 2019-01-15 13:00:10 -0500

Carlos Agüero gravatar image

I was using the physics::Joint::Position() function in Gazebo 9 to get the deflection of the child link from its initial position. Now I want to implement the same in Gazebo 7, but it doesn't have this function and I can't find anything in the API documentation, that looks like it does the same thing.

What can I use to get the deflection of the prismatic joint in Gazebo 7?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2019-01-15 11:42:47 -0500

Carlos Agüero gravatar image

It's called GetAngle(). Note that this function accepts an argument representing the index of the axis. In a prismatic joint, you'll use 0. See here for the function definition.

edit flag offensive delete link more


I was thinking about that, but the function returns an angle. How do I map this value to the prismatic joint deflection from initial position in meters?

kumpakri gravatar imagekumpakri ( 2019-01-16 08:37:43 -0500 )edit

The name of the function is confusing and that's why we deprecated it. It will actually return a position if you're using a prismatic joint.

Carlos Agüero gravatar imageCarlos Agüero ( 2019-01-16 17:11:51 -0500 )edit

Question Tools

1 follower


Asked: 2019-01-15 03:30:09 -0500

Seen: 465 times

Last updated: Jan 15 '19