Package com.flarerobotics.lib.auto
Class AutonomousManager.ZoneTrigger
java.lang.Object
com.flarerobotics.lib.auto.AutonomousManager.ZoneTrigger
- Enclosing class:
- AutonomousManager
Creates a trigger zone to execute a command when the robot is close enough to a pose by the
given amount.
-
Constructor Summary
ConstructorsConstructorDescriptionZoneTrigger
(String poseName, double triggerDist, edu.wpi.first.wpilibj2.command.Command command) Constructs a new ZoneTrigger. -
Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.wpilibj2.command.Command
Returns the command to execute.Returns the origin pose of the trigger.double
Returns the distance from the pose to trigger the command.
-
Constructor Details
-
ZoneTrigger
public ZoneTrigger(String poseName, double triggerDist, edu.wpi.first.wpilibj2.command.Command command) Constructs a new ZoneTrigger.- Parameters:
poseName
- The name of origin of the trigger.triggerDist
- The distance from the pose to trigger the command.command
- The command to execute when the robot is within the trigger distance.
-
-
Method Details
-
getPoseName
Returns the origin pose of the trigger.- Returns:
- The pose name.
-
getTriggerDistance
public double getTriggerDistance()Returns the distance from the pose to trigger the command.- Returns:
- The trigger distance.
-
getCommand
public edu.wpi.first.wpilibj2.command.Command getCommand()Returns the command to execute.- Returns:
- The command.
-