![]() |
Programming - Getting Started
With the advent of a new season and the influx of new programmers-to-be I decided to do a 1 or 2 page write-up on just how a programmer new to FIRST can get started. I wrote this up to bootstrap rookie team programmers. Sort of a how does one get started when they know absolutely nothing about where to even start programming the FIRST controller. It’s not intended to replace the IFI documentation, it’s more to direct new programmers to it. I tried to stay away from most "how to program" type stuff and more advanced topics like the Linux/Windows debate and configuration management. This is just to get newbies rolling. Anyone have suggestions, additions, corrections. Everything is up for debate.
P.S. I have enough tips now to continue the recent trend in “lists”, but I’ve created three lists: One for programming tips, another for tips specific to just the control system, and the third for quick starting new FIRST programmers. Programming Quick Start
|
Re: Programming - Getting Started
1) Programming will take more time than you expect, especially if you want autonomous to work. Tell the team that the robot needs to be driving and in your (the programmer's) hands with at least three days before shipping.
2) Rookies: Don't program without sleep. Sure, you'll hear the experienced programmers bragging about a 36-hour code marathon, but all that means is that they are good at procrastinating. And working without sleep. 3) Don't forget to initialize a variable you are using as a PWM output to 127. 4) Increment your counters! (One year my robot span around in a circle for about three minutes...) 5) If at all possible, make sure the code works *before* dumping it into your robot 6) When testing your robot, lift it off the ground. Prop it up somehow. This can save lives! (well, shins, anyways) Good Luck! |
Re: Programming - Getting Started
you might want to add that sometimes serial to usb converters are really tempermental. Alot of people have trouble with them.
Maybe recommend a certain kind that is known to be more reliable than others? |
Re: Programming - Getting Started
Quote:
2) Things in theory are not always right practically. You can calculate how far your robot will go in a certain time, but when you do it practically you might find different reasons. For that reason everyone tells you to reserve a lot of time for programming autonomous. 3) Most of the time if you find a problem, look Though a C guide for syntax, or the Innovation FIRST programming guide, simple mistakes can cause you to go crazy. I agree to Noah, sleep is important, it helps you take it easy and not go bonkers programming. 4) Step by step: Don't write the whole robot code in one shot and expect it to work, do it step by step i.e. part by part, drives first, then arm, then other stuff.... 5) Will think up more and post later... |
Re: Programming - Getting Started
Download PowerPoint Module A:
http://www.usfirst.org/robotics/C_help.htm It has a great overview of the programming process. |
Re: Programming - Getting Started
1) Kill Switches: It's always a good idea to add drive/device kill switches.(If you have the time)
2) Limit switches can prevent an appendage from destroying itself. Last year my team constructed a poorly designed arm with the ability to destroy it self, limit switches are the only reason while that robot is still in one piece. |
Re: Programming - Getting Started
|
Re: Programming - Getting Started
Quote:
Comments are your friends. Use them, use them frequently, and use them intelligently. Try to document the code well enough so that someone who's never seen it before could understand it. There are certain things that you DON'T want to do - like, say, leaving excessive amounts of old code in the program but commented out, or copying and pasting PBASIC (!) into the comment sections - but it can't hurt to use them in most cases. Try to understand the basic framework of the code ahead of time. It would be nice to have your programming team know how to map the controls to the robot fuctions, or how to set up a basic autonomous mode. Be prepared to deal with time constraints. My team gets the robot with less than two weeks to go most years, and it can be hard to do what you want before you ship. Even if other teams are more efficient in getting the robot to the programmers, you'll still have to worry about making sure that your code works and that you'll have enough time to fix what doesn't. Most importantly...have fun. The programmers tend to get less credit than they deserve, but the robot wouldn't run if we weren't there. :) |
Re: Programming - Getting Started
This is an excellent overview, I'll have to make a copy for myself and the rest of the programmers on my team.
As far as programming is concerned, I have these few suggestions: 1.) LEARN BASIC or at least take a quick look. It will give you the basics of programming like logical, arithmetic, and relational operators, plus simple counter builds and other good basics. 2.) Then goto About.com's C Tutorial to learn the basics of C. How it's structured, done, etc. Try and find a simple compiler other than MPLAB while you're at it. I have Pacific C, but the site I got it from isn't working. 3.) Don't let all the script make you think it's difficult. Yes, there's a few difficult parts to get passed like the declaration of variables, knowing what they are, etc. The rest, however, is quite logical. Otherwise, just remember that you ARE the most important group of people within your team, for it is the programming that makes it a robot and not just a highly modified RC car. :D Have fun! |
Re: Programming - Getting Started
This is a good overview. But all you people talking about having programming "teams" i ask you : how is it that you get a team, for my team its always just me. And new programmers out there don't be discuraged when you get blamed for *every* problem the robot has. And don't think that you will get any fame out of the robot even if it does work. Everyone else in the team gets that. But hey us programmers get to have all the fun so i soppose it's a fair trade. :D
|
Re: Programming - Getting Started
|
Re: Programming - Getting Started
Quote:
Dr Joe has recommended a Bafo Technologies BF-810 if I recall correctly. From last year's experience, I have to concur that some are VERY tempermental. Thanks everyone......this is a really good thread Eric |
Re: Programming - Getting Started
KISS- Keep It Simple Stupid
Example: 2003: Our robot, Miss Daisy II won the Galileo Division at Nats. Number of Speed Controllers: 3 2004: Our robot, Miss Daisy III didn't work at Chesapeake, didn't work very well at Drexel or Nats, and only started working in the offseason. Number of Speed Controllers: 10-12 (too many) Don't let the mechanics bully you into trying to add way too much stuff. Simple stuff can work quite well and it also gives time to write a nice autonomous program. |
Re: Programming - Getting Started
Quote:
I'll post the programming and control systems list later on in the week. I almost pulled a gwross and have a sprained wrist, so typing is slower. It's hard to post fast enough to beat the time-out. |
Re: Programming - Getting Started
this helped me soooo much. thank you all. this is our second yr competing and this is my first year in FIRST. i have a java background and a simple C background from 8th grade...but it was so long ago. :eek:
I'm the only one in charge of programming so when i was handed all these Cd's and codes and links and websites, i was pretty overwhelmed. i just learned about this today and I've spend the majority of the day looking through posts to answer my Q's is there anyone here that i can directly e-mail or talk to if i have questions? (warning: I'm like a pet, i demand a lot of attn: i have questions everyday....or close to it) :( also, everyone speaks about a "dongle" and i saw the picture and everything. but what exactly IS it? :confused: |
| All times are GMT -5. The time now is 00:26. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi