42 units::meters_per_second_squared_t maxAcceleration)
43 : m_maxVelocity(maxVelocity), m_maxAcceleration(maxAcceleration) {}
56 m_startVelocity = startVelocity;
64 m_endVelocity = endVelocity;
77 template <
typename Constraint,
typename =
std::enable_if_t<std::is_base_of_v<
80 m_constraints.emplace_back(std::make_unique<Constraint>(constraint));
110 template <
size_t NumModules>
119 units::meters_per_second_t
StartVelocity()
const {
return m_startVelocity; }
125 units::meters_per_second_t
EndVelocity()
const {
return m_endVelocity; }
131 units::meters_per_second_t
MaxVelocity()
const {
return m_maxVelocity; }
138 return m_maxAcceleration;
145 const std::vector<std::unique_ptr<TrajectoryConstraint>>&
Constraints()
147 return m_constraints;
157 units::meters_per_second_t m_startVelocity = 0_mps;
158 units::meters_per_second_t m_endVelocity = 0_mps;
159 units::meters_per_second_t m_maxVelocity;
160 units::meters_per_second_squared_t m_maxAcceleration;
161 std::vector<std::unique_ptr<TrajectoryConstraint>> m_constraints;
162 bool m_reversed =
false;
#define WPILIB_DLLEXPORT
Definition: SymbolExports.h:36
A class that enforces constraints on the differential drive kinematics.
Definition: DifferentialDriveKinematicsConstraint.h:21
Helper class that converts a chassis velocity (dx and dtheta components) to left and right wheel velo...
Definition: DifferentialDriveKinematics.h:25
A class that enforces constraints on the mecanum drive kinematics.
Definition: MecanumDriveKinematicsConstraint.h:23
Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual wheel s...
Definition: MecanumDriveKinematics.h:42
A class that enforces constraints on the swerve drive kinematics.
Definition: SwerveDriveKinematicsConstraint.h:21
Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual module ...
Definition: SwerveDriveKinematics.h:47
Represents the configuration for generating a trajectory.
Definition: TrajectoryConfig.h:34
units::meters_per_second_t StartVelocity() const
Returns the starting velocity of the trajectory.
Definition: TrajectoryConfig.h:119
units::meters_per_second_t MaxVelocity() const
Returns the maximum velocity of the trajectory.
Definition: TrajectoryConfig.h:131
void SetStartVelocity(units::meters_per_second_t startVelocity)
Sets the start velocity of the trajectory.
Definition: TrajectoryConfig.h:55
units::meters_per_second_t EndVelocity() const
Returns the ending velocity of the trajectory.
Definition: TrajectoryConfig.h:125
void SetKinematics(const DifferentialDriveKinematics &kinematics)
Adds a differential drive kinematics constraint to ensure that no wheel velocity of a differential dr...
Definition: TrajectoryConfig.h:89
void SetKinematics(SwerveDriveKinematics< NumModules > &kinematics)
Adds a swerve drive kinematics constraint to ensure that no wheel velocity of a swerve drive goes abo...
Definition: TrajectoryConfig.h:111
bool IsReversed() const
Returns whether the trajectory is reversed or not.
Definition: TrajectoryConfig.h:154
TrajectoryConfig(units::meters_per_second_t maxVelocity, units::meters_per_second_squared_t maxAcceleration)
Constructs a config object.
Definition: TrajectoryConfig.h:41
units::meters_per_second_squared_t MaxAcceleration() const
Returns the maximum acceleration of the trajectory.
Definition: TrajectoryConfig.h:137
void SetKinematics(MecanumDriveKinematics kinematics)
Adds a mecanum drive kinematics constraint to ensure that no wheel velocity of a mecanum drive goes a...
Definition: TrajectoryConfig.h:100
TrajectoryConfig(const TrajectoryConfig &)=delete
void SetReversed(bool reversed)
Sets the reversed flag of the trajectory.
Definition: TrajectoryConfig.h:71
void AddConstraint(Constraint constraint)
Adds a user-defined constraint to the trajectory.
Definition: TrajectoryConfig.h:79
TrajectoryConfig(TrajectoryConfig &&)=default
TrajectoryConfig & operator=(TrajectoryConfig &&)=default
TrajectoryConfig & operator=(const TrajectoryConfig &)=delete
void SetEndVelocity(units::meters_per_second_t endVelocity)
Sets the end velocity of the trajectory.
Definition: TrajectoryConfig.h:63
const std::vector< std::unique_ptr< TrajectoryConstraint > > & Constraints() const
Returns the user-defined constraints of the trajectory.
Definition: TrajectoryConfig.h:145
An interface for defining user-defined velocity and acceleration constraints while generating traject...
Definition: TrajectoryConstraint.h:22
typename std::enable_if< B, T >::type enable_if_t
Definition: core.h:298
Definition: AprilTagFieldLayout.h:22