View Single Post
  #5   Spotlight this post!  
Unread 08-01-2013, 14:43
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Random autonomous

You can do this. But you should not make it random, I used C++ last year, and programmed it so that by holding a single button on the joystick during disabled mode, the robot would select different routines to run in autonomous. The driver station had a text output describing the mode.

It was indeed very useful/effective. We could switch between shooting 2 balls from the key, shooting 2 and tipping the bridge, driving up to the fender and shooting 2 balls, shooting 4 balls, or feeding balls to an alliance member.

It made life easier to be able to switch modes without a reprogram, the only thing to watch out for is if your robot gets reset, or the field is reset, you have to re-select the mode (it's a good idea to use your preferred mode as the default).

Here is a link to my main source code file: https://github.com/TeamExcel/Project.../Robot2012.cpp
Line 489 shows the switching logic.
Line 420 resets the mode when the robot gets disabled.
Line 665 shows the switching between autonomous cases during running.

Last edited by DjScribbles : 08-01-2013 at 14:44. Reason: forgot to add the link