Inertial Sensor Yaw

Our team built a holonomic robot for the Tipping Point Competition…the robot does not drive straight. We read to use tank drive to correct, but couldn’t an inertial sensor be used to constantly correct the yaw to keep it going straight? Thoughts on this…we would love input…ALSO if any of you have done this, we would love to see your code as ours returns errors :frowning:

there a are lot of factors that could cause your drive to not drive straight. One of the biggest factors is likely that your wheels are not at positioned correctly/friction causing the wheels to spin at different velocity causing drift. you said your drive was a holonomic drive and that could a few different types of drives. if you built and x-drive the angle that the wheels are at could possibly be off a few degrees.

Back to the original question: yes you can use the inertial sensor to auto correct to the drift but the gyro does drift and that can cause issues. a hard coded drift correction value could work as well and be less complicated. And the use of tank controls allows for the driver to automatically correct for the drift while driving more easily. All of these factors can be put together or used independently to create some awesome fun driver and auton code.


While yes, an inertial sensor could work I strongly prefer to use wheel rotations. If all wheels have traveled the same distance the robot is likely traveling straight. If the left side hast traveled as far, the robot is likely pointing left of center, etc.

I would suggest trying to solve the core issues of your robot not driving strait rather than trying to correct for it.

Pictures of the drive and the code would help a lot.

On an x-drive, it is also important to have even weight distribution across all wheels. If the weight is very uneven, the robot will tend to jerk significantly at the start of a move (especially sideways), and then drift slowly.

1 Like