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

Math operations for geometry_msgs/Vector3

asked 2011-10-17 20:36:10 -0500

raahlb gravatar image

updated 2011-10-17 20:36:42 -0500

I have an IMU sensor mounted on my robot, but without properly aligned axes. To more get more easily processed data, I want to transform its output so the axes align. This is quite easily done with some calibration and usage of the dot product. However, there seem to be no math operations defined for Vector3 in geometry_msgs.

Is the proper way to do this to create a new vector of Eigen's format, do the calculations and then convert it back to Vector3? As I've understood there's no way to just cast between the types.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-10-17 21:22:32 -0500

As far as I know, there are no math operators for the message types. For many geometry messages there are converter functions in TF. The resulting types are typedefs to bullet types which have many math methods. Here is the conversion method for Vector3 and the according bullet documentation.

edit flag offensive delete link more


OK, I see. Doesn't seem to be that different from using Eigen, but at least it's closer to being a built-in type in ROS. I might stick to using my own implementation of the needed operations for geometry_msgs::Vector3. Thanks!
raahlb gravatar image raahlb  ( 2011-10-17 23:42:10 -0500 )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: 2011-10-17 20:36:10 -0500

Seen: 2,266 times

Last updated: Oct 17 '11