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

    Fields
    Modifier and Type
    Field
    Description
    final 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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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
    Blocking method to follow a trajectory created by TrajectorySequenceBuilder.
    void
    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 needed
    com.qualcomm.robotcore.hardware.DcMotorEx
    Get the leftFront motor, if direct access is needed
    double
    Use your robot's FriendlyIMU instead.
    com.qualcomm.robotcore.hardware.DcMotorEx
    Get the rightBack motor, if direct access is needed
    com.qualcomm.robotcore.hardware.DcMotorEx
    Get the rightFront motor, if direct access is needed
    com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryVelocityConstraint
    getVelocityConstraint(double maxVel, double maxAngularVel, double trackWidth)
     
     
     
    boolean
    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
    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

  • 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 interface RRMecanumDrive
    • 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 interface RRMecanumDrive
    • 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 interface RRMecanumDrive
    • 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 interface RRMecanumDrive
    • applyDTS

      public void applyDTS(DTS dts)
      Apply motor powers from a DTS (Drive-Turn-Strafe). This implementation will apply acceleration control before it reaches the motors.
      Specified by:
      applyDTS in interface org.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
      Specified by:
      applyDTS in interface RRMecanumDrive
      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 interface org.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
      Specified by:
      setMode in interface RRMecanumDrive
      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 interface org.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
      Specified by:
      setZeroPowerBehavior in interface RRMecanumDrive
      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 interface org.firstinspires.ftc.teamcode.fy23.robot.old.MecanumDrive
      Specified by:
      update in interface RRMecanumDrive
    • 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 interface RRMecanumDrive
    • 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 interface RRMecanumDrive
    • 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 interface RRMecanumDrive
    • 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 interface RRMecanumDrive
    • turnAsync

      public void turnAsync(double angle)
      Specified by:
      turnAsync in interface RRMecanumDrive
    • turn

      public void turn(double angle)
      Specified by:
      turn in interface RRMecanumDrive
    • 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 interface RRMecanumDrive
    • 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 interface RRMecanumDrive
    • followTrajectorySequenceAsync

      public void followTrajectorySequenceAsync(TrajectorySequence trajectorySequence)
      Description copied from interface: RRMecanumDrive
      Asynchronously follows a trajectory created by TrajectorySequenceBuilder.
      Specified by:
      followTrajectorySequenceAsync in interface RRMecanumDrive
    • followTrajectorySequence

      public void followTrajectorySequence(TrajectorySequence trajectorySequence)
      Description copied from interface: RRMecanumDrive
      Blocking method to follow a trajectory created by TrajectorySequenceBuilder.
      Specified by:
      followTrajectorySequence in interface RRMecanumDrive
    • getLastError

      public com.acmerobotics.roadrunner.geometry.Pose2d getLastError()
      Specified by:
      getLastError in interface RRMecanumDrive
    • 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 interface RRMecanumDrive
    • isBusy

      public boolean isBusy()
      Description copied from interface: RRMecanumDrive
      Is RoadRunner doing something right now?
      Specified by:
      isBusy in interface RRMecanumDrive
    • setPIDFCoefficients

      public void setPIDFCoefficients(com.qualcomm.robotcore.hardware.DcMotor.RunMode runMode, com.qualcomm.robotcore.hardware.PIDFCoefficients coefficients)
      Specified by:
      setPIDFCoefficients in interface RRMecanumDrive
    • 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 interface RRMecanumDrive
    • encoderTicksToInches

      public double encoderTicksToInches(double ticks)
    • getWheelPositions

      @NonNull @NotNull public List<Double> getWheelPositions()
      Specified by:
      getWheelPositions in interface RRMecanumDrive
      Specified by:
      getWheelPositions in class com.acmerobotics.roadrunner.drive.MecanumDrive
    • getWheelVelocities

      public List<Double> getWheelVelocities()
      Specified by:
      getWheelVelocities in interface RRMecanumDrive
      Overrides:
      getWheelVelocities in class com.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 interface RRMecanumDrive
      Specified by:
      setMotorPowers in class com.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 interface RRMecanumDrive
      Specified by:
      getRawExternalHeading in class com.acmerobotics.roadrunner.drive.Drive
    • getExternalHeadingVelocity

      public Double getExternalHeadingVelocity()
      Description copied from interface: RRMecanumDrive
      Use your robot's FriendlyIMU instead. This exists only to match SampleMecanumDrive.
      Specified by:
      getExternalHeadingVelocity in interface RRMecanumDrive
      Overrides:
      getExternalHeadingVelocity in class com.acmerobotics.roadrunner.drive.Drive
    • getVelocityConstraint

      public com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryVelocityConstraint getVelocityConstraint(double maxVel, double maxAngularVel, double trackWidth)
      Specified by:
      getVelocityConstraint in interface RRMecanumDrive
    • getAccelerationConstraint

      public com.acmerobotics.roadrunner.trajectory.constraints.TrajectoryAccelerationConstraint getAccelerationConstraint(double maxAccel)
      Specified by:
      getAccelerationConstraint in interface RRMecanumDrive
    • 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 interface RRMecanumDrive
    • setDriveSignal

      public void setDriveSignal()
      Specified by:
      setDriveSignal in interface RRMecanumDrive
    • setDrivePower

      public void setDrivePower(@NotNull com.acmerobotics.roadrunner.geometry.Pose2d drivePower)
      Overrides:
      setDrivePower in class com.acmerobotics.roadrunner.drive.MecanumDrive
    • setDriveSignal

      public void setDriveSignal(@NotNull com.acmerobotics.roadrunner.drive.DriveSignal driveSignal)
      Overrides:
      setDriveSignal in class com.acmerobotics.roadrunner.drive.MecanumDrive