# How can I get the direction for a square box component?

hi, everybody, I made a square box. it is symmetric. The picture about my box shows in the link:https://drive.google.com/file/d/1gqVz9CmSGdZlxI_jLgG9w-sPNqZueQf0/view?usp=sharing

How can I get the direction of the square box? Because I need to define a direction of the square box in my simulation. for example, assuming the box is moving and a little bit rotation, and I want to calculate the distance of moving in the direction (eg. vertical of a side of the box) in 5 seconds. So, how we know the vertical of a side of the box?

I know how to get the position when the box is moving. But I have no idea how to get the direction (eg. vertical of a square box) of a component.

maybe this is not very clear. please write comments if you have any questions.

Thanks a lot!

or, could I get the corner coordinate? If yes, I have idea for this problem

You can get the link's pose in the world with GetWorldPose, does that help you? http://gazebosim.org/api/dev/classgazebo_1_1physics_1_1Entity.html#af2c1fe75dece185f5299b298b1332a4a

no, this does not answer my question. I used GetWorldPose() to get the position. But it is not enough to define a direction of a box. maybe one more coordinate of a point in the box or the line of an edge in the box is necessary to get a direction (orientation) of the box. Thanks a lot!

do you know how to get the corner coordinate of a square box, or the line or point on the edge of the a square (not limited on my box)? Thanks a lot!

Note that the pose does contain orientation: https://ignitionrobotics.org/api/math/4.0/classignition_1_1math_1_1Pose3.html#a0e1ba27eeb9ad5ac022a5bfe60634b07

very good! I will try and give you feedback later. I guess It should be working. Thanks a lot!