Package com.thunder.lib.trajectory
Class ThunderTrajectoryState
java.lang.Object
com.thunder.lib.trajectory.ThunderTrajectoryState
Class representing a state in a trajectory for a robot.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for ThunderTrajectoryState.ThunderTrajectoryState(double timeSeconds, Pose2d pose, ChassisSpeeds chassisSpeeds, double linearVelocityMetersPerSecond, Rotation2d heading) Parameterized constructor for ThunderTrajectoryState. -
Method Summary
Modifier and TypeMethodDescriptionGet the robot chassis speeds at this state in the trajectory.Get the robot heading at this state in the trajectory.doubleGet the robot linear velocity in meters per second at this state in the trajectory.getPose()Get the robot pose at this state in the trajectory.doubleGet the time in seconds of this state in the trajectory.voidsetChassisSpeeds(ChassisSpeeds chassisSpeeds) Set the robot chassis speeds at this state in the trajectory.voidsetHeading(Rotation2d heading) Set the robot heading at this state in the trajectory.voidsetLinearVelocityMetersPerSecond(double linearVelocityMetersPerSecond) Set the robot linear velocity in meters per second at this state in the trajectory.voidSet the robot pose at this state in the trajectory.voidsetTimeSeconds(double timeSeconds) Set the time in seconds of this state in the trajectory.
-
Constructor Details
-
ThunderTrajectoryState
public ThunderTrajectoryState()Default constructor for ThunderTrajectoryState. -
ThunderTrajectoryState
public ThunderTrajectoryState(double timeSeconds, Pose2d pose, ChassisSpeeds chassisSpeeds, double linearVelocityMetersPerSecond, Rotation2d heading) Parameterized constructor for ThunderTrajectoryState.- Parameters:
timeSeconds- Time in secondspose- Robot posechassisSpeeds- Robot chassis speedslinearVelocityMetersPerSecond- Robot linear velocity in m/sheading- Robot heading
-
-
Method Details
-
getTimeSeconds
public double getTimeSeconds()Get the time in seconds of this state in the trajectory.- Returns:
- Time in seconds
-
setTimeSeconds
public void setTimeSeconds(double timeSeconds) Set the time in seconds of this state in the trajectory.- Parameters:
timeSeconds- Time in seconds
-
getPose
Get the robot pose at this state in the trajectory.- Returns:
- Robot pose
-
setPose
Set the robot pose at this state in the trajectory.- Parameters:
pose- Robot pose
-
getChassisSpeeds
Get the robot chassis speeds at this state in the trajectory.- Returns:
- Robot chassis speeds
-
setChassisSpeeds
Set the robot chassis speeds at this state in the trajectory.- Parameters:
chassisSpeeds- Robot chassis speeds
-
getLinearVelocityMetersPerSecond
public double getLinearVelocityMetersPerSecond()Get the robot linear velocity in meters per second at this state in the trajectory.- Returns:
- Robot linear velocity in m/s
-
setLinearVelocityMetersPerSecond
public void setLinearVelocityMetersPerSecond(double linearVelocityMetersPerSecond) Set the robot linear velocity in meters per second at this state in the trajectory.- Parameters:
linearVelocityMetersPerSecond- Robot linear velocity in m/s
-
getHeading
Get the robot heading at this state in the trajectory.- Returns:
- Robot heading
-
setHeading
Set the robot heading at this state in the trajectory.- Parameters:
heading- Robot heading
-