Get a pose of nested model relative to it's parent model
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.
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,
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.
So lookupTransform already gives you the wrong values?