Ask Your Question
0

What should we replace setEulerZYX with in the btQuaternion class (this method is now deprecated)?

asked 2014-06-24 17:16:32 -0600

pdrews gravatar image

We are using a Sparkfun Razor IMU, and it produces Euler angles in yaw,pitch,roll order. We need the setEulerZYX method to put this into a quaternion, but compiling this produces a warning that it is deprecated. I cannot find an equivalent function, do anyone have any suggestions for replacement?

edit retag flag offensive close merge delete

Comments

I use transform_datatypes.h to implement OMPL. The transform_datatypes.h includes createIdentityQuaternion() and createQuaternionFromRPY() and so on. There is the transform_datatypes.h in /opt/ros/***/include/tf/. It's my pleasure if my comment is useful for you.

Ken_in_JAPAN gravatar imageKen_in_JAPAN ( 2014-06-24 17:54:18 -0600 )edit

Unfortunately, this has the same problem as Dan's answer. All of these methods are rotations around fixed angles, instead of sequential Euler angle rotations. I agree that Euler angle implementation can be ambiguous, but euler rotations and fixed angle rotations don't seem to be equivalent.

pdrews gravatar imagepdrews ( 2014-06-24 18:26:35 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-06-24 17:48:01 -0600

updated 2014-06-24 17:48:55 -0600

You can do that with a tf::Quaternion

tf::Quaternion q;
q.setRPY(from_degrees(roll), from_degrees(pitch), from_degrees(yaw));
edit flag offensive delete link more

Comments

We are actually using tf::Quaternion, which is mostly derived from the bullet btQuaternion class. The problem is that q.setRPY and q.setEulerZYX are not equivalent. setRPY takes rotations around a fixed set of axes. setEulerZYX uses rotations relative to a frame that stays attached to the body (see the wikipedia article http://en.wikipedia.org/wiki/Euler_angles).

pdrews gravatar imagepdrews ( 2014-06-24 18:13:54 -0600 )edit

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

Stats

Asked: 2014-06-24 17:16:32 -0600

Seen: 633 times

Last updated: Jun 24 '14