wpilib PackageΒΆ

The WPI Robotics library (WPILib) is a set of classes that interfaces to the hardware in the FRC control system and your robot. There are classes to handle sensors, motors, the driver station, and a number of other utility functions like timing and field management. The library is designed to:

  • Deal with all the low level interfacing to these components so you can concentrate on solving this year’s “robot problem”. This is a philosophical decision to let you focus on the higher-level design of your robot rather than deal with the details of the processor and the operating system.
  • Understand everything at all levels by making the full source code of the library available. You can study (and modify) the algorithms used by the gyro class for oversampling and integration of the input signal or just ask the class for the current robot heading. You can work at any level.
wpilib.ADXL345_I2C(port, range) ADXL345 accelerometer device via i2c
wpilib.ADXL345_SPI(port, range) ADXL345 accelerometer device via spi
wpilib.ADXL362(range[, port]) ADXL362 SPI Accelerometer.
wpilib.ADXRS450_Gyro([port]) Use a rate gyro to return the robots heading relative to a starting position.
wpilib.AnalogAccelerometer(channel) Analog Accelerometer
wpilib.AnalogGyro(channel[, ...]) Interface to a gyro device via an AnalogInput
wpilib.AnalogInput(channel) Analog input
wpilib.AnalogOutput(channel) Analog output
wpilib.AnalogPotentiometer(channel) Reads a potentiometer via an AnalogInput
wpilib.AnalogTrigger(channel) Converts an analog signal into a digital signal
wpilib.AnalogTriggerOutput(...) Represents a specific output from an AnalogTrigger
wpilib.BuiltInAccelerometer([range]) Built-in accelerometer device
wpilib.CANJaguar(deviceNumber) Texas Instruments Jaguar Speed Controller as a CAN device.
wpilib.CANTalon(deviceNumber[, ...]) Talon SRX device as a CAN device
wpilib.Compressor([pcmId]) Operates the PCM (Pneumatics compressor module)
wpilib.ControllerPower Provides access to power levels on the RoboRIO
wpilib.Counter(*args, **kwargs) Counts the number of ticks on a DigitalInput channel.
wpilib.DigitalGlitchFilter() Class to enable glitch filtering on a set of digital inputs.
wpilib.DigitalInput(channel) Reads a digital input.
wpilib.DigitalOutput(channel) Writes to a digital output
wpilib.DigitalSource(channel, ...) DigitalSource Interface.
wpilib.DoubleSolenoid(*args, ...) Controls 2 channels of high voltage Digital Output.
wpilib.DriverStation() Provide access to the network communication data to / from the Driver Station.
wpilib.Encoder(*args, **kwargs) Reads from quadrature encoders.
wpilib.Filter(source) Superclass for filters
wpilib.GearTooth(channel[, ...]) Interface to the gear tooth sensor supplied by FIRST
wpilib.GyroBase() GyroBase is the common base class for Gyro implementations such as AnalogGyro.
wpilib.I2C(port, deviceAddress[, simPort]) I2C bus interface class.
wpilib.InterruptableSensorBase() Base for sensors to be used with interrupts
wpilib.IterativeRobot() IterativeRobot implements a specific type of Robot Program framework, extending the RobotBase class.
wpilib.Jaguar(channel) Texas Instruments / Vex Robotics Jaguar Speed Controller as a PWM device.
wpilib.Joystick(port[, ...]) Handle input from standard Joysticks connected to the Driver Station.
wpilib.LinearDigitalFilter(...) This class implements a linear, digital filter.
wpilib.LiveWindow The public interface for putting sensors and actuators on the LiveWindow.
wpilib.LiveWindowSendable A special type of object that can be displayed on the live window.
wpilib.MotorSafety() Provides mechanisms to safely shutdown motors if they aren’t updated often enough.
wpilib.PIDController(*args, ...) Can be used to control devices via a PID Control Loop.
wpilib.PowerDistributionPanel([...]) Use to obtain voltage, current, temperature, power, and energy from the CAN PDP
wpilib.Preferences() Provides a relatively simple way to save important values to the RoboRIO to access the next time the RoboRIO is booted.
wpilib.PWM(channel) Raw interface to PWM generation in the FPGA.
wpilib.Relay(channel[, direction]) Controls VEX Robotics Spike style relay outputs.
wpilib.Resource(size) Tracks resources in the program.
wpilib.RobotBase() Implement a Robot Program framework.
wpilib.RobotDrive(*args, **kwargs) Operations on a robot drivetrain based on a definition of the motor configuration.
wpilib.RobotState Provides an interface to determine the current operating state of the robot code.
wpilib.SafePWM(channel) A raw PWM interface that implements the MotorSafety interface
wpilib.SampleRobot() A simple robot base class that knows the standard FRC competition states (disabled, autonomous, or operator controlled).
wpilib.SD540(channel) Mindsensors SD540 Speed Controller
wpilib.Sendable The base interface for objects that can be sent over the network
wpilib.SendableChooser() A useful tool for presenting a selection of options to be displayed on
wpilib.SensorBase Base class for all sensors
wpilib.Servo(channel) Standard hobby style servo
wpilib.SmartDashboard The bridge between robot programs and the SmartDashboard on the laptop
wpilib.Solenoid(*args, **kwargs) Solenoid class for running high voltage Digital Output.
wpilib.SolenoidBase(moduleNumber) SolenoidBase class is the common base class for the Solenoid and DoubleSolenoid classes.
wpilib.Spark(channel) REV Robotics SPARK Speed Controller
wpilib.SPI(port[, simPort]) Represents a SPI bus port
wpilib.Talon(channel) Cross the Road Electronics (CTRE) Talon and Talon SR Speed Controller via PWM
wpilib.TalonSRX(channel) Cross the Road Electronics (CTRE) Talon SRX Speed Controller via PWM
wpilib.Timer() Provides time-related functionality for the robot
wpilib.Ultrasonic(pingChannel, ...) Ultrasonic rangefinder control
wpilib.Utility Contains global utility functions
wpilib.Victor(channel) VEX Robotics Victor 888 Speed Controller via PWM
wpilib.VictorSP(channel) VEX Robotics Victor SP Speed Controller via PWM