Skip to content

Commit

Permalink
Updated to 2024.6.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thenetworkgrinch committed Oct 20, 2024
1 parent 4bf4e3a commit 412016a
Show file tree
Hide file tree
Showing 44 changed files with 163 additions and 11 deletions.
2 changes: 1 addition & 1 deletion publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'maven-publish'

ext.licenseFile = files("$rootDir/LICENSE.txt")

def pubVersion = '2024.6.0.0'
def pubVersion = '2024.6.1.0'

def outputsFolder = file("$buildDir/outputs")

Expand Down
112 changes: 112 additions & 0 deletions src/main/java/swervelib/imu/CanandgyroSwerve.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
package swervelib.imu;

import com.reduxrobotics.sensors.canandgyro.Canandgyro;
import edu.wpi.first.math.geometry.Rotation3d;
import edu.wpi.first.math.geometry.Translation3d;
import java.util.Optional;

/** SwerveIMU interface for the Boron Candandgyro by Redux Robotics */
public class CanandgyroSwerve extends SwerveIMU {

/** Wait time for status frames to show up. */
public static double STATUS_TIMEOUT_SECONDS = 0.04;
/** Boron Canandgyro by Redux Robotics. */
Canandgyro imu;
/** Offset for the Boron Canandgyro. */
private Rotation3d offset = new Rotation3d();
/** Inversion for the gyro */
private boolean invertedIMU = false;

/**
* Generate the SwerveIMU for {@link Canandgyro}.
*
* @param canid CAN ID for the Boron Canandgyro
*/
public CanandgyroSwerve(int canid) {
imu = new Canandgyro(canid);
}

/** Reset IMU to factory default. */
@Override
public void factoryDefault() {
imu.resetFactoryDefaults(STATUS_TIMEOUT_SECONDS);
}

/** Clear sticky faults on IMU. */
@Override
public void clearStickyFaults() {
imu.clearStickyFaults();
}

/**
* Set the gyro offset.
*
* @param offset gyro offset as a {@link Rotation3d}.
*/
public void setOffset(Rotation3d offset) {
this.offset = offset;
}

/**
* Set the gyro to invert its default direction
*
* @param invertIMU invert gyro direction
*/
public void setInverted(boolean invertIMU) {
invertedIMU = invertIMU;
}

/**
* Fetch the {@link Rotation3d} from the IMU without any zeroing. Robot relative.
*
* @return {@link Rotation3d} from the IMU.
*/
@Override
public Rotation3d getRawRotation3d() {
Rotation3d reading = imu.getRotation3d();
return invertedIMU ? reading.unaryMinus() : reading;
}

/**
* Fetch the {@link Rotation3d} from the IMU. Robot relative.
*
* @return {@link Rotation3d} from the IMU.
*/
@Override
public Rotation3d getRotation3d() {
return getRawRotation3d().minus(offset);
}

/**
* Fetch the acceleration [x, y, z] from the IMU in meters per second squared. If acceleration
* isn't supported returns empty.
*
* @return {@link Translation3d} of the acceleration as an {@link Optional}.
*/
@Override
public Optional<Translation3d> getAccel() {

return Optional.of(
new Translation3d(imu.getAccelerationFrame().getValue()).times(9.81 / 16384.0));
}

/**
* Fetch the rotation rate from the IMU in degrees per second. If rotation rate isn't supported
* returns empty.
*
* @return {@link Double} of the rotation rate as an {@link Optional}.
*/
public double getRate() {
return imu.getAngularVelocityYaw();
}

/**
* Get the instantiated IMU object.
*
* @return IMU object.
*/
@Override
public Object getIMU() {
return imu;
}
}
3 changes: 3 additions & 0 deletions src/main/java/swervelib/parser/json/DeviceJson.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import swervelib.imu.ADIS16470Swerve;
import swervelib.imu.ADXRS450Swerve;
import swervelib.imu.AnalogGyroSwerve;
import swervelib.imu.CanandgyroSwerve;
import swervelib.imu.NavXSwerve;
import swervelib.imu.Pigeon2Swerve;
import swervelib.imu.PigeonSwerve;
Expand Down Expand Up @@ -102,6 +103,8 @@ public SwerveIMU createIMU() {
return new ADXRS450Swerve();
case "analog":
return new AnalogGyroSwerve(id);
case "canandgyro":
return new CanandgyroSwerve(id);
case "navx":
case "navx_spi":
return new NavXSwerve(SPI.Port.kMXP);
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
08caa4af8eaae4675661179f851ffb27
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
de3b1976111495ed71be02dc1e444364198ecaf0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fb99f57bbdc7c3b30b185c9643609f16d4e60d7e3b1e69dfe1f112924fb168ec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
418b466a46440387ed256fa4937014c875ff04f0e454b13af2caf3d9a44734720e2f1c79df8224a7e9dead59a1d018b0635cae03daa77908c949395df953bb96
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
08caa4af8eaae4675661179f851ffb27
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
de3b1976111495ed71be02dc1e444364198ecaf0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fb99f57bbdc7c3b30b185c9643609f16d4e60d7e3b1e69dfe1f112924fb168ec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
418b466a46440387ed256fa4937014c875ff04f0e454b13af2caf3d9a44734720e2f1c79df8224a7e9dead59a1d018b0635cae03daa77908c949395df953bb96
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
08caa4af8eaae4675661179f851ffb27
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
de3b1976111495ed71be02dc1e444364198ecaf0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fb99f57bbdc7c3b30b185c9643609f16d4e60d7e3b1e69dfe1f112924fb168ec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
418b466a46440387ed256fa4937014c875ff04f0e454b13af2caf3d9a44734720e2f1c79df8224a7e9dead59a1d018b0635cae03daa77908c949395df953bb96
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
08caa4af8eaae4675661179f851ffb27
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
de3b1976111495ed71be02dc1e444364198ecaf0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fb99f57bbdc7c3b30b185c9643609f16d4e60d7e3b1e69dfe1f112924fb168ec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
418b466a46440387ed256fa4937014c875ff04f0e454b13af2caf3d9a44734720e2f1c79df8224a7e9dead59a1d018b0635cae03daa77908c949395df953bb96
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
08caa4af8eaae4675661179f851ffb27
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
de3b1976111495ed71be02dc1e444364198ecaf0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fb99f57bbdc7c3b30b185c9643609f16d4e60d7e3b1e69dfe1f112924fb168ec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
418b466a46440387ed256fa4937014c875ff04f0e454b13af2caf3d9a44734720e2f1c79df8224a7e9dead59a1d018b0635cae03daa77908c949395df953bb96
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
08caa4af8eaae4675661179f851ffb27
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
de3b1976111495ed71be02dc1e444364198ecaf0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fb99f57bbdc7c3b30b185c9643609f16d4e60d7e3b1e69dfe1f112924fb168ec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
418b466a46440387ed256fa4937014c875ff04f0e454b13af2caf3d9a44734720e2f1c79df8224a7e9dead59a1d018b0635cae03daa77908c949395df953bb96
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>swervelib</groupId>
<artifactId>YAGSL-cpp</artifactId>
<version>2024.6.1.0</version>
<packaging>pom</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15c1ed32c4809b1411479d40787a42dd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5d19c3e21ef8b690ae7f70cfb3442f343ad83290
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fdcf4fa7e0255f14fc78e7ea0bc6983385457ea8f7d2af4fb13eb36bbd22a383
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8baf639cc5eec93c6cb7ad835107be1efaf063dcc5f53a3d2503b531154a11257f5a2d16e20327926299e9678b7ede922489dea9422192de58359d36e8a1859f
8 changes: 4 additions & 4 deletions yagsl/repos/swervelib/YAGSL-cpp/maven-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<groupId>swervelib</groupId>
<artifactId>YAGSL-cpp</artifactId>
<versioning>
<latest>2024.6.0.0</latest>
<release>2024.6.0.0</release>
<latest>2024.6.1.0</latest>
<release>2024.6.1.0</release>
<versions>
<version>2024.6.0.0</version>
<version>2024.6.1.0</version>
</versions>
<lastUpdated>20241014182213</lastUpdated>
<lastUpdated>20241020141510</lastUpdated>
</versioning>
</metadata>
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-cpp/maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8a9685d8d13a07be925cb4fb6fd2c4d6
74e043dcf53eb55d262249d291ae1420
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-cpp/maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a6a215dd2d571ab9eda8a18454b7ac655f8e9dd8
6b33c042123af3448a5a6b0863d7b53290a1b5b1
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-cpp/maven-metadata.xml.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dd8cf19a48aff3e89460bb02a4aa5315f628d1121ce4fe5ebc2edcee2543394d
87078e1becdae699951529b3cd648dc56001b5d2607ac0b037381ad7851eb514
2 changes: 1 addition & 1 deletion yagsl/repos/swervelib/YAGSL-cpp/maven-metadata.xml.sha512
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ad5b2f3158c616bd247f801f13af19f3f0bc75ccea33d5c70eca2879fd5795a789733dd1f0e681d6d9100e9fc098b2cc789e5ff2c7cbb6f57135f197195fa71a
d871165b1a1c23c684f77efaca4c63d6210290521aa8b99b2b8590af312bc60e400b7b00ef4603c525cb6ba6ca829fc9a28224d41110020156a4a86ab8ce5176
4 changes: 2 additions & 2 deletions yagsl/yagsl.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileName": "yagsl.json",
"name": "YAGSL",
"version": "2024.6.0.0",
"version": "2024.6.1.0",
"frcYear": "2024",
"uuid": "1ccce5a4-acd2-4d18-bca3-4b8047188400",
"mavenUrls": [
Expand All @@ -12,7 +12,7 @@
{
"groupId": "swervelib",
"artifactId": "YAGSL-java",
"version": "2024.6.0.0"
"version": "2024.6.1.0"
}
],
"jniDependencies": [
Expand Down

0 comments on commit 412016a

Please sign in to comment.