View Full Version : test autonomous mode
CharlieWilken
25-01-2004, 22:01
How does one test their autonomous code. How do you set your robot into autonomous mode. Then how do you turn off autonomous remotely?
This is what we did last year:
We created a "key" (as in a wire on a keychain). Whenever we wanted to put our robot in autonomous mode, we would close a circuit between the autonomous mode pin and +5v with the ends of the "key." We pulled out the key when we were done.
This is what we did last year:
We created a "key" (as in a wire on a keychain). Whenever we wanted to put our robot in autonomous mode, we would close a circuit between the autonomous mode pin and +5v with the ends of the "key." We pulled out the key when we were done.
my team did this last year too, worked perfectly everytime.
ShadowKnight
25-01-2004, 23:20
we actually wired that circuit to a switch on our oi last year for testing purposes...
Adam Shapiro
25-01-2004, 23:49
Our team created a dongle (basically the same thing) by taking a DB-25 casing and attaching an SPST on the top of it (wiring the same as mentioned above). This allowed us quick usage of the autonomous mode and also made it easy to lend the dongle to others in the pits. I highly suggest this method as it is very easy to build and to use!
I was under the impression that input from the OI is ignored when in autonomous mode. So how did you get it out of auto mode?
Adam Shapiro
26-01-2004, 00:03
How did you get it out of auto mode?
I'm not quite sure what you mean but I'll try to answer:
The dongle was used only to test the autonomous programs so we really didn't have much need to switch out of the mode. Still, if problems did arise, we could simply switch the dongle off and user mode would pop right back up. This became useful at times when program bugs would send the robot scrambling in a random direction on a murderous rampage (which happened more than once)!
One great thing about the OI is that it will read control input during disabled mode. This allows you to give the robot information (such as which program to run) up to the last second before the buzzer. Our team used this to our advantage, allowing us to have 7 autonomous programs (3 switches, binary) that we could choose as we set up the controls and switch quickly if problems came up (we used the last binary position - 0 - as a manual override in the program just in case something went wrong with both the program AND the dongle (quelle catastrophe!).
ShadowKnight
26-01-2004, 00:11
for testing purposes, we wired the switch into the competition port, utilizing the autonomous pin and a ground. if it was a close, the robot saw auton_mode = 1 and it would act based on that. When we flipped the switch off, auton_mode = 0 and it would act as if the 15 seconds was over...That's how were wired our controls for testing. We unplugged our stuff from the competition port when we would go to a match.
Oops, i was asking ShadowKnight.
ShadowKnight
26-01-2004, 00:14
does that answer your question?
Tom Bottiglieri
26-01-2004, 09:19
theres a schematic to make a dongle that connects to the oi and controls the auto mode, disabling the robot, and the channel it runs on here http://www.innovationfirst.com/FIRSTRobotics/pdfs/Competition_Port_Pinout_Guide.PDFPinout Guide (http://www.innovationfirst.com/FIRSTRobotics/pdfs/Competition_Port_Pinout_Guide.PDF)
KenWittlief
26-01-2004, 09:24
best thing to do is to wire up the auton and disable switches as the post above suggested
then you will be using auton mode exactly the same as it will be used at the regionals
if you kludge some special user interface switch and let your own code decide when its suppose to run auton mode
you may end up like many teams last year, who thought they had auton mode working great, but it would not work with the FIRST equipment on the field.
The 'competition port' switch setup is the only way to go.
can it not be as simple as setting the value of autonomous_mode = 1?
(if not mind letting me know why please!)
deltacoder1020
19-02-2004, 23:19
yes, you could just hardcode the if/while statement... but I believe autonomous_mode is reset each getdata(), so you'd probably just want to replace autonomous_mode with 1, instead of assigning it
Pat Fairbank
20-02-2004, 00:39
If you don't have time to do the soldering (or if you're too lazy), setting your team number to 0000 turns autonomous mode on too, if you briefly connect the tether cable between the OI and RC after setting it. You can't turn it off remotely though, since this makes the RC act completely independantly of the OI.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.