Go to Post More inspired students, more community involvement, less drain on the mentors... Sounds pretty swell to me! - Karthik [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-04-2008, 17:19
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Silly Programming screw ups (funny)

Quote:
Originally Posted by Water Bandit23 View Post
Code:
autonomous_mode = p2_sw_aux1;
I am NOT a programmer, so what does that mean? I really hate programming, its confusing!
It replaces the field control system's "autonomous mode" signal with the state of a switch on the operator console. This has two results. First, the robot will not run its autonomous/hybrid mode routine when the field tells it to. Second, the robot will run that routine any time the switch is activated.

This line of code was inserted into a file which contains prominent warnings that it is not to be modified. Some of us programmers know the reason for the warnings, and know that some modifications are "safe". We just fail to clean up after ourselves sometimes.

Oh! That reminds me of my silly programming mistake this year. Our prototype drivebase was built with Mecanum wheels and four independent drive motors, but we settled on a six-wheel skid steer system for the competition 'bot. I decided it was "safe" to leave the strafe function in the code, since we went with y-cables to the drive motors and would thus never be commanding the paired motors to different speeds. Because of the choice of pwm outputs, pushing the joysticks from side to side would end up making the 'bot turn in the expected direction, so I figured we'd be okay with it.

In the pit at Atlanta, after replacing a Victor, we suddenly started having extreme difficulty with the joystick centering. Everything was calibrated properly. The dashboard data told me the joystick trim was perfect. The telemetry from the robot told me both the steering and speed command values were zero, yet the Victors were buzzing and the wheels were turning slowly. After puzzling over it for a very long time, eventually I noticed that the x axis trim was not perfect. Setting it to center made everything fine again.

I immediately changed the code to ensure that the strafe command value was always zero. The speed/steer/strafe mixing is still there, however.
  #2   Spotlight this post!  
Unread 22-04-2008, 17:50
mgreenley
 
Posts: n/a
Re: Silly Programming screw ups (funny)

I'll contribute with probably my least serious, and most funny programming error I've encountered (outside of FIRST, but we were working in C/C++).
My freshman year, I took an introductory computer science class, and our final project was to design and code a remake of Tetris. We've been working on this project for a little while and it seems as if all the major flaws (that we found) were out of the code. Our team leader maintains this Windows independence, and will only work on his laptop, or, if he has to, in notepad (since MS Visual Studio is "evil" in his eyes). We finish work on the code, and GUI, compile everything, and...it doesn't work.
Try again...
...And it still doesn't work...
...We decide to each look over our parts of the code since the error messages were being less than helpful in figuring out why the code wasn't working...
...Try again...
...Yet another failure...
...Our experienced programmer gives up, calls it a day and checks in the code. I check it out for the rest of the team to work on for a little bit, open MS Visual Studio...
...And it immediately highlights the little " /* " at the top of the page that the senior team member forgot to delete when he took out comment header that described the beta process we had gone through.


We had inadvertently, commented out our declarations and main() since the next instance of a " */ " was below the code. We had used // comments everywhere else.


Proving that notepad, while incredibly useful, is not always the best program to use.

Last edited by mgreenley : 22-04-2008 at 17:54. Reason: Making a grammatical fix.
  #3   Spotlight this post!  
Unread 23-04-2008, 18:33
ExarKun666's Avatar
ExarKun666 ExarKun666 is offline
Ben Error/MC Ben/NC Ben
AKA: Ben Kellogg
FRC #2429 (LCEC)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: La Caņada, CA
Posts: 208
ExarKun666 is an unknown quantity at this point
Send a message via AIM to ExarKun666 Send a message via MSN to ExarKun666 Send a message via Yahoo to ExarKun666
Re: Silly Programming screw ups (funny)

One of my countless screw ups as a rookie coder was when I was coding for the encoders at one put I changed the sign one positive and one negative, since it was a tank drive, which is logical, and I turned it. First mistake was I left the cable in so it bulled the laptop, but I luckily caught it, and second it span in really fast circles.
__________________
Ben Kellogg




Team Sites: [LCEC Site] [FRC/FLL Site] [LCEC Blog]
  #4   Spotlight this post!  
Unread 24-04-2008, 01:30
mcf747 mcf747 is offline
Registered User
AKA: Matthew Forman
FRC #0190 (Team 190)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Worcester, MA
Posts: 66
mcf747 has much to be proud ofmcf747 has much to be proud ofmcf747 has much to be proud ofmcf747 has much to be proud ofmcf747 has much to be proud ofmcf747 has much to be proud ofmcf747 has much to be proud ofmcf747 has much to be proud of
Re: Silly Programming screw ups (funny)

2008:

I am hooking up the electrical and working with our programmer to well drive the motors im hooking up.(the two window motors keyed together). Any way we have a button set to automatically shoot the ball out of the arm and then drop the arm to a position where it can pick up a ball again. At our first regional we end up inverting the position of our window motors and go out to another practice match. We start the automatic sequence and bang the arm drives backwards and fold over itself crashing into the back of the robot. We cant figure out what happened but I think it was the recoil from the punch so i tell our drivers to not raise the arm so high when they fire it and in the next match it does the same thing. We put a hard stop, using steel wire, on it as the arm was "pushing" through the stop sensor think this would stop the recoil. We send it back out and it happens again and then i remember that we never reversed the code when we inverted the motors, and the powerful worm drives pushed through our hard stop and the delay was to great from the senors that the arm was already more than half way over when the arm lost its momentum, crashing down anyway due to gravity.

What we learned:
-Two worm drives are no match for a 20G steel cable
-Remember to check code after inverting ANYTHING
-Built a robot so tough it can handle major abuse to cover for the occasional mistake

Matthew
MorTourq 1515
  #5   Spotlight this post!  
Unread 24-04-2008, 03:12
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
Re: Silly Programming screw ups (funny)

In 2001 I was trying to write a program to automatically balance the bridge (which was basically a big see-saw) with our 2000 robot and a gyro. My first idea was to have it slowly drive up the bridge until it sensed rotation, then have it reverse proportional to the gyro input. Unfortunately I got the gyro input backwards, and as the bridge started to tip instead of reversing the robot began to accelerate. The faster it tipped, the more it accelerated. Fortunately the bridge and the robot came crashing down on the other side before the robot could launch itself off the end or else it would have really caught some air.
  #6   Spotlight this post!  
Unread 24-04-2008, 07:37
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: Silly Programming screw ups (funny)

Quote:
Originally Posted by mcf747 View Post
What we learned:
-Two worm drives are no match for a 20G steel cable
-Remember to check code after inverting ANYTHING
-Built a robot so tough it can handle major abuse to cover for the occasional mistake
*chuckle* I guess you didn't need MorTorque.

Back when we were using a toughbox transmission at the Midwest regional, the 36:1 -> 12.75:1 reduction from the dual FP motors was SO SLOW... but way way too forceful (it could lift the whole robot without breaking a sweat).

Well... and we found out on our practice bot that if it did break a sweat... it bent a 9" length of beautiful new 1/2" stainless steel shaft.

...After that we made a new single-reduction-stage transmission that saved weight and turned all that extra force into lightning quick arm speed.

-q

p.s. It never screwed up the right way in competition, but we found out that if you pick the ball up then hold the manual up button with only a few psi of air in the system... the ball flys out and actually goes high enough to hurdle over the back of the robot with a perfect shot.
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #7   Spotlight this post!  
Unread 24-04-2008, 16:15
JesseK's Avatar
JesseK JesseK is online now
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,608
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: Silly Programming screw ups (funny)

This one reminds me of Zoolander:

On our scrimmage bot from the summer we broke a banebots 56mm drive transmission due to over-agressive driving and direction changes. Since we didn't want this happening to our expensive new AM shifters, the coding team implemented a "soft steer" drive that limited how fast the robot could change directions for the '08 season. They had limited testing due to unforseen and unavoidable build-team delays.

We get to VCU in week 2 and all of a sudden the robot can't turn left in teleoperated mode! This was the cause of most of our penalties at VCU. All our driver could say was "I don't know, don't blame me, I'm not an ambiturner!". We commented out that portion fo the code Friday night and BAM it could turn left.
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub
  #8   Spotlight this post!  
Unread 24-04-2008, 18:14
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,494
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: Silly Programming screw ups (funny)

Quote:
Originally Posted by JesseK View Post
This one reminds me of Zoolander:

On our scrimmage bot from the summer we broke a banebots 56mm drive transmission due to over-agressive driving and direction changes. Since we didn't want this happening to our expensive new AM shifters, the coding team implemented a "soft steer" drive that limited how fast the robot could change directions for the '08 season. They had limited testing due to unforseen and unavoidable build-team delays.

We get to VCU in week 2 and all of a sudden the robot can't turn left in teleoperated mode! This was the cause of most of our penalties at VCU. All our driver could say was "I don't know, don't blame me, I'm not an ambiturner!". We commented out that portion fo the code Friday night and BAM it could turn left.
For future reference, you can run the AM shifters HARD without issue.
  #9   Spotlight this post!  
Unread 24-04-2008, 16:32
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,344
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Silly Programming screw ups (funny)

Quote:
Originally Posted by Alan Anderson View Post
This line of code was inserted into a file which contains prominent warnings that it is not to be modified. Some of us programmers know the reason for the warnings, and know that some modifications are "safe". We just fail to clean up after ourselves sometimes.
In my line of work, we affectionately refer to this approach as "Seagull Engineering". Why? Because we swoop in, flap around making a lot of noise and commotion, leave a big mess of "stuff" behind and then fly off. (You can substitute your own words in for "stuff" ) No one really knows what we did or what happened.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #10   Spotlight this post!  
Unread 24-04-2008, 18:05
11Mort11's Avatar
11Mort11 11Mort11 is offline
Registered User
AKA: Alex Joss
FRC #0011 (MORT)
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Mount Olive
Posts: 94
11Mort11 is a splendid one to behold11Mort11 is a splendid one to behold11Mort11 is a splendid one to behold11Mort11 is a splendid one to behold11Mort11 is a splendid one to behold11Mort11 is a splendid one to behold11Mort11 is a splendid one to behold11Mort11 is a splendid one to behold
Send a message via AIM to 11Mort11
Re: Silly Programming screw ups (funny)

mecanum drive code in a tank drive robot
bad things happened
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
pic: I Love UPS! dubious elise Extra Discussion 15 05-05-2006 16:43
pic: UPS with UPS Kevin Kolodziej Extra Discussion 10 04-05-2005 12:57
I am silly. FotoPlasma Chit-Chat 15 07-01-2003 09:55
silly fun Mark Hamilton Chit-Chat 8 29-10-2002 13:56


All times are GMT -5. The time now is 15:59.

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