ReduxLib Docs and Installation

The current version of ReduxLib is 2024.1.2.

Current Java/C++ documentation

LabVIEW is not supported at this time.

Vendordep installation

Tip

For more detailed information, see WPILib’s documentation on 3rd party libraries

Online installation

In your robot project in WPILib VSCode, press Ctrl+Shift+P and select WPILib: Manage Vendor Libraries. When prompted for a JSON url, paste in https://frcsdk.reduxrobotics.com/ReduxLib_2024.json

Offline installation

Download the current offline zip and extract its contents to either C:\Users\Public\wpilib\2024 on Windows or ~/wpilib/2024 on Linux/MacOS

In your robot project in WPILib VSCode, press Ctrl+Shift+P and select WPILib: Manage Vendor Libraries. Select Install new libraries (offline) and then select ReduxLib

Changelog

2024.1.2

Bugfixes

  • [Java] Fix an NPE in the firmware version checker

2024.1.1

Notable Breaking Changes

  • Canandcoder.getSettings() and Canandcolor.getSettings() no longer return null/nullopt! They will always return a Settings object with the set of settings received.

  • To check if all settings have been received, use allSettingsReceived (e.g. Canandcoder.Settings.allSettingsReceived())

  • Many settings, faults and status classes are now inner classes of their associated object in Java only.

  • Basically, one writes Canandcoder.Settings instead of CanandcoderSettings.

  • Canandcoder.isPresent and Canandcolor.isPresent have been renamed to isConnected and moved to CanandDevice (for consistency with WPILib’s similar function)

  • [Java] New overloads for .getSettings() and .setSettings() have been added to acccomodate retries.

  • [C++] GetSettings() and SetSettings have had their original function signatures have been changed, in particular the return type of .SetSettings().

  • The vendordep now sends 8-byte settings sets. Canandcoders with firmwares older than v2024.1.0 will need a firwmare update for settings to work correctly. – This is especially important for the original pre-October run (green Canandcoders), as settings will not set at all for their factory-flashed firmware.

  • The Canandcolor API in general had large revisions from the preview in v2023.2.0.

New Features

  • Settings have been overhauled with a focus on reliability. getSettings() and setSettings() for both Canandcoder and Canandcolor now retry failed operations by default, and will (by default) inform the driver station if ReduxLib is not absolutely sure settings have not been written successfully.

  • Ephemeral settings writes are now supported in many places, allowing for changing device configuration without wearing down flash.

  • Introduced firmware version checking on device instantiation, which produces errors on out-of-date firmware.

  • Driver station errors/warnings are also logged for devices with instantiated objects that have been disconnected from the CAN bus.

  • The Canandcolor API has been more or less rewritten from the preview in v2023.2.0, with many functions and classes renamed for clarity. These names are final for the 2024 season.

  • The Canandcoder zero offset is now directly settable with CanandcoderSettings.SetZeroOffset

2023.2.0

October 14, 2023

Notable Breaking Changes

  • All instances of “CANand” have been changed to “Canand” for consistency with everything that’s not ReduxLib. Our apologies for the breakage this will cause.

  • Switching current code should be as simple as using the VSCode search and replace to change “CANand” (with Match Case selected) with “Canand”

New Features

  • Canandcolor CAN color/proximity sensor suppport added

  • CAN timestamps now use FPGA time rather than CLOCK_MONOTONIC

  • Linux arm32/arm64 standalone builds are now provided

Bug fixes

  • [Java] Fix hang on sim exit due to unterminated CanandEventLoop

  • [Java] Fix crashes due to mutation of the listener list with CanandEventLoop

  • [Java] Removed heap allocations from handleMessage() updates to reduce GC load

  • [Java] CanandUtils.bytesToLong(byte[] data) now actually works

  • [C++] Fix C++ crash on simulation init due to uninitialized HAL

  • [Java/C++] Blocking settings operations reworked to be thread safe

  • [Java/C++] Use the FPGA timestamp for all timediffs internally (it’s faster than the standard CLOCK_MONOTONIC/System.nanoTime for 2024)

  • [Java/C++] CAN timestamps are now relative to the FPGA timestamp rather than CLOCK_MONOTONIC

  • [Java/C++] Various doc comment fixes

API changes

  • [Java] CAN/Setting/Setting command constants are now in Details-type classes, similar to the details namespace in C++

  • [Java] Frames have been reworked to avoid heap (de)allocation on update – the base class is abstract and implementing classes are backed by a primitive (or array of primitives)

  • [Java] CanandMessage now has a copy constructor and is mutable to avoid heap allocation

  • [C++] Source files have been internally reorganized – side classes for devices are now distributed in different headers that the main device header imports

  • [C++] Canandcoder::kCountsPerRotation and Canandcoder::kCountsPerRotationPerSecond are now public

  • [Java/C++] Constants are changed to fit the WPILib Hungarian notation

  • [Java/C++] Support for the FETCH_SETTING_VALUE setting command has been added

  • [Java/C++] ReduxCore version is now checked

  • [Core] ReduxCore_WaitForCANMessage now returns an int (-1 means CANLink is exiting)

  • [Core] ReduxCore_GetVersion now exists

  • [Core] ReduxCore_CANMessage has been rearranged to account for 64-bit microsecond-resolution timestamps, and all timestamps are retimed to the FPGA timestamp

2023.1.0

June 4, 2023

  • The Canandcoder can now have its on-board zeroing button disabled at runtime via getDisableZeroButton(boolean) and setDisableZeroButton(boolean)

  • Several fields relating to Canandcoder-related constants have been made public rather than protected or private.

  • The faultsValid field for CANandcoderFaults now functions as intended.

  • C++ can now manually start the Redux CANLink server via redux::canand::EnsureCANLinkServer()

  • CANandMessage uses timestamps in seconds now.

  • Various docs typos

2023.0.1

May 11, 2023

Builds using simulation should run without crashing. Proper simulation support is planned for later this year.

2023.0.0

May 10, 2023

Initial release.