We are pleased to announce the availability of the 2020 kickoff release (2020.1.2) of WPILib, the official FIRST libraries for robot programming in C++ and Java.
As announced in today’s FRC Blog post, the NI 2020 FRC Game Tools have also been posted, so you can get a head start on getting all the 2020 software installed before kickoff! 2020 vendor software from suppliers should be available very soon as well.
Documentation
Thanks in large part to a community effort, the control system software documentation (including WPILib) has moved from ScreenSteps to Read The Docs, and can now be found at https://docs.wpilib.org/ (if you have trouble accessing this location, https://frcdocs.wpi.edu/ is an alternate location with the same content).
Changes for 2020
The focus of C++ and Java WPILib development over the past year has been on major library improvements and features, including:
Command Based Framework Rewrite (the 2019 framework is still available as an option, but we highly recommend using the new one for new projects)
PID Controller Rewrite
High level controls, kinematics, & trajectory generation (replaces pathfinder)
Robot Characterization Tool (useful for LabVIEW teams as well)
Simulation GUI (run your robot code on the desktop)
All languages are also benefiting from these 2020 NI RoboRIO image changes and FPGA improvements:
Major past contributors to WPILib include Jaci Brunning, Sam Carlberg, Evan Gilgenbach, Alex Henning, Jonathan Leitschuh, James Kuszmaul, Peter Mitrano, Kevin O’Brien, Patrick Plenefisch, Fred Silberberg, and Griffin Tabor.
Based on what we think we we’re seeing last year, that is very good news. We were having timing overrun issues that we thought might have been incurred by solenoids on the PCM.
To put CAN performance into graphical form, I took these images off of an oscilloscope hooked up to the CAN bus as well as a Digital Output line on the rio. The Pink line is the digital output, it is set low right before the CAN write, and set high right after the can call returns.
Note that for the 2020 image, the time scale is in 10us, whereas in the 2019 image the timescale is in 50us.
So, a write in 2019 holds your code for about 300us. Also, in 2019, these times are massively inconsistent, and can range anywhere from 150us all the way into a couple of milliseconds.
For 2020, the write takes about 20us, and from testing this is fairly deterministic, so no massive spikes anymore. It really is a huge difference.
Thank you to all the volunteers for the great work!
We are particularly looking forward to use the new trajectory generation and robot characterization tools & controllers this year.
I see a couple of volunteers listed in the machine learning category. Are there any machine learnings tools/API in the WPILIB that can be used by teams? A quick look at what’s new does not seem to mention anything, but I might have missed it.
I’m trying to go though this install/Getting Started process myself as I have been out of FRC for a while, and I want to understand what my students (who are rookies) will see.
I followed the instructions on the WPILib Installation guide to install the tools onto a macOS computer using the new WPILib today. This included needing to install Java 11 which VS Studio prompted me to do (though from an outside link, not from the SDK included in the WPILib download).
I created a new Java project using the arcade drive example. When I run ‘Build Robot Code’ and ‘Test Robot Code’ there are no errors.
I wanted to see if this would run in the simulator (as of now we don’t have our control system), so I followed the instructions here to try it in the simulator. This message appeared:
java.io.IOException: wpiHaljni could not be loaded from path or an embedded resource.
attempted to load for platform /osx/x86-64/
at edu.wpi.first.wpiutil.RuntimeLoader.loadLibrary(RuntimeLoader.java:78)
at edu.wpi.first.hal.JNIWrapper.<clinit>(JNIWrapper.java:38)
at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:316)
at frc.robot.Main.main(Main.java:27)
I’m not sure what else to try there without any hardware to test on.
I also went through the same process for a C++ project, but am getting the following error in the install window when the project loads:
=============================
No Toolchain Found for roboRio
Run `./gradlew installRoboRioToolchain` to install one!
You can ignore this error with -Ptoolchain-optional-roboRio
For more information, run with `--info`
=============================
FAILURE: Build failed with an exception.
Given that I am doing this on macOS, I haven’t done the FRC 2020 tools install. That really isn’t an option for me to dual boot right now. It’s possible that I missed something else, but I’m pretty sure I followed the C++/Java instructions precisely.
Any ideas to help a guy out of the FRC game since 2009? I am amazed with the resources built into the WPILib now and am really excited to use it with my students.
As stated in the other thread, the simulation issue with Java is likely caused by the known bug requiring simulation to run twice.
For C++, where did you extract the offline tar file too? It needs to be in ~/wpilib/2020 in order to be found. The 2020 folder after extraction should have about 8 folders in it. if theyre in a subfolder, they need to move back.
That should fix it, but if you have internet you can do an online install, and to do that you can just run ./gradlew installRoboRioToolchain in the project command prompt, and that will do an online install of the toolchain.
If the next control system has enough overhead to run anything standalone (like a python script), then using a previously-trained ML becomes trivial, and also a game-changer for very specific things.
The error is saying that there is already another instance of shuffleboard running. Do you still get the error if you close shuffleboard before launching the second one?
If I manually add the second entry to my tools.json, the second one loads for me.
I installed wpilib with the installer and I ran the “install tools from GradleRIO” command in VS Code.
And yes I have the error even if I close the first shuffleboard. But, I restarted my computer and tried to launch the second shuffleboard (the one that didn’t work) and it successfully loaded. After that, I tried to launch the first shuffleboard and I had the same issue that I previously had with the second shuffleboard.
You don’t need to run both, the installer installs the tools. I had actually never tested having both the installer and the tool install task ran, so not super surprised it has an issue. I’ll look into it, but for now you can just remove the ShuffleBoard one (the one with less metadata.