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

asked 2017-11-13 11:23:51 -0600

langong gravatar image

updated 2017-11-13 11:28:16 -0600

sloretz gravatar image

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

image description

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!

edit retag flag offensive close merge delete

Comments

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

langong gravatar imagelangong ( 2017-11-13 11:30:13 -0600 )edit

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

chapulina gravatar imagechapulina ( 2017-11-13 11:48:49 -0600 )edit

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!

langong gravatar imagelangong ( 2017-11-13 15:57:12 -0600 )edit

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!

langong gravatar imagelangong ( 2017-11-13 16:10:51 -0600 )edit

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

langong gravatar imagelangong ( 2017-11-14 03:13:07 -0600 )edit