REVLib Information
We're Updating our Documentation! For the most up-to-date information about the SPARK MAX and other ION Motor Controllers please check out the following new documentation pages:
Below you will find information on how to download and install REVLib for LabVIEW, Java, and C++.
Language | Current REVLib Version | Documentation |
2023.1.3 | Embedded (Press Ctrl-H) | |
2023.1.3 | ||
2023.1.3 |
Migrating from the SPARK MAX API and/or Color Sensor V3 API
Beginning with 2022, The SPARK MAX API and the Color Sensor V3 API have been merged into a unified library called REVLib. You need to make sure that you have uninstalled those old libraries before you install REVLib.
LabVIEW migration
Ensure that the old SPARK MAX API and/or Color Sensor V3 API packages are uninstalled.
Opening a project that used the old APIs should work fine. When it is loading, it may show that there are some missing VIs, but eventually LabVIEW should find the new VIs automatically.
C++/Java migration
Open your robot project in VSCode.
Click on the WPI icon in the corner to open the WPI Command Pallet.
Select Manage Vendor Libraries.
Select Manage Current Libraries.
Check the
REVRobotics
and/orREVColorSensorV3
items (whichever ones are present)Click the
OK
button to uninstall them.Install REVLib for C++ and Java.
Downloads and Installation Instructions
LabVIEW
REVLib LabVIEW - Version 2023.1.3 |
---|
Download the latest REVLib LabVIEW package from the download link above.
Make sure LabVIEW for FRC 2023 is installed and updated.
Open the REVLib LabVIEW Package. The NI Package Manager should automatically open.
Click Next:
Once the installation is complete, you will be able to access the REVLib VIs at LabVIEW Functions Pallet -> WPI Robotics Library -> Third Party -> REV Robotics.
C++ and Java
REVLib C++/Java - Version 2023.1.3 |
---|
Online Installation
You can use the online method to install REVLib C++/Java if your development machine is connected to the internet:
Open your robot project in VSCode.
Click on the WPI icon in the corner to open the WPI Command Pallet.
Select Manage Vendor Libraries.
Select Install new library (online).
Enter the following installation URL and press ENTER:
Offline Installation
Download and unzip the latest REVLib into the C:\Users\Public\wpilib\2023 directory on Windows and ~/wpilib/2023 directory on Unix-like systems.
Follow the WPILib instructions for Adding Offline Libraries.
Java API Documentation
For a list and description of all classes:
C++ API Documentation
For a list and description of all classes:
Changelog
Version 2023.1.3
This version of REVLib requires SPARK MAX Firmware v1.6.3. Please update your SPARK MAX through the REV Hardware Client.
Improves documentation for the setZeroOffset() and getZeroOffset() methods on Absolute Encoder objects
Fixes issue where reading an absolute encoder’s zero offset could return an incorrect value in certain conditions
Version 2023.1.2
This version of REVLib requires SPARK MAX Firmware v1.6.2. Please update your SPARK MAX through the REV Hardware Client.
Adds support to configure the hall sensor's velocity measurement
C++/Java: Updates
SetMeasurementPeriod()
andSetAverageDepth()
in theSparkMaxRelativeEncoder
class to be used when the relative encoder is configured to be of typekHallSensor
.LabVIEW: Adds
SPARK MAX Configure Hall Sensor.vi
andSPARK MAX Get Hall Sensor Config.vi
to set and get the hall sensor's measurement period and average depth.
Version 2023.1.1
Adds support for WPILib 2023
Adds support for using a duty cycle absolute encoder as a feedback device for the SPARK MAX
C++/Java: Adds SparkMaxAbsoluteEncoder class
LabVIEW: Adds VIs for configuring and getting the values from a duty cycle absolute encoder
Adds Position PID Wrapping to allow continuous input for the SPARK MAX PID controller
C++/Java: Adds PositionPIDWrapping methods to the SparkMaxPIDController class
LabVIEW: Adds VIs for setting and getting the Position PID Wrapping configuration
Allows configuring the periodic frame rates for status frames 4-6
Version 2022.1.2
Breaking Changes
LabVIEW: The version of NI Package Manager bundled with the FRC LabVIEW offline installer will no longer work when installing the REVLib package. NIPM must be updated to the latest version or installed from the FRC LabVIEW online installer to be able to install this package of REVLib for LabVIEW
Enhancements
LabVIEW: Adds
Spark MAX Set Inverted.vi
andSpark MAX Get Inverted.vi
Known issues
SparkMaxPIDController.setIAccum() only works while the control mode is active
LabVIEW: VIs to get the SPARK MAX controller parameters do not work
Version 2022.1.1
Fixes
Adds Linux aarch64 (64-bit ARM) build
C++: Adds missing GetAlternateEncoder(int countsPerRev) method
Version 2022.1.0
Enhancements
Java: Adds initial WPILib simulation support
Supports
ControlType.kVelocity
andControlType.kVoltage
To use, make the following modifications to your Robot class (adjust parameters as necessary):
Call
RevPhysicsSim.getInstance().addSparkMax(sparkMax, DCMotor.getNEO(1))
fromsimulationInit()
Call
RevPhysicsSim.GetInstance.run()
fromsimulationPeriodic()
These changes will keep the simulated position value up-to-date.
Limitations
When in simulation mode, calling
setReference()
will only update the velocity of the primary encoder, even ifSparkMaxPIDController.setFeedbackDevice()
was called with a different feedback sensor
Fixes
C++: Fixes move semantics for supported classes
Known issues
SparkMaxPIDController.setIAccum() only works while the control mode is active
Version 2022.0.0
Breaking changes
C++/Java:
CANError
has been renamed toREVLibError
.Java:
ColorMatch.makeColor()
and theColorShim
class have been removed. Use the WPILibColor
class instead.C++/Java: Deleted deprecated constructors, methods, and types
Replace deprecated constructors with
CANSparkMax.getX()
functions.Replace
CANEncoder.getCPR()
withgetCountsPerRevolution()
.Remove all usages of
CANDigitalInput.LimitSwitch
.Replace
CANSparkMax.getAlternateEncoder()
withCANSparkMax.getAlternateEncoder(int countsPerRev)
.Remove all usages of
CANSparkMax.setMotorType()
. You can only set the motor type in the constructor now.Replace
SparkMax
withPWMSparkMax
, which is built into WPILib.
Java:
CANSparkMax.get()
now returns the velocity setpoint set byset(double speed)
rather than the actual velocity, in accordance with the WPILibMotorController
API contract.C++/Java:
CANPIDController.getSmartMotionAccelStrategy()
now returnsSparkMaxPIDController.AccelStrategy
.C++/Java: Trying to do the following things will now throw an exception:
Creating a
CANSparkMax
object for a device that already has oneSpecifying an incorrect
countsPerRev
value for a NEO hall sensorJava: Calling a
CANSparkMax.getX()
method using different settings than were used previously in the programJava: Trying to use a
CANSparkMax
(or another object retrieved from it) afterclose()
has been calledC++: Calling a
CANSparkMax.getX()
method more than once for a single device
C++/Java: Deprecated classes in favor of renamed versions
C++ users will get
cannot declare field to be of abstract type
errors until they replace their object declarations with ones for the new classes. Java users will be able to continue to use the old classes through the 2022 season.AlternateEncoderType
is replaced bySparkMaxAlternateEncoder.Type
.CANAnalog
is replaced bySparkMaxAnalogSensor
.CANDigitalInput
is replaced bySparkMaxLimitSwitch
.Java:
CANEncoder
is replaced byRelativeEncoder
.C++:
CANEncoder is replaced by
SparkMaxRelativeEncoderand
SparkMaxAlternateEncoder`.CANPIDController
is replaced bySparkMaxPIDController
.CANSensor
is replaced byMotorFeedbackSensor
.ControlType
is replaced byCANSparkMax.ControlType
.EncoderType
is replaced bySparkMaxRelativeEncoder.Type
.
Enhancements:
C++/Java: Added the ability to set the rate of periodic frame 3
Fixes:
C++/Java:
CANSparkMax.getMotorType()
no longer uses the Get Parameter API, which means that it is safe to call frequentlyJava: The
CANSparkMax.getX()
methods no longer create a new object on every call
Known issues:
SparkMaxPIDController.setIAccum()
only works while the control mode is active
Last updated