|
Re: How to get the robot to stop...
Last year my team (S.P.A.M. #180) ran into a serious problem during autonomous. If we ran into something and the robot didn't fix itself, we would continue driving forward and start to burn holes into the carpet. If you have some sort of motion sensor (be it an accelerometer or something equivalent) have a counter going that adds 1 every loop. Each time the sensor returns data, have it zero the counter. So if the sensor doesn't return anything (I.E. you're not moving) then the counter will count to whatever you have set as the max. When it reaches the max, set the motors to neutral (127). This bit of code kept us from being disqualified for field damage for at least five matches during one regional.
That may not be exactly what you're asking for, but its good none-the-less.
__________________
Steven Buss
"Far and away the best prize that life offers is the chance to work hard at work worth doing."
-- Teddy Roosevelt
|