REVLib Information
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.
- 1.Ensure that the old SPARK MAX API and/or Color Sensor V3 API packages are uninstalled.
- 3.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.
- 1.Open your robot project in VSCode.
- 2.Click on the WPI icon in the corner to open the WPI Command Pallet.
- 3.Select Manage Vendor Libraries.
- 4.Select Manage Current Libraries.
- 5.Check the
REVRobotics
and/orREVColorSensorV3
items (whichever ones are present) - 6.Click the
OK
button to uninstall them. - 7.
REVLib LabVIEW - Version 2023.1.3 |
---|
- 1.Download the latest REVLib LabVIEW package from the download link above.
- 2.Make sure LabVIEW for FRC 2023 is installed and updated.
- 3.Open the REVLib LabVIEW Package. The NI Package Manager should automatically open.
- 4.Click Next:
- 5.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.
REVLib C++/Java - Version 2023.1.3 |
---|
You can use the online method to install REVLib C++/Java if your development machine is connected to the internet:
- 1.Open your robot project in VSCode.
- 2.Click on the WPI icon in the corner to open the WPI Command Pallet.
- 3.Select Manage Vendor Libraries.
- 4.Select Install new library (online).
- 5.Enter the following installation URL and press ENTER:
- 1.Download and unzip the latest REVLib into the C:\Users\Public\wpilib\2023 directory on Windows and ~/wpilib/2023 directory on Unix-like systems.
- 2.
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()
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.
- 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
andSpark 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
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
- C++: Fixes move semantics for supported classes
- SparkMaxPIDController.setIAccum() only works while the control mode is active
- 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 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) afterclose()
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 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
.
- 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