0
$\begingroup$

Rosanswers logo

I am trying to create a geometry_msgs::Quaternion from two other (to create an Odometry message). I've found that tf::Quaternion is a btQuaternion but it is not a geometry_msgs one. I would like to know which is the difference and how can I work if I only have geometry_msgs::Quaternion inputs and outputs. Thanks!


Originally posted by martimorta on ROS Answers with karma: 843 on 2011-07-19

Post score: 8

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

They represent the same data. There are different libraries which support native processing of each of them.

There are conversion methods such as to and from message datatypes for your convenience.


Originally posted by tfoote with karma: 58457 on 2011-07-19

This answer was ACCEPTED on the original site

Post score: 12


Original comments

Comment by martimorta on 2011-07-20:
Thank you !

Comment by mikepurvis on 2013-11-14:
What's the method for the geometry classes in tf2? I found my way to tf2::convert, but that doesn't seem to do quite the right thing.

Comment by NickSpeal on 2014-01-27:
Hi can you please update the broken links?

Comment by tfoote on 2014-01-27:
I've updated the links.

$\endgroup$
0
$\begingroup$

Rosanswers logo

As a noob i always are happy if a "nice" answer is provided. One, that can be copy-pasted. Because most likely someone will find this question when searching for a solution for a similar problem. So, if i'm correct, this should do the required trick:

Both ways this is needed at the very beginning of the code:

#include <tf/transform_datatypes.h>

msg -> TF:

 quaternionMsgToTF(quat_msg , quat_tf);

tf -> msg

 quaternionTFToMsg(quat_tf , quat_msg);

Basically this is exactly what the answer above includes, just as a line of code for everyone who isn't (jet) able to read the code provided by the link.


Originally posted by -LD- with karma: 135 on 2018-08-31

This answer was NOT ACCEPTED on the original site

Post score: 8

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.