Go to Post Remember to have fun! That's what the FIRST experience should be for you- a lot of fun while doing a lot of learning. - smurfgirl [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
  #1   Spotlight this post!  
Unread 07-08-2006, 15:19
Booger's Avatar
Booger Booger is offline
Registered User
FRC #0637
 
Join Date: Jul 2006
Location: Montville, NJ
Posts: 74
Booger will become famous soon enough
Re: Stupidest Programming Mistakes

i loaded the defualt code from last year, and the robot just started going. It ran into a table and knocked everything over. Luckly it wasnt facing the otherway becasue it would have went down the road.
__________________
Collars up!

637
  #2   Spotlight this post!  
Unread 20-05-2006, 01:00
aaronm_k aaronm_k is offline
Registered User
no team
 
Join Date: Jan 2006
Rookie Year: 2006
Location:  
Posts: 10
aaronm_k is on a distinguished road
Post Re: Stupidest Programming Mistakes

Quote:
Originally Posted by Eldarion
One of the things that keeps tripping us up is that the MPLAB compiler does not follow standard C data type promotion rules.

For example, given the statement below, standard C would promote both data types to integer, then multiply. The MPLAB compiler, however, multiplies a and b as unsigned chars and then sticks the result in the integer value, resulting in an overflow where you least expect it!

Code:
unsigned char a = 127:
unsigned char b = 127;
int result;

result = (a * b);
You can turn on integer promotions by going to "Project" > "Build Options" > "Project" in MPLAB, clicking the "MPLAB C18" tab, and adding "-Oi " to the beginning of the "Use Alternate Settings" text box. (Checking the "Enable integer promotions" check box will NOT work.) Believe me, I had plenty of trouble with this too!
  #3   Spotlight this post!  
Unread 21-05-2006, 00:15
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Stupidest Programming Mistakes

The stupidest programming mistake:

Assuming the programmer is driving.
  #4   Spotlight this post!  
Unread 05-02-2006, 11:14
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: Stupidest Programming Mistakes

Worst ones I've seen on our team:

1. Our variation of "when robots attack", when someone re-routed the shaft encoder harness to where one of the CIM motor chains could suck it in, resulting in one of the shaft encoders zeroing out while the other incremented, causing a wild spiral while folks are falling over themselves to hit the disable switch on the OI.

2. Various spastic responses from leaving the backup battery off the bot and having the motors draw enough current to reset the RC, causing very, spastic results.
  #5   Spotlight this post!  
Unread 09-02-2006, 01:04
Brad Voracek Brad Voracek is offline
.999~=1
FRC #0399 (Eagle Robotics)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Lancaster, CA (SoCal)
Posts: 328
Brad Voracek is a glorious beacon of lightBrad Voracek is a glorious beacon of lightBrad Voracek is a glorious beacon of lightBrad Voracek is a glorious beacon of lightBrad Voracek is a glorious beacon of light
Send a message via AIM to Brad Voracek
Re: Stupidest Programming Mistakes

We've had one major error that took -forever- to figure out.

We had this cubic function for the drive system, since it would increase slower... And it built and all, but when we loaded it an error popped up in the IFI command prompt, all in HEX. It took a while until we realized that victors couldn't take floats @.@

Then we had to change our step(which works very well now, speeds up slowly then stops fast, speeds in reverse slowly but goes to 127 again fast.) from .8 to 1 =P All is good now... also we decided to move our autonomous code to a new file, and leave manual in another... Only to forget to change this
#ifndef __399_Code_h_ in our header file to the name of our Autonomous file @.@ That gave us the same hex error stuff... Oh well! All is good now... Except it seems like our cam is fried. =/... Will be able to test it more tommorow =(

EDIT: After reading tons of the messages here, it seems that those hex errors were actually oversized memory? I doubt we have the new IFI loader so eh... I guess maybe we can go back to our cubic. This works good though, so we'll see.

Last edited by Brad Voracek : 09-02-2006 at 01:20.
  #6   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
  #7   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
  #8   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.
  #9   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
  #10   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


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 19:07.

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