How will Autonomous mode be started

Greetings,
Am helping out on the programming a bit.
How will autonomous mode be initiated ?
Will a signal automatically be sent to the robot from the OI ? Or are we suppose to program a button ?

thanks.

PB_mode… a donle in the competition port deal of the operating interface… assuming you included the PB_mode variable in your code, or you copy and pasted someone else’s code that includes it… You should be set… I would like to know if it’s cool to reuse bits of the PB_mode variable.

Greetings,
how do you simulate the autonomous mode bit being set ? I need this to test
the autonomous mode code .

thanks

Depends -

In the real event, the operator interface will be connected to a FIRST interface via the Competition port. All inputs, digital or analog, will be 127 and 0, respectively.

(Please search for more information on the inputs during autonomous mode in these forums. There is a wealth of information here.)

Also, the auton_mode bit, a bit of the PB_mode byte is sent to the Robot Controller with a value of 1. This byte and bit is defined in the default code.

(Check it out at http://www.innovationfirst.com/firstrobotics)

To tell when autonomous mode has completed, auton_mode will become 0. You can also tell by the (possible) change of values on the Operator Interface inputs.

(This is possible if and only if the driver changes the values on the Operator Interface after the autonomous mode has completed. This is an advanced tactic that some programmers will use to allow the robot to continue in autonomous mode, if they choose to do so. )

In practice, you can use a custom made dongle to simulate the change in the auton_mode bit in the Competition Port.

(This dongle can be found at http://www.innovationfirst.com)

Hope this helps,

To make a switch to turn on autonomous mode, all you have to do is put a switch between pins 5 (autonomous mode pin) and 8 (GND), on the 15-pin competition port.

As far as I can tell, the physical switch connection changes bit6 of the PB_Mode byte, both of which are defined in the default 2003 code, from a 0 (open, automous mode off) to a 1 (closed, autonomous mode on).

If I’m wrong, please correct me.

If controls will read 127, then can you program the robot to do autonomous mode if the controllers are in neutral? Or will this not be an option? Like right now, we have it programmed to do our autonomous mode when the joysticks are not being touched. Will this work?

Thanks a bunch! :slight_smile:

Jenni

This is all kind of overkill. My team programmer wrote a few lines of code that run our auton code when he pushes the joystick trigger. For testing purposes this would be fine
and we could probably levae it that way, triggers don’t get used that mhc. anyway, that is much simpler (and safer) then jumping pins on hte competition port. Enjoy!

Matt Krass

just be careful programming. It would
be quite undesired to be into the
user control period and have the operator accidentally push the joystick button and cause execution of the autonomous code yet again.

if you look in the beginning of the main program loop, you will see an if statement that uses the auton_mode variable. this is what will do the switch between main and autonomous mode. the only way you can change to autonomous mode yourself without the competition port is by setting your team number to 0. i have myself done something else to test autonomous mode. here is the code i have used for this:

to be placed in main program:
if P1_sw_top = 1 &~ 0 then run 2

to be placed in autonomous mode:
if p1_sw_top = 0 &~ 1 then run 1

hope this helps

I have heard (but not tried) setting the team number to 0 on the OI will initiate autonomous mode. I haven’t tried it, but it seems it came from an offical place…

*Originally posted by imjustmatthew *
**I have heard (but not tried) setting the team number to 0 on the OI will initiate autonomous mode. I haven’t tried it, but it seems it came from an offical place… **

Yes, that is true, but it seems like it would be easier to program a trigger button or make an autonomous mode dongle than to be constantly changing dip switches. We made a dongle, and are very satisfied with how it works. It’s much easier to use, and it has a handy disable switch, too.

Our team is planning on (or accidentally doing) waiting till the last minute for stuff (see my signature). i’m a little worried about auton_mode. the code i have set up (but of course not tried yet) is:
if auton_mode = 1 then GOSUB AUTONMODE
where the sub AUTONMODE will have different programs that i can specify before each match. will this do what i want it to do or not??