Go to Post 90% of innovation is inspiration. - martin417 [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
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 21-04-2009, 12:32
dooey100 dooey100 is offline
Registered User
FTC #3037
 
Join Date: Feb 2009
Location: Fernie
Posts: 47
dooey100 is on a distinguished road
Thumbs up [FTC]: Post your code!

Post your code so that others may learn from you and you may learn from others!


Here is our code, its not exactly the most readable, we made a lot of changes during our competition and I didn't do any comments for that code, and I'm not exactly good about my commenting in the first place, bet here ya go. Alot of the stuff is very poorly written, from when I was first learning RobotC, so we aren't as bad at coding as you might think from some of this.

What each function does:

MotorDeadZone: Limits our joystick values to be within +/- 100 and sets it to zero if it is close to zero (this accounts for the joysticks not always returning to zero)

Drive: sets the drive motor speed and turns our servo powered castors to the proper position for the setting (we used the d-pad for driving)

Arm: pretty self explanatory

Flippers: our flippers were NXT powered, and used to quickly knock out opponents puck racks. Uses a button to set a position for the flipper (either up or down) the function is intentionally written so there are no loops, so you can drive regardless of the position

LiftBucketToVerticle, LiftBucketToVerticleSlow, BackwardsGoal, BucketToGround, CollectPucksLeft, ColelctPucksRight, and CollectPucksBack are all button activated subroutines to automate difficult and/or common tasks.

DriveToTapePlusEncoder: this function was originally supposed to drive until it hits the tape then keep going for an encoder distance, but we switched to a time instead.
Attached Files
File Type: c TELEOP.c (10.8 KB, 52 views)
File Type: c LEFT_AUTO.c (10.5 KB, 40 views)
File Type: c RIGHT_AUTO.c (10.5 KB, 41 views)
Reply With Quote
  #2   Spotlight this post!  
Unread 22-04-2009, 21:57
gdo's Avatar
gdo gdo is offline
Never too much duct-tape ;)
AKA: Patrick
FTC #0001 (Team Unlimited)
Team Role: Engineer
 
Join Date: Dec 2005
Rookie Year: 2001
Location: MA
Posts: 131
gdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to behold
Send a message via AIM to gdo Send a message via MSN to gdo
Re: [FTC]: Post your code!

Attached in the files below. There is only 1 autonomous routine as I wrote a program chooser which hijacks the entire screen from the Driver's Diagnostic Subroutine. (ask any questions that you want about it, if you want to know how to modify it for your own use, tell me, and I will be more than happy to help you do so)
Attached Files
File Type: c Autonomous 6.c (10.6 KB, 34 views)
File Type: c Operator 3.c (5.2 KB, 29 views)
__________________



FTC #1: http://unlimited.syraweb.org

Got any question for me; AIM, MSN or PM me
Reply With Quote
  #3   Spotlight this post!  
Unread 22-04-2009, 22:14
595294001 595294001 is offline
FTC World Champion
FTC #2820 (Longhorn Robotics)
 
Join Date: Mar 2009
Rookie Year: 2008
Location: Canada
Posts: 40
595294001 is an unknown quantity at this point
Re: [FTC]: Post your code!

I'll post our code later (maybe) but I just thought I'd point something pretty funny out, like unlimited, we numbered our auto and tele-op versions (I highly recommend it as it allows restoring when you screw up (PS do it often)), by the end of the season we were at about version 50 for the new code, until we restarted the numbering, which then counted up to 21, and the old code counted to almost 70, or about 140 version of our auto code.

You know how we wasted our lives now,

PS wow, after reading unlimitted's code, I realize how badly commented ours is, and how unrequiredly long.
__________________
2820: Longhorn Robotics

2009 World Championships - Winning Alliance
2009 Edison Division - Winning Alliance
2009 BC Regional - Inspire
2009 BC Regional - Winning Alliance
2009 Rookie Team

Last edited by 595294001 : 22-04-2009 at 22:17.
Reply With Quote
  #4   Spotlight this post!  
Unread 23-04-2009, 10:31
emmell's Avatar
emmell emmell is offline
Murphy was an Optimist!
AKA: Mannie Lowe
no team (Radbotics, RoboKnights, CircuitRunners, Oscar, and more...)
Team Role: Coach
 
Join Date: Dec 2005
Rookie Year: 2005
Location: Marietta, GA
Posts: 178
emmell is just really niceemmell is just really niceemmell is just really niceemmell is just really niceemmell is just really nice
Re: [FTC]: Post your code!

Quote:
Originally Posted by gdo View Post
Attached in the files below. There is only 1 autonomous routine as I wrote a program chooser which hijacks the entire screen from the Driver's Diagnostic Subroutine. (ask any questions that you want about it, if you want to know how to modify it for your own use, tell me, and I will be more than happy to help you do so)
Patrick: I noticed that you commented out the WaitForStart() routine in the autonomous code. How did you get away with that during inspection? Or was that part of code in use during the competition?
__________________
Mannie Lowe
FIRST Program Manager - Center for Mathematics and Science Education - University of Mississippi
Mississippi FIRST Tech Challenge Affiliate Partner


Reply With Quote
  #5   Spotlight this post!  
Unread 23-04-2009, 10:38
gdo's Avatar
gdo gdo is offline
Never too much duct-tape ;)
AKA: Patrick
FTC #0001 (Team Unlimited)
Team Role: Engineer
 
Join Date: Dec 2005
Rookie Year: 2001
Location: MA
Posts: 131
gdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to behold
Send a message via AIM to gdo Send a message via MSN to gdo
Re: [FTC]: Post your code!

Our code is a few extra hundred lines from the Program chooser, that is a long piece of code...but so very useful by having all your autonomous rountines in one program . That program chooser was so hard to write, but when it all came together it was so great, the team loved to use it because they could use the screen to choose a program and not have to worry about which code specificly would do what, and could select the alliance, the starting position and finally what routine to run.
__________________



FTC #1: http://unlimited.syraweb.org

Got any question for me; AIM, MSN or PM me
Reply With Quote
  #6   Spotlight this post!  
Unread 23-04-2009, 23:21
gdo's Avatar
gdo gdo is offline
Never too much duct-tape ;)
AKA: Patrick
FTC #0001 (Team Unlimited)
Team Role: Engineer
 
Join Date: Dec 2005
Rookie Year: 2001
Location: MA
Posts: 131
gdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to beholdgdo is a splendid one to behold
Send a message via AIM to gdo Send a message via MSN to gdo
Re: [FTC]: Post your code!

Quote:
Originally Posted by emmell View Post
Patrick: I noticed that you commented out the WaitForStart() routine in the autonomous code. How did you get away with that during inspection? Or was that part of code in use during the competition?
I think that wait for start was commented out because this was a testing version of the code. I must have picked the wrong folder when i posted the code here. Our actual code would be the same thing without the commented out wait for start. Sorry about that confusion, we had some late round problems with the autonomous and i needed to test it fast, and commenting that line out was the quickest way to do so.
__________________



FTC #1: http://unlimited.syraweb.org

Got any question for me; AIM, MSN or PM me
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
[FTC]: FTC 2008-2009 Championship - your thoughts Abra Cadabra IV FIRST Tech Challenge 7 21-04-2009 00:02
[FTC]: NXT Display Code gdo FIRST Tech Challenge 6 05-02-2009 10:16
[FTC]: Your in Atlanta...now what? gdo FIRST Tech Challenge 0 10-04-2008 21:49
[FTC]: FTC]: FTC Champ Tournament - Ontario (Scoring Breakdown) Mr. Lim FIRST Tech Challenge 2 03-03-2008 11:54
Post Your Team Number If your Going to Hartford Competition. DanTheRobotMan Scouting 2 13-01-2006 08:44


All times are GMT -5. The time now is 18:38.

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