Previous in Forum: Ghost Overlay   Next in Forum: what about free lotto?
Close
Close
Close
7 comments
Rate Comments: Nested
Participant

Join Date: Dec 2006
Posts: 1

High School Robotics team urgently needs C++ programmer!

12/22/2006 12:36 PM

Hi, first time here and not quite sure how this goes. I run a high school robotics team here in Staten Island, New York. We are seeking someone that can possibly help our team to learn C++ programming, for our F.I.R.S.T robot that we are about to build. Please contact me for more information.
thanks again,

Mr. T

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
Popular Science - Evolution - New Member Popular Science - Weaponology - New Member

Join Date: May 2006
Location: The 'Space Coast', USA
Posts: 11119
Good Answers: 918
#1

Re: High School Robotics team urgently needs C++ programmer!

12/22/2006 3:17 PM

I am sure you already have your hardware and processor selected. However, you might lighten the academic load for your students by using C and not C++.

C is usually better in embedded applications anyway and learning C will be easier than learning C and piling on a whole bunch of abstractions.

Another tact is BASIC, There are processors like the BASIC Stamp that use that language. However, C is more versitile and there are a larger number of programmers that can help you.

Register to Reply
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#2

Re: High School Robotics team urgently needs C++ programmer!

12/23/2006 7:42 AM

I thoroughly agree with Anonymous Hero - C++ has a lot of 'clutter' which, in relatively small projects, just tends to make things way more complicated than they need to be.

C is a very well defined language, and your students should be able to pick it up quickly from almost any of the huge range of books on the market.

Do remember, though, that C programs can get quite contorted - things like 'side effects' come into play, and often the side effect is the exact point of a particular line of code. The need for clear and abundant comments cannot be overstressed!

All the best with your project.

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply
Anonymous Poster
#3

Re: High School Robotics team urgently needs C++ programmer!

12/23/2006 8:36 PM

while c++ is a powerful language, lthere are many more programs and languages more suited to your students. you could try a porduct from Innotech,the maxim series porgram is free on line, included are simulators so your students can test there porgrams before downloading them. the web link is www.innotech.com.au I am a rep for the product in Canada but the Us rep would also be glad to assist you.

Register to Reply
Commentator

Join Date: Oct 2006
Location: Cape Town
Posts: 88
Good Answers: 1
#4

Re: High School Robotics team urgently needs C++ programmer!

12/23/2006 11:17 PM

Cut out a whole bunch of trouble and get back to BASICs!

If your students are using Microchip PICs in their projects, take a look at PicBasicPro at: http://www.melabs.com This compiler is really great for embedded applications, and is well supported with forums for your students to get further help.

Often associated with the embedded projects, a PC interface is also required, and a great compiler for these applications is Liberty Basic: http://www.libertybasic.com This compiler is extremely versatile, can easily do GUIs, and is also well supported with forums for your students to get further help.

NeilJ

Register to Reply
Active Contributor

Join Date: Dec 2006
Posts: 12
Good Answers: 1
#5

Re: High School Robotics team urgently needs C++ programmer!

12/24/2006 11:44 PM

Hi Mr. T...

I organize the FIRST Robotics Team in Colonie. NY, Team 250. Welcome to FIRST, it's a great program. FIRST Robots are programmed in C, not C++. I'm not a programmer, but as I understand it, C++ is a superset of C and therefore contains many features that aren't available on the Innovation First controller that FIRST uses.

Although it is great to have C programmers on the Team, don't despair if you don't have one. In the past FIRST has included a piece of software called easyC that enables a user familiar with flowcharting or the programming process (any language) to create robot code in a graphical manner. EasyC transforms flowcharts that the user creates into C code that can be run on the robot controller. We've seen Teams successfully use this to a reasonable level of functionality when no programmers were available. EasyC is powerful enough to handle the programming needs of all but the most advanced FIRST Teams. It can easily be used for basic autonomous programs, custom control stations for drivers, and basic sensor feedback.

EasyC is a great teaching tool for entry level kids and for programmers transitioning to C from another language. It shows you the C code as you design your flowchart, so you can see how to construct a C program and how changes to the flowchart affect the outputted C code.

Providing technical assistance from afar can present challenges, but if there is anything we at Team 250 can do to help you out, let us know. Send me a note and I'd be happy to connect you with our senior programmers (students) who can give you some more specific suggestions. You will find that while FIRST is a competition, everyone involved will do whatever they can to help each other along. Please have a look at the Team 250 blog on CR4; we'll be updating it throughout the season, and as we go on you will be glad to see that you aren't alone in what you are experiencing!

If you want more info about the controllers we use, check out last year's controller at Innovation First.

Register to Reply
Associate

Join Date: Jan 2007
Location: Texas
Posts: 42
Good Answers: 4
#6

Re: High School Robotics team urgently needs C++ programmer!

01/02/2007 5:11 PM

Using EasyC (mentioned by one of the replies) to create your team's first programs is probably a good way to start learning C: use the graphical flowchart to design a program with simple operation for the robot to carry out, then look at the generated C code and correlate what was generated with the actions specified in the flow chart.

That will give your students some good questions from which to learn 'what is C' and 'how does C work'.

Here is a quick list of the principal topics any computer programmer needs to grasp (some are a little more advanced than the absolute basics, but all are important to writing programs that are easy to understand and maintain, and that are reliable - i.e. bug free):

Learning C (actually, learning any programming language) - topic list
=====================================================================

Variables; Memory; uninitialized variables; initializers (scalar & vector; atomic & struct; static and non-static);

Pointers; arrays; pointer arithmetic [VERY important; use of pointers is

Type declarations - e.g. an array of pointers to ints is different from a pointer to an array of ints - how to tell what you've got.
int *x[] - array of pointer to int
int (*x)[] - pointer to array of int

Control flow: if/else; for; while; switch; break; continue; [goto & labels]; return

byte order; sizes of int types; binary representation of numbers; strings

Functions; Stack; Global vs. Local vs. Static; function pointers (and arrays of them);

Cautions
- returning addr of local non-static var
- expecting static (local) var to remain untouched == risks with globals
- uninitialized pointers;

Design philosophy - objects

Parameters; Arguments (pointers as parameters; are references now part of standard C?)

Statements; Expressions; Operators

memory allocation; lifetime of allocated memory;
'dangling references' ('live' references to deleted/freed memory);
memory 'leaks' - loss of the last reference to allocated memory prior to the memory being deleted / freed (returned to the 'heap')
heap vs. stack vs. global memory spaces; 'alloca' (dynamic memory allocation on the stack vs. on the heap)

Structs; Unions; volatile (critical for code that directly 'touches' hardware registers used for input and state sensing); mutable; const; bitfields (useful for hardware registers)

System API (access to operations provided by built-in software designed to manage the environment)

"Standard" Library (a collection of functions to perform commonly used general purpose operations - i.e. unrelated to the machine (computer or robot) the software is running on)

main() standard parameters

Environment variables

compilation units; extern; static

dialects - standard C vs. subsets (e.g. designed for a specific robotics system)

naming conventions (struct members use 'm_' prefix; methods that relate to XXX struct use XXX...() prefix; methods are verbs; variables are nouns; pointers use p prefix)

Benefits of C++ over C - simplified summary
===========================================

One of the principal benefits of using C++ is the addition of Constructors & a Destructor to what was a struct - forming what is now called a class.
Destructors allow a class to delete memory owned by instances of the class - i.e. only the delete code can (and should) only be put in one place.

Similarly, when objects are copied, the constructor is used to allocate new memory blocks for the copy of allocated blocks in the source object, and
then to copy the contents of the block. Note that dynamic memory allocation is really only appropriate when the size of a block of data is unknown
until run time. For robotics work this is probably unlikely (arrays that represent sensor data, buffers that contain queues of commands, arrays that
contain maps of the world, etc. are rarely sized according to the situation the robot finds itself in. On the other hand, a robot that is designed
to 'discover' and log information about its world may need to be able to 'accumulate' a growing list of objects discovered in its environment. The
concern with this, for typical robots, is that robots are generally memory-limited. The problem then becomes one of 'at what level of abstraction'
does the robots control software deal with 'out of memory'?': when malloc() or new() returns null, or when a fixed-size array in the application
has its last element populated? i.e. out of memory can be managed as a system response (the former) or an application constraint (the latter).

C++ adds a powerful concept called polymorphism (use of 'virtual functions' - i.e. given a family of related objects, functions that are dynamically
selected according to the type of the derived object. For instance - a pogo-stick's Move() function would do a Bounce action; a car's Move function
would do a Drive action.

Note that virtual functions add a new level of complexity to program design. The use of C++ is probably unwise for beginning programmers. In addition,
for robotics use when very tight response times are critical the use of virtual functions affects how deterministic the application can be. This is
probably not an issue for a FIRST competition - but is mission critical for control units for vehicles, medical instruments, weapons systems, etc.

The 'seminal' book for learning C is:

The C Programming Language, Second Edition

by Brian W. Kernighan and Dennis M. Ritchie.
Prentice Hall, Inc., 1988.
ISBN 0-13-110362-8 (paperback), 0-13-110370-9 (hardback).

(also see http://cm.bell-labs.com/cm/cs/cbook/ for further information).

If you can afford to get a copy of it for each student on the team, asking each student to read it and understand one topic from the list above (or - just have each study one chapter) - and then present what they've learned to the rest of the team - you'll find they learn the language quickly. Or you can get a copy for yourself and teach the team. That is probably the best route - and when you have questions find an appropriate internet newsgroup on which to post your question.

Register to Reply
Active Contributor

Join Date: Dec 2006
Posts: 12
Good Answers: 1
#7

Re: High School Robotics team urgently needs C++ programmer!

01/09/2007 12:04 AM

The FIRST Robotics game was revealed on Saturday, so now you know what we are feverishly strategizing about. In addition to the usual array of potentiometers, relays, speed controllers and all the rest of the mundane parts (?) we have a camera for vision sensing of green lights above the rack goals, and the option to use yaw rate gyros and dual axis accelerometers, though I'm not sure they are needed this year. For anyone who wants a look at what the electronic components available to FIRST robotics Teams this year, you can see the listing here. You can watch the competition animation for the game we will be playing at the NASA website. Jegan provides a game overview at the Team 250 blog.

Good Luck, Staten Island FIRST Team. Again, if Team 250 can help in any way, let us know.

Register to Reply
Register to Reply 7 comments
Copy to Clipboard

Users who posted comments:

Anonymous Hero (1); Anonymous Poster (1); dsaulsbery (2); JohnDG (1); NeilJ (1); Odessey2001 (1)

Previous in Forum: Ghost Overlay   Next in Forum: what about free lotto?
You might be interested in: Device Programmers, Sales Management Software

Advertisement