Class ProjectileTarget

java.lang.Object
com.flarerobotics.lib.control.shooter.data.ProjectileTarget

public class ProjectileTarget extends Object
A class representing a projectile target on the field.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final boolean
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProjectileTarget(Surface3d surface, boolean hideProjectileOnHit)
    Constructs a new ProjectileTarget.
    ProjectileTarget(edu.wpi.first.math.geometry.Translation3d point, double toleranceMeters, boolean hideProjectileOnHit)
    Constructs a new ProjectileTarget.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkHit(edu.wpi.first.math.geometry.Pose3d prev, edu.wpi.first.math.geometry.Pose3d current)
    Checks whether the target was hit or not over a very short interval.

    Methods inherited from class java.lang.Object

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

    • hideProjectileOnHit

      public final boolean hideProjectileOnHit
  • Constructor Details

    • ProjectileTarget

      public ProjectileTarget(Surface3d surface, boolean hideProjectileOnHit)
      Constructs a new ProjectileTarget.
      Parameters:
      surface - The hit surface.
      hideProjectileOnHit - Whether to destroy the projectile after hit.
    • ProjectileTarget

      public ProjectileTarget(edu.wpi.first.math.geometry.Translation3d point, double toleranceMeters, boolean hideProjectileOnHit)
      Constructs a new ProjectileTarget.
      Parameters:
      point - The target point.
      toleranceMeters - The tolerance for the hit, in meters.
      hideProjectileOnHit - Whether to destroy the projectile after hit.
  • Method Details

    • checkHit

      public boolean checkHit(edu.wpi.first.math.geometry.Pose3d prev, edu.wpi.first.math.geometry.Pose3d current)
      Checks whether the target was hit or not over a very short interval.
      Parameters:
      prev - The previous pose.
      current - The current pose.
      Returns:
      True if hit, false otherwise.