WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
frc::SwerveDriveKinematicsConstraint< NumModules > Class Template Reference

A class that enforces constraints on the swerve drive kinematics. More...

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

Inheritance diagram for frc::SwerveDriveKinematicsConstraint< NumModules >:
frc::TrajectoryConstraint

Public Member Functions

 SwerveDriveKinematicsConstraint (const frc::SwerveDriveKinematics< NumModules > &kinematics, units::meters_per_second_t maxSpeed)
 
units::meters_per_second_t MaxVelocity (const Pose2d &pose, units::curvature_t curvature, units::meters_per_second_t velocity) const override
 Returns the max velocity given the current pose and curvature.
 
MinMax MinMaxAcceleration (const Pose2d &pose, units::curvature_t curvature, units::meters_per_second_t speed) const override
 Returns the minimum and maximum allowable acceleration for the trajectory given pose, curvature, and speed.
 
- Public Member Functions inherited from frc::TrajectoryConstraint
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
 

Detailed Description

template<size_t NumModules>
class frc::SwerveDriveKinematicsConstraint< NumModules >

A class that enforces constraints on the swerve drive kinematics.

This can be used to ensure that the trajectory is constructed so that the commanded velocities of the wheels stay below a certain limit.

Constructor & Destructor Documentation

◆ SwerveDriveKinematicsConstraint()

template<size_t NumModules>
frc::SwerveDriveKinematicsConstraint< NumModules >::SwerveDriveKinematicsConstraint ( const frc::SwerveDriveKinematics< NumModules > & kinematics,
units::meters_per_second_t maxSpeed )
inline

Member Function Documentation

◆ MaxVelocity()

template<size_t NumModules>
units::meters_per_second_t frc::SwerveDriveKinematicsConstraint< NumModules >::MaxVelocity ( const Pose2d & pose,
units::curvature_t curvature,
units::meters_per_second_t velocity ) const
inlineoverridevirtual

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.

Implements frc::TrajectoryConstraint.

◆ MinMaxAcceleration()

template<size_t NumModules>
MinMax frc::SwerveDriveKinematicsConstraint< NumModules >::MinMaxAcceleration ( const Pose2d & pose,
units::curvature_t curvature,
units::meters_per_second_t speed ) const
inlineoverridevirtual

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.

Implements frc::TrajectoryConstraint.


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