19template <std::derived_from<TrajectoryConstra
int> Constra
int>
33 units::meter_t yWidth,
const Rotation2d& rotation,
34 const Constraint& constraint)
36 m_radii(xWidth / 2.0, yWidth / 2.0),
37 m_constraint(constraint) {
38 m_radii = m_radii.
RotateBy(rotation);
43 units::meters_per_second_t velocity)
const override {
45 return m_constraint.MaxVelocity(pose, curvature, velocity);
47 return units::meters_per_second_t{
48 std::numeric_limits<double>::infinity()};
53 units::meters_per_second_t speed)
const override {
55 return m_constraint.MinMaxAcceleration(pose, curvature, speed);
79 return units::math::pow<2>(pose.
X() - m_center.
X()) *
80 units::math::pow<2>(m_radii.
Y()) +
81 units::math::pow<2>(pose.
Y() - m_center.
Y()) *
82 units::math::pow<2>(m_radii.
X()) <=
83 units::math::pow<2>(m_radii.
X()) * units::math::pow<2>(m_radii.
Y());
89 Constraint m_constraint;
Enforces a particular constraint only within an elliptical region.
Definition: EllipticalRegionConstraint.h:20
bool IsPoseInRegion(const Pose2d &pose) const
Returns whether the specified robot pose is within the region that the constraint is enforced in.
Definition: EllipticalRegionConstraint.h:68
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,...
Definition: EllipticalRegionConstraint.h:52
EllipticalRegionConstraint(const Translation2d ¢er, units::meter_t xWidth, units::meter_t yWidth, const Rotation2d &rotation, const Constraint &constraint)
Constructs a new EllipticalRegionConstraint.
Definition: EllipticalRegionConstraint.h:32
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.
Definition: EllipticalRegionConstraint.h:41
Represents a 2D pose containing translational and rotational elements.
Definition: Pose2d.h:23
constexpr units::meter_t Y() const
Returns the Y component of the pose's translation.
Definition: Pose2d.h:96
constexpr units::meter_t X() const
Returns the X component of the pose's translation.
Definition: Pose2d.h:89
A rotation in a 2D coordinate frame represented by a point on the unit circle (cosine and sine).
Definition: Rotation2d.h:23
An interface for defining user-defined velocity and acceleration constraints while generating traject...
Definition: TrajectoryConstraint.h:22
Represents a translation in 2D space.
Definition: Translation2d.h:27
constexpr units::meter_t X() const
Returns the X component of the translation.
Definition: Translation2d.h:76
constexpr Translation2d RotateBy(const Rotation2d &other) const
Applies a rotation to the translation in 2D space.
Definition: Translation2d.inc:27
constexpr units::meter_t Y() const
Returns the Y component of the translation.
Definition: Translation2d.h:83
Definition: AprilTagPoseEstimator.h:15
Represents a minimum and maximum acceleration.
Definition: TrajectoryConstraint.h:37