![]() |
Re: multiple switches
Quote:
Quote:
|
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:
|
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 |
Quote:
|
it wont? it DID, im only arguing what happened and happens to me
|
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 :) |
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. |
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. |
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. |
executed auton faster
|
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. |
| All times are GMT -5. The time now is 03:21. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi