Log in

View Full Version : Auton Mode simple question


Morgoth
06-02-2003, 17:04
All right, from what I understand before the match the inputs will be this:

comp_mode = 1
auton_mode = 0

then when autonomous mode is engaged it will change to:

comp_mode = 0
auton_mode = 1

and after the match is over it will be:

comp_mode = 1
auton_mode = 0

So if I put code in my robot like this:

autonloop:
if (comp_mode = 0 AND auton_mode = 1) then
'whatever you want it to do during autonmode
goto autonloop:
endif


then you shouldn't have to worry about timing assuming that you can take your ques off of the comp and auton variable changes.

Would this work?

n[ate]vw
06-02-2003, 17:37
search for comp_mode, but I'm pretty sure comp_mode is set to 1 whenever the robot is on, so to speak.

Morgoth
06-02-2003, 18:55
But would it be legal? (changing that is a quick fix)

rust710
06-02-2003, 19:09
To tell you the truth, there are not to many rules in software except that it must work and teams are responsible for any problems with it.

Morgoth your code look correct too.

Morgoth
06-02-2003, 22:30
Thanks, now I don't have to worry about the timing.

n[ate]vw
09-02-2003, 00:00
Actually, Team Update #11 changed these bits

Before match - comp=1,auto=0
During autonomous - comp=0,auto=1
During human driver - comp=0,auto=0
After match is over - comp=1,auto=0

Note that 'comp' and 'auto' are abbreviations for actual variable names.

So what you originally said was correct. Sorry about that.

Carl Owenby
09-02-2003, 01:17
Here's the autonomous code that we are using. It seems to work. You are welcome to use it as you see fit.

I turn the Robot Controller's Basic Run LED off when the Competition Control is disabled, turn it on during the Autonomous Robot Control period, and make it flash during the Operator Control period. This gives me an indication on the Robot Controller similar to the Competition Control indicator on the Operator Interface.

If comp_mode = 0 then Relay_Control
'Competition Control is disabled
Out7 = 0 'Basic Run LED off when Competition Control disabled
Goto End_Control

Relay_Control:
'Competition Control is enabled
relay3_fwd = rc_sw3 'Air compressor on when pressure switch closed - Green
relay3_rev = 0 'Disable Relay 3 reverse function

relay8_fwd = 1 'Rotating light on when Competition Control not disabled - Green
relay8_rev = 0 'Disable Relay 8 reverse function

If auton_mode = 0 then Oper_Control
'Game is in Autonomous Robot Control Period
Out7 = 1 'Basic Run LED on during Autonomous Robot Control Period

'ADD OTHER AUTONOMOUS PROGRAM CODE HERE

Goto End_Control

Oper_Control:
'Game is in Operator Control Period
Toggle 7 'Basic Run LED flashes during Operator Control Period
relay1_fwd = p1_sw_trig 'Left Index - Lower Left Arm - Green
relay1_rev = p1_sw_top 'Left Thumb - Raise Left Arm - Red
relay2_fwd = p2_sw_trig 'Right Index - Lower Right Arm - Green
relay2_rev = p2_sw_top 'Right Thumb - Raise Right Arm - Red

End_Control:

Hope this helps...

Lloyd Burns
10-02-2003, 10:10
Originally posted by n[ate]vw
search for comp_mode, but I'm pretty sure comp_mode is set to 1 whenever the robot is on, so to speak.

No, comp mode is 1 only when the robots are disabled before and after the 2 minutes.

If the auton_mode is 1 at some time during the match, and comp_mode is turned on (can you say DQ?), auton_mode cannot remain 1. When the comp_mode is switched to 0 again, auton_mode goes to 1. (I used a New Yellow Dongle.)