mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-25 06:51:40 +00:00
Updated to include gyro and accelerometer, and Rotation3d offset.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package swervelib.imu;
|
||||
|
||||
import edu.wpi.first.math.geometry.Rotation3d;
|
||||
import edu.wpi.first.math.geometry.Translation3d;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Swerve IMU abstraction to define a standard interface with a swerve drive.
|
||||
*/
|
||||
@@ -30,6 +34,21 @@ public abstract class SwerveIMU
|
||||
*/
|
||||
public abstract void getYawPitchRoll(double[] yprArray);
|
||||
|
||||
/**
|
||||
* Fetch the {@link Rotation3d} from the IMU. Robot relative.
|
||||
*
|
||||
* @return {@link Rotation3d} from the IMU.
|
||||
*/
|
||||
public abstract Rotation3d getRotation3d();
|
||||
|
||||
/**
|
||||
* 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}.
|
||||
*/
|
||||
public abstract Optional<Translation3d> getAccel();
|
||||
|
||||
/**
|
||||
* Get the instantiated IMU object.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user