Class DrivetrainSpeed
- java.lang.Object
-
- com.lightningrobotics.common.geometry.kinematics.DrivetrainSpeed
-
public class DrivetrainSpeed extends java.lang.Object
Class represents a speed vector for the robot, relative to the robot.
-
-
Constructor Summary
Constructors Constructor Description DrivetrainSpeed()
Creates a new, zero drivetrain speed.DrivetrainSpeed(double vx, double vy, double omega)
Creates a new drivetrain speed.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DrivetrainSpeed
fromFieldCentricSpeed(double vx, double vy, double omega, edu.wpi.first.math.geometry.Rotation2d theta)
Creates a drivetrain speed from a field-centric velocity.java.lang.String
toString()
-
-
-
Constructor Detail
-
DrivetrainSpeed
public DrivetrainSpeed()
Creates a new, zero drivetrain speed.
-
DrivetrainSpeed
public DrivetrainSpeed(double vx, double vy, double omega)
Creates a new drivetrain speed.- Parameters:
vx
- Velocity in X directionvy
- Velocity in Y directionomega
- Rotational velocity
-
-
Method Detail
-
fromFieldCentricSpeed
public static DrivetrainSpeed fromFieldCentricSpeed(double vx, double vy, double omega, edu.wpi.first.math.geometry.Rotation2d theta)
Creates a drivetrain speed from a field-centric velocity.- Parameters:
vx
- Velocity in X direction relative to the fieldvy
- Velocity in Y direction relative to the fieldomega
- Rotational velocity relative to the fieldtheta
- Robot's orientation relative to the field- Returns:
- A new drivetrain speed equal to the input speed relative to the robot.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-