Class MecanumDriveBlank
java.lang.Object
org.firstinspires.ftc.teamcode.fy23.robot.subsystems.blank.MecanumDriveBlank
- All Implemented Interfaces:
RRMecanumDrive
A blank implementation of
RRMecanumDrive (and formerly 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.subsystems.RRMecanumDrive
RRMecanumDrive.DriveConstants, RRMecanumDrive.Parameters -
Field Summary
Fields inherited from interface org.firstinspires.ftc.teamcode.fy23.robot.subsystems.RRMecanumDrive
ACCEL_CONSTRAINT, VEL_CONSTRAINT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidApply motor powers from a DTS (Drive-Turn-Strafe).voidfollowTrajectory(com.acmerobotics.roadrunner.trajectory.Trajectory trajectory) Blocking method to follow a trajectory created by TrajectoryBuilder (NOT TrajectorySequenceBuilder).voidfollowTrajectoryAsync(com.acmerobotics.roadrunner.trajectory.Trajectory trajectory) Asynchronously follows a trajectory created by TrajectoryBuilder (NOT TrajectorySequenceBuilder).voidfollowTrajectorySequence(TrajectorySequence trajectorySequence) Blocking method to follow a trajectory created by TrajectorySequenceBuilder.voidfollowTrajectorySequenceAsync(TrajectorySequence trajectorySequence) Asynchronously follows a trajectory created by TrajectorySequenceBuilder.com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryAccelerationConstraintgetAccelerationConstraint(double maxAccel) Use your robot's FriendlyIMU instead.com.acmerobotics.roadrunner.geometry.Pose2dcom.qualcomm.robotcore.hardware.DcMotorExGet the leftBack motor, if direct access is neededcom.qualcomm.robotcore.hardware.DcMotorExGet the leftFront motor, if direct access is neededcom.acmerobotics.roadrunner.geometry.Pose2ddoubleUse your robot's FriendlyIMU instead.com.qualcomm.robotcore.hardware.DcMotorExGet the rightBack motor, if direct access is neededcom.qualcomm.robotcore.hardware.DcMotorExGet the rightFront motor, if direct access is neededcom.acmerobotics.roadrunner.trajectory.constraints.TrajectoryVelocityConstraintgetVelocityConstraint(double maxVel, double maxAngularVel, double trackWidth) booleanisBusy()Is RoadRunner doing something right now?voidPlease use applyDTS() instead.voidvoidsetMode(com.qualcomm.robotcore.hardware.DcMotor.RunMode runMode) The usual DcMotor method, but applied to all four motors.voidsetMotorPowers(double v, double v1, double v2, double v3) Please use applyDTS() instead.voidsetPIDFCoefficients(com.qualcomm.robotcore.hardware.DcMotor.RunMode runMode, com.qualcomm.robotcore.hardware.PIDFCoefficients coefficients) voidsetPoseEstimate(com.acmerobotics.roadrunner.geometry.Pose2d startPose) voidsetWeightedDrivePower(com.acmerobotics.roadrunner.geometry.Pose2d drivePower) Please use applyDTS() instead.voidsetZeroPowerBehavior(com.qualcomm.robotcore.hardware.DcMotor.ZeroPowerBehavior behavior) The usual DcMotor method, but applied to all four motors.com.acmerobotics.roadrunner.trajectory.TrajectoryBuildertrajectoryBuilder(com.acmerobotics.roadrunner.geometry.Pose2d startPose) We'll usually use TrajectorySequenceBuilder.com.acmerobotics.roadrunner.trajectory.TrajectoryBuildertrajectoryBuilder(com.acmerobotics.roadrunner.geometry.Pose2d startPose, boolean reversed) We'll usually use TrajectorySequenceBuilder.com.acmerobotics.roadrunner.trajectory.TrajectoryBuildertrajectoryBuilder(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.voidturn(double angle) voidturnAsync(double angle) voidupdate()Called by robot.update().voidvoidA 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:RRMecanumDriveGet the leftFront motor, if direct access is needed- Specified by:
getLeftFrontMotorin interfaceRRMecanumDrive
-
getRightFrontMotor
public com.qualcomm.robotcore.hardware.DcMotorEx getRightFrontMotor()Description copied from interface:RRMecanumDriveGet the rightFront motor, if direct access is needed- Specified by:
getRightFrontMotorin interfaceRRMecanumDrive
-
getLeftBackMotor
public com.qualcomm.robotcore.hardware.DcMotorEx getLeftBackMotor()Description copied from interface:RRMecanumDriveGet the leftBack motor, if direct access is needed- Specified by:
getLeftBackMotorin interfaceRRMecanumDrive
-
getRightBackMotor
public com.qualcomm.robotcore.hardware.DcMotorEx getRightBackMotor()Description copied from interface:RRMecanumDriveGet the rightBack motor, if direct access is needed- Specified by:
getRightBackMotorin interfaceRRMecanumDrive
-
applyDTS
Description copied from interface:RRMecanumDriveApply motor powers from a DTS (Drive-Turn-Strafe).- Specified by:
applyDTSin 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:RRMecanumDriveThe usual DcMotor method, but applied to all four motors.- Specified by:
setModein interfaceRRMecanumDrive- Parameters:
runMode- The RunMode to set
-
setZeroPowerBehavior
public void setZeroPowerBehavior(com.qualcomm.robotcore.hardware.DcMotor.ZeroPowerBehavior behavior) Description copied from interface:RRMecanumDriveThe usual DcMotor method, but applied to all four motors.- Specified by:
setZeroPowerBehaviorin interfaceRRMecanumDrive- Parameters:
behavior- The ZeroPowerBehavior to set
-
update
public void update()Description copied from interface:RRMecanumDriveCalled by robot.update(). You do not need to call this method.- Specified by:
updatein interfaceRRMecanumDrive
-
trajectoryBuilder
public com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder trajectoryBuilder(com.acmerobotics.roadrunner.geometry.Pose2d startPose) Description copied from interface:RRMecanumDriveWe'll usually use TrajectorySequenceBuilder. Learn more about TrajectoryBuilder at https://learnroadrunner.com/trajectories.html#building-a-trajectory.- Specified by:
trajectoryBuilderin interfaceRRMecanumDrive
-
trajectoryBuilder
public com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder trajectoryBuilder(com.acmerobotics.roadrunner.geometry.Pose2d startPose, boolean reversed) Description copied from interface:RRMecanumDriveWe'll usually use TrajectorySequenceBuilder. Learn more about TrajectoryBuilder at https://learnroadrunner.com/trajectories.html#building-a-trajectory.- Specified by:
trajectoryBuilderin interfaceRRMecanumDrive
-
trajectoryBuilder
public com.acmerobotics.roadrunner.trajectory.TrajectoryBuilder trajectoryBuilder(com.acmerobotics.roadrunner.geometry.Pose2d startPose, double startHeading) Description copied from interface:RRMecanumDriveWe'll usually use TrajectorySequenceBuilder. Learn more about TrajectoryBuilder at https://learnroadrunner.com/trajectories.html#building-a-trajectory.- Specified by:
trajectoryBuilderin interfaceRRMecanumDrive
-
trajectorySequenceBuilder
public TrajectorySequenceBuilder trajectorySequenceBuilder(com.acmerobotics.roadrunner.geometry.Pose2d startPose) Description copied from interface:RRMecanumDriveLearn more at https://learnroadrunner.com/trajectory-sequence.html.- Specified by:
trajectorySequenceBuilderin interfaceRRMecanumDrive
-
turnAsync
public void turnAsync(double angle) - Specified by:
turnAsyncin interfaceRRMecanumDrive
-
turn
public void turn(double angle) - Specified by:
turnin interfaceRRMecanumDrive
-
followTrajectoryAsync
public void followTrajectoryAsync(com.acmerobotics.roadrunner.trajectory.Trajectory trajectory) Description copied from interface:RRMecanumDriveAsynchronously follows a trajectory created by TrajectoryBuilder (NOT TrajectorySequenceBuilder).- Specified by:
followTrajectoryAsyncin interfaceRRMecanumDrive
-
followTrajectory
public void followTrajectory(com.acmerobotics.roadrunner.trajectory.Trajectory trajectory) Description copied from interface:RRMecanumDriveBlocking method to follow a trajectory created by TrajectoryBuilder (NOT TrajectorySequenceBuilder).- Specified by:
followTrajectoryin interfaceRRMecanumDrive
-
followTrajectorySequenceAsync
Description copied from interface:RRMecanumDriveAsynchronously follows a trajectory created by TrajectorySequenceBuilder.- Specified by:
followTrajectorySequenceAsyncin interfaceRRMecanumDrive
-
followTrajectorySequence
Description copied from interface:RRMecanumDriveBlocking method to follow a trajectory created by TrajectorySequenceBuilder.- Specified by:
followTrajectorySequencein interfaceRRMecanumDrive
-
getLastError
public com.acmerobotics.roadrunner.geometry.Pose2d getLastError()- Specified by:
getLastErrorin interfaceRRMecanumDrive
-
waitForIdle
public void waitForIdle()Description copied from interface:RRMecanumDriveA poorly named RoadRunner update method that only updates RR stuff (like async(?) trajectory following) when the OpMode thread is active.- Specified by:
waitForIdlein interfaceRRMecanumDrive
-
isBusy
public boolean isBusy()Description copied from interface:RRMecanumDriveIs RoadRunner doing something right now?- Specified by:
isBusyin interfaceRRMecanumDrive
-
setPIDFCoefficients
public void setPIDFCoefficients(com.qualcomm.robotcore.hardware.DcMotor.RunMode runMode, com.qualcomm.robotcore.hardware.PIDFCoefficients coefficients) - Specified by:
setPIDFCoefficientsin interfaceRRMecanumDrive
-
setWeightedDrivePower
public void setWeightedDrivePower(com.acmerobotics.roadrunner.geometry.Pose2d drivePower) Description copied from interface:RRMecanumDrivePlease use applyDTS() instead. This only exists for compatibility with stuff written for SampleMecanumDrive.- Specified by:
setWeightedDrivePowerin interfaceRRMecanumDrive
-
getWheelPositions
- Specified by:
getWheelPositionsin interfaceRRMecanumDrive
-
getWheelVelocities
- Specified by:
getWheelVelocitiesin interfaceRRMecanumDrive
-
setMotorPowers
public void setMotorPowers(double v, double v1, double v2, double v3) Description copied from interface:RRMecanumDrivePlease use applyDTS() instead. This only exists for compatibility with stuff written for SampleMecanumDrive.- Specified by:
setMotorPowersin interfaceRRMecanumDrive
-
getRawExternalHeading
public double getRawExternalHeading()Description copied from interface:RRMecanumDriveUse your robot's FriendlyIMU instead. This exists only to match SampleMecanumDrive.- Specified by:
getRawExternalHeadingin interfaceRRMecanumDrive
-
getExternalHeadingVelocity
Description copied from interface:RRMecanumDriveUse your robot's FriendlyIMU instead. This exists only to match SampleMecanumDrive.- Specified by:
getExternalHeadingVelocityin interfaceRRMecanumDrive
-
getVelocityConstraint
public com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryVelocityConstraint getVelocityConstraint(double maxVel, double maxAngularVel, double trackWidth) - Specified by:
getVelocityConstraintin interfaceRRMecanumDrive
-
getAccelerationConstraint
public com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryAccelerationConstraint getAccelerationConstraint(double maxAccel) - Specified by:
getAccelerationConstraintin interfaceRRMecanumDrive
-
setDrivePower
public void setDrivePower()Description copied from interface:RRMecanumDrivePlease use applyDTS() instead. This only exists for compatibility with stuff written for RoadRunner's MecanumDrive.- Specified by:
setDrivePowerin interfaceRRMecanumDrive
-
setDriveSignal
public void setDriveSignal()- Specified by:
setDriveSignalin interfaceRRMecanumDrive
-
updatePoseEstimate
public void updatePoseEstimate()- Specified by:
updatePoseEstimatein interfaceRRMecanumDrive
-
getPoseEstimate
public com.acmerobotics.roadrunner.geometry.Pose2d getPoseEstimate()- Specified by:
getPoseEstimatein interfaceRRMecanumDrive
-
setPoseEstimate
public void setPoseEstimate(com.acmerobotics.roadrunner.geometry.Pose2d startPose) - Specified by:
setPoseEstimatein interfaceRRMecanumDrive
-