i got a task for which i need to drive a certain distance and move around an object. I finally managed that my robot goes almost straight but i think its enough. But now i gotta tackle the problem how to turn my robot by 90° at certain points. Can someone give me some advise how i can program the turning of the robot? For measurements i got wheel encoders and an IMU but i dont have any experience using the IMU. Thanks you for reading :)


Usually IMUs have only an accelerometer and a Gyro. Gyro gives the angular rates around x,y and z axes. The gyro can help to measure the rotated angle around z axis. But this is not very accurate method since gyro gives the angular rate to calculate the rotated angle by multiplying from the sample time.

$\theta = \omega_z*\Delta t$

Calculating the absolute rotation is not possible unless you use an magnetometer. My personal advice is to use the wheel encoders to calculate the rotated angle using the following method.

enter image description here


Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.