Chop Shop – Team 166 would like to present Framework 166.
Framework 166 provides a basis for c++ programmers. It is intended to be a layer between WPILib and your own code. It provides easy access to some of the more advanced features of the vxWorks operating system, and makes various other programming tasks easier.
Features:
- Multi-threading
- Joystick abstraction
- Central storage area for data
- Memory Logging
- Simplifies autonomous
- Easy access to User message area on the Driver Station
Framework 166 contains code to simplify the use of multiple threads in your code. Each task is located in its own set of source files. This greatly simplifies management of code, by keeping only related code together. This also makes it easy to have multiple people working on code at the same time. If they’re working on separate parts of the robot code, they won’t interfere with each other.
Joystick abstraction is provided by a part of the framework known as Proxy. The proxy is its own task that is used to store data for all of the robot code to use. The proxy also contains code that interfaces with the joysticks. All joystick data is stored in the proxy. This allows for an abstraction of inputs, making autonomous easier to code. Autonomous only has to set the various parts of the joystick in the proxy. With this system, each manipulator runs in its own task and gets any inputs from the proxy. Then during autonomous the autonomous function sets various parts of the joystick to get the related manipulator to activate. This allows you to focus less on “how” autonomous will do something and more on “what” it will do – since it can simulate a button, the rest of the robot won’t care what part of the match is happening, only that it got input.
The proxy contains functions for adding your own values to be stored. This allows it to be used as an easy way to share values between tasks without worrying about global variables. Every value stored in the proxy uses semaphores to prevent race conditions.
The framework also provides functions for logging values to csv files on the cRIO. With the help of an included vi, the dashboard can then download the files from the cRIO to the Driver Station after each match. These log files could be used for debugging, or to determine what went wrong after the fact.
A function similar to printf for printing to the User Message area on the Driver Station has been included, this makes it easy to tell the driver about the state of the robot.
The framework is available from http://code.google.com/p/framework166/ under the downloads section.