Class RRMecanumDriveImpl
java.lang.Object
com.acmerobotics.roadrunner.drive.Drive
com.acmerobotics.roadrunner.drive.MecanumDrive
org.firstinspires.ftc.teamcode.fy23.robot.subsystems.normalimpl.RRMecanumDriveImpl
- All Implemented Interfaces:
org.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
,RRMecanumDrive
public class RRMecanumDriveImpl
extends com.acmerobotics.roadrunner.drive.MecanumDrive
implements RRMecanumDrive, org.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
-
Nested Class Summary
Nested classes/interfaces inherited from class com.acmerobotics.roadrunner.drive.MecanumDrive
com.acmerobotics.roadrunner.drive.MecanumDrive.MecanumLocalizer
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
Modifier and TypeFieldDescriptionfinal com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryAccelerationConstraint
static double
com.qualcomm.robotcore.hardware.DcMotorEx
com.qualcomm.robotcore.hardware.DcMotorEx
double
com.qualcomm.robotcore.hardware.DcMotorEx
com.qualcomm.robotcore.hardware.DcMotorEx
final com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryVelocityConstraint
double
double
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Apply motor powers from a DTS (Drive-Turn-Strafe).double
encoderTicksToInches
(double ticks) 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 neededdouble
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
setDrivePower
(com.acmerobotics.roadrunner.geometry.Pose2d drivePower) void
void
setDriveSignal
(com.acmerobotics.roadrunner.drive.DriveSignal driveSignal) 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
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
A poorly named RoadRunner update method that only updates RR stuff (like async(?) trajectory following) when the OpMode thread is active.Methods inherited from class com.acmerobotics.roadrunner.drive.MecanumDrive
getLocalizer, setLocalizer
Methods inherited from class com.acmerobotics.roadrunner.drive.Drive
getExternalHeading, getPoseEstimate, getPoseVelocity, setExternalHeading, setPoseEstimate, updatePoseEstimate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.firstinspires.ftc.teamcode.fy23.robot.subsystems.RRMecanumDrive
getPoseEstimate, setPoseEstimate, updatePoseEstimate
-
Field Details
-
leftFront
public com.qualcomm.robotcore.hardware.DcMotorEx leftFront -
rightFront
public com.qualcomm.robotcore.hardware.DcMotorEx rightFront -
leftBack
public com.qualcomm.robotcore.hardware.DcMotorEx leftBack -
rightBack
public com.qualcomm.robotcore.hardware.DcMotorEx rightBack -
LATERAL_MULTIPLIER
public static double LATERAL_MULTIPLIER -
VX_WEIGHT
public double VX_WEIGHT -
VY_WEIGHT
public double VY_WEIGHT -
OMEGA_WEIGHT
public double OMEGA_WEIGHT -
VEL_CONSTRAINT
public final com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryVelocityConstraint VEL_CONSTRAINT -
ACCEL_CONSTRAINT
public final com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryAccelerationConstraint ACCEL_CONSTRAINT
-
-
Constructor Details
-
RRMecanumDriveImpl
-
-
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
Apply motor powers from a DTS (Drive-Turn-Strafe). This implementation will apply acceleration control before it reaches the motors.- 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
-
encoderTicksToInches
public double encoderTicksToInches(double ticks) -
getWheelPositions
- Specified by:
getWheelPositions
in interfaceRRMecanumDrive
- Specified by:
getWheelPositions
in classcom.acmerobotics.roadrunner.drive.MecanumDrive
-
getWheelVelocities
- Specified by:
getWheelVelocities
in interfaceRRMecanumDrive
- Overrides:
getWheelVelocities
in classcom.acmerobotics.roadrunner.drive.MecanumDrive
-
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
- Specified by:
setMotorPowers
in classcom.acmerobotics.roadrunner.drive.MecanumDrive
-
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
- Specified by:
getRawExternalHeading
in classcom.acmerobotics.roadrunner.drive.Drive
-
getExternalHeadingVelocity
Description copied from interface:RRMecanumDrive
Use your robot's FriendlyIMU instead. This exists only to match SampleMecanumDrive.- Specified by:
getExternalHeadingVelocity
in interfaceRRMecanumDrive
- Overrides:
getExternalHeadingVelocity
in classcom.acmerobotics.roadrunner.drive.Drive
-
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
-
setDrivePower
public void setDrivePower(@NotNull com.acmerobotics.roadrunner.geometry.Pose2d drivePower) - Overrides:
setDrivePower
in classcom.acmerobotics.roadrunner.drive.MecanumDrive
-
setDriveSignal
public void setDriveSignal(@NotNull com.acmerobotics.roadrunner.drive.DriveSignal driveSignal) - Overrides:
setDriveSignal
in classcom.acmerobotics.roadrunner.drive.MecanumDrive
-