Class LowResField

java.lang.Object
xbot.common.trajectory.LowResField
All Implemented Interfaces:
ProvidesWaypoints

public class LowResField extends Object implements ProvidesWaypoints
Represents a simple version of the field, with Axis-Aligned Bounding Boxes representing no-go zones due to obstacles.
  • Constructor Details

    • LowResField

      public LowResField()
  • Method Details

    • addObstacle

      public void addObstacle(Obstacle o)
      Adds an obstacle to the field. If the obstacle intersects with any existing obstacles, it will be combined with the existing obstacle into a single larger obstacle with a bounding box that fully contains both obstacles. This should be the only method used to add new obstacles; otherwise obstacles could intersect.
      Parameters:
      o - The obstacle to add.
    • getObstacles

      public List<Obstacle> getObstacles()
    • generatePath

      public List<XbotSwervePoint> generatePath(Pose2d currentPose, Pose2d targetPoint)
      Generates a path from the current position to the target point, avoiding known obstacles. Very generally, it will recursively solve paths nearby the target, and then step foward to approach the target.
      Specified by:
      generatePath in interface ProvidesWaypoints
      Parameters:
      currentPose - Starting point
      targetPoint - Terminating Point
      Returns:
      A List of XbotSwervePoints that can be followed to reach the destination without collision.