Package tagalong.commands.aim
Class PivotAimAtYawCompCmd<T extends TagalongSubsystemBase & PivotAugment>
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
tagalong.commands.TagalongCommand
tagalong.commands.base.PivotToDynamicCmd<T>
tagalong.commands.aim.PivotAimAtYawCompCmd<T>
- All Implemented Interfaces:
- Sendable
public class PivotAimAtYawCompCmd<T extends TagalongSubsystemBase & PivotAugment>
extends PivotToDynamicCmd<T>
Command that continuously points at a target in 2d space while compensating for the current
 rotation of the robot. Since this is strictly rotational targeting give robot position as (X, Y)
 pose
- 
Nested Class SummaryNested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.CommandCommand.InterruptionBehavior
- 
Constructor SummaryConstructorsConstructorDescriptionPivotAimAtYawCompCmd(int id, T pivot, Supplier<Pose2d> positionSupplier, Translation2d target) Minimal constructor with default parametersPivotAimAtYawCompCmd(int id, T pivot, Supplier<Pose2d> positionSupplier, Translation2d target, boolean holdPositionAfter) Constructor that creates the command with the below parameters.PivotAimAtYawCompCmd(int id, T pivot, Supplier<Pose2d> positionSupplier, Translation2d target, boolean holdPositionAfter, double maxVelocityRPS) Constructor that creates the command with the below parameters.PivotAimAtYawCompCmd(T pivot, Supplier<Pose2d> positionSupplier, Translation2d target) Minimal constructor with default parametersPivotAimAtYawCompCmd(T pivot, Supplier<Pose2d> positionSupplier, Translation2d target, boolean holdPositionAfter) Constructor that creates the command with the below parameters.PivotAimAtYawCompCmd(T pivot, Supplier<Pose2d> positionSupplier, Translation2d target, boolean holdPositionAfter, double maxVelocityRPS) Constructor that creates the command with the below parameters.
- 
Method SummaryModifier and TypeMethodDescriptionprotected static DoubleSupplierpositionTransform(Supplier<Pose2d> location, DoubleSupplier pivotPosition, Translation2d target, double pivotMinRot, double pivotMaxRot) Transform position into an optimal path angle to target, compensates for the current robot yaw while respecting the system's positional limitsMethods inherited from class tagalong.commands.base.PivotToDynamicCmdend, execute, initialize, isFinishedMethods inherited from class tagalong.commands.TagalongCommandanonymizeMethods inherited from class edu.wpi.first.wpilibj2.command.CommandaddRequirements, addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineFor, deadlineWith, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initSendable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, runsWhenDisabled, schedule, setName, setSubsystem, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout
- 
Constructor Details- 
PivotAimAtYawCompCmdpublic PivotAimAtYawCompCmd(int id, T pivot, Supplier<Pose2d> positionSupplier, Translation2d target) Minimal constructor with default parameters- Parameters:
- id- Integer ID of the pivot microsystem inside the Tagalong Subsystem
- pivot- Tagalong Subsystem containing a pivot microsystem
- positionSupplier- Supplies the current robot position position
- target- Unmoving 2-dimensional target location
 
- 
PivotAimAtYawCompCmdMinimal constructor with default parameters- Parameters:
- pivot- Tagalong Subsystem containing a pivot microsystem
- positionSupplier- Supplies the current robot position position
- target- Unmoving 2-dimensional target location
 
- 
PivotAimAtYawCompCmdpublic PivotAimAtYawCompCmd(int id, T pivot, Supplier<Pose2d> positionSupplier, Translation2d target, boolean holdPositionAfter, double maxVelocityRPS) Constructor that creates the command with the below parameters.- Parameters:
- id- Integer ID of the pivot microsystem inside the Tagalong Subsystem
- pivot- Tagalong Subsystem containing a pivot microsystem
- positionSupplier- Supplies the current robot position position
- target- Unmoving 2-dimensional target location
- holdPositionAfter- If the pivot should hold position when the command completes
- maxVelocityRPS- The maximum velocity of the pivot, in rotations per second, during this command
 
- 
PivotAimAtYawCompCmdpublic PivotAimAtYawCompCmd(T pivot, Supplier<Pose2d> positionSupplier, Translation2d target, boolean holdPositionAfter, double maxVelocityRPS) Constructor that creates the command with the below parameters.- Parameters:
- pivot- Tagalong Subsystem containing a pivot microsystem
- positionSupplier- Supplies the current robot position position
- target- Unmoving 2-dimensional target location
- holdPositionAfter- If the pivot should hold position when the command completes
- maxVelocityRPS- The maximum velocity of the pivot, in rotations per second, during this command
 
- 
PivotAimAtYawCompCmdpublic PivotAimAtYawCompCmd(int id, T pivot, Supplier<Pose2d> positionSupplier, Translation2d target, boolean holdPositionAfter) Constructor that creates the command with the below parameters.- Parameters:
- id- Integer ID of the pivot microsystem inside the Tagalong Subsystem
- pivot- Tagalong Subsystem containing a pivot microsystem
- positionSupplier- Supplies the current robot position position
- target- Unmoving 2-dimensional target location
- holdPositionAfter- If the pivot should hold position when the command completes
 
- 
PivotAimAtYawCompCmdpublic PivotAimAtYawCompCmd(T pivot, Supplier<Pose2d> positionSupplier, Translation2d target, boolean holdPositionAfter) Constructor that creates the command with the below parameters.- Parameters:
- pivot- Tagalong Subsystem containing a pivot microsystem
- positionSupplier- Supplies the current robot position position
- target- Unmoving 2-dimensional target location
- holdPositionAfter- If the pivot should hold position when the command completes
 
 
- 
- 
Method Details- 
positionTransformprotected static DoubleSupplier positionTransform(Supplier<Pose2d> location, DoubleSupplier pivotPosition, Translation2d target, double pivotMinRot, double pivotMaxRot) Transform position into an optimal path angle to target, compensates for the current robot yaw while respecting the system's positional limits- Parameters:
- location- Current robot location supplier
- pivotPosition- Pivot position supplier
- target- Target to aim at's location
- pivotMinRot- pivots minimum position in rotations
- pivotMaxRot- pivots maximum position in rotations
- Returns:
- Optimal path target angle for the pivot
 
 
-