View Single Post
  #19   Spotlight this post!  
Unread 28-08-2008, 22:54
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Compact rio not being able to use C

Quote:
Originally Posted by Pat Fairbank View Post
If the base code will compile and run in C++, I don't see why you wouldn't be able to use OOP and templates; it all just crunches down to machine code in the end.

If I were to speculate, I would guess is that the base functionality provided by FIRST will all be in C, but teams will be free to write their extraneous code in C++ and just interface it with the C base code.
Actually it's the opposite. To make C++ work really well, the libraries have been developed as a series of classes that implement all the sensors, motors, etc. Then the idea is to add C wrappers around the class methods (functions). We're currently trying to decide if the wrappers are really necessary since one could write the entire robot program using only C code except when calling the methods for those sensors and motors. And even that looks a lot like C. The upside for not doing the wrappers is that it allows the C++ code to be much more flexible and easy to use.

Any thoughts?

Brad Miller
WPI Robotics Resource Center
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute