mirror of
https://github.com/BroncBotz3481/YAGSL
synced 2026-06-19 06:21:40 +00:00
42 lines
1.0 KiB
Java
42 lines
1.0 KiB
Java
|
|
package frc.robot.subsystems.swervedrive2.swervelib.math;
|
||
|
|
|
||
|
|
import edu.wpi.first.math.geometry.Rotation2d;
|
||
|
|
import edu.wpi.first.math.kinematics.SwerveModuleState;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Second order kinematics swerve module state.
|
||
|
|
*/
|
||
|
|
public class SwerveModuleState2 extends SwerveModuleState
|
||
|
|
{
|
||
|
|
|
||
|
|
public double speedMetersPerSecond;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Rad per sec
|
||
|
|
*/
|
||
|
|
public double omegaRadPerSecond = 0;
|
||
|
|
|
||
|
|
public Rotation2d angle = Rotation2d.fromDegrees(0);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Constructs a SwerveModuleState with zeros for speed and angle.
|
||
|
|
*/
|
||
|
|
public SwerveModuleState2()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Constructs a SwerveModuleState.
|
||
|
|
*
|
||
|
|
* @param speedMetersPerSecond The speed of the wheel of the module.
|
||
|
|
* @param angle The angle of the module.
|
||
|
|
* @param omegaRadPerSecond The angular velocity of the module.
|
||
|
|
*/
|
||
|
|
public SwerveModuleState2(double speedMetersPerSecond, Rotation2d angle, double omegaRadPerSecond)
|
||
|
|
{
|
||
|
|
this.speedMetersPerSecond = speedMetersPerSecond;
|
||
|
|
this.angle = angle;
|
||
|
|
this.omegaRadPerSecond = omegaRadPerSecond;
|
||
|
|
}
|
||
|
|
}
|