RectangularRegionConstraint

class wpimath.trajectory.constraint.RectangularRegionConstraint(bottomLeftPoint: wpimath.geometry._geometry.Translation2d, topRightPoint: wpimath.geometry._geometry.Translation2d, constraint: TrajectoryConstraint)

Bases: TrajectoryConstraint

Enforces a particular constraint only within a rectangular region.

Constructs a new RectangularRegionConstraint.

Parameters:
  • bottomLeftPoint – The bottom left point of the rectangular region in which to enforce the constraint.

  • topRightPoint – The top right point of the rectangular region in which to enforce the constraint.

  • constraint – The constraint to enforce when the robot is within the region.

isPoseInRegion(pose: wpimath.geometry._geometry.Pose2d) bool

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

Parameters:

pose – The robot pose.

Returns:

Whether the robot pose is within the constraint region.

maxVelocity(pose: wpimath.geometry._geometry.Pose2d, curvature: radians_per_meter, velocity: meters_per_second) meters_per_second
minMaxAcceleration(pose: wpimath.geometry._geometry.Pose2d, curvature: radians_per_meter, speed: meters_per_second) wpimath._controls._controls.constraint.TrajectoryConstraint.MinMax