diff --git a/src/main/java/com/techhounds/houndutil/houndlib/ChassisAccelerations.java b/src/main/java/com/techhounds/houndutil/houndlib/ChassisAccelerations.java new file mode 100644 index 0000000..c8a4623 --- /dev/null +++ b/src/main/java/com/techhounds/houndutil/houndlib/ChassisAccelerations.java @@ -0,0 +1,22 @@ +package com.techhounds.houndutil.houndlib; + +import edu.wpi.first.math.kinematics.ChassisSpeeds; + +public class ChassisAccelerations { + public double axMetersPerSecondSquared; + public double ayMetersPerSecondSquared; + public double omegaRadiansPerSecondSquared; + + public ChassisAccelerations(double axMetersPerSecondSquared, double ayMetersPerSecondSquared, + double omegaRadiansPerSecondSquared) { + this.axMetersPerSecondSquared = axMetersPerSecondSquared; + this.ayMetersPerSecondSquared = ayMetersPerSecondSquared; + this.omegaRadiansPerSecondSquared = omegaRadiansPerSecondSquared; + } + + public ChassisAccelerations(ChassisSpeeds speed, ChassisSpeeds previousSpeed, double dt) { + this.axMetersPerSecondSquared = (speed.vxMetersPerSecond - previousSpeed.vxMetersPerSecond) / dt; + this.ayMetersPerSecondSquared = (speed.vyMetersPerSecond - previousSpeed.vyMetersPerSecond) / dt; + this.omegaRadiansPerSecondSquared = (speed.omegaRadiansPerSecond - previousSpeed.omegaRadiansPerSecond) / dt; + } +} \ No newline at end of file