|
|
|
![]() |
|
|||||||
|
||||||||
| View Poll Results: What automatic programs do you have? | |||
| dead reckoning (time-based) |
|
47 | 51.09% |
| dead reckoning (other) |
|
32 | 34.78% |
| line tracking |
|
14 | 15.22% |
| line tracking/dead reckoning hybrid |
|
16 | 17.39% |
| stored paths |
|
22 | 23.91% |
| aaa! we dont have any! |
|
9 | 9.78% |
| other/not mentioned |
|
20 | 21.74% |
| Multiple Choice Poll. Voters: 92. You may not vote on this poll | |||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Re: multiple switches
Quote:
Quote:
|
|
#17
|
||||
|
||||
|
I digress.
Switches can be an effective way to implement autonomous mode if you are storing your multiple autonomous programs in multiple program slots. This is how we do it: Code:
auto_selection VAR tempvar3 auto_select VAR auto_selection.nib0 auto_bit1 VAR auto_selection.bit0 auto_bit2 VAR auto_selection.bit1 auto_bit3 VAR auto_selection.bit2 if active_button = 1 then auto_bit1 = auto_select0 auto_bit2 = auto_select1 auto_bit3 = auto_select2 endif if auto_button = 1 OR auton_mode = 1 then select (auto_select) case 0 'joy 1 run 2 case 1 'joy 2 run 3 case 2 'joy 3 run 4 case 3 'joy 4 run 5 case 4 'joy 5 run 2 case 5 'joy 6 run 3 case 6 run 4 case 7 'do nothing... just in case :-) endselect else gosub operator_control endif ![]() |
|
#18
|
|||||
|
|||||
|
Okay, Everytime your robot loads for the competition. IT takes time for the RC to read and interpret/tokenize the code. When I use to have four autonomous programs in the same program, it took two seconds longer to tokenize during the loading period like turning it on time.
it was structured rather similar to randomperson's - Ryan |
|
#19
|
||||
|
||||
|
Quote:
|
|
#20
|
|||||
|
|||||
|
it wont? it DID, im only arguing what happened and happens to me
|
|
#21
|
||||
|
||||
|
Yeah, what he said.
Actually, by loading all of your programs at once you save time because you don't have to recompile and re-load everything at run time.. all you have to do is flip a switch and voila, new program! No loading and crap.. lol, we didn't really use our laptop very much this weekend at all because of this ![]() Idea: post your code so we can see ![]() |
|
#22
|
||||
|
||||
|
Quote:
If you'd like to post the section of your code that was deciding which program to execute maybe we can help pinpoint the problem. |
|
#23
|
|||||
|
|||||
|
The code is identical to randomperson's pretty much word for word.
if it's a certain auton program (rc digital bits) then it runs x from the initialization program I don't know, whatever. I'm just saying from experience, it runs faster for me using less slots and code (auton programs). I see your argument. I see the absurdity in it running slower. But I also see it happening to me. |
|
#24
|
|||||
|
|||||
|
Did your code seem to execute faster after you changed, or did it start executing your autonomous sooner?
Slower execution would probably have been due to debug statements left in the code. Depending on how efficient your debug statements are they will make your code start to miss program cycles after 2 or 3 of them. Just a thought that might help. |
|
#25
|
|||||
|
|||||
|
executed auton faster
|
|
#26
|
|||||
|
|||||
|
If you still have the old code around you might try monitoring delta_t to see if it is greater than 0 while the auto code is executing. It would be easiest to simply save the greatest value delta_t reaches during loops and then either use the OI user_display_mode or a debug statement outside the auto loop after the auto finishes (so the debug slowdown isn't an issue) to display the high value.
From your description of the symptoms it sounds like the separate slot definitely had an additional delay for some reason and the new implementation doesn't have that delay. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pic: 103vs75 Auto | CD47-Bot | Extra Discussion | 2 | 05-04-2003 18:48 |
| picking auto program | Mike375 | Programming | 19 | 03-03-2003 15:47 |
| To all the ladies in the hiz-ous!! lol a quick question | archiver | 2001 | 1 | 24-06-2002 02:12 |
| Auto CAD | Stacy | General Forum | 7 | 10-09-2001 21:25 |