Package xbot.common.trajectory
Class LowResField
java.lang.Object
xbot.common.trajectory.LowResField
- All Implemented Interfaces:
ProvidesWaypoints
Represents a simple version of the field, with Axis-Aligned Bounding Boxes representing no-go zones due to obstacles.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an obstacle to the field.generatePath
(Pose2d currentPose, Pose2d targetPoint) Generates a path from the current position to the target point, avoiding known obstacles.
-
Constructor Details
-
LowResField
public LowResField()
-
-
Method Details
-
addObstacle
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
-
generatePath
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 interfaceProvidesWaypoints
- Parameters:
currentPose
- Starting pointtargetPoint
- Terminating Point- Returns:
- A List of XbotSwervePoints that can be followed to reach the destination without collision.
-