WPILibC++ 2024.3.2
frc::RectangularRegionConstraint< Constraint > Class Template Reference

Enforces a particular constraint only within a rectangular region. More...

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

Inheritance diagram for frc::RectangularRegionConstraint< Constraint >:
frc::TrajectoryConstraint

Public Member Functions

 RectangularRegionConstraint (const Translation2d &bottomLeftPoint, const Translation2d &topRightPoint, const Constraint &constraint)
 Constructs a new RectangularRegionConstraint. More...
 
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. More...
 
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. More...
 
bool IsPoseInRegion (const Pose2d &pose) const
 Returns whether the specified robot pose is within the region that the constraint is enforced in. More...
 
- Public Member Functions inherited from frc::TrajectoryConstraint
 TrajectoryConstraint ()=default
 
 TrajectoryConstraint (const TrajectoryConstraint &)=default
 
TrajectoryConstraintoperator= (const TrajectoryConstraint &)=default
 
 TrajectoryConstraint (TrajectoryConstraint &&)=default
 
TrajectoryConstraintoperator= (TrajectoryConstraint &&)=default
 
virtual ~TrajectoryConstraint ()=default
 
virtual 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. More...
 
virtual 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. More...
 

Detailed Description

template<std::derived_from< TrajectoryConstraint > Constraint>
class frc::RectangularRegionConstraint< Constraint >

Enforces a particular constraint only within a rectangular region.

Constructor & Destructor Documentation

◆ RectangularRegionConstraint()

template<std::derived_from< TrajectoryConstraint > Constraint>
frc::RectangularRegionConstraint< Constraint >::RectangularRegionConstraint ( const Translation2d bottomLeftPoint,
const Translation2d topRightPoint,
const Constraint &  constraint 
)
inline

Constructs a new RectangularRegionConstraint.

Parameters
bottomLeftPointThe bottom left point of the rectangular region in which to enforce the constraint.
topRightPointThe top right point of the rectangular region in which to enforce the constraint.
constraintThe constraint to enforce when the robot is within the region.

Member Function Documentation

◆ IsPoseInRegion()

template<std::derived_from< TrajectoryConstraint > Constraint>
bool frc::RectangularRegionConstraint< Constraint >::IsPoseInRegion ( const Pose2d pose) const
inline

Returns whether the specified robot pose is within the region that the constraint is enforced in.

Parameters
poseThe robot pose.
Returns
Whether the robot pose is within the constraint region.

◆ MaxVelocity()

template<std::derived_from< TrajectoryConstraint > Constraint>
units::meters_per_second_t frc::RectangularRegionConstraint< Constraint >::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<std::derived_from< TrajectoryConstraint > Constraint>
MinMax frc::RectangularRegionConstraint< Constraint >::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: