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

Math operations for geometry_msgs/Vector3

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

raahlb gravatar image

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

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
4

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

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

Comments

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 -0600 )edit

Question Tools

Stats

Asked: 2011-10-17 20:36:10 -0600

Seen: 2,657 times

Last updated: Oct 17 '11