|
Re: Can I use gyro to drive straight in teleop period?
Another thing I would recommend for teleop driving straight is to put a deadband on your joystick turning amount so that you automatically engage gyro code to attempt to drive straight when your inputs are within a certain range of straight ahead. On a single joystick this might mean assuming straight whenever the y axis is within +-0.2 of zero, on a dual joystick setup it would be when left right differential from mikets' example is within +-0.2 of zero. This helps to avoid drift if you have joysticks that don't perfectly center or if your driver doesn't consistently push straight ahead on the stick when trying to drive straight. That last point is especially pertinent for a rookie since you will have inexperienced drivers and they tend to do this more under match pressure in my experience.
I like to always engage this code when driving and have a button or switch to disable when something breaks. If you have to remember to push a button to engage it many will forget to use the assist button consistently.
__________________
FRC Team 498 (Peoria, AZ), Student: 2004 - 2007
FRC Team 498 (Peoria, AZ), Mentor: 2008 - 2011
FRC Team 167 (Iowa City, IA), Mentor: 2012 - 2014
FRC Team 2662 (Tolleson, AZ), Mentor: 2014 - Present
|