ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 2011-12-24 09:25:25 -0500

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). Blockquote

click to hide/show revision 2
answer first question

The For the first question:

ranges.resize((size_t)size);

For the second, 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). Blockquoteyaw).

click to hide/show revision 3
make answer more specific

For the first question:

ranges.resize((size_t)size);
scan.ranges.resize((int)(90/0.25));

Be careful of that (int) cast. I believe the floating point result will be exact in this example, so truncation should not be an issue. Generally, it is better to round explicitly.

For the second, 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).

click to hide/show revision 4
move btQuaternion answer to a separate question

For Use the first question:std::vector resize method directly:

scan.ranges.resize((int)(90/0.25));

Be careful of that (int) cast. I believe the floating point result will be exact in this example, so truncation should not be an issue. Generally, it is better to round explicitly.

For the second, 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).