How to cancel out roll and pitch in IMU?
I bought a quite decent IMU called Bosch BN055. It is a 9-DOF IMU. The thing is, I have a differential drive robot and runs on a flat surface, which means I do not need roll and pitch, only YAW.
I am using robot_localization to fuse odometry vx,vy and IMU roll, pitch and yaw. My robot sometimes creates a vibration which causes my IMU to drift and making my robot to spin and roll.
I have tried to fuse robot_localization with only YAW values but after some time, ROS will throw an error stating that the combined quaternion value should equal to 1 and I get it, as I making roll and pitch to be 0, when IMU thinks it has been rotated in those directions, the YAW values become different.
How can I cope with that?
do you convert yaw in quarternian by yourself or using tf?(if you convert by yourself can you share your code)
@hamid I am using library which you can find here: LINK
that code doesn't convert eurl angle to quarternian if i realize correctly you set imu_msg.orientation.x and imu_msg.orientation.y to zero and publish the msg?am i right?
@hamid the libary publishes imu msg to /imu. Yes, I did that before but after sometime that will give me an error as quaternion should add up to 1