Ask Your Question
1

Deprecated issue regarding btQuaternion in electric

asked 2011-12-24 21:01:01 -0600

alfa_80 gravatar image

updated 2014-01-28 17:11:02 -0600

ngrennan gravatar image

I have a line of code that has deprecated issue in electric and I would like to know what is its better substitute.

=> btQuaternion q(pcl::deg2rad(data_set[t][8]), pcl::deg2rad(data_set[t][7]), pcl::deg2rad(data_set[t][6]));

[Warning:‘btQuaternion::btQuaternion(const btScalar&, const btScalar&, const btScalar&)’ is deprecated (declared at /opt/ros/electric/stacks/bullet/include/LinearMath/btQuaternion.h:47)]

P/S: Waiting for @joq's answer for he has done it already. This post is a refactor one.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2011-12-25 01:21:34 -0600

joq gravatar image

The bullet manifest says:

  • "To eliminate ambiguity about which API is active the btQuaternion constructor from Euler angles is deprecated. Please explicitly construct it and populate it seperately from euler angles, otherwise it is ambiguous as to what convention is being used."

At this point, I would avoid using the bullet types directly, as they will change again in Fuerte. Here's a solution using only the tf typedef:

// translate roll, pitch and yaw into a Quaternion
tf::Quaternion q;
q.setRPY(pcl::deg2rad(data_set[t][6]), 
         pcl::deg2rad(data_set[t][7]), 
         pcl::deg2rad(data_set[t][8]));

Note the reordering from (yaw, pitch, roll) to (roll, pitch, yaw).

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

Stats

Asked: 2011-12-24 21:01:01 -0600

Seen: 1,285 times

Last updated: Dec 25 '11