Home | Tutorials | Wiki | Issues
Ask Your Question

How can I get the pose (coordinate) of each part for a modular robot?

asked 2017-11-09 10:35:21 -0500

langong gravatar image

updated 2017-11-09 10:37:06 -0500

hi, everybody, I need to get the pose (coordinate) of each part (modules) for a modular robot. I used the following codes to get the coordinate (x, y): previousPosition_.Pos().X()


But I just used this codes to get the centre coordinate of the whole robot. I do not know how to get coordinates for each module of a robot. So, How can I do this?

Note: My modular robot consists of many modules that corresponding many <link> in XML file for Gazebo.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-11-09 11:46:03 -0500

Considering your robot is your model, you can get each link by its name and then get the link's pose:

// robot is a ModelPtr
auto link1 = robot->GetLink("linkname");
auto linkPoseWrtParent = link1->RelativePose();
auto linkPoseWrtWorld = link1->WorldPose();
edit flag offensive delete link more


I will try. Thanks in advance. feedbacks to you later. But I am wondering how you know we can do like this using the function? Do we need to check every plugin function of Gazebo?

langong gravatar imagelangong ( 2017-11-09 13:37:33 -0500 )edit

Good answer to my question. But here is small question "I suggest you search for keywords related to the problem", do you mean searching on Gazebo website or Google or whatever?

langong gravatar imagelangong ( 2017-11-10 05:31:24 -0500 )edit

It is working. Thanks a lot!

langong gravatar imagelangong ( 2017-11-10 05:32:40 -0500 )edit

Yup, I mean searching on the internet in general ;)

chapulina gravatar imagechapulina ( 2017-11-10 10:31:22 -0500 )edit

okay, Thanks a lot!

langong gravatar imagelangong ( 2017-11-10 13:13:11 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-11-09 10:35:21 -0500

Seen: 117 times

Last updated: Nov 09 '17