C/C++ Updates

2011 Updates

Software updates for the 2011 FRC Season are now located on the FIRSTForge WPILib project server. To access the content you don't need a FIRSTForge account. You do not need WPILib project membership - please don't request it. The software is located in 3 areas:

 and you can access the Project Home with news and other information.


Prior to 2011

C/C++ Team Update 4.3 2/17/2010

Note: this software will work with either the V19 or V20 cRIO image to be installed.

This update is just a rebuild of the 4.2 update to resolve issues with camera and image processing symbols not showing up in the library. There are no functional changes since the previous update.

Workbench Software update download

C/C++ Team Update 4.2 2/8/2010

Note: this software requires the V19 cRIO image to be installed to operate properly!

This update fixes a compiler problem that was causing the kLineLength symbol in the DriverStationLCD class to show up as undefined. This is the only change since the previous update so if you weren't using the DriverStationLCD class there is no reason to install it.

Workbench Software update download


C/C++ Team Update 4.1 2/3/2010

Note: this software requires the V19 cRIO image to be installed to operate properly!

There have been several changes from Version 4.0 to 4.1. Most are source-code compatible meaning that you won’t have to change any of the code that you have written. One change may require you to make changes to your source code.

Getting Started with C++ (pdf) download

Workbench Software Update download

C/C++ Team Update 4.0 1/9/2010

Note: this software currently requires the V19 cRIO image to be installed to operate properly!

C Team Update 3.1 2/25/2009

C/C++ Update 3.1.

This update has a number of bug fixes and improvements. This requires the latest cRIO update FRC_2009_v11.zip (same as previous C/C++ update below).

While we believe this code is well tested, it is impossible to know for sure how it will behave on your robot. Because robots have shipped and there may be no way of testing this update adequately on your robot until you are at a competition, please be sure to have a copy of the previous update that you can reinstall in case you have unexpected results. With that said, here are the changes:

  1. Many documentation updates
  2. Updates to PIDController class to fix bug with continuous option and added a semaphore for syncronization between task and main code. Also fixed an issue with Notifier running continuously. Added setters and getters for P, I, and D coefficients.
  3. Camera rotation is restricted to 0 or 180 degrees.
  4. Fixed a number of issues with the Notifier class causing it to not be deleted properly.
  5. Modified parameter names in various places to match between the header and source files.
  6. Fixed problem with DeleteSingletons()
  7. Fixed issue with synchronization objects caused by incorrect Semaphore creation. This should eliminate some eratic behavior in a number of classes include Analog sampling where multiple tasks are running at the same time.
  8. Counters will now return infinity when the timer in the counter detects a stalled condition. Be sure to set the MaxPeriod in any cases where this might affect program operation.
  9. A number of other issues with Notifiers as described here: http://forums.usfirst.org/showthread.php?t=12020
  10. Added a void * parameter to DigitalInput RequestInterrupts to allow passing context to an interrupt service routine.
  11. Set default MaxPeriod in the Ultrasonic object to allow it to not timeout between pings.



C Team Update 3 1/27/2009

C/C++ Update 3.0.1718

This update adds the following fixes and updates. This update requires the latest cRIO update FRC_2009_v11.zip. It will not work without applying this update.

  1. Removed the Encoder::SetReverseDirection() method. The reverse direction flag is on each of the Encoder constructors as an argument.
  2. Added 1X and 2X decoding to the Encoder class to allocate counters instead of the 4 Encoder FPGA objects.
  3. Fixed a bug in the TrackAPI code where FindColor was returning the first particle rather than the largest particle.
  4. Fixed a bug in TrackAPI.InArea where positions were incorrectly identified
  5. Added CameraDemo sample program for camera configuration
  6. Updated TwoColorDemo to use fix in library for InArea
  7. Added camera property set and get methods to AxisCamera.cpp
  8. Added configuration file processing to BaeUtilities.cpp
  9. Modified Encoder::Get() method to return a normalized result (1x, 2x, and 4x will return same result)
  10. Fixed the default Watchdog timer value to be seconds rather than milliseconds





Previous Older Updates 

Sample Vision Target Tracking Program (now contained in C Team Update 3)

This program is a sample program that implements two color tracking in the autonomous mode. It assumes that you are using a gimbal such as the one provided in the 2009 kit, with two servos on PWM 9 and 10.

This program follows a pink/green target during the Autonomous period. It looks for green above pink. To change to pink above green, modify the input parameter from ABOVE to BELOW. Determination of alliance (pink/green order) is left as an exercise for teams, either by mechanical means or input from the Driver Station.

This demo assumes that the camera is set up as follows: White balance: Fluorescent 1, Auto Exposure on, Brightness: 40. We had good results with the code testing in a range of lighting conditions from dim fluorescent to bright stage lighting (similar to a competition). If you are having trouble getting the program to recognize the target in some specific lighting condition, be sure to look at an image with these settings to make sure the target is not washed out (all white) or too dark. The auto exposure will tend to find a single setting based on everything in the image including dark and brightly lit backgrounds. This may tend to throw off the exposure for the target in the forground.

Download (44k) - TwoColorTrackDemo-v2.zip (Note: updated Thursday, Jan15, 2009 4:10PM EST)


Update Version 1.2 (build 1562) 1/1/2009

This update is cummulative - you do not need to install previous updates before this one, it can be installed either after a fresh install of the team DVDs or after Temporary update 1 (below). This update adds or fixes the following:

  1. All times have changed from whatever units they were previously in to float or double seconds. Methods in previously written code for functions like Wait() or returned periods from counters and encoders, and the Timer class, etc. need to be changed.
  2. Added header for GetImageData() in AxisCamera.h
  3. Added PanInit() and PanForTarget to BaeUtilities.cpp to support servo panning.
  4. Changed the RobotDrive class and supporting C functions to use Jaguars instead of Victors.
  5. Fixed some bugs in Timer and Ultrasonic classes.
  6. Added method to Encoder to reverse direction sensing for encoders mounted in opposite direction.
  7. C Interfaces are now implemented for most functions. There are still some of the more complex functions that are currently only accessible in C++ like AnalogTriggers.
  8. Added missing methods to Joystick object.
  9. Added demo for viewing images from the camera on the LabVIEW dashboard program.
  10. Added PCVideoServer class to send images to the dashboard. To use this, the camera must be initialized.
  11. Added Task class for creating and manipulating tasks in C/C++ programs. Tasks created with these objects will automatically be deleted when the parent object is deleted.
  12. Added DashBoard class for creating the robot-side of dashboard programs in C/C++ to send data back to the LabVIEW dashboard program.
  13. Added DashBoard example program showing the method of packing data to send it to the dashbaord application. Also includes a class that can pack in the format of the default DashBoard application.
  14. Modified the ArcadeDrive code in the RobotDrive object (and corresponding C functions) to use an algorithm that prevents overflow when joysticks are set to full X and Y (full 45 degree angle). Also optionally will modify the inputs to be more sensitive for low speed driving. This is compatible with the LabVIEW version of WPILib.
  15. Improved the PIDController class to include a user settable loop time parameter especially useful for integral and proportional control.
  16. New documents including a PDF version of the C++ Reference Manual, the C Reference Manual, and updated version of the C/C++ Users Guide.
  17. Sample programs have been renamed to be more descriptive and understandable.


Download (requires new cRIO image - see below):



We will soon have a SourceForge server running and we'll post messages when that is running. In the mean time, please don't try to sign up for the WPI Campus SourceForge server. We'll let you know when the FIRST project server is going.

For those not installing LabVIEW, the new image and installer can be installed by using this update (90mb). Remember, the new cRIO image is required for this version of WPILib.


Temporary update 1 (12/10/2008)

You must install this update after the reflashing the cRIO with the image contained in FRCLabVIEWUpdate1.0. This is a temporary update that will be replaced shortly with the final version 1 C/C++ update. Check back in a few days for the version 1 update.


This code will be replaced shortly with a more complete version (see notes below).

C/C++ Programmer Reference Guide (generated from doxygen) - reference guide for all the classes and methods in the library. C and Vision will be updated shortly.

C/C++ Users Guide - describes the use of the library, using Wind River Workbench, and general tips and techniques. Also updating.


Mandatory cRIO Image Updater (you must update the cRIO image before using the above Beta Update 5. It can either be done with the following imaging tool or by using the imaging tool installed with the LabVIEW update FRCLabVIEWUpdate1.0)

Download: FRCNIWRUpdate1.0 (88mb) - do not use this updater for V1.2 or newer of the C/C++ libraries!


Notes about the update



Maintained by webmaster@wpi.edu
Last modified: January 09, 2011 11:49:09