WPIlib Reference

This guide is adapted from the Toronto Coding Collective

What is WPILib

From the WPILib reference:

The WPI Robotics library (WPILib) is a set of software classes that interfaces with the hardware and software in your FRC robot’s control system. There are classes to handle sensors, motor speed controllers, the driver station, and a number of other utility functions such as timing and field management.

Most Useful WPILib Classes

This is a list of the primary WPILib classes used in robot programming:

Command Based Programming

  • Scheduler - scheduling a command
  • Command - the basic framework for all commands
  • Subsystem - a container for sensors, motors and pneumatics actuators. Keep in mind that we use our own LoopableSubsystem

Operator Input (OI) Layer

  • XboxController - An interface to the Xbox controllers we use to drive our bots
  • SendableChooser - a way to select an auto pattern on the SmartDashboard
  • SmartDashboard - put debug/status information on the SmartDashboard

Drive Calculator Classes

Speed Controllers (Motors)

Sensors

  • AnalogInput - an analog input (ie. proximity sensor)
  • DigitalInput - a limit switch or other digital input plugged into a DIO port
  • Counter - a counter attached to a DIO channel used to count fast DIO pulses

Pnematics

Key IP Address Lists

  • roboRIO USB: 172.22.11.2
  • roboRIO mDNS: roboRIO-####-FRC.local (where #### is your team number with no leading zeroes) You should be able to use this address to communicate with the roboRIO over either interface through ping, browser, etc.
  • Robot Radio: 10.TE.AM.1 (where TE.AM is your 4 digit team number with leading zeroes if required)
  • DHCP range: 10.TE.AM.20 to 10.TE.AM.199