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

How can i code quaternion in lsm6.h library.

asked 2022-01-22 17:00:56 -0500

turkoahmet gravatar image
    imu_msg.orientation.w =A ;
    imu_msg.orientation.x =B ;
    imu_msg.orientation.y = C;
    imu_msg.orientation.z = D;

in my code what A B C D should be ?My imu is minimu9 v5.Lİbrary is lsm6.h.Iwant to visualize it on rviz.i could not similar example in lsm6.h library.could you help please, urgenttt???

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2022-01-23 22:54:00 -0500

cst0 gravatar image

A, B, C and D should be set to the w, x, y, and z quaternion values, respectively.

I think the reason you haven't been able to solve this is because you may not be familiar with what a quaternion is: Quaternions are a method of representing orientation, and they are better than the usual roll/pitch/yaw approach for a handful of math reasons I won't get into here (but you may be interested in the wikipedia page on this). I recommend you read up on resources there to get a stronger understanding of what it is you're trying to do here.

To actually solve your problem, you'll need to take the data from the IMU and convert it from its current data representation into the Quaternion data representation. The tf2 library has some tools for this that should help.

edit flag offensive delete link more

Comments

is there tf2 library in arduino?i am working with arduino mega?

turkoahmet gravatar image turkoahmet  ( 2022-01-24 05:53:03 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-01-22 17:00:56 -0500

Seen: 85 times

Last updated: Jan 23 '22