Package frclib.archive
Class FrcHolonomicTrajectory
java.lang.Object
edu.wpi.first.math.trajectory.Trajectory
frclib.archive.FrcHolonomicTrajectory
- All Implemented Interfaces:
edu.wpi.first.util.protobuf.ProtobufSerializable
,edu.wpi.first.util.WPISerializable
public class FrcHolonomicTrajectory
extends edu.wpi.first.math.trajectory.Trajectory
This class modifies the behavior of the Trajectory class in a minor way.
The
FrcSwervePathFollower
class uses a Trajectory
object to follow a path.
However, that class doesn't decouple heading from the velocity vector direction, which holonomic drivebases are capable of.
The path generation in FrcPath.createHolonomicTrajectory(trclib.pathdrive.TrcPath, edu.wpi.first.math.trajectory.TrajectoryConfig)
gets around this by modifying the heading values to
be the velocity vector directions instead of the target heading.
Since the path follower only uses the ending heading as the target (it doesn't use intermediate heading values) this wrapper class is the solution.
It acts identically to the Trajectory class most of the time, but when the final waypoint is being requested, the heading value is set as the target heading, not velocity direction.
This is basically bound to the implementation of SwerveControllerCommand
, which isn't very elegant, but it works.-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.math.trajectory.Trajectory
edu.wpi.first.math.trajectory.Trajectory.State
-
Field Summary
Fields inherited from class edu.wpi.first.math.trajectory.Trajectory
proto
-
Constructor Summary
ConstructorsConstructorDescriptionFrcHolonomicTrajectory
(edu.wpi.first.math.trajectory.Trajectory trajectory, double targetHeading) -
Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.math.trajectory.Trajectory.State
sample
(double timeSeconds) Methods inherited from class edu.wpi.first.math.trajectory.Trajectory
concatenate, equals, getInitialPose, getStates, getTotalTimeSeconds, hashCode, relativeTo, toString, transformBy
-
Constructor Details
-
FrcHolonomicTrajectory
public FrcHolonomicTrajectory(edu.wpi.first.math.trajectory.Trajectory trajectory, double targetHeading)
-
-
Method Details
-
sample
public edu.wpi.first.math.trajectory.Trajectory.State sample(double timeSeconds) - Overrides:
sample
in classedu.wpi.first.math.trajectory.Trajectory
-