Target tracking/centering converted to tank drive: help?
Since our robot is driven with tank drive, we had to convert NI's robot centering code from arcade drive to tank drive. It is not working right now, so we would appreciate if you could help us out...
The code uses the camera and gyro to center the robot with the camera, as you may know. But it sends out one value for the X axis of an arcade drive robot. So I took that value and made 2 out of it for each side of the drive. See my logic for negating one of them in the picture of my code.
Unfortunately this doesn't seem to work, as it turns in the wrong direction. When I negated the other side of the drive instead, it still turned in the wrong direction.
By the way, I multiplied the initial value by .5 because the robot was turning too fast, kept overshooting, and swaying side to side. But after this, it started acting weird.
Thanks for any of your help!
|