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

error with package imu_9_dof

asked 2013-05-01 20:44:18 -0500

Gisela gravatar image

updated 2014-01-28 17:16:24 -0500

ngrennan gravatar image

I'm new to ROS and i'm trying to do a project starting with the imu sensor stick. While trying to convert the raw data (raw, pitch & yaw) from the IMU 9dof sensor to ros data, I've got a problem with this line:

   imu.orientation.x = tf::createQuaternionFromYaw(0.0);

And this derived the error:

   error: cannot convert ‘tf::Quaternion’ to ‘geometry_msgs::Quaternion_<std::allocator<void> >::_x_type {aka double}’ in assignment.

Any help is appreciated. Thanks :)

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2013-05-02 05:02:59 -0500

Something along these lines should work:

tf::Quaternion q = tf::createQuaternionFromYaw(0.0);
tf::quaternionTFToMsg(q, imu.orientation);

See tf::quaternionTFToMsg().

edit flag offensive delete link more

Comments

Thank you! Right now I am working my imu sensor stick with an Arduino board. I've got the data from the imu printed out (roll, pitch and yaw). However I have to convert the raw data(roll, pitch and yaw) to ros capatible data and publish these data. So do you have any suggestions? Thank you again! :)

Gisela gravatar image Gisela  ( 2013-05-02 16:30:10 -0500 )edit

Question Tools

Stats

Asked: 2013-05-01 20:44:18 -0500

Seen: 198 times

Last updated: May 02 '13