|
Re: Help in Driving Straight
How severely does it veer to one side?
Does it always veer to the same side?
What are the units of the getDistance methods? There would be a big difference between adjusting your turn if one wheel was ahead of the other by 0.5 feet vs 0.5 inches.
How did you pick your increaseFactor to divide the distance error by 200?
If the increaseFactor is too small your system will not respond quickly enough to compensate for deviations off your desired heading.
For reference, last year our drive straight code would compensate if we were +/- 1 degree off our heading. Our slow wheel's commanded value would be increased by 10%. this yielded good results on our robot at speeds that were pretty close to our top travel speeds.
Last edited by otherguy : 29-01-2014 at 21:23.
Reason: changed response, didn't see you were using two encoders in the code block, makes more sense now
|