WPILib安装指南

本指南适用于Java和C ++团队。LabVIEW团队可以跳至安装LabVIEW for FRC(仅LabVIEW)。此外,以下教程使用了Windows 10,但所有操作系统的步骤均相同。将显示区分操作系统的注意事项。

先行准备

Supported Operating Systems and Architectures:
  • Windows 10 & 11, 64 bit only. 32 bit and Arm are not supported

  • Ubuntu 22.04, 64 bit. Other Linux distributions with glibc >= 2.34 may work, but are unsupported

  • macOS 11 or higher, both Intel and Arm.

警告

The following OSes are no longer supported: macOS 10.15, Ubuntu 18.04 & 20.04, Windows 7, Windows 8.1, and any 32-bit Windows.

WPILib is designed to install to different folders for different years, so that it is not necessary to uninstall a previous version before installing this year’s WPILib.

Downloading

WPILib Installer

WPILib 2023.4.3 Release - March 29, 2023

Downloads

Downloads for other platforms

Release Notes

This is an update release of WPILib for the 2023 season. This release reduces NetworkTables CPU usage and latency, improves dashboard NetworkTables connection/disconnection behavior, and has several other quality-of-life improvements, in particular to Shuffleboard. This release also includes all fixes made in earlier releases.

Upgrading from earlier 2023 releases is easy: simply download and run the new installer and it will update your current installation. If you already have the 2023 WPILib vscode installed, it will detect it and you can simply click "next" for that installation step. After installation, vscode will prompt you when opening your robot project whether you want to upgrade it to this version. Note that using the installer is required to get the new version of desktop tools such as Shuffleboard.

The documentation for WPILib is located at https://docs.wpilib.org/ (if you have trouble accessing this location, https://frcdocs.wpi.edu/en/stable/ is an alternate location with the same content).

If you're new to FRC, start with Getting Started.

Minimum system requirements have changed for 2023. WPILib requires 64-bit Windows 10 or 11, Ubuntu 22.04, or macOS 11 or higher. Newly supported this year is Apple Silicon (arm64)! C++ teams should note that Visual Studio 2022 is now required for desktop builds. For this release, Mac users will need to have the Xcode Command Line Tools installed before running the installer; we are working on removing this requirement in a future release. This can be done by running xcode-select --install in the Terminal.

If you're returning from a previous season, check out what's new for 2023; be sure to read through this, as a lot has changed from 2022! You will need a new RoboRIO image for 2023; this is available via the FRC 2023 Game Tools. Follow the WPILib installation guide to install WPILib.

If you're starting from a 2022 robot project, you will need to import your project to create a 2023 project. The import process is important, as it will make a number of automated corrections for some breaking changes that happened in 2023. It is also necessary to import vendor libraries again, since last year’s vendor libraries must be updated to be compatible with this year’s projects.

A complete list of known issues with this release can be found here.

WPILib is developed by a small team of volunteers and the FIRST community.

What's Changed since 2022.4.2

NetworkTables

  • Optimize scan of outgoing messages by @PeterJohnson in https://github.com/wpilibsuite/allwpilib/pull/5227
  • NT4 client: close timed-out connections by @PeterJohnson in https://github.com/wpilibsuite/allwpilib/pull/5175
  • Use int64 for datalog type string by @PeterJohnson in https://github.com/wpilibsuite/allwpilib/pull/5186
  • ParallelTcpConnector: don't connect to duplicate addresses by @PeterJohnson in https://github.com/wpilibsuite/allwpilib/pull/5169

Math

  • Check LTV controller max velocity precondition by @calcmogul in https://github.com/wpilibsuite/allwpilib/pull/5142
  • Fix invalid iterator access in TimeInterpolatableBuffer by @virtuald in https://github.com/wpilibsuite/allwpilib/pull/5138
  • Fix Pose3d log returning Twist3d NaN for theta between 1E-9 and 1E-7 by @7910f6ba7ee4 in https://github.com/wpilibsuite/allwpilib/pull/5168
  • Fix NaN in C++ MakeCostMatrix() that takes an array by @calcmogul in https://github.com/wpilibsuite/allwpilib/pull/5194
  • Fix potential divide-by-zero in RKDP by @calcmogul in https://github.com/wpilibsuite/allwpilib/pull/5242

Commands

  • RamseteCommand: default-initialize m_prevSpeeds by @PeterJohnson in https://github.com/wpilibsuite/allwpilib/pull/5188

WPILib

  • Add isTestEnabled and minor docs cleanup by @rzblue in https://github.com/wpilibsuite/allwpilib/pull/5172
  • Fix enableLiveWindowInTest crashing in disabled by @rzblue in https://github.com/wpilibsuite/allwpilib/pull/5173
  • DataLogManager: increase time for datetime to be valid by @PeterJohnson in https://github.com/wpilibsuite/allwpilib/pull/5185
  • Fix DutyCycleEncoder.setDistancePerRotation() in java simulation by @rzblue in https://github.com/wpilibsuite/allwpilib/pull/5147
  • Fix RobotController.getComments() mishandling quotes inside the comments string by @rzblue in https://github.com/wpilibsuite/allwpilib/pull/5197
  • [java] DriverStation: Fix joystick data logs by @PeterJohnson in https://github.com/wpilibsuite/allwpilib/pull/5240
  • Shuffleboard: Keep duplicates on SelectTab() by @Starlight220 in https://github.com/wpilibsuite/allwpilib/pull/5198

Shuffleboard

  • Fix IndexOutOfBoundsException in tab setup by @Starlight220 in https://github.com/wpilibsuite/shuffleboard/pull/772
  • Make any entries set by dashboard retained by @PeterJohnson in https://github.com/wpilibsuite/shuffleboard/pull/778
  • FieldData: Don't throw on missing data by @Starlight220 in https://github.com/wpilibsuite/shuffleboard/pull/776
  • Add DataSource.equals() by @Starlight220 in https://github.com/wpilibsuite/shuffleboard/pull/774
  • Don't switch to selected tab on value change by @Starlight220 in https://github.com/wpilibsuite/shuffleboard/pull/771
  • CameraServerWidget: Explicitly unbox Number objects by @Starlight220 in https://github.com/wpilibsuite/shuffleboard/pull/780
  • Use ConcurrentHashMap for static collection of NT sources by @Starlight220 in https://github.com/wpilibsuite/shuffleboard/pull/779

SysId

  • Give measurement period a valid default of 1 by @calcmogul in https://github.com/wpilibsuite/sysid/pull/495
  • Add Venom support by @wlmchen in https://github.com/wpilibsuite/sysid/pull/499

Docs

  • CommandScheduler.isComposed: Remove incorrect throws clause (NFC) by @DAflamingFOX in https://github.com/wpilibsuite/allwpilib/pull/5183
  • WaitCommand: Remove subclass note (NFC) by @Starlight220 in https://github.com/wpilibsuite/allwpilib/pull/5200

Examples

  • Shuffleboard: Correct parameter order by @Starlight220 in https://github.com/wpilibsuite/allwpilib/pull/5204

New Contributors

  • @7910f6ba7ee4 made their first contribution in https://github.com/wpilibsuite/allwpilib/pull/5143
  • @wlmchen made their first contribution in https://github.com/wpilibsuite/sysid/pull/499

MD5 Hashes

fc58a52edea675b0ff91938a9c9d0743 WPILib_Linux-2023.4.3.tar.gz
5b67d336669bed34ab0dd428f81b9d31 WPILib_Windows-2023.4.3.iso
47246def80eea87b468e0be30119f789 WPILib_macOS-Intel-2023.4.3.dmg
1bb6113c1202fbb68248c3848556e47e WPILib_macOS-Arm64-2023.4.3.dmg

SHA256 Hashes

640e1ee7cc8f39d1789b4137f4a5aae90f78eeecf2326e2c50808205d02e7795 WPILib_Linux-2023.4.3.tar.gz
8ea417ede0a8541c9ab906b943be55ca49112dddef6750f2db1a742ba0c69378 WPILib_Windows-2023.4.3.iso
a80723596a08790c78b4c35ac64b4758c72076e74df559512a62c808b2a11ef1 WPILib_macOS-Intel-2023.4.3.dmg
8dad67e28a3bdf482979a1fe4c857d52ab36a2fdec56ae05971b7177d5409ae9 WPILib_macOS-Arm64-2023.4.3.dmg

You can download the latest release of the installer from GitHub.

Once on the GitHub releases page, scroll to the assets section at the bottom of the page.

Latest WPILib release page on GitHub

Then click on the correct binary for your OS and architecture to begin the download.

Assets at bottom of latest WPILib release page on GitHub

解压缩安装程序

当您下载WPILib安装程序时,对于Windows,它作为磁盘映像文件.iso分发;对于Linux,它作为.tar.gz分发;对于MacOS,它作为DMG分发。

Windows 10+ users can right click on the downloaded disk image and select Mount to open it. Then launch WPILibInstaller.exe.

右键单击 .iso 文件以选择“安装”后的菜单。

备注

Other installed programs may associate with iso files and the mount option may not appear. If that software does not give the option to mount or extract the iso file, then follow the directions below.

You can use 7-zip to extract the disk image by right-clicking, selecting 7-Zip and selecting Extract to…. Windows 11 users may need to select Show more options at the bottom of the context menu.

右键单击 .iso 文件后,转到“7-Zip”,然后“解压至....”。

After opening the .iso file, launch the installer by opening WPILibInstaller.exe.

备注

After launching the installer, Windows may display a window titled “Windows protected your PC”. Click More info, then select Run anyway to run the installer.

运行安装程序

打开安装程序后,将显示以下屏幕。继续并按:Start。

安装程序启动安装程序选项概述

This showcases a list of options included with the WPILib installation.

  • Tools Only installs just the WPILib tools (Pathweaver, Shuffleboard, RobotBuilder, SysID, Glass, and OutlineViewer) and JDK.

  • Everything installs the full development environment (VS Code, extensions, all dependencies), WPILib tools, and JDK.

您会注意到两个按钮,“为此用户安装”和“为所有用户安装”。为此用户安装仅将其安装在当前用户帐户上,并且不需要管理员特权。然而,为所有用户安装安装工具,所有系统帐户和将需要管理员权限。为所有用户安装不是macOS和Linux的选项。

备注

If you select Install for all Users, Windows will prompt for administrator access through UAC during installation.

选择适合您的选项,然后将显示以下安装界面。

下一个界面涉及下载VS Code。不幸的是,由于许可原因,VS Code无法与安装程序捆绑在一起。

VS Code 下载选项概述
  • Download for this computer only

    • 这仅下载当前平台的VS Code,这也是最小的下载。

  • Skip and don’t use VS Code

    • 跳过安装VS Code。对于高级安装或配置很有用。通常不推荐。

  • Select existing VS Code zip for offline install on this computer

    • 选择此选项将弹出提示,允许您选择安装程序先前已下载的VS Code压缩文件。该选项不是让您在机器上选择一个已安装VS代码的副本。

  • Create VS Code zip to share with other computers/OSes for offline install

    • 此选项为所有平台下载并保存VS Code的副本,这对于共享安装程序的副本很有用。

Go ahead and select Download for this computer only. This will begin the download process and can take a bit depending on internet connectivity (it’s ~100MB). Once the download is done, select Next. You should be presented with a screen that looks similar to the one below.

安装进度条

安装完成后,将显示完成的界面。

安装程序完成界面。

重要

WPILib installs a separate version of VS Code. It does not use an already existing installation. Each year has it’s own copy of the tools appended with the year. IE: WPILib VS Code 2022. Please launch the WPILib VS Code and not a system installed copy!

恭喜,您的计算机上现已安装WPILib开发环境和工具!按完成退出安装程序。

安装后

某些操作系统需要某些最终操作才能完成安装。

安装后,安装程序将打开WPILib VS Code文件夹。将VS Code应用程序拖到扩展坞上。从桌面弹出WPILibInstaller映像。

备注

Installing desktop tools and rebooting will create a folder on the desktop called YYYY WPILib Tools, where YYYY is the current year. Desktop tool shortcuts are not available on Linux and macOS.

Additional C++ Installation for Simulation

C++ robot simulation requires that a native compiler to be installed. For Windows, this would be Visual Studio 2022 (not VS Code), macOS requires Xcode 13 or later, and Linux (Ubuntu) requires the build-essential package.

Ensure the Desktop Development with C++ option is checked in the Visual Studio installer for simulation support.

Screenshot of the Visual Studio build tools option

安装了什么?

脱机安装程序将安装以下组件:

  • ** Visual Studio代码**-受支持的IDE,适用于2019及更高版本的机器人代码开发。即使您的计算机上已经安装了VS Code,脱机安装程序也会为WPILib开发设置单独的VS Code副本。这样做是因为,如果您将VS Code用于其他项目,则使WPILib安装程序起作用的某些设置可能会破坏现有的工作流程。

  • ** C ++编译器**-用于为roboRIO构建C ++代码的工具链

  • ** Gradle **-用于构建/部署C ++或Java机器人代码的Gradle的特定版本

  • ** Java JDK / JRE **-Java JDK / JRE的特定版本,用于构建Java机器人代码并运行任何基于Java的工具(Dashboards等)。它与任何现有的JDK安装并存,并且不会覆盖JAVA_HOME变量

  • WPILib Tools - SmartDashboard, Shuffleboard, RobotBuilder, Outline Viewer, Pathweaver, Glass, SysID

  • ** WPILib依赖项**-OpenCV等

  • ** VS Code Extensions **-用于VS Code中的机器人代码开发的WPILib扩展

卸载

WPILib旨在在不同的年份安装到不同的文件夹,因此在安装今年的WPILib之前不必卸载以前的版本。但是,如果需要,可以使用以下说明卸载WPILib。

  1. Delete the appropriate wpilib folder (c:\Users\Public\wpilib\YYYY where YYYY is the year to uninstall)

  2. 删除``C:Users Public Public Desktop’’中的桌面图标

  3. 删除路径环境变量。

    1. 在开始菜单中,输入环境,然后选择“编辑系统环境变量”

    2. 单击环境变量按钮(1)。

    3. 在用户变量中,选择路径(2),然后单击编辑(3)。

    4. 用``roborio bin``选择路径(4),然后单击Delete(5)。

    5. 用``frccode’’选择路径,然后单击Delete(5)。

    6. 在“系统变量”窗格中重复步骤3-6。

“系统属性”、“环境变量”和“编辑环境变量”界面。

故障排除

如果安装程序失败,请在安装程序库中打开反馈问题。`此处 <https://github.com/wpilibsuite/wpilibinstaller-avalonia>`__提供链接。安装程序在错误时应会报错,请在您的问题说明中提供有关错误原因的报错信息。