Hey all, I am currently trying to get the gyro to work with our robot and our robot currently drives in tank drive and we’d like to keep it that way, but still be able to use the gyro. I am unsure how to go about programming the gyro with tank drive as I can only find resources about using the gyro with only one joystick controlling the forward and back movements of the robot.
We are using tank drive with two joysticks, one controls forward/back and the other controls left/right
We are using an ADXRS450 to keep the robot going straight while we drive. We use a P-controller that “takes over” the role of the turning joystick when driving straight.
Your threshold for when to use the straight-driving code seems very small at only 1% of the joystick range during normal driving. When I have made similar code in the past I recall making the threshold much higher, like between 5% and 15%.