|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Multiple programs/autonomous routines
Being that we're no longer using banked code, is there an easy way to switch between autonomous routines using functions, or is it best to just re-download code after each match (a side-switch, for example) if we're using dead-reckoning?
|
|
#2
|
|||||
|
|||||
|
Re: Multiple programs/autonomous routines
Personally, I would have a set of functions
//auton check int program = 0; //bit shift digital inputs to program var doAutonomous(program); //auton check //misc funcs #define REGULAR_AUTON 0 void doAutonomous(int program) { if (program == REGULAR_AUTON) regular_auton(); else if... } void regular_auton() { // blah regular auton } |
|
#3
|
|||||
|
|||||
|
Re: Multiple programs/autonomous routines
Will the RC pick up inputs from the OI prior to the match starting so it knows which autonomous mode to use (if we used a set of digital switches at the OI to determine the autonomous code)
|
|
#4
|
|||||
|
|||||
|
Re: Multiple programs/autonomous routines
I wouldn't use OI digital inputs, last year they were cleared and autonomous started with no initial communication from OI I believe. Last year, our team put digital switches on our robot and used that and it worked fine.
Programs per switch 1 2 - 0, 1 2 4 00, 01, 10, 11 3 8 000, 001, 010, 011, ... 4 16 |
|
#5
|
|||
|
|||
|
Re: Multiple programs/autonomous routines
Actually, you could use digital inputs on the OI, as there are two variables, one for autonomous, and one for competition. Communication exists between the OI and the RC, although no outputs may be changed. However, inputs can still be received.
It's better to have the controls connected to the OI, because a situation may occur where you may notice a different setup by the opposing robots (especially during finals, when you don't know which 2 robots are selected, or which side they're on), and you can change your own autonomous immediately. Last edited by Koci : 09-01-2004 at 19:28. |
|
#6
|
|||||
|
|||||
|
Re: Multiple programs/autonomous routines
See, that's what I thought -- I knew that your outputs couldn't be changed, but I thought there was still communication and variables could be changed. that's good news to hear.
|
|
#7
|
||||
|
||||
|
Re: Multiple programs/autonomous routines
Quote:
I want to make sure I understand this point. It seems very important to emphasize. I would be interested to hear more view points in particular. So, PRIOIR TO autonomous mode (i.e. while the robot is disabled), your OI and RC are still communicating and your OI is accepting signals from its inputs and passing those along to the RC? BUT, the RC can not change its outputs? Right? The disabled mode cancels outputs? This seems like a critical point and I'd be interested to hear some folks chime in. Another question, can |
|
#8
|
|||
|
|||
|
Re: Multiple programs/autonomous routines
Yes, this is true. We did it last year, along with many teams. You can store a variable that is based on inputs from the OI, and that can be used during the autonomous running of the program. We had switches on our control board that were used to tell the robot which autonomous program to run. Many teams got much more complicated than we did, and had analog inputs (pots) to have many different autonomous programs.
[edit]I guess I should make references. Page 26 of the Programming Reference Guide explains the competition mode. Quote:
if (competition_mode == 0) and put your code there.[/edit] Last edited by Koci : 09-01-2004 at 22:02. |
|
#9
|
|||
|
|||
|
Re: Multiple programs/autonomous routines
This was functionality that FIRST made clear partway through the build season. At the beginning of the year, it was not believed that you could do this. My point? rules change. Especially year to year. Once the rules are released tomorrow, check and see if you can do this, I wouldnt count on it from the beginning without consulting the rules. If it isnt specified, then we'll just have to ask for a clarification
Good luck all, and let me know if you have any further questions ![]() |
|
#10
|
|||
|
|||
|
Re: Multiple programs/autonomous routines
Rules may change, but this is the way the software works, and FIRST cannot change that mid-season. It is stated in the reference guide that it is functional the same as last year, so unless this is a typo (it has been reworded since last year), you can be quite sure it is still available.
Prior to the game, the auton_mode is set to 0, but competition_mode is also set to 0, and there IS contact between the two. It is only once autonomous has begun that they no longer interact. |
|
#11
|
|||||
|
|||||
|
Re: Multiple programs/autonomous routines
The manual has this to say in the RC Manual is this:
Quote:
Quote:
--Damian Manda |
|
#12
|
||||
|
||||
|
Re: Multiple programs/autonomous routines
Quote:
I think there's a point to clarify here... I'm refering to the time before the autonomous mode when you plug your OI into the driving station and you have live link before the contest begins. I believe that a "disabled" it is set at this time. This disabled bit keeps the bot from moving before the contest starts, right? But, if I understand previous posts from last year, that disabled just means no output at the RC. You do however have inputs from the OI that are passed onto the RC. IF THIS IS TRUE, then you can set an switch to designate an automous program just moments before the game begins as you are setting up your robot at the driver station. THEN once the contest begins and autonomous mode starts, the "disable" bit becomes false, but the auotonomous bit becomes true. Can anyone verify the above? |
|
#13
|
|||||
|
|||||
|
Re: Multiple programs/autonomous routines
The manual says that there is transmission during disabled status:
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Attending Multiple Regionals | WakeZero | General Forum | 11 | 19-11-2003 16:23 |
| Multiple Programs | goegan31 | Programming | 3 | 17-03-2003 22:56 |
| question for teams created among multiple high schools | archiver | 2001 | 20 | 24-06-2002 03:58 |
| 3 teams win multiple regionals! | archiver | 2000 | 0 | 23-06-2002 22:38 |
| Proposal for 2001 - Multiple Leagues | archiver | 2000 | 2 | 23-06-2002 22:18 |