WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::math::EllipticalRegionConstraint< Constraint > Class Template Reference

Enforces a particular constraint only within an elliptical region. More...

#include <wpi/math/trajectory/constraint/EllipticalRegionConstraint.hpp>

Inheritance diagram for wpi::math::EllipticalRegionConstraint< Constraint >:
wpi::math::TrajectoryConstraint

Public Member Functions

constexpr EllipticalRegionConstraint (const Translation2d &center, wpi::units::meter_t xWidth, wpi::units::meter_t yWidth, const Rotation2d &rotation, const Constraint &constraint)
 Constructs a new EllipticalRegionConstraint.
constexpr EllipticalRegionConstraint (const Ellipse2d &ellipse, const Constraint &constraint)
 Constructs a new EllipticalRegionConstraint.
constexpr wpi::units::meters_per_second_t MaxVelocity (const Pose2d &pose, wpi::units::curvature_t curvature, wpi::units::meters_per_second_t velocity) const override
 Returns the max velocity given the current pose and curvature.
constexpr MinMax MinMaxAcceleration (const Pose2d &pose, wpi::units::curvature_t curvature, wpi::units::meters_per_second_t velocity) const override
 Returns the minimum and maximum allowable acceleration for the trajectory given pose, curvature, and velocity.
Public Member Functions inherited from wpi::math::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<std::derived_from< TrajectoryConstraint > Constraint>
class wpi::math::EllipticalRegionConstraint< Constraint >

Enforces a particular constraint only within an elliptical region.

Constructor & Destructor Documentation

◆ EllipticalRegionConstraint() [1/2]

template<std::derived_from< TrajectoryConstraint > Constraint>
wpi::math::EllipticalRegionConstraint< Constraint >::EllipticalRegionConstraint ( const Translation2d & center,
wpi::units::meter_t xWidth,
wpi::units::meter_t yWidth,
const Rotation2d & rotation,
const Constraint & constraint )
inlineconstexpr

Constructs a new EllipticalRegionConstraint.

Parameters
centerThe center of the ellipse in which to enforce the constraint.
xWidthThe width of the ellipse in which to enforce the constraint.
yWidthThe height of the ellipse in which to enforce the constraint.
rotationThe rotation to apply to all radii around the origin.
constraintThe constraint to enforce when the robot is within the region.
Deprecated
Use constructor taking Ellipse2d instead.

◆ EllipticalRegionConstraint() [2/2]

template<std::derived_from< TrajectoryConstraint > Constraint>
wpi::math::EllipticalRegionConstraint< Constraint >::EllipticalRegionConstraint ( const Ellipse2d & ellipse,
const Constraint & constraint )
inlineconstexpr

Constructs a new EllipticalRegionConstraint.

Parameters
ellipseThe ellipse in which to enforce the constraint.
constraintThe constraint to enforce when the robot is within the region.

Member Function Documentation

◆ MaxVelocity()

template<std::derived_from< TrajectoryConstraint > Constraint>
wpi::units::meters_per_second_t wpi::math::EllipticalRegionConstraint< Constraint >::MaxVelocity ( const Pose2d & pose,
wpi::units::curvature_t curvature,
wpi::units::meters_per_second_t velocity ) const
inlineconstexproverridevirtual

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 wpi::math::TrajectoryConstraint.

◆ MinMaxAcceleration()

template<std::derived_from< TrajectoryConstraint > Constraint>
MinMax wpi::math::EllipticalRegionConstraint< Constraint >::MinMaxAcceleration ( const Pose2d & pose,
wpi::units::curvature_t curvature,
wpi::units::meters_per_second_t velocity ) const
inlineconstexproverridevirtual

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

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.
Returns
The min and max acceleration bounds.

Implements wpi::math::TrajectoryConstraint.


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