מה זה WPILib?

WPI Robotics Library (WPILib) היא ספריית התוכנה הסטנדרטית המסופקת לקבוצות עבור כתיבת קוד לרובוטי FRC®. ספריית תוכנה היא אוסף של קוד שניתן לייבא לתוכנות אחרות ולהשתמש בו. WPILib מכילה מחלקות ופעולות שימושיות להתממשקות עם חלקים שונים של מערכת הבקרה של FRC (כגון חיישנים, בקרי מנוע, וה-Driver Station), וכן מגוון של פעולות עזר אחרות.

שפות נתמכות

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.

In general, C++ offers better high-end performance, at the cost of increased user effort (memory must be handled manually, and the C++ compiler does not do much to ensure user code will not crash at runtime). Java offers lesser performance, but much greater convenience. New/inexperienced users are strongly encouraged to use Java.

Source code and documentation

WPILib is an open-source library - the entirety of its source code is available online on the WPILib GitHub Page:

The Java and C++ source code can be found in the WPILibJ and WPILibC source directories:

While users are strongly encouraged to read the source code to resolve detailed questions about library functionality, more-concise documentation can be found on the official documentation pages for WPILibJ and WPILibC: