Skip to content

Commit

Permalink
Updated to the new reduxlib.
Browse files Browse the repository at this point in the history
Signed-off-by: thenetworkgrinch <thenetworkgrinch@users.noreply.github.com>
  • Loading branch information
thenetworkgrinch committed Dec 18, 2024
1 parent 9d81fda commit 28cbc6f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
12 changes: 10 additions & 2 deletions src/main/java/swervelib/encoders/CanAndMagSwerve.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package swervelib.encoders;

import com.reduxrobotics.sensors.canandmag.Canandmag;
import com.reduxrobotics.sensors.canandmag.CanandmagSettings;

/**
* HELIUM {@link Canandmag} from ReduxRobotics absolute encoder, attached through the CAN bus.
Expand All @@ -12,6 +13,10 @@ public class CanAndMagSwerve extends SwerveAbsoluteEncoder
* The {@link Canandmag} representing the CANandMag on the CAN bus.
*/
public Canandmag encoder;
/**
* The {@link Canandmag} settings object to use.
*/
public CanandmagSettings settings;

/**
* Create the {@link Canandmag}
Expand All @@ -21,6 +26,7 @@ public class CanAndMagSwerve extends SwerveAbsoluteEncoder
public CanAndMagSwerve(int canid)
{
encoder = new Canandmag(canid);
settings = encoder.getSettings();
}

/**
Expand Down Expand Up @@ -51,7 +57,8 @@ public void clearStickyFaults()
@Override
public void configure(boolean inverted)
{
encoder.setSettings(new Canandmag.Settings().setInvertDirection(inverted));
settings.setInvertDirection(inverted);
encoder.setSettings(settings);
}

/**
Expand Down Expand Up @@ -85,7 +92,8 @@ public Object getAbsoluteEncoder()
@Override
public boolean setAbsoluteEncoderOffset(double offset)
{
return encoder.setSettings(new Canandmag.Settings().setZeroOffset(offset));
settings.setZeroOffset(offset);
return encoder.setSettings(settings);
}

/**
Expand Down
27 changes: 22 additions & 5 deletions vendordeps/ReduxLib_2025.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileName": "ReduxLib_2025.json",
"name": "ReduxLib",
"version": "2025.0.0-beta0",
"version": "2025.0.0-beta2",
"frcYear": 2025,
"uuid": "151ecca8-670b-4026-8160-cdd2679ef2bd",
"mavenUrls": [
Expand All @@ -12,14 +12,14 @@
{
"groupId": "com.reduxrobotics.frc",
"artifactId": "ReduxLib-java",
"version": "2025.0.0-beta0"
"version": "2025.0.0-beta2"
}
],
"jniDependencies": [
{
"groupId": "com.reduxrobotics.frc",
"artifactId": "ReduxLib-driver",
"version": "2025.0.0-beta0",
"version": "2025.0.0-beta2",
"isJar": false,
"skipInvalidPlatforms": true,
"validPlatforms": [
Expand All @@ -36,8 +36,8 @@
{
"groupId": "com.reduxrobotics.frc",
"artifactId": "ReduxLib-cpp",
"version": "2025.0.0-beta0",
"libName": "ReduxLib-cpp",
"version": "2025.0.0-beta2",
"libName": "ReduxLib",
"headerClassifier": "headers",
"sourcesClassifier": "sources",
"sharedLibrary": true,
Expand All @@ -50,6 +50,23 @@
"osxuniversal",
"windowsx86-64"
]
},
{
"groupId": "com.reduxrobotics.frc",
"artifactId": "ReduxLib-driver",
"version": "2025.0.0-beta2",
"libName": "ReduxCore",
"headerClassifier": "headers",
"sharedLibrary": true,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"linuxathena",
"linuxx86-64",
"linuxarm32",
"linuxarm64",
"osxuniversal",
"windowsx86-64"
]
}
]
}

0 comments on commit 28cbc6f

Please sign in to comment.