# Orientation from wheel based odometry vs IMU

Hi,

I have run some tests using the jackal and ros indigo. I collected the "x,y,z,w" values for the orientation from the wheel based odometry. These are quaternion representations of the orientation of the jackal.

Similar values are printed for the IMU as well. Here are some values which I logged:

//odometry orientation
[ INFO] [1524638957.013930930]:robotorn:x,y,z,w=0.000000,0.000000,0.037674,0.999290

//Imu orientation
[ INFO] [1524638957.013949804]:robotimu:x,y,z=0.000690,-0.000165,-0.987262


Why are the IMU values negative as compared to those of the odometry? Which should we consider while making our calculations?

Regards, rsmitha.

edit retag close merge delete

You are comparing the values between a quaternion and euler angles ?

( 2018-04-26 07:00:08 -0500 )edit

Hi @Delb, I am comparing quaternions for odometry and imu. I did not capture the'w' value for the imu as I forgot to add it to the ROS INFO list.

( 2018-04-26 07:05:05 -0500 )edit

I find quaternions pretty hard to compare without straight up plotting / drawing them or converting to euler angles. Which one you should use will depend on your application requirements & the quality of the IMU you're using (e.g., is it the onboard IMU?).

( 2018-04-26 07:15:27 -0500 )edit

Hi.@stevejp, I am using the onboard imu.

( 2018-04-26 07:30:23 -0500 )edit

and what is your application / goal?

( 2018-04-26 07:37:01 -0500 )edit

Sort by ยป oldest newest most voted

It's because of how quaternions are maid, here is a little tool to see the evolution of the values of Euler angles and quaternion, you could see that (in Euler angles) for x=y=z=0 you can either have the w=1 or -1 (yet it's the same orientation).

For your calculations you should consider the most precise one. Odometry can be wrong if your robot drift, but usually you combine the wheel based odometry and the IMU to have the best value.

more

Hi @Delb, thanks for the visualisation link. Its great. If I have just the x,y,z values for the imu orientation and I wish to calculate the angle, would it be possible to do so without the 'w'? This is so I can plot orintation change for imu values. Regards, rsmitha.

( 2018-04-26 07:36:17 -0500 )edit

Why don't you have the w ? If the IMU generates a quaternion then you can directly use the functions from the answers of #q50113

( 2018-04-26 07:42:53 -0500 )edit