|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#31
|
|||||
|
|||||
|
Re: Stupidest Programming Mistakes
How about having a programmer delete PutData as "unnecessary" in a code update 2 minutes before a match?
|
|
#32
|
|||
|
|||
|
Re: Stupidest Programming Mistakes
Quote:
...ouch. |
|
#33
|
|||
|
|||
|
Re: Stupidest Programming Mistakes
Well our "programming" errors tend to really not be programming errors at all. One of the more frustrating ones we had this year happened a couple weeks ago. We were testing some code for gyros we are using. Well after two hours of pouring over the code trying to figure out why our printf with the variables wouldnt work we realized that we never tethered the OI to the the robot controller.
|
|
#34
|
|||
|
|||
|
Re: Stupidest Programming Mistakes
My associate programmer decided to add Limit_Mix calls to the equations for joystick input / pwm output. He uploaded the code, but before we tested it he left, and took with him the updated code files (when I asked to get a copy, he uploaded only the .hex file onto my computer for some reason). Apparently he didn't read the Limit_Mix function correctly, because when we fired the robot up and began testing the ball launcher, it started spinning backwards!
In the dilemma that ensued, we reversed the polarity of the motor to get it to spin correctly (though we didn't know what was the original cause at the time). The launcher worked, but then we noticed its speed couldn't be adjusted. Upon reaching home, I looked at the code (we post it onto a team wiki) and found... lo and behold, he forgot to add " + 2000" to the Limit_Mix calls. After fixing this error, I realized how lucky the team was to have remembered to take the drivetrain fuses out before testing the launcher -- all functions calling Limit_Mix were being returned as 0 (FULL REVERSE!). We almost had a mass murdering robot (at least this years robot doesn't have a huge arm like last years -- now that would have been bad). |
|
#35
|
|||||
|
|||||
|
Re: Stupidest Programming Mistakes
just yesterday i made an incredibly stupid mistake
Code:
if(TempCount4BA <= 38)
{
BALL_MOVER = 1;
}
else if((TempCount4BA > 38) && (TempCount4BA <= 78))
{
BALL_MOVER = 0;
TempCount4BA = 0;
}
TempCount4BA++;
|
|
#36
|
||||
|
||||
|
Re: Stupidest Programming Mistakes
Quote:
Gosh that is funny. When programming in java I've gotten so lost in Code:
public static final volatile private blah Code:
public static final theta; Good thread. Paul Dennis |
|
#37
|
||||
|
||||
|
Re: Stupidest Programming Mistakes
I had this:
Code:
auto_mode = ~auto_select1 + 2(~auto_select2) + 3(~auto_select3); Can someone spot the error there? Yeah, 2() is not a valid method. So I changed it to this: Code:
auto_mode = ~auto_select1 + 2*(~auto_select2) + 3*(~auto_select3); In another one we had: Code:
printf("Some motor values %d %d %d", 1,2,3);//Whatever
Thank goodness for Java. Paul Dennis |
|
#38
|
|||
|
|||
|
Re: Stupidest Programming Mistakes
How about spending an hour trying to decipher a run-time error and systematically commenting all of our added code up to that point, only to later find we were compiling with the 2005 FRC settings instead of 2006?
Oh, and this isn't really a programming error, but I still think it's up there as stupid. In our third or fourth practice match last year, our robot suddenly started smoking out on the field. We had used a large ribbon cable to wire the camera and dozens of switches throughout the robot for use in autonomous mode to sense and pick up tetras, and cap them, which had been working perfectly. As it turns out, several of the spare wires, which was about half of the cable, that had been cut off from removed sensors and never removed from the electronics, and that included several five volts and grounds, had brushed up against the frame, which, simply put, melted the entire cable and fried our camera. |
|
#39
|
|||
|
|||
|
Re: Stupidest Programming Mistakes
I decided to make life easier and write functions, and reuse them through out the program... Last night I spent 2 hours trying to figure out what was wrong with the functions, later I discovered that I forgot to include them in the user_routines.c
|
|
#40
|
||||
|
||||
|
Re: Stupidest Programming Mistakes
During the stack attack game, in Atlanta, we had to change our autonomous code. I had a brain fart and missed the fact the motors were moving in different directions on left and right sides. The robot was supposed to move forward for x seconds. Instead it looked like it was dancing as it spent all autonomous mode spining around.
![]() |
|
#41
|
||||
|
||||
|
Originally our drive motors were hooked up such that 255 on both sides made the bot drive backward, because the person wiring them didn't know what the polarity should be. At this point I was using EasyC's Tank command to drive the bot, so I told the electronics people not reverse the wiring, because it was easier for me to just check "Invert direction" in EasyC.
My (yet untested) autonomous code, however, used PWM commands, which I had already set to numbers greater than 127 to drive the bot forward (logically). For the longest time, I couldn't figure out why it drove backward in autonomous.... |
|
#42
|
||||
|
||||
|
Re: Stupidest Programming Mistakes
Earlier today i was confounded with a mysterious bug in my php code. No matter what i did, i couldn't get it to work. After exhausting everything i could possibly think of, i spent another 15 minutes scouring the php manual thinking my bug might be due to an obscure security permissions issue. Well, it turns out I was uploading my code to the wrong server. I felt pretty dumb as i realized i fixed the bug half an hour ago.
------------------------------- edit ---------------------------------------- At regionals i had block of code like: ... if(condition) //do something ... which i later changed to : ... if(condition) //do something //do something else without adding the brackets. I tend to do that often. In any case it caused out robot to automatically aim at people level and autofire/load until it ran out of balls Last edited by Rickertsen2 : 26-04-2006 at 01:22. |
|
#43
|
||||||
|
||||||
|
Re: Stupidest Programming Mistakes
Quote:
This is an EXTREMELY common mistake. In fact, most companies' coding standards require to use braces {} even if there is only one line of code in the code block. The reason for this standard is to aviod the bug you speak of. We mention this in our Advanced Programming presentation at the FIRST Robotics Conference that we presented last year (and will be presenting again at 3:00 tomorrow. It's good that you finally caught it. I would definitely suggest always using braces. |
|
#44
|
|||||
|
|||||
|
Re: Stupidest Programming Mistakes
How about I made a new program during Florida Regional that did something simple for a few seconds and then was supposed to stop. I forgot to set the pwms to neutral. It kept going. That flipped our robot.
|
|
#45
|
||||
|
||||
|
Re: Stupidest Programming Mistakes
stupidest programming mistake I ever made
when I was in college I took a course in the language LISP. This language is all functions, and you can define or change the definition of any function, even the core default ones built into the language. I was entering code on a terminal at the computer center, and the terminal wacked out for a second. I thought the mainframe was crashing so I typed EXIT <return> which is how you get out of the LISP program space. But then the terminal was ok, it did not exit, it just kept running. So I finished up my project, printed the listing and entered EXIT <return> and nothing happened - I was still in LISP - it wouldnt stop running. Then I realized just before the terminal wacked out I was defining a new function, so what I had really done was enter Define EXIT <return> which in LISP means: define the function 'EXIT' to be nothing! I had to sit at the terminal for 30 minutes to wait for the mainframe to timeout my link and kick me off. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming Vex w/ MPLab | dababyjebus | FIRST Tech Challenge | 27 | 25-04-2008 09:11 |
| Programming - Getting Started | Mark McLeod | Programming | 80 | 16-04-2008 23:37 |
| VEX programming | Gene F | Programming | 14 | 08-08-2006 22:21 |
| Suggestion for Delphi Programming Posts | Chris Hibner | CD Forum Support | 1 | 27-07-2005 10:02 |
| Robot Programming Education | phrontist | Programming | 11 | 03-05-2004 07:32 |