![]() |
Re: EasyC autonomous modes
All I can say is too cool, too elegant, and too late at night.
Thanks for fixing the example. |
Re: EasyC autonomous modes
Can't you also just put a couple of switches right on the robot using the digital in ports. That way they can be read right at the begining of autonomous mode. Rather than risking getting stuck. This is what my team plans on doing. Hopefully it won't have too many bugs to have to deal with.
|
Re: EasyC autonomous modes
Quote:
|
Re: EasyC autonomous modes
Quote:
|
Re: EasyC autonomous modes
Hmm. I attempted to use the code on the first page, after all the bugs were worked out and all, and it wont display to my userbyte on the OI- any ideas?
|
Re: EasyC autonomous modes
Quote:
Code:
while ( !IsEnabled() ) |
Re: EasyC autonomous modes
IS the OI set in the correct mode. Eg when you get set to user mode it should
first display u012 then u000 until you chage modes. |
Re: EasyC autonomous modes
When configuring globals to be either on or off (i.e. only two conditions) such as the "isEnabled" global mentioned above. You might want to instead use a
#define ISENABLED 1 // instead of defining a global //later in the program put #ifdef ISENABLED //put autonomous code here #endif This page is a good tutorial on using MACROS, http://vergil.chemistry.gatech.edu/r...al/basic2.html |
Re: EasyC autonomous modes
Quote:
|
Re: EasyC autonomous modes
I believe that all your creative solutions using !IsEnabled() are actually moot.
Input from the competition port overrides code loops. In other words, even if you have a while(1) in your autonomous code, when your dongle (or whoever's running the match) switches off autonomous, your code drops whatever it's doing, and the Operator Control code starts. Our code has a while(1) in Autonomous() and it works fine. I can't remember if I've tried it in Initialize(), but I have every reason to think it should work the same. Still, test it with a dongle, just to be triple sure. On the other hand, the simple way (the way I used) is to have a switch (or several, or an analog input as described above), set it before you power on the bot, and just read it once (no loops). |
Re: EasyC autonomous modes
The advantage to this is that it allows us to use the pre-existing joystick; something I much prefer. I got this working on last years robot, so it should be fine; no reason to mess with the safety measures in place- redundancy is my friend. I'd rather have something I know that I wrote backing it up than mystical field-happenings.
Thanks for the info, nonetheless. |
| All times are GMT -5. The time now is 23:05. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi