Get a pose of nested model relative to it's parent model

asked 2016-11-09 11:40:23 -0500

l4ncelot gravatar image

Hi,

I've been experimenting with Gazebo plugins recently and I've encountered problem while trying to publish tf transformations from Gazebo to ROS.

I have sdf model of quadcopter with nested model of camera attached to the quadcopter with joint. I then created model plugin where I'm trying to get position of my nested camera model relative to quadcopter model by GetRelativePose() function documented here.

But it doesn't work and it seems like I'm getting world coordinates instead of relative ones. Also when I try GetParent()->GetName() function it gives me my quadcopter's name which is fine. But when I do the same on model with GetParentModel()->GetName() it gives me my camera's model name which is weird to me...

Any idea what's happening and what am I missing?

Thank you.

edit retag flag offensive close merge delete

Comments

I recently wanted to do the same, you can use ros tf. http://wiki.ros.org/tf/Tutorials As the wiki seems to be down right now, I can't tell you the functions in cpp, but in python it would be the lookupTransform('parent_link', 'child_link', rospy.Time(0)) function. My solution to the problem was writing a rosservice and not a plugin,

Lyndwyrm gravatar imageLyndwyrm ( 2016-11-11 01:03:51 -0500 )edit

Well I'm using tf to send transformation to ROS. I've used plugin to get the transformation and then send it through tf, becase the model can't send transformation itself.

l4ncelot gravatar imagel4ncelot ( 2016-11-12 02:59:40 -0500 )edit

So lookupTransform already gives you the wrong values?

Lyndwyrm gravatar imageLyndwyrm ( 2016-11-14 07:29:24 -0500 )edit