View Single Post
  #29   Spotlight this post!  
Unread 18-03-2007, 23:17
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,113
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: Programming jokes

Quote:
Originally Posted by Andrew Morris View Post
...When the robot comes back the mentor takes one look at the transmission, swears, and apologizes.
Our 2004 'bot developed a transmission issue that only showed up at high speed in reverse with an actual load on the wheels. It wasn't apparent with the robot "up on blocks" in the pit. It happened that our autonomous routine was to go high speed in reverse. It started drifting seriously to one side, but things seemed fine when under operator control. I was the only real programmer on the team at the competition, so it fell to me to correct the problem. I put in some "go straight" code to increase power to the slower side and decrease power to the faster side until the left and right wheel rotation sensors matched. The robot then went straight in autonomous, but only for a foot or two before stopping completely.

It took several disappointing matches and lots of testing on the floor with a very long tether cable before we discovered that the software was doing exactly what we asked it to, and the trouble was with the hardware (a gear was riding up out of place and disengaging with its partner). I think the final clue was when the driver complained about not being able to turn one direction in reverse.

That's about the time I started putting in "defensive diagnostics" so I could easily demonstrate that the code was operating properly, and could quickly determine when undesired operation was due to disconnected wiring or misbehaving mechanisms.