Autonomous testing question

according to our sources, the user_routines_fast.c would not work for autonomous testing, because we do not have signal from FIRST competition arena to activate the Autonomous part in the user_routines_fast.C. anyone knows how fix the code to test it in user_routines_fast.c?

The Competition Port Pinout Guide at http://www.innovationfirst.com/FIRSTRobotics/pdfs/Competition_Port_Pinout_Guide.PDF shows you how to wire a “dongle” to send the autonomous mode signal to the robot controller.

Several methods:

  1. Build a competition port dongle as noted above
  2. Assign a joystick button or a robot switch to start autonomous, e.g.,

in main.c after Getdata()
 
autonomous_mode = !p1_sw_trig;

With a joystick trigger holding the button could keep it in autonomous and releasing it could immediately stop auto. You’ll need a way to stop quickly.
3) Hardcode a call to your autonomous routine and pull the OI power to emergency stop.

what is going to happen if we change
while (autonomous);

to

while (1)?

The robot will start auto as soon as it’s turned on and run over your programmer.
You can keep it quiet by keeping your OI unplugged while you’re turning the robot on.

well u will have a never ending loop of autonomous… i would NOT advise that. If your robot goes on a rampage, there is no way to stop it. Also, you will not be able to call that function without some outside event, like the trigger stated above, so you will never get into auto mode anyway…

just set your RC’s team number to 0000. This sets in auto mode.

Would the auto mode be completely set on if we set the team number to 0’s, without any programing involved? :confused:

Yep, it will always be on.
You have to tether the robot the first time you change the Team #, and remember the robot will attempt to flee taking your programmer with it.

There are 3 “modes” that the RC can process. It can only be in one mode at a time. The 3 modes are User Control Mode, Automous Mode, and Disabled Mode. In user mode, the Default_Routine() function is called. Any code in this routine is repeated about every 25 milliseconds. The mappings in this file is what links your joystick to motor outputs.
Disabled Mode is a function that disables all outputs on the RC.
All autonomous mode is another function that still allows outputs, but no inputs to be linked to outputs. This is why all the code must be self contained in auto mode, by using counters or whatnot…

When you set a team number, it is setting your robot to run by default in user mode. This will loop indefinitely until an outside event triggers a new call (or the battery dies) When the team number is 0000, the RC interperets that as just another call to the automous mode… so it will always be true (on) There is no need to change the program to test it this way.

Also, if you are using this method and timers in your code… if your code reached until the end of the 15 second auto period, i recomend puting else statements or something else at the end of your code that will set all of your output values to neutral so you dont run someone over.