WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
frc::TrajectoryConstraint Class Referenceabstract

An interface for defining user-defined velocity and acceleration constraints while generating trajectories. More...

#include <frc/trajectory/constraint/TrajectoryConstraint.h>

Inheritance diagram for frc::TrajectoryConstraint:
frc::CentripetalAccelerationConstraint frc::DifferentialDriveKinematicsConstraint frc::DifferentialDriveVoltageConstraint frc::EllipticalRegionConstraint< Constraint > frc::MaxVelocityConstraint frc::MecanumDriveKinematicsConstraint frc::RectangularRegionConstraint< Constraint > frc::SwerveDriveKinematicsConstraint< NumModules >

Classes

struct  MinMax
 Represents a minimum and maximum acceleration. More...
 

Public Member Functions

constexpr TrajectoryConstraint ()=default
 
constexpr TrajectoryConstraint (const TrajectoryConstraint &)=default
 
constexpr TrajectoryConstraintoperator= (const TrajectoryConstraint &)=default
 
constexpr TrajectoryConstraint (TrajectoryConstraint &&)=default
 
constexpr TrajectoryConstraintoperator= (TrajectoryConstraint &&)=default
 
virtual constexpr ~TrajectoryConstraint ()=default
 
virtual constexpr units::meters_per_second_t MaxVelocity (const Pose2d &pose, units::curvature_t curvature, units::meters_per_second_t velocity) const =0
 Returns the max velocity given the current pose and curvature.
 
virtual constexpr MinMax MinMaxAcceleration (const Pose2d &pose, units::curvature_t curvature, units::meters_per_second_t speed) const =0
 Returns the minimum and maximum allowable acceleration for the trajectory given pose, curvature, and speed.
 

Detailed Description

An interface for defining user-defined velocity and acceleration constraints while generating trajectories.

Constructor & Destructor Documentation

◆ TrajectoryConstraint() [1/3]

frc::TrajectoryConstraint::TrajectoryConstraint ( )
constexprdefault

◆ TrajectoryConstraint() [2/3]

frc::TrajectoryConstraint::TrajectoryConstraint ( const TrajectoryConstraint & )
constexprdefault

◆ TrajectoryConstraint() [3/3]

frc::TrajectoryConstraint::TrajectoryConstraint ( TrajectoryConstraint && )
constexprdefault

◆ ~TrajectoryConstraint()

virtual constexpr frc::TrajectoryConstraint::~TrajectoryConstraint ( )
constexprvirtualdefault

Member Function Documentation

◆ MaxVelocity()

virtual constexpr units::meters_per_second_t frc::TrajectoryConstraint::MaxVelocity ( const Pose2d & pose,
units::curvature_t curvature,
units::meters_per_second_t velocity ) const
constexprpure virtual

Returns the max velocity given the current pose and curvature.

Parameters
poseThe pose at the current point in the trajectory.
curvatureThe curvature at the current point in the trajectory.
velocityThe velocity at the current point in the trajectory before constraints are applied.
Returns
The absolute maximum velocity.

Implemented in frc::CentripetalAccelerationConstraint, frc::DifferentialDriveKinematicsConstraint, frc::DifferentialDriveVoltageConstraint, frc::EllipticalRegionConstraint< Constraint >, frc::MaxVelocityConstraint, frc::MecanumDriveKinematicsConstraint, frc::RectangularRegionConstraint< Constraint >, and frc::SwerveDriveKinematicsConstraint< NumModules >.

◆ MinMaxAcceleration()

virtual constexpr MinMax frc::TrajectoryConstraint::MinMaxAcceleration ( const Pose2d & pose,
units::curvature_t curvature,
units::meters_per_second_t speed ) const
constexprpure virtual

Returns the minimum and maximum allowable acceleration for the trajectory given pose, curvature, and speed.

Parameters
poseThe pose at the current point in the trajectory.
curvatureThe curvature at the current point in the trajectory.
speedThe speed at the current point in the trajectory.
Returns
The min and max acceleration bounds.

Implemented in frc::CentripetalAccelerationConstraint, frc::DifferentialDriveKinematicsConstraint, frc::DifferentialDriveVoltageConstraint, frc::EllipticalRegionConstraint< Constraint >, frc::MaxVelocityConstraint, frc::MecanumDriveKinematicsConstraint, frc::RectangularRegionConstraint< Constraint >, and frc::SwerveDriveKinematicsConstraint< NumModules >.

◆ operator=() [1/2]

TrajectoryConstraint & frc::TrajectoryConstraint::operator= ( const TrajectoryConstraint & )
constexprdefault

◆ operator=() [2/2]

TrajectoryConstraint & frc::TrajectoryConstraint::operator= ( TrajectoryConstraint && )
constexprdefault

The documentation for this class was generated from the following file: