REVLib Changelog
Version2024.2.4
Changes to C++ and Java
Increases the default timeout to wait for a periodic status from 2*framePeriodMs to 500ms.
Reduces possibility of large, inaccurate jumps in data occurring when retrieving from status frames.
Reduces amount of "timed out while waiting for periodic status X" errors in driver station.
Adds
setPeriodicFrameTimeout()
to configure the CAN timeout for periodic status frames. See code docs for more information.
Improves reliability of RTR CAN frames such as setting parameters and other commands that expect a response from the device.
Adds mechanism to retry requests if sending the request or receiving the response failed. The default value for maximum number of retries is 5.
Adds
setCANMaxRetries()
to configure the value for maximum number of retries. See code docs for more information.
Fixes undefined behavior when SPARK motor controller information cannot be retrieved during initialization.
Version 2024.2.3
Changes to Java
Fixes issue introduced in v2024.2.2 where calling getEncoder() multiple times can cause a fatal exception in certain circumstances.
Changes to C++ and Java
Removes dynamic check for SPARK model when calling getEncoder(), causing unnecessary CAN traffic.
Moves zero argument CANSparkBase.getEncoder() to CANSparkMax and CANSparkFlex subclasses to determine default encoder values.
Version 2024.2.2
Changes to C++ and Java
Fixes issue where configuring the velocity filter for the default relative encoder of a SPARK Flex would not set the correct parameters.
Changes to Java
Improves memory allocation performance.
Version 2024.2.1
Changes to C++ and Java
Changes behavior of SPARK Flex and MAX initialization errors to throw exceptions rather than terminating the robot program.
Fixes issue where initializing a SPARK Flex or MAX in brushed mode while the device is disconnected from the CAN bus causes the robot program to terminate.
Fixes issue where initializing a SPARK Flex or MAX in brushed mode causes robot simulation to terminate.
Fixes warning about using the wrong class for a SPARK Flex or MAX during robot simulation.
Changes to C++
Fixes ambiguous overload error when no parameters are supplied when calling
GetAnalogSensor()
.Fixes ambiguous overload error when no parameters are supplied when calling
GetEncoder()
.
Version 2024.2.0
Official 2024 FRC kickoff release for REVLib, with full support for SPARK Flex. Requires WPILib 2024 and SPARK Flex/SPARK MAX firmware 24.x.x.
Changes to C++, Java, and LabVIEW
Throws an error if firmware version is less than 24.0.0
Throws an error if the motor type is set to Brushed on a SPARK Flex while a SPARK Flex Dock is not connected
Gets main encoder position with enhanced precision
Changes to C++ and Java
Sends a warning to the Driver Station if the wrong class is used for the type of SPARK that is connected
Adds
CanSparkBase
class that exposes functionality that is common to both the SPARK MAX and the SPARK FlexAdds
CanSparkFlex
class that exposes all functionality of the SPARK FlexCanSparkFlex
has agetExternalEncoder()
method that returns aSparkFlexExternalEncoder
instead of agetAlternateEncoder()
method that returns aSparkMaxAlternateEncoder
.This is because Alternate Encoder Mode is not necessary for SPARK Flex, and has been replaced by the External Encoder Data Port feature:
Can be used simultaneously with the internal encoders in NEO class motors
Can be used simultaneously with an absolute encoder and limit switches
Virtually no RPM limit
No special configuration
The following items have been deprecated in favor of new equivalents:
Instead of
CANSparkMaxLowLevel
, useCANSparkLowLevel
Instead of
SparkMaxAbsoluteEncoder
, useSparkAbsoluteEncoder
Instead of
SparkMaxAnalogSensor
, useSparkAnalogSensor
Instead of
SparkMaxLimitSwitch
, useSparkLimitSwitch
Instead of
SparkMaxPIDController
, useSparkPIDController
Instead of
SparkMaxRelativeEncoder
, useSparkRelativeEncoder
Instead of
ExternalFollower.kFollowerSparkMax
, useExternalFollower.kFollowerSpark
The
ExternalFollower
enum can be accessed atCANSparkMax.ExternalFollower
,CANSparkFlex.ExternalFollower
, orCANSparkBase.ExternalFollower
Adds a
CANSparkBase.getSparkModel()
method that returns aSparkModel
enum
Changes to LabVIEW
Deprecates old VIs that are prefixed with "Spark MAX" and replaces them with VIs prefixed with "SPARK"
Deprecated icons are "grayed out"
Help context (documentation) for deprecated VIs point the user to the equivalent new VI
New icons say "SPARK" instead of "REV MAX"
Adds
SPARK Get Model.vi
Fixes
SPARK Get Analog Sensor Voltage.vi
when used with a SPARK FlexUpdates
SPARK Get I Accum.vi
to get I Accum from status 7 instead of status 2Updates "Alternate Encoder" VIs to be "Alternate or External Encoder"
Only throw the data port config warnings when the device is a SPARK MAX
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
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