Class CircleFieldObstacle
java.lang.Object
xbot.common.subsystems.pose.CircleFieldObstacle
- All Implemented Interfaces:
IFieldObstacle
-
Constructor Summary
ConstructorsConstructorDescriptionCircleFieldObstacle(org.wpilib.math.geometry.Translation2d center, org.wpilib.units.measure.Distance radius, boolean isToughTerrain) -
Method Summary
Modifier and TypeMethodDescriptionorg.wpilib.units.measure.DistanceWhat's the radius that we'll attempt to avoid when we need to move away from the obstacle.org.wpilib.math.geometry.Translation2dcenter()Returns the center of the obstacle to help determine closest obstacle.booleandoesRobotPathIntersect(org.wpilib.math.geometry.Translation2d start, org.wpilib.math.geometry.Translation2d end, org.wpilib.units.measure.Distance robotRadius) Whether the described robot path will collide with this field obstacle or not.booleanReturns this obstacle can still be moved through, but is slower terrain or more dangerous terrain to move through.org.wpilib.units.measure.Distanceradius()
-
Constructor Details
-
CircleFieldObstacle
public CircleFieldObstacle(org.wpilib.math.geometry.Translation2d center, org.wpilib.units.measure.Distance radius, boolean isToughTerrain)
-
-
Method Details
-
isToughTerrain
public boolean isToughTerrain()Description copied from interface:IFieldObstacleReturns this obstacle can still be moved through, but is slower terrain or more dangerous terrain to move through.- Specified by:
isToughTerrainin interfaceIFieldObstacle- Returns:
- Whether the obstacle matches the description above for tough terrain.
-
center
public org.wpilib.math.geometry.Translation2d center()Description copied from interface:IFieldObstacleReturns the center of the obstacle to help determine closest obstacle.- Specified by:
centerin interfaceIFieldObstacle- Returns:
- A translation 2d for where the center of this obstacle
-
radius
public org.wpilib.units.measure.Distance radius() -
avoidanceRadius
public org.wpilib.units.measure.Distance avoidanceRadius()Description copied from interface:IFieldObstacleWhat's the radius that we'll attempt to avoid when we need to move away from the obstacle.- Specified by:
avoidanceRadiusin interfaceIFieldObstacle- Returns:
- Whether the obstacle matches the description above for tough terrain.
-
doesRobotPathIntersect
public boolean doesRobotPathIntersect(org.wpilib.math.geometry.Translation2d start, org.wpilib.math.geometry.Translation2d end, org.wpilib.units.measure.Distance robotRadius) Description copied from interface:IFieldObstacleWhether the described robot path will collide with this field obstacle or not.- Specified by:
doesRobotPathIntersectin interfaceIFieldObstacle- Parameters:
start- The start of the path.end- The end of the path.robotRadius- The radius we should use to determine whether the robot can make the path through this obstacle.- Returns:
- Whether the path will work for this obstacle.
-