WPILib Nedir?

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.

Desteklenen Diller

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.

Genel olarak, C++, artan kullanıcı çabası karşılığında daha iyi bir üst düzey performans sunar (bellek manuel olarak ele alınmalıdır ve C++ derleyicisi, kullanıcı kodunun çalışma zamanında çökmemesini sağlamak için fazla bir şey yapmaz). Java, daha az performans, ancak çok daha fazla kolaylık sunar. Yeni/deneyimsiz kullanıcıların Java’yı kullanmaları şiddetle tavsiye edilir.

Kaynak kodu ve belgeleme

WPILib açık kaynaklı bir kütüphanedir - kaynak kodunun tamamı WPILib GitHub Sayfasında çevrimiçi olarak mevcuttur:

Java ve C++ kaynak kodu, WPILibJ ve WPILibC kaynak dizinlerinde bulunabilir:

  • Java kaynak kodu <https://github.com/wpilibsuite/allwpilib/tree/main/wpilibj/src/main/java/edu/wpi/first/wpilibj> __

  • C ++ kaynak kodu <https://github.com/wpilibsuite/allwpilib/tree/main/wpilibc/src/main/native/cpp> __

Kullanıcıların kütüphane işlevselliği ile ilgili ayrıntılı soruları çözmek için kaynak kodunu okumaları şiddetle tavsiye edilirken, WPILibJ ve WPILibC için resmi belge sayfalarında daha kısa ve öz belgeler bulunabilir: