ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

bullet_migration: electric and fuerte compatibility

asked 2012-08-07 10:19:56 -0600

bwasserm gravatar image

updated 2012-08-07 22:48:30 -0600

AHornung gravatar image

Hello, I'm trying to upgrade a project from Electric to Fuerte while still maintaining Electric compatibility (some systems will be on Electric for a while). I ran into an issue with tf and bullet. In the following code section, I need R defined as a btMatrix3x3 in Electric, but a tf::Matrix3x3 in Fuerte. Is there any way to have one set of code that will satisfy both? I would like to stay with the recommended Fuerte form, but I need it to work in both versions.

//world_to_camera is a tf::StampedTransform
//Electric version
btMatrix3x3 R;

Edit: In Electric, the error comes at tf::Matrix3x3 (Matrix3x3 is not a member of tf). In Fuerte, the error is at R.setRotation (no matching function call btMatrix3x3::setRotation(tf::Quaternion, can't convert tf::Quaternion to btQuaternion.) I tried putting .toBt() after .getRotation() in the migration guide, but I got the error Class tf::Quaternion has no member toBt.

I tried to follow the bullet_migration guide. The sed script doesn't work because it breaks in Electric. I'm sorry if this answer is obvious somewhere. Thanks for the help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-08-07 22:47:21 -0600

AHornung gravatar image

updated 2012-08-08 03:55:40 -0600

You can switch between fuerte and electric with the following code:

  tf::Matrix3x3 R;      
  btMatrix3x3 R;

edit flag offensive delete link more


Alternatively, if you have many occurrences of btMatrix3x3, you can put a typedef in a header file that defines tf::Matrix3x3 for older ros versions.

Lorenz gravatar image Lorenz  ( 2012-08-07 23:23:07 -0600 )edit

Thanks, that worked. Except you got the types backwards, but I got the idea of what you meant.

bwasserm gravatar image bwasserm  ( 2012-08-08 03:52:28 -0600 )edit

Ah right - I'll edit that. You should also consider what Lorenz wrote, in case you have multiple occurrences.

AHornung gravatar image AHornung  ( 2012-08-08 03:54:40 -0600 )edit

Cool. And I would, but for some reason its only the one definition that causes problems. It is probably the right way to go though.

bwasserm gravatar image bwasserm  ( 2012-08-08 03:58:17 -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


Asked: 2012-08-07 10:19:56 -0600

Seen: 867 times

Last updated: Aug 08 '12