|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
What follows is a rather amusing idea from Joe Hall, one of our teams seniors. You guys will probably be amused:
________________________________________ I say we name our autonomous programs after soviet dictators.. Lenin: Bravely ventures forth to crush the capitalist ball trigger and return the people's balls to their rightful status, then trips the main circuit breaker... Stalin: In a series of coordinated five second plans, proceeds to pop the bonus ball, flip over the goal, and then works on shoving the other robots off of the field, even the friendly ones... Malenkov: Forcefully protests the entire robotics competition, works for three seconds, then mysteriously shuts down the robot and disappears... Kruschchev: Ignores any attempt at line following and simply rushes headlong into the opponent's zone, only to crash into the wall and tip the bot over.. Brezhnev: Goes over and knocks the ball off quickly and effectively, spends time gathering balls, then proceeds to flip the teammate's robot over for subversive behavior... Andropov: Wanders around the playing field boldly and stridently, albeit without purpose. Gradually slows in speed until the robot is no longer capable of motion by the end of autonomous... Chernenko: Drives back to the pit, searches for a keg... Gorbachev: Continuously drives into wall, while encouraging teammates to do whatever they wish... ________________________________________ This sounds quite offbeat, but we had very unique names for our autonomous programs last year as well. Some examples were "Operation Free Iraq" and "Electronic Couch Potato". How do you guys name your autonomous programs? ![]() |
|
#2
|
|||||
|
|||||
|
Re: Autonomous Program Names
One prog name we're gonna have(and code before the comp) is "boogie down"
|
|
#3
|
|||
|
|||
|
Re: Autonomous Program Names
#define GREAT mao
mao() { LEAP_FORWARD(GREAT); } ____________________________________________ The above segment is definately going to be in our code. I think we might have the LEAP_FORWARD function contain all the critical code for driving, and have main() call mao(). Something like that. Another segment from our code so far: #define ONE 2 #define TWO 3 IF (ONE != TWO) { /* Main loop goes here */ } And a freshman on our team has written these lines: RETURN_OF_THE_EVIL_MENTALLY_DISTURBED_TAX_COLLECTI NG_POTATO_CARROT_HYBRID = 0; and #define OUCH pain #define unneeded_variable NULL /* This should upset the compiler*/ #define GEORGE BUSH #define AL GORE #define BILL CLINTON #define LYNDON LAROUCHE #define I_AM NOT_DRINKING_SODA #define YOU_WILL DELETE_MOST_OF_THESE_VARIABLES #define DEAN HOWARD ___________________ If the code has personality, all is well. Seriously, all our code is well commented and human readable, except the code in our interrupts. That code is as fast as possible (to the point where it requires at least 2 people working at it to understand it, but it is three lines long) And our line-tracking code is exactly 2 lines long. =) |
|
#4
|
||||
|
||||
|
Re: Autonomous Program Names
Quote:
Here are some wonderful (and iambic pentameteric) samples: Timer interrupt, anyone? /* When I do count the clock that tells the time */ Auton mode; first drive full speed forward! /* O! what excuse will my poor beast then find, When swift extremity can seem but slow? */ Encoders and PID control make for some nice driving: /* Be where you list, your charter is so strong That you yourself may privilege your time To what you will; to you it doth belong Yourself to pardon of self-doing crime. */ For static or global variables: /* Your name from hence immortal life shall have, Though I, once gone, to all the world must die: */ And, in honor of the BASIC stamp of years past, here's the last sample I'll give (afterall, you might reverse engineer my code if I offer too much )/* Thou art as fair in knowledge as in hue, Finding thy worth a limit past my praise; And therefore art enforced to seek anew Some fresher stamp of the time-bettering days. */ See, I'm not obsessed with programming. I do have a literary side! (And with 154 sonnets, and other poems to boot, you can imagine that this is but a small sample. W00t!) |
|
#5
|
||||
|
||||
|
Re: Autonomous Program Names
I decided to let a crazy German run amok in my code this year.. It beats the mute from last year that didn't explain anything at all
Code:
void normalize_motors(unsigned char left, unsigned char right) {
// Vait!! Dat's der vrong direction
// -- Inverse the polarity if required
left = (INVERT_LEFT ? 255 - left : left);
right = (INVERT_RIGHT ? 255 - right : right);
// Vut da hell ist up wiv dat der blinkin lighten
// -- Keep the controller from resting by stopping the magic word
left = (left == 255 ? 254 : left);
right = (right == 255 ? 254 : right);
// Vee vill tell das utters vhere vee vent
// -- Keep this information, it may be useful
left_reverse = (left < 127 ? -1 : 1);
right_reverse = (right < 127 ? -1 : 1);
// Und zee motors spin vround und vround
// -- Final output goes to motors
Generate_Pwms( 127, 127, left, right);
LEFT_MOTOR = right;
RIGHT_MOTOR = right;
}
|
|
#6
|
||||
|
||||
|
Re: Autonomous Program Names
ha! i like both the german and the poet
![]() |
|
#7
|
|||
|
|||
|
Re: Autonomous Program Names
for some odd reason, i decided to use wierd variable names in our filtering code.
the variable to refer to the pwm is "watermelon", and the one to refer to the joystick is "napalm"... kind of funny seeing things like: if ( (watermelon - napalm) > (p2_wheel / 10) ) ... |
|
#8
|
|||
|
|||
|
Re: Autonomous Program Names
This thread is hilarious.
I would participate in similar obfuscatory antics, but I'm the only person on my team who can do the programming, and I'm hoping to keep my code fairly self-explanatory and well-commented so that my freshman apprentice can carry on in my stead after I graduate. It's really a shame - properly obfuscating code is an underappreciated art. |
|
#9
|
||||
|
||||
|
Re: Autonomous Program Names
You guys are hysterical! Thanks again for a great laugh. Wow, best thread I've seen yet. Maybe I'll start naming all of my variables after Toronto Maple Leafs players now. The really slow motor speed will be JYRKE_LUMME. The super-fast speed will be MATS_SUNDIN and the game-saving kick-$@#$@#$@# strategy mode will be a call to Ed_Belfour(). And whenever we get in a pushing match with another bot we'll just call in Tie_Domi() to sort things out...
![]() |
|
#10
|
|||
|
|||
|
Re: Autonomous Program Names
Last year we named our left and right programs NOOPS and KROF...now start figuring out which was which!
Also, I too cannot make strange names. However, the sonnet thing sounds like a fun idea. Then when I am gone, the others can learn through sonnets. Its shakespear and robotics...come together! |
|
#11
|
|||||
|
|||||
|
Re: Autonomous Program Names
I wrote this compressor control code after playing a few too many Zelda games. My students found it very amusing and it is actually in the robot (and works quite well, debounce helps).
Code:
/*******************************************************************************
* FUNCTION NAME: Magic_Wind
* PURPOSE: Creates magic wind (air pressure) to blow into (confidential info edited out) of the robot.
* Minimizes rapid wind changes (debounces).
* CALLED FROM: Process_Data_From_Master_uP
* PARAMETERS: none
* RETURNS: void
*******************************************************************************/
//constants
#define Change_in_Wind 15
//aliases
#define Rumble_Pak relay1_fwd //compressor (until fuse blows)
#define Rumble_Gnd relay1_rev //compressor (always 0, unless
//I choose to decompress the bot)
#define Wind_Waker rc_dig_in18 //pressure switch
//global var
unsigned char Old_Wind_Waker = 1;
unsigned char Wind_Timer = Change_in_Wind;
void Magic_Wind()
{
if (Wind_Timer == Change_in_Wind)
Rumble_Pak = !Wind_Waker;
else if (Wind_Timer < Change_in_Wind)
Wind_Timer++;
if (Wind_Waker != Old_Wind_Waker)
Wind_Timer = 0;
Rumble_Gnd = 0;
Old_Wind_Waker = Wind_Waker;
}
Last edited by The Lucas : 17-02-2004 at 00:34. |
|
#12
|
||||
|
||||
|
Re: Autonomous Program Names
I point you all to http://www.ioccc.org/ - particularly, to:
http://www0.us.ioccc.org/2000/anderson.c (http://www0.us.ioccc.org/2000/anderson.hint) http://www0.us.ioccc.org/1996/gandalf.c (http://www0.us.ioccc.org/1996/gandalf.hint) http://www0.us.ioccc.org/1994/smr.c - you have to read the hint file for this one... (http://www0.us.ioccc.org/1994/smr.hint) http://www0.us.ioccc.org/1984/mullender.c - this one is insane, read the hint file to find out what the heck it is (http://www0.us.ioccc.org/1984/mullender.hint) |
|
#13
|
||||
|
||||
|
Re: Autonomous Program Names
I don't think all this obsfucation is too good for actual robot code (in good fun, perhaps, but not for production code). I try to keep my creativity confined to the blissful realm of comments (non-compiled) -- err.. mostly, anyway. If something goes wrong (when doesn't it), staring at watermelons and other fruit all day might not help too much in troubleshooting ... variable names should be descriptive -- e.g., our drive motors last year had the variable name '[lr]chalupa' (for the harder to spell chipahuah ... well, yeah, hence the easier to spell consistently variable name).
With my comments, if you understand why they are there, it is a sure sign you understand the code (well, almost). I was thinking about writing the code in iambic pentameter (or at least composed of iambs more likely) -- but having to end most lines with semi-colon, or the frequent open parentheses, close square bracket, tilde carret, combinations made it difficult. Plus, my comments were added so that non-programming types can enjoy the code and perhaps understand it -- something obsfucation tends to decrease the odds of. But it does make one ponder. What if shakespeare were a programmer? (Much apologies to my english teacher; I can only imagine how her face must be writhing now, considering such heresy as this.) (Oh, and to the humour impaired, strict style programmer out there, my tongue is thoroughly lodged in my cheek as I write this.) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A better autonomous method.. | randomperson | Programming | 4 | 24-02-2004 18:02 |
| how to add steps in the provided encoder program for the edu | Zaramel2002 | Programming | 3 | 11-02-2004 08:35 |
| What type of autonomous mode program are you using? | SilverStar | Programming | 1 | 21-01-2004 18:48 |
| autonomous mode problem on field | Chris_C | Programming | 17 | 26-03-2003 19:11 |
| Fried program slots? | Jeff Waegelin | Programming | 18 | 19-03-2003 18:08 |