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++.
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.
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.
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/or REVColorSensorV3
items (whichever ones are present)
Click the OK
button to uninstall them.
Install REVLib for C++ and Java.
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.
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:
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.
For a list and description of all classes:
For a list and description of all classes:
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
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()
and SetAverageDepth()
in the SparkMaxRelativeEncoder
class to be used when the relative encoder is configured to be of type kHallSensor
.
LabVIEW: Adds SPARK MAX Configure Hall Sensor.vi
and SPARK MAX Get Hall Sensor Config.vi
to set and get the hall sensor's measurement period and average depth.
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
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
LabVIEW: Adds Spark MAX Set Inverted.vi
and Spark MAX Get Inverted.vi
SparkMaxPIDController.setIAccum() only works while the control mode is active
LabVIEW: VIs to get the SPARK MAX controller parameters do not work
Adds Linux aarch64 (64-bit ARM) build
C++: Adds missing GetAlternateEncoder(int countsPerRev) method
Java: Adds initial WPILib simulation support
Supports ControlType.kVelocity
and ControlType.kVoltage
To use, make the following modifications to your Robot class (adjust parameters as necessary):
Call RevPhysicsSim.getInstance().addSparkMax(sparkMax, DCMotor.getNEO(1))
from simulationInit()
Call RevPhysicsSim.GetInstance.run()
from simulationPeriodic()
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 if SparkMaxPIDController.setFeedbackDevice()
was called with a different feedback sensor
C++: Fixes move semantics for supported classes
SparkMaxPIDController.setIAccum() only works while the control mode is active
C++/Java: CANError
has been renamed to REVLibError
.
Java: ColorMatch.makeColor()
and the ColorShim
class have been removed. Use the WPILib Color
class instead.
C++/Java: Deleted deprecated constructors, methods, and types
Replace deprecated constructors with CANSparkMax.getX()
functions.
Replace CANEncoder.getCPR()
with getCountsPerRevolution()
.
Remove all usages of CANDigitalInput.LimitSwitch
.
Replace CANSparkMax.getAlternateEncoder()
with CANSparkMax.getAlternateEncoder(int countsPerRev)
.
Remove all usages of CANSparkMax.setMotorType()
. You can only set the motor type in the constructor now.
Replace SparkMax
with PWMSparkMax
, which is built into WPILib.
Java: CANSparkMax.get()
now returns the velocity setpoint set by set(double speed)
rather than the actual velocity, in accordance with the WPILib MotorController
API contract.
C++/Java: CANPIDController.getSmartMotionAccelStrategy()
now returns SparkMaxPIDController.AccelStrategy
.
C++/Java: Trying to do the following things will now throw an exception:
Creating a CANSparkMax
object for a device that already has one
Specifying an incorrect countsPerRev
value for a NEO hall sensor
Java: Calling a CANSparkMax.getX()
method using different settings than were used previously in the program
Java: Trying to use a CANSparkMax
(or another object retrieved from it) after close()
has been called
C++: 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 by SparkMaxAlternateEncoder.Type
.
CANAnalog
is replaced by SparkMaxAnalogSensor
.
CANDigitalInput
is replaced by SparkMaxLimitSwitch
.
Java: CANEncoder
is replaced by RelativeEncoder
.
C++: CANEncoder is replaced by
SparkMaxRelativeEncoderand
SparkMaxAlternateEncoder`.
CANPIDController
is replaced by SparkMaxPIDController
.
CANSensor
is replaced by MotorFeedbackSensor
.
ControlType
is replaced by CANSparkMax.ControlType
.
EncoderType
is replaced by SparkMaxRelativeEncoder.Type
.
C++/Java: Added the ability to set the rate of periodic frame 3
C++/Java: CANSparkMax.getMotorType()
no longer uses the Get Parameter API, which means that it is safe to call frequently
Java: The CANSparkMax.getX()
methods no longer create a new object on every call
SparkMaxPIDController.setIAccum()
only works while the control mode is active
REVLib LabVIEW - Version 2023.1.3 |
---|
REVLib C++/Java - Version 2023.1.3 |
---|
Language
Current REVLib Version
Documentation
2023.1.3
Embedded (Press Ctrl-H)
2023.1.3
2023.1.3