Ask Your Question

Using TF package to transform rotations

asked 2015-04-07 09:49:26 -0500

Jordan9 gravatar image

I'm using the Gazebo simulator and gazebo_ros to interface with it. It the simulator, I have a "quadcopter" object. I would like to apply a thrust to the quadcopter. Gazbo_ros offers a way to apply a force to an object, but it can only do so in the world's coordinate frame (i.e. even if my quadcopter is on its side, applying a force in the Z axis will still make it go directly vertical).

I'm trying to figure out how to use the TF package to transform between the two coordinate frames. Essentially, with a given Pose vector and Quaternion orientation of the quadcopter model, how can I convert from the quadcopter's Z axis to a vector in the world's coordinate frame? i.e. what force vector in the world's coordinate frame should be applied to give a force in the quadcopter's Z axis?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-04-08 11:17:55 -0500

Jordan9 gravatar image

I figured it out, using the tf::Quaternion class which comes with built-in vector transformations.

edit flag offensive delete link more

answered 2015-04-08 14:53:31 -0500

This TF tutorial will be a good starting point; it listens to the TF topic and calculates the requested transform in the listener.lookupTransform call.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-04-07 09:49:26 -0500

Seen: 1,068 times

Last updated: Apr 08 '15