Class TurnToCommand
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.CommandBase
-
- io.github.frc5024.lib5k.bases.drivetrain.commands.TurnToCommand
-
public class TurnToCommand extends CommandBase
A command for making drivetrains turn to a specific heading.
-
-
Field Summary
-
Fields inherited from class edu.wpi.first.wpilibj2.command.CommandBase
m_requirements
-
-
Constructor Summary
Constructors Constructor Description TurnToCommand(AbstractDriveTrain driveTrain, Rotation2d fieldRelativeAngle, Rotation2d epsilon)
Create a new TurnToCommandTurnToCommand(AbstractDriveTrain driveTrain, Rotation2d angle, Rotation2d epsilon, boolean fieldRelative)
Create a new TurnToCommandTurnToCommand(AbstractDriveTrain driveTrain, Rotation2d fieldRelativeAngle, Rotation2d epsilon, double speedCap)
Create a new TurnToCommandTurnToCommand(AbstractDriveTrain driveTrain, Rotation2d angle, Rotation2d epsilon, double speedCap, boolean fieldRelative)
Create a new TurnToCommand
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
end(boolean interrupted)
void
execute()
void
initialize()
boolean
isFinished()
-
Methods inherited from class edu.wpi.first.wpilibj2.command.CommandBase
addRequirements, getName, getRequirements, getSubsystem, initSendable, setName, setSubsystem, withName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.wpi.first.wpilibj2.command.Command
alongWith, andThen, andThen, asProxy, beforeStarting, cancel, deadlineWith, hasRequirement, isScheduled, perpetually, raceWith, runsWhenDisabled, schedule, schedule, withInterrupt, withTimeout
-
-
-
-
Constructor Detail
-
TurnToCommand
public TurnToCommand(AbstractDriveTrain driveTrain, Rotation2d fieldRelativeAngle, Rotation2d epsilon)
Create a new TurnToCommand- Parameters:
driveTrain
- DriveTrain to controlfieldRelativeAngle
- Desired heading (field-relative)epsilon
- Rotational epsilon
-
TurnToCommand
public TurnToCommand(AbstractDriveTrain driveTrain, Rotation2d angle, Rotation2d epsilon, boolean fieldRelative)
Create a new TurnToCommand- Parameters:
driveTrain
- DriveTrain to controlangle
- Desired headingepsilon
- Rotational epsilonfieldRelative
- Is the desired heading field-relative?
-
TurnToCommand
public TurnToCommand(AbstractDriveTrain driveTrain, Rotation2d fieldRelativeAngle, Rotation2d epsilon, double speedCap)
Create a new TurnToCommand- Parameters:
driveTrain
- DriveTrain to controlfieldRelativeAngle
- Desired heading (field-relative)epsilon
- Rotational epsilonspeedCap
- Maximum speed as a percent
-
TurnToCommand
public TurnToCommand(AbstractDriveTrain driveTrain, Rotation2d angle, Rotation2d epsilon, double speedCap, boolean fieldRelative)
Create a new TurnToCommand- Parameters:
driveTrain
- DriveTrain to controlangle
- Desired headingepsilon
- Rotational epsilonspeedCap
- Maximum speed as a percentfieldRelative
- Is the desired heading field-relative?
-
-