Class PAPFController.LineObstacle

java.lang.Object
org.team1126.lib.math.PAPFController.Obstacle
org.team1126.lib.math.PAPFController.LineObstacle
Enclosing class:
PAPFController

public static final class PAPFController.LineObstacle extends PAPFController.Obstacle
A line segment that pushes perpendicular from its length.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LineObstacle(edu.wpi.first.math.geometry.Translation2d start, edu.wpi.first.math.geometry.Translation2d end, boolean sidesOnly, double strength, double range)
    Creates a line obstacle.
    LineObstacle(edu.wpi.first.math.geometry.Translation2d start, edu.wpi.first.math.geometry.Translation2d end, boolean sidesOnly, double strength, double range, PAPFController.ForceHeuristic heuristic)
    Creates a line obstacle.
    LineObstacle(edu.wpi.first.math.geometry.Translation2d start, edu.wpi.first.math.geometry.Translation2d end, double strength, double range)
    Creates a line obstacle.
    LineObstacle(edu.wpi.first.math.geometry.Translation2d start, edu.wpi.first.math.geometry.Translation2d end, double strength, double range, PAPFController.ForceHeuristic heuristic)
    Creates a line obstacle.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    applyForce(double x, double y, org.team1126.lib.math.PAPFController.NetForce netForce)
    Applies the force generated by the obstacle to the provided accumulator, based on the robot's current position and goal.

    Methods inherited from class org.team1126.lib.math.PAPFController.Obstacle

    getForceMagnitude

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LineObstacle

      public LineObstacle(edu.wpi.first.math.geometry.Translation2d start, edu.wpi.first.math.geometry.Translation2d end, double strength, double range)
      Creates a line obstacle.
      Parameters:
      start - The start of the line segment.
      end - The end of the line segment.
      strength - The strength of the obstacle's force. Positive values represent a repulsive potential (pushes away), negative values represent an attractive potential (pulls towards).
      range - The range of the obstacle's potential, in meters.
    • LineObstacle

      public LineObstacle(edu.wpi.first.math.geometry.Translation2d start, edu.wpi.first.math.geometry.Translation2d end, boolean sidesOnly, double strength, double range)
      Creates a line obstacle.
      Parameters:
      start - The start of the line segment.
      end - The end of the line segment.
      sidesOnly - If the line obstacle should only apply force when a projection perpendicular to the line from the robot's position intersects the line.
      strength - The strength of the obstacle's force. Positive values represent a repulsive potential (pushes away), negative values represent an attractive potential (pulls towards).
      range - The range of the obstacle's potential, in meters.
    • LineObstacle

      public LineObstacle(edu.wpi.first.math.geometry.Translation2d start, edu.wpi.first.math.geometry.Translation2d end, double strength, double range, PAPFController.ForceHeuristic heuristic)
      Creates a line obstacle.
      Parameters:
      start - The start of the line segment.
      end - The end of the line segment.
      strength - The strength of the obstacle's force. Positive values represent a repulsive potential (pushes away), negative values represent an attractive potential (pulls towards).
      range - The range of the obstacle's potential, in meters.
      heuristic - A heuristic for transforming the obstacle's force profile.
    • LineObstacle

      public LineObstacle(edu.wpi.first.math.geometry.Translation2d start, edu.wpi.first.math.geometry.Translation2d end, boolean sidesOnly, double strength, double range, PAPFController.ForceHeuristic heuristic)
      Creates a line obstacle.
      Parameters:
      start - The start of the line segment.
      end - The end of the line segment.
      sidesOnly - If the line obstacle should only apply force when a projection perpendicular to the line from the robot's position intersects the line.
      strength - The strength of the obstacle's force. Positive values represent a repulsive potential (pushes away), negative values represent an attractive potential (pulls towards).
      range - The range of the obstacle's potential, in meters.
      heuristic - A heuristic for transforming the obstacle's force profile.
  • Method Details

    • applyForce

      public void applyForce(double x, double y, org.team1126.lib.math.PAPFController.NetForce netForce)
      Description copied from class: PAPFController.Obstacle
      Applies the force generated by the obstacle to the provided accumulator, based on the robot's current position and goal.
      Specified by:
      applyForce in class PAPFController.Obstacle
      Parameters:
      x - The robot's current X position on the field.
      y - The robot's current Y position on the field.
      netForce - The force accumulator to apply the force to.