This was my first year programming (well, most of my time ended up being spent troubleshooting hardware ) in the FRC, and I had a blast. I’ve loved computers since I first touched one, but until getting involved with this competition my interest in programming had been waning (something about the low-level “clean slate” of C interests me oh-so-much-more than my wanderings with PHP ever could).
I’m now eager to improve my skills for next season, since I took a “learn-as-you-go” approach this season, combining my marginal PHP experience with copious Google / CD searches.
However, I’d like some guidance from those who’ve been along this path before as to what would be a good approach to expanding my knowledge, both in terms of general programming and more robotics-related topics (navigation, noise filtering, etc).
Would it be worth my time to start out with a basic C book and work up from there? Should I dive right into data structures and algorithms? Should I work on improving my mathematics knowledge – if so, in what topics – discrete mathematics? calculus? Are there any specific books anyone can recommend? What would be a good platform to develop on? – I’m thinking of buying an Arduino board.
Any guidance would be appreciated. If you’d like an idea of my current skill level, I know basic syntax and have delved some into bitwise operations and pointers, but have little else to go on aside from broad-but-thin conceptual knowledge of many CS topics.
I have to say this is pretty much describes me , starting at build. 'cept I didn’t have any coding experience.
If you learn the way I do, you might use the new google code search and read through the results, trying to figure it out yourself, and pick up a couple of books.
Otherwise, I would suggest starting on a slower pace starting with genral programming concepts and then try to pick up each language as you choose.
Either way, I think it is great that you want to expand you’re horizons.
But yeah… definitely, I’ve actually written a couple programs to find round about values to pid values and pwm values, along with many others. (games,math,formulas,).Something I figured out how to do in ISS.
I have to with the calcs but for 83 and the 89 titanium. Many programs and questions asked even by teachers.
But for myself I have been self taught (calc just trying out different codes and see what happens) but with other languages I usually get many books from the library and read them. For C a farely good one(I read this book front to back and wrote a report on it for lang. arts for reading credit, I worked on robot and school at the same time) but it was “C for Dummies” there are other books out there too. For other languages and they have been good books are the "Sam’s Teach Yourself ______ in 24hrs, 24 days, 1 week, whatever length they are. It also helped with C and still learning is doing Google Searches when I forgot something, also having a mentor that somewhat knew C too and he could help me when I got troubled, and I helped him when he got troubled too.
Some community colleges offer summer classes on C programming. Look into that venue and earn some college credit along the way. The formal training may help in pointing out things you may gloss over from just trying to go through a book on your own.
My programming philosophy is that the program is the algorithm needed to do the job, not the syntax that a particular language requires to satisfy its compiler. You don’t need to know the intricacies of C to get the 'bot to do the cool things you want - the basics of the language will get you there. You do need to know the math behind the robot behavior, though, and the subtleties of the control system. I’d steer you towards more math/physics stuff.
My main advice is to try to get access to robots (either by building them or finding them) with different drive trains and manipulators and see what you can to trying to program them. One huge advantage you have is that there are at least half a dozen other teams within about an arm’s length of your home. I’d imagine you could get together with their programmers to get access to some old machines and see what you can learn.
Unfortunately, really learning this year’s RC subtleties is of dubious value, since the control system is going to change next year. Still, it’s easier to learn to do something if you’ve done it once before. An education is never wasted.
Getting the math background will help not just for programming the robot, but also in physics, trig, and calc classes. Think of the robot as a year-long physics lab, without having to write lab reports.
i am a beginner at programing too! i found that easyc is very useful but one thing that i don’t understand is variables, macros, constants and arrays. What are they used for? And what kind of functions do they perform? Can you povide examples of codes and what the code does so i can understand it better?
I’ve been thinking about programming my TI83+, but right now my main issue is that I have no idea what I’d write for it. If I ever think of anything, I’ll definitely give it a whirl.
Yeah, I’ve heard of the Butterfly and it looks very cool. I’ll probably go with an Arduino as a development platform instead, however, because while similar (it’s also AVR-based), its open source nature is more in line with my choice of operating system (Linux) and associated software (I’m no zealot, but I prefer to go open when it’s a viable option).
Hey, I remember seeing you guys at Peachtree!
That all sounds spot on to me, thanks. I’m thinking that a good course of action might be to begin perusing whatever useful math resources I can find (MIT OCW seems especially nice, particularly its free calculus textbook; if there are any resources you or anyone else can suggest that’d be fantastic), and then build a small robot of my own I can program in my free time (I’m leaning towards a Tamiya treaded chassis + a gear box set + an Arduino + some cheapish sensors, a servo, etc).
You’re right on the mark with that, too.
It’s also very nice to go to school literally minutes away from the regional.
As someone who had some programming experience but not nearly enough, I found “Essential C” (a free PDF document) from Stanford’s CS dept. to be particularly useful; you might want to take a gander at that.
Quick, generalized rundown:
Variables are quite a bit like “x”, “y”, etc in Algebra; they are little chunks of data read and manipulated in a program.
The easiest way (for me) to think of macros is as “find and replace” commands run at compile time by the compiler’s preprocessor. They’re used in various ways to make code cleaner and more organized (and programmers more sane [or less insane? ]).
Constants are variables stored in memory and read by the program just like any others, except that the programmer specifies them as unchangeable (thus constant), and the compiler will spit out an error if it finds code that tries to modify them.
Arrays are groupings of like variables (e.g. “unsigned int exampleArray[50];” declares a set of 50 unsigned integers, referred in the program as “exampleArray[0]”, “exampleArray[1]”, “exampleArray[2]” … “exampleArray[49]” – the counting goes 0-49 rather than 1-50).
Here is the original FIRST Email Blast announcement thread.
Nothing official has been announced yet, but there are plenty of rumors going around. The National Instruments cRIO unit seems to be a leading contender.
Just do a CD Thread Search on “cRIO” and check out the threads that pop up.
Word is that an official announcement and demo will be coming in Atlanta, so we don’t have too much longer to wait!
As someone who had some programming experience but not nearly enough, I found “Essential C” (a free PDF document) from Stanford’s CS dept. to be particularly useful; you might want to take a gander at that.
Quick, generalized rundown:
Variables are quite a bit like “x”, “y”, etc in Algebra; they are little chunks of data read and manipulated in a program.
The easiest way (for me) to think of macros is as “find and replace” commands run at compile time by the compiler’s preprocessor. They’re used in various ways to make code cleaner and more organized (and programmers more sane [or less insane? ]).
Constants are variables stored in memory and read by the program just like any others, except that the programmer specifies them as unchangeable (thus constant), and the compiler will spit out an error if it finds code that tries to modify them.
Arrays are groupings of like variables (e.g. “unsigned int exampleArray[50];” declares a set of 50 unsigned integers, referred in the program as “exampleArray[0]”, “exampleArray[1]”, “exampleArray[2]” … “exampleArray[49]” – the counting goes 0-49 rather than 1-50).
I can understand that but i need examples to explain to me what i need to use these functions for. Like are arrays used to help program relays? and what will it do to the relay? stuff like that
I gotta say my story is a lot like yours. I’m a PHP programmer, had a very small amount of Java knowledge stored in my brain from years ago, and learned C as I went during the competition. (Turned out good for me, my autonomous period constantly crossed 3 lines!)
After the competition ended I was in the same situation as you, so I bought myself an Arduino, in fact I’ve started making myself an alarm clock that runs away from my body heat in the morning. I recommend you buy that Arduino you’ve been thinking about and make something awesome in the off-season.
cprogramming.com (or is it .net?) is great. i learnedmost of my C there, and it’s full of examples. the new control, of it’s not from IFI, will really even the playing field, IMO. since the control system has been relatively the same since 04 (or 05, i forget), programming knowledge is built upon. now, this is a good thing for the veteran teams, but not so good for rookie or inexperienced teams. i remember last year, our programmer had to basically learn the RC from scratch in the 6 weeks. he did it, but it was much better this year with a programmer who already knew somewhat of how the RC works. next year, unless the system is remarkably similar, even veteran teams will have to re-learn how to control the robot.
I always found that I learned best when I had a goal, either contrived or concrete, to work towards.
To that end, most of my C++ learning took place when I worked fairly hard to do topcoder problems. I did each of the weekly competitions, and that helped me to get a grip on the basic data structures and algorithms that the language offers. You could set a goal of solving an easy (Div II 250pt), medium (Div II 500pt), hard (Div II 1000pt), or insane (Div I 1000pt) problem every day, and by the end of a month you’ll be shocked at how much better you are. It’ll teach you all the various approaches to an algorithm (divide and conquer, dynamic programming, greedy, etc), it’ll teach you basic data structures, and you can always view the winner’s code to see how they do it. If you don’t want to get locked into a particular language, you could cycle languages by day. On Monday, do Java. Tuesday, do VB. Wednesday, do C++, and so on. If you get even somewhat good at it, you can win nontrivial amounts of money. I think I’ve won about $80, though since I didn’t have an affadavit as to who I am, I haven’t been able to collect. The people at the top of the rankings have won on the order of tens of thousands of dollars.
Other goals:
-A 3D simulation of driving various robot drivetrains (mechanum, swerve, 6WD, linkage) for future driver training. Make sure the ‘level’ is modular so you can switch in future game maps. Have the camera point locked to the driver station, and don’t forget to implement phenomena like the lane divider blocking your sight.
-Take your existing robot base and teach it to do things. Was there something you couldn’t accomplish this year like knocking off both balls in hybrid? Adjust the code so it drives a path like 1114’s autonomous.
-Tweak your existing drive code to maximize the number of laps you can do, or to minimize lap time, or to minimize VARIABILITY in lap time. It’s one thing if your driver can hit a certain time 1 in 10 tries, but if you can get him to hit it 9 in 10 times, that’s something special. Drive code should be easy to use, not something that only one person has a good ‘feel’ for.
-Write a RC-independent framework for programming in order to maximize portability of your code for the switch next year.