¿Qué es WPILib?

The WPI Robotics Library (WPILib) is the standard software library provided for teams to write code for their FRC® robots. WPILib contains a set of useful classes and subroutines for interfacing with various parts of the FRC control system (such as sensors, motor controllers, and the driver station), as well as an assortment of other utility functions.

Idiomas admitidos

There are two versions of WPILib, one for each of the two officially-supported text-based languages: WPILibJ for Java, and WPILibC for C++. A considerable effort is made to maintain feature-parity between these two languages - library features are not added unless they can be reasonably supported for both Java and C++, and when possible the class and method names are kept identical or highly-similar. While unofficial community-built support is available for some other languages, notably python, this documentation will only cover Java and C++. Java and C++ were chosen for the officially-supported languages due to their appropriate level-of-abstraction and ubiquity in both industry and high-school computer science classes.

En general, C++ ofrece un mejor rendimiento de gama alta, a costa de un mayor esfuerzo del usuario (la memoria debe manejarse manualmente y el compilador de C++ no hace mucho para garantizar que el código del usuario no se bloquee en tiempo de ejecución). Java ofrece un rendimiento menor, pero una comodidad mucho mayor. Se recomienda encarecidamente a los usuarios nuevos o sin experiencia que utilicen Java.

Documentación y código fuente

WPILib es una biblioteca de código abierto; la totalidad de su código fuente está disponible en línea en la página de WPILib Github:

El código fuente de Java y C ++ se puede encontrar en los directorios fuente de WPILibJ y WPILibC:

Si bien se recomienda encarecidamente a los usuarios que lean el código fuente para resolver preguntas detalladas sobre la funcionalidad de la biblioteca, se puede encontrar documentación más concisa en las páginas de documentación oficial de WPILibJ y WPILibC: