![]() |
How to get the robot to stop...
Does anyone know how to get the robot to stop in autonomous mode with out using script?
|
Re: How to get the robot to stop...
I'm not sure if you're trying to stop the robot using software (as in, if we run into something stop) or if you mean that you want to be able to kill the robot in mid-stride because you can tell it's just about to rip its arm off. :D
For the first thing, you just have to set the variables pwmXX and pwmXX to 127 in your code, where the two XX is where your motors are hooked up. For the other option, which only works when you're on your practice field, you build a dongle, which is basically just a few stiches which connect/disconnect a few pins on the competition port on the operator interface. I'm not sure right now exactly where those are, but there is lots about them here. Do a search. :) |
Re: How to get the robot to stop...
while(1);
Works every time! :D |
Re: How to get the robot to stop...
Quote:
Ok, anyways, back to the making the robot stop. In autonomous mode, what I find that works best is at the end of the loop, use Quote:
Quote:
Quote:
|
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. |
| All times are GMT -5. The time now is 09:23. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi