Class ProjectileTarget
java.lang.Object
com.flarerobotics.lib.control.shooter.data.ProjectileTarget
A class representing a projectile target on the field.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionProjectileTarget
(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 TypeMethodDescriptionboolean
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.
-
Field Details
-
hideProjectileOnHit
public final boolean hideProjectileOnHit
-
-
Constructor Details
-
ProjectileTarget
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.
-