Class MecanumDriveBlank
java.lang.Object
org.firstinspires.ftc.teamcode.fy23.robot.subsystems.blank.MecanumDriveBlank
- All Implemented Interfaces:
org.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
,RRMecanumDrive
public class MecanumDriveBlank
extends Object
implements org.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive, RRMecanumDrive
A blank implementation of
MecanumDrive
that does nothing. Can also be
used for any variant of that interface. Never returns null (returns blank objects
instead where applicable), so hopefully no null pointers.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
org.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive.Parameters
Nested classes/interfaces inherited from interface org.firstinspires.ftc.teamcode.fy23.robot.subsystems.RRMecanumDrive
RRMecanumDrive.DriveConstants, RRMecanumDrive.Parameters
-
Field Summary
Fields inherited from interface org.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
leftBack, leftFront, rightBack, rightFront
Fields inherited from interface org.firstinspires.ftc.teamcode.fy23.robot.subsystems.RRMecanumDrive
ACCEL_CONSTRAINT, VEL_CONSTRAINT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Apply motor powers from a DTS (Drive-Turn-Strafe).void
followTrajectory
(com.acmerobotics.roadrunner.trajectory.Trajectory trajectory) Blocking method to follow a trajectory created by TrajectoryBuilder (NOT TrajectorySequenceBuilder).void
followTrajectoryAsync
(com.acmerobotics.roadrunner.trajectory.Trajectory trajectory) Asynchronously follows a trajectory created by TrajectoryBuilder (NOT TrajectorySequenceBuilder).void
followTrajectorySequence
(TrajectorySequence trajectorySequence) Blocking method to follow a trajectory created by TrajectorySequenceBuilder.void
followTrajectorySequenceAsync
(TrajectorySequence trajectorySequence) Asynchronously follows a trajectory created by TrajectorySequenceBuilder.com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryAccelerationConstraint
getAccelerationConstraint
(double maxAccel) Use your robot's FriendlyIMU instead.com.acmerobotics.roadrunner.geometry.Pose2d
com.qualcomm.robotcore.hardware.DcMotorEx
Get the leftBack motor, if direct access is neededcom.qualcomm.robotcore.hardware.DcMotorEx
Get the leftFront motor, if direct access is neededcom.acmerobotics.roadrunner.geometry.Pose2d
double
Use your robot's FriendlyIMU instead.com.qualcomm.robotcore.hardware.DcMotorEx
Get the rightBack motor, if direct access is neededcom.qualcomm.robotcore.hardware.DcMotorEx
Get the rightFront motor, if direct access is neededcom.acmerobotics.roadrunner.trajectory.constraints.TrajectoryVelocityConstraint
getVelocityConstraint
(double maxVel, double maxAngularVel, double trackWidth) boolean
isBusy()
Is RoadRunner doing something right now?void
Please use applyDTS() instead.void
void
setMode
(com.qualcomm.robotcore.hardware.DcMotor.RunMode runMode) The usual DcMotor method, but applied to all four motors.void
setMotorPowers
(double v, double v1, double v2, double v3) Please use applyDTS() instead.void
setPIDFCoefficients
(com.qualcomm.robotcore.hardware.DcMotor.RunMode runMode, com.qualcomm.robotcore.hardware.PIDFCoefficients coefficients) void
setPoseEstimate
(com.acmerobotics.roadrunner.geometry.Pose2d startPose) void
setWeightedDrivePower
(com.acmerobotics.roadrunner.geometry.Pose2d drivePower) Please use applyDTS() instead.void
setZeroPowerBehavior
(com.qualcomm.robotcore.hardware.DcMotor.ZeroPowerBehavior behavior) The usual DcMotor method, but applied to all four motors.com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder
trajectoryBuilder
(com.acmerobotics.roadrunner.geometry.Pose2d startPose) We'll usually use TrajectorySequenceBuilder.com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder
trajectoryBuilder
(com.acmerobotics.roadrunner.geometry.Pose2d startPose, boolean reversed) We'll usually use TrajectorySequenceBuilder.com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder
trajectoryBuilder
(com.acmerobotics.roadrunner.geometry.Pose2d startPose, double startHeading) We'll usually use TrajectorySequenceBuilder.trajectorySequenceBuilder
(com.acmerobotics.roadrunner.geometry.Pose2d startPose) Learn more at https://learnroadrunner.com/trajectory-sequence.html.void
turn
(double angle) void
turnAsync
(double angle) void
update()
Called by robot.update().void
void
A poorly named RoadRunner update method that only updates RR stuff (like async(?) trajectory following) when the OpMode thread is active.
-
Constructor Details
-
MecanumDriveBlank
public MecanumDriveBlank()
-
-
Method Details
-
getLeftFrontMotor
public com.qualcomm.robotcore.hardware.DcMotorEx getLeftFrontMotor()Description copied from interface:RRMecanumDrive
Get the leftFront motor, if direct access is needed- Specified by:
getLeftFrontMotor
in interfaceRRMecanumDrive
-
getRightFrontMotor
public com.qualcomm.robotcore.hardware.DcMotorEx getRightFrontMotor()Description copied from interface:RRMecanumDrive
Get the rightFront motor, if direct access is needed- Specified by:
getRightFrontMotor
in interfaceRRMecanumDrive
-
getLeftBackMotor
public com.qualcomm.robotcore.hardware.DcMotorEx getLeftBackMotor()Description copied from interface:RRMecanumDrive
Get the leftBack motor, if direct access is needed- Specified by:
getLeftBackMotor
in interfaceRRMecanumDrive
-
getRightBackMotor
public com.qualcomm.robotcore.hardware.DcMotorEx getRightBackMotor()Description copied from interface:RRMecanumDrive
Get the rightBack motor, if direct access is needed- Specified by:
getRightBackMotor
in interfaceRRMecanumDrive
-
applyDTS
Description copied from interface:RRMecanumDrive
Apply motor powers from a DTS (Drive-Turn-Strafe).- Specified by:
applyDTS
in interfaceorg.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
- Specified by:
applyDTS
in interfaceRRMecanumDrive
- Parameters:
dts
- The DTS to apply. Normalize it before passing it in for desirable behavior.
-
setMode
public void setMode(com.qualcomm.robotcore.hardware.DcMotor.RunMode runMode) Description copied from interface:RRMecanumDrive
The usual DcMotor method, but applied to all four motors.- Specified by:
setMode
in interfaceorg.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
- Specified by:
setMode
in interfaceRRMecanumDrive
- Parameters:
runMode
- The RunMode to set
-
setZeroPowerBehavior
public void setZeroPowerBehavior(com.qualcomm.robotcore.hardware.DcMotor.ZeroPowerBehavior behavior) Description copied from interface:RRMecanumDrive
The usual DcMotor method, but applied to all four motors.- Specified by:
setZeroPowerBehavior
in interfaceorg.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
- Specified by:
setZeroPowerBehavior
in interfaceRRMecanumDrive
- Parameters:
behavior
- The ZeroPowerBehavior to set
-
update
public void update()Description copied from interface:RRMecanumDrive
Called by robot.update(). You do not need to call this method.- Specified by:
update
in interfaceorg.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
- Specified by:
update
in interfaceRRMecanumDrive
-
trajectoryBuilder
public com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder trajectoryBuilder(com.acmerobotics.roadrunner.geometry.Pose2d startPose) Description copied from interface:RRMecanumDrive
We'll usually use TrajectorySequenceBuilder. Learn more about TrajectoryBuilder at https://learnroadrunner.com/trajectories.html#building-a-trajectory.- Specified by:
trajectoryBuilder
in interfaceRRMecanumDrive
-
trajectoryBuilder
public com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder trajectoryBuilder(com.acmerobotics.roadrunner.geometry.Pose2d startPose, boolean reversed) Description copied from interface:RRMecanumDrive
We'll usually use TrajectorySequenceBuilder. Learn more about TrajectoryBuilder at https://learnroadrunner.com/trajectories.html#building-a-trajectory.- Specified by:
trajectoryBuilder
in interfaceRRMecanumDrive
-
trajectoryBuilder
public com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder trajectoryBuilder(com.acmerobotics.roadrunner.geometry.Pose2d startPose, double startHeading) Description copied from interface:RRMecanumDrive
We'll usually use TrajectorySequenceBuilder. Learn more about TrajectoryBuilder at https://learnroadrunner.com/trajectories.html#building-a-trajectory.- Specified by:
trajectoryBuilder
in interfaceRRMecanumDrive
-
trajectorySequenceBuilder
public TrajectorySequenceBuilder trajectorySequenceBuilder(com.acmerobotics.roadrunner.geometry.Pose2d startPose) Description copied from interface:RRMecanumDrive
Learn more at https://learnroadrunner.com/trajectory-sequence.html.- Specified by:
trajectorySequenceBuilder
in interfaceRRMecanumDrive
-
turnAsync
public void turnAsync(double angle) - Specified by:
turnAsync
in interfaceRRMecanumDrive
-
turn
public void turn(double angle) - Specified by:
turn
in interfaceRRMecanumDrive
-
followTrajectoryAsync
public void followTrajectoryAsync(com.acmerobotics.roadrunner.trajectory.Trajectory trajectory) Description copied from interface:RRMecanumDrive
Asynchronously follows a trajectory created by TrajectoryBuilder (NOT TrajectorySequenceBuilder).- Specified by:
followTrajectoryAsync
in interfaceRRMecanumDrive
-
followTrajectory
public void followTrajectory(com.acmerobotics.roadrunner.trajectory.Trajectory trajectory) Description copied from interface:RRMecanumDrive
Blocking method to follow a trajectory created by TrajectoryBuilder (NOT TrajectorySequenceBuilder).- Specified by:
followTrajectory
in interfaceRRMecanumDrive
-
followTrajectorySequenceAsync
Description copied from interface:RRMecanumDrive
Asynchronously follows a trajectory created by TrajectorySequenceBuilder.- Specified by:
followTrajectorySequenceAsync
in interfaceRRMecanumDrive
-
followTrajectorySequence
Description copied from interface:RRMecanumDrive
Blocking method to follow a trajectory created by TrajectorySequenceBuilder.- Specified by:
followTrajectorySequence
in interfaceRRMecanumDrive
-
getLastError
public com.acmerobotics.roadrunner.geometry.Pose2d getLastError()- Specified by:
getLastError
in interfaceRRMecanumDrive
-
waitForIdle
public void waitForIdle()Description copied from interface:RRMecanumDrive
A poorly named RoadRunner update method that only updates RR stuff (like async(?) trajectory following) when the OpMode thread is active.- Specified by:
waitForIdle
in interfaceRRMecanumDrive
-
isBusy
public boolean isBusy()Description copied from interface:RRMecanumDrive
Is RoadRunner doing something right now?- Specified by:
isBusy
in interfaceRRMecanumDrive
-
setPIDFCoefficients
public void setPIDFCoefficients(com.qualcomm.robotcore.hardware.DcMotor.RunMode runMode, com.qualcomm.robotcore.hardware.PIDFCoefficients coefficients) - Specified by:
setPIDFCoefficients
in interfaceRRMecanumDrive
-
setWeightedDrivePower
public void setWeightedDrivePower(com.acmerobotics.roadrunner.geometry.Pose2d drivePower) Description copied from interface:RRMecanumDrive
Please use applyDTS() instead. This only exists for compatibility with stuff written for SampleMecanumDrive.- Specified by:
setWeightedDrivePower
in interfaceRRMecanumDrive
-
getWheelPositions
- Specified by:
getWheelPositions
in interfaceRRMecanumDrive
-
getWheelVelocities
- Specified by:
getWheelVelocities
in interfaceRRMecanumDrive
-
setMotorPowers
public void setMotorPowers(double v, double v1, double v2, double v3) Description copied from interface:RRMecanumDrive
Please use applyDTS() instead. This only exists for compatibility with stuff written for SampleMecanumDrive.- Specified by:
setMotorPowers
in interfaceRRMecanumDrive
-
getRawExternalHeading
public double getRawExternalHeading()Description copied from interface:RRMecanumDrive
Use your robot's FriendlyIMU instead. This exists only to match SampleMecanumDrive.- Specified by:
getRawExternalHeading
in interfaceRRMecanumDrive
-
getExternalHeadingVelocity
Description copied from interface:RRMecanumDrive
Use your robot's FriendlyIMU instead. This exists only to match SampleMecanumDrive.- Specified by:
getExternalHeadingVelocity
in interfaceRRMecanumDrive
-
getVelocityConstraint
public com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryVelocityConstraint getVelocityConstraint(double maxVel, double maxAngularVel, double trackWidth) - Specified by:
getVelocityConstraint
in interfaceRRMecanumDrive
-
getAccelerationConstraint
public com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryAccelerationConstraint getAccelerationConstraint(double maxAccel) - Specified by:
getAccelerationConstraint
in interfaceRRMecanumDrive
-
setDrivePower
public void setDrivePower()Description copied from interface:RRMecanumDrive
Please use applyDTS() instead. This only exists for compatibility with stuff written for RoadRunner's MecanumDrive.- Specified by:
setDrivePower
in interfaceRRMecanumDrive
-
setDriveSignal
public void setDriveSignal()- Specified by:
setDriveSignal
in interfaceRRMecanumDrive
-
updatePoseEstimate
public void updatePoseEstimate()- Specified by:
updatePoseEstimate
in interfaceRRMecanumDrive
-
getPoseEstimate
public com.acmerobotics.roadrunner.geometry.Pose2d getPoseEstimate()- Specified by:
getPoseEstimate
in interfaceRRMecanumDrive
-
setPoseEstimate
public void setPoseEstimate(com.acmerobotics.roadrunner.geometry.Pose2d startPose) - Specified by:
setPoseEstimate
in interfaceRRMecanumDrive
-