Go to Post FRC for a four year student is a marathon disguises as four sprints. I'd much rather win the marathon than a sprint. - Ian Curtis [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #31   Spotlight this post!  
Unread 09-02-2006, 08:15
Adam Shapiro's Avatar
Adam Shapiro Adam Shapiro is offline
Registered User
FRC #0555 (Montclair Robotics)
Team Role: Alumni
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Montclair, NJ
Posts: 401
Adam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud of
Send a message via AIM to Adam Shapiro
Re: Stupidest Programming Mistakes

How about having a programmer delete PutData as "unnecessary" in a code update 2 minutes before a match?
__________________
Mentor to Teams 555, 1929, and 2070!
Currently working in hardware design at Cisco.
Cornell University DARPA Urban Challenge - http://www.cornellracing.com
Co-Captain Team 555 - 2003,2004,2005
Trust, Love, and Magic
  #32   Spotlight this post!  
Unread 09-02-2006, 11:07
Dillon Compton Dillon Compton is offline
Jack-Of-All-Trades
FRC #1391 (Metal Moose)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Malvern, PA
Posts: 186
Dillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud ofDillon Compton has much to be proud of
Send a message via AIM to Dillon Compton
Re: Stupidest Programming Mistakes

Quote:
Originally Posted by Adam Shapiro
How about having a programmer delete PutData as "unnecessary" in a code update 2 minutes before a match?


...ouch.
__________________
www.metalmoose.com
  #33   Spotlight this post!  
Unread 09-02-2006, 16:56
JugglingSuns120 JugglingSuns120 is offline
Registered User
#1071
Team Role: Programmer
 
Join Date: Feb 2005
Location: Wolcott, Connecticut
Posts: 2
JugglingSuns120 is an unknown quantity at this point
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   Spotlight this post!  
Unread 15-02-2006, 17:21
slade24 slade24 is offline
AKA: Slick Daddy Ellis
AKA: Aaron Schultz
FRC #1370 (Blue Charge)
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Middletown, DE
Posts: 6
slade24 is on a distinguished road
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).
__________________
-- Time is my only enemy --

Middletown Robotics: Home
  #35   Spotlight this post!  
Unread 15-02-2006, 22:30
CmptrGk's Avatar
CmptrGk CmptrGk is offline
Programming Mentor
AKA: Dillon
FRC #0716 (Who'sCTEKS)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Kent,CT
Posts: 212
CmptrGk has much to be proud ofCmptrGk has much to be proud ofCmptrGk has much to be proud ofCmptrGk has much to be proud ofCmptrGk has much to be proud ofCmptrGk has much to be proud ofCmptrGk has much to be proud ofCmptrGk has much to be proud of
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++;
needless to say, the air postion never "moved"
__________________
#14


"Great autonomous mode Dillon."," It hasn't been written yet"
after an Archimedes match


  #36   Spotlight this post!  
Unread 15-02-2006, 22:35
aaeamdar's Avatar
aaeamdar aaeamdar is offline
Post-A-Holic
AKA: Paul Dennis
FRC #1719 (The Umbrella Corp)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Baltimore, MD
Posts: 231
aaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant future
Re: Stupidest Programming Mistakes

Quote:
Originally Posted by Andrew Blair
Last night, tried to get my drive code lookup table to compile. Turns out that I did everything right...except NAME THE STUPID THING!!! Thanks to Alan Anderson for catching it.

Gosh that is funny. When programming in java I've gotten so lost in
Code:
public static final volatile private blah
that I forgot to give it an actual type. I did this:
Code:
public static final theta;
It no like that...

Good thread.

Paul Dennis
  #37   Spotlight this post!  
Unread 15-02-2006, 22:45
aaeamdar's Avatar
aaeamdar aaeamdar is offline
Post-A-Holic
AKA: Paul Dennis
FRC #1719 (The Umbrella Corp)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Baltimore, MD
Posts: 231
aaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant future
Re: Stupidest Programming Mistakes

I had this:

Code:
auto_mode = ~auto_select1 + 2(~auto_select2) + 3(~auto_select3);
Where auto_mode is later used in a switch{case:}, and auto_selectNs are variouss rc_dig_ins.

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);
And it still didn't work. Gee whiz. What is wrong now. It gives me a run-time unexpectedness glitch where auto_mode is calculated to be 246 or some nonsense like that. OK, fixed that by not using the binary complement and instead used the logical complement (in a #define) and it works.

In another one we had:

Code:
printf("Some motor values %d %d %d", 1,2,3);//Whatever
And nothing was printing. Gosh, that sure was weird. Well, it turns out that we failed to import stdio.h (or anything else that gives us access to printfs). And then, to make things worse, the C language is so incredibly stupid that all it gives you is a warning because it's not prototyped. Since we had been using some other methods that weren't prototyped (may have been a few in Kevins Code) those warnings got mushed in with the others.

Thank goodness for Java.

Paul Dennis
  #38   Spotlight this post!  
Unread 15-02-2006, 23:19
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
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.
__________________
Code:
void function(void)
 {
  function();
 }
  #39   Spotlight this post!  
Unread 16-02-2006, 02:50
Calvin Calvin is offline
Registered User
no team
 
Join Date: Feb 2005
Location: Portland OR
Posts: 105
Calvin has a spectacular aura aboutCalvin has a spectacular aura about
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   Spotlight this post!  
Unread 16-02-2006, 12:28
GeorgeTheEng's Avatar
GeorgeTheEng GeorgeTheEng is offline
Former Lord of the Vex
AKA: George Marchant
FRC #0087 (Red Devils)
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2000
Location: Mount Laurel, NJ
Posts: 166
GeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud of
Send a message via AIM to GeorgeTheEng
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.
__________________
George Marchant - Lockheed Martin Engineer & General Nut Case
FIRST Credentials: Team 87 Mentor | Former Director FIRST Vex Challenge
NJ FIRST Planning Committee Member & NJ FVC Committee Member
Philadelphia Alliance Regional Corporate Advisory Board Member |
FRC and FTC volunteer at too many places to list (NJ, VA, DE, PA, NY, Championship)|


"Hi my name is George and I'm a FIRST-aholic. I've been a FIRST-aholic since 2000..."
  #41   Spotlight this post!  
Unread 26-04-2006, 00:58
P1h3r1e3d13's Avatar
P1h3r1e3d13 P1h3r1e3d13 is offline
Unregistered User
FRC #0295
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: San Diego/Granite Bay
Posts: 46
P1h3r1e3d13 is an unknown quantity at this point
Red face Re: Stupidest Programming Mistakes

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   Spotlight this post!  
Unread 26-04-2006, 01:09
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
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
__________________
1139 Alumni

Last edited by Rickertsen2 : 26-04-2006 at 01:22.
  #43   Spotlight this post!  
Unread 26-04-2006, 09:41
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Stupidest Programming Mistakes

Quote:
Originally Posted by Rickertsen2
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

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.
__________________
-
An ounce of perception is worth a pound of obscure.
  #44   Spotlight this post!  
Unread 26-04-2006, 09:46
nehalita's Avatar
nehalita nehalita is offline
Robots are friends
AKA: tagger fanatic
FRC #1345 (Platinum Dragons); FRC# 97 (RoboRuminants)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Ft. Laud, FL
Posts: 870
nehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond reputenehalita has a reputation beyond repute
Send a message via AIM to nehalita Send a message via MSN to nehalita Send a message via Yahoo to nehalita
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.
__________________
"Relativity applies to physics, not ethics." Thank you Einstein
MIT '10

Proud Member of H.I.L.
The PLATINUM DRAGONS are on FIRE!
  #45   Spotlight this post!  
Unread 26-04-2006, 10:36
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 22:30.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi