Go to Post Instant Replay??? AAAAAAUUUUUGGGGGHHHHHH!!! - Bill Moore [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-02-2003, 16:02
Jeff McCune's Avatar
Jeff McCune Jeff McCune is offline
Alpha Geek
#0677 (The Wirestrippers)
Team Role: Mentor
 
Join Date: Jan 2003
Location: The Ohio State University
Posts: 67
Jeff McCune is on a distinguished road
Send a message via ICQ to Jeff McCune Send a message via AIM to Jeff McCune
Rookie Teams: Programming Examples

Personally, as a programmer I learn best through example. So, I wanted to mention to rookie teams, and any team for that matter, than I back up our team's code every night after we work on it (Sometimes more often) to a public webserver.

I'm by no means saying our code is spectacular or anything like that (Quite the contrary.) But we area a veteran team, and we're doing some things that from my experience working with other teams in Columbus might seem "complex" to a rookie team.

We chose to stick with PBASIC 2.0 this year rather than 2.5, but all the stuff here still applies. The actual syntax is just easier in 2.5. Logic is still the same.

Some things that are in our code base that might be interesting to your team. (Again, this is by no means the "correct" or even a "good" way to do these tasks. It's just how our team does them.)

1: Serial Communication to an external Basic Stamp, complete with a system to gracefully handle the external microcontroller getting jarred lose, and possibly coming back alive during the match.
2: Shaft Encoder routines to sense velocity and distance. (This is more hardware than software, as we have one hardware counter register attached to each of 4 shaft encoders on our robot.)
3: Single Joystick Tank Style driving. (Not so cool, since it's in the default code now.)
4: Low Pass Filter on all joystick inputs. (Makes motor acceleration smooth given "jerky" joystick movements.)
5: Momentary push buttons (Like the trigger) acting as a toggle.
6: A compass (Soon to come.)
7: Heavy use of subroutines to give the feel of programming in a higher level language.
8: Heavily automated transmission control.
9: Joystick Dead-Zone logic, which plays nice with the low pass filter. (If you combine the LPF example form the whitepaper on this site with the Dead Zone example from first, they don't play nice togeher... The Dead Zone will "overrride" the LPF the instant the joystick enters it.)

Stuff to be implemented as of right now:
1: Autonomous code. (It'll be there in a few days.)
2: GyroScope logic (For sensing top of ramp)
3: Optic Sensor logic (Also for sensing top of ramp.)
4: Completely automatic CVT handling (I.E. the robot will "Realize" that the wheels aren't spinning in high speed, but the user has the joystick all the way forward, and hence will automatically shut off the CVT to get more torque. This will be done within one pass through the main loop at max. Usually faster since our external stamp executes many passes through it's main loop for every pass through the RC's main loop.)

We really aren't doing anything special at all in our code that most veteran teams don't already do. I figured the rookie teams might benefit from it though. Anyway, it's there if you're interested, if it doesn't help, no harm done. If you have any questions specifically regarding the "what or why" of our code, just ask here.

Code with the RC tag gets loaded on the Robot Controller, 2P gets loaded onto our external stamp. And if it's not obvious, code with the most recent date tag (YYMMDD_HHMM) is the most recent.

So on that note, if other teams wanted to comment on our code, it would be most welcome! We always welcome constructive criticism, and with code there's *always* a slicker way to do things.

Take it easy, and good luck!

Finally, one last thing to mention. Only about half of our code is actually implemented at this point. Less than half even. There's a ton of empty subroutines and sections of code which do pretty much nothing. This is VERY much a work in progress, and as we proceed with programming we'll try to make it clear in comments which sections of code are for the most part complete and which aren't.

http://studentorg.eng.ohio-state.edu/~first/677/files/
__________________
Team 677 - The Wirestrippers - Columbus School for Girls and The Ohio State University
EMAIL: mccune@ling.ohio-state.edu

...And all you touch and all you see
Is all your life will ever be...

Last edited by Jeff McCune : 10-02-2003 at 16:10.
Reply With Quote
  #2   Spotlight this post!  
Unread 10-02-2003, 16:26
powercat powercat is offline
Registered User
no team
 
Join Date: Jan 2003
Location: Kansas
Posts: 14
powercat is an unknown quantity at this point
Where did you find the Joystick dead zone whilte paper ?
Reply With Quote
  #3   Spotlight this post!  
Unread 10-02-2003, 17:54
Jeff McCune's Avatar
Jeff McCune Jeff McCune is offline
Alpha Geek
#0677 (The Wirestrippers)
Team Role: Mentor
 
Join Date: Jan 2003
Location: The Ohio State University
Posts: 67
Jeff McCune is on a distinguished road
Send a message via ICQ to Jeff McCune Send a message via AIM to Jeff McCune
Honestly I don't remember. I glanced in the normal places but couldn't find it. Sorry.

Take a look at our code. That piece of it is working at this point.
__________________
Team 677 - The Wirestrippers - Columbus School for Girls and The Ohio State University
EMAIL: mccune@ling.ohio-state.edu

...And all you touch and all you see
Is all your life will ever be...
Reply With Quote
Reply


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
I tip my hat to all rookie teams archiver 2001 2 24-06-2002 02:25
help to rookie teams archiver 2001 5 23-06-2002 23:38
Hits, Misses, & Suggestions -- long message archiver 2000 17 23-06-2002 23:36
The Case For 'Regionalizing' teams at the Nationals. archiver 2000 33 23-06-2002 23:35
How do we view more teams? archiver 2000 0 23-06-2002 23:11


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

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