Introduction
Code Resources
Software
Since 2004, Robots in the USFIRST Robotics Competitions use the 'C' programming language. 'C' is well suited to access a microcontroller at the hardware level, allows powerful coding, and generates compact code. Higher level languages, such as C++ or Java require more support code or lack the ability to program at the hardware level. Students who know C++ or Java should find the transition to 'C' straightforward. The greatest hurdle is creating a complex system to control motors and sensors in a short period of time.
FIRST Robots use IFI Robotic's FRC Control system, that is composed of an operator interface for the joysticks and the robot-side controller. The two halves are linked by a two-way data radio modem. The robot-side controller contains two MICROCHIP PIC18F8722 microcontrollers, in the roles of a Master and User controller. From the programmer's viewpoint, only the User controller is visible and provides access to all of the needed robot functions. The IFI Robotic's FRC Robot Controller has 128KBytes of program memory, >3KB of variable space, 1024 bytes of EEPROM, and operation speed of 10MIPs.
The C compiler must be written specifically for the microcontroller used in the robot controller, which in this case, is the MICROCHIP PIC18F8722. Since the robot controller's instruction set differs from the instruction set of the CPU in a desktop computer, common C compilers such as MS Visual C cannot be used. Our team uses MICROCHIP's free MPLab IDE in combination with MICROCHIP's commercial ($$) MPLab C18 compiler. MPLab software operates on a M.S. Windows based computer, and the compiled code is then uploaded through a serial cable to the robot controller.
The primary code sources for FIRST Robot's are available through IFI Robotics' and Kevin Watson's (of NASA's Jet Propulsion Laboratory) websites. IFI Robotics provides default code for the current and prior years, while Kevin Watson's site contains the best collection of code for higher level control features, such as navigation, gyros, encoders, and camera's.
Additionally, code from Lynbrook Robotics Team #846 is available both for download and convenient online web browsing.
Lynbrook Robotics Team #846
Code Archive
http://lynbrookrobotics.com/robotcode/source_code/
Kevin Watson of NASA's Jet Propulsion Laboratory
Code for navigation, gyros,
encoders, and camera's & links to MICROCHIP
documents:
http://kevin.org/frc/
IFI Robotics
default code: http://www.ifirobotics.com/rc.shtml#Programming
code
from prior years:
http://www.ifirobotics.com/first-legacy.shtml
MPLab IDE - free download from
MICROCHIP. Search
for download in development tools area.
The IDE (Integrated Development Environment) allows you to view and edit source
code. However, to compile the code, you need the add-in "MPLab C18" 'C'
compiler.
MPLab C18 Compiler - commercial product provided at no cost to the team.
Contact the team software group.
IFI Loader - IFI Robotics; MS Windows based software used to upload the compiled code from the PC to the IFI FRC Robot Controller.
Dashboard - IFI Robotics; Optional MS Windows based utility software used to display data sent from the robot to the operator interface. http://www.ifirobotics.com/dashboard_viewer.shtml
David Giandomenico Last revised: December 11, 2006