At the heart of every high-performing FTC robot is the programming code telling each mechanism how and when to perform a task. If you're a new (or old) team, the challenge of programming may loom large between you and your tournament. I want to take a little time and explain the programming languages and lay out some resources that will help (if I may) crack the programming code.
Don't forget, if you need help, the best resource is often a local veteran team. I'd encourage any team struggling with programming (or otherwise) to reach out to other teams to find solutions. The collaboration will guide you to a solution and create new relationships.
FTC teams can use two programming languages on their NXT: National Instrument's LabVIEW and Carnegie Mellon University's ROBOTC. The resources you have available and your past experiences can help guide you to the language you should choose. For example, you should check with your local FTC Affiliate Partner to see which language is predominately used in your region. Using the same language as other teams near you means you'll have an easier time getting help through those rough patches. We'll start by looking at LabVIEW.
LabVIEW
LabVIEW, included free in each team's registration kit (courtesy of National Instruments), is a graphical programming language that allows you to test, program and deploy code to the NXT. If you have students familiar with the FIRST Lego® League, they may be familiar with NXT G, which is similar. Here are some other key items to note:
- Graphically configure the motors and sensors (Supports TETRIX, MATRIX and other 3rd party components)
- Automatically generate Teleop code from the remote control editor.
- Test and create simple graphical autonomous code the whole team can understand.
- Learn an industry standard programming language that you can use in college and beyond. Over 7000 universities and 35,000 companies use LabVIEW!
- Use LabVIEW well beyond competition, LabVIEW can talk to anything, download free LabVIEW drivers for the Kinect, Arduino, AR Drone, MindWave, wiimote, android devices and many other platforms. (LabVIEWHacker.com)
- Here's a concise description of all the major technical features.
There are a number of good FTC resources to help you get started with LabVIEW, if you decide to choose this option. These are all linked to from the FTC Toolbox on www.usfirst.org/ftc.
- TETRIX Mastery with LabVIEW - Start here. This step-by-step online tutorial will bring you up to speed on everything you need to know to get going with LabVIEW and TETRIX.
- NI LabVIEW Forum and Resources - This is a National Instruments-provided website with a variety of resources and a forum for getting programming assistance. Be sure to check out the "Important Links" list for guidance on hot programming issues.
- LabVIEW FTC Toolkit - You need this! Here's more information.
- LabVIEW Templates for autonomous/teleop - You need these to pass Software Inspection! These templates allow your robot to connect with the Field Control System. The templates are included in the LabVIEW FTC Toolkit.
ROBOTC
ROBOTC is a text based, linear code editor, based on traditional C programming. A one-year license costs $49 (classroom and perpetual license options are also available). ROBOTC was developed as a learning tool, so if you are interested in teaching your students C programming, this is a good place to start.
Here are some resources available for teams wanting to learn ROBOTC. These are also linked from the FTC Toolbox on www.usfirst.org/ftc.
- ROBOTC Curriculum - Start here. This online training module will guide you through everything you need to know to write your own robot code.
- ROBOTC FTC resources - A CMU page dedicated to all things FTC and ROBOTC. Find trainings, software updates and more here.
- ROBOTC Online Course - CMU is currently offering this free to FTC coaches. You'll need the details to register. They live at the bottom of this team e-mail blast.
- ROBOTC Program Chooser - This allows you to select which of your programs you want the FCS to trigger during the Autonomous and Teleop periods.
Templates
Now let's talk briefly about Templates. In order for your FTC robot to function correctly with the Field Control System, you must use the programming-language-specific templates to write your programs. These templates allow the FCS to tell your NXT to execute your designated autonomous and teleop programs. Using the templates is a little different depending on what platform you are working from. Use the TETRIX Getting Started Guide section on programming for instructions on your programming platform (For LabVIEW, you can also use the LabVIEW Templates for autonomous/Teleop link found above).Program Chooser
The last thing we'll talk about today is Program Chooser. Program Chooser is a program you deploy to your NXT that allows you to select which teleop program you will use in a given match. Basically, it tells the FCS which program to run after the autonomous period has ended.
In LabVIEW, Program Chooser is included in the FTC Toolkit and must be compiled as a VI and deployed to the NXT . In ROBOTC, Program Chooser is located in the "Sample Programs->NXT->FIRST Tech Challenge" folder. Open, compile and download the program to use it.
Don't forget, if you need help, the best resource is often a local veteran team. I'd encourage any team struggling with programming (or otherwise) to reach out to other teams to find solutions. The collaboration will guide you to a solution and create new relationships.