MecanumRoadRunnerDrive

open class MecanumRoadRunnerDrive : MecanumDrive, RoadRunnerDrive

RoadRunner implementation for a 4-wheel Mecanum drive on REV hardware.

This class directly extends the base SampleMecanumDrive found in the RoadRunner v0.5 quickstart, and is wrapped to be a BunyipsSubsystem via MecanumDrive. Use the MecanumDrive class to use this drive in a BunyipsOpMode. This class requires you pass in an instance of DriveConstants, which has been adapted to allow multiple configurations for any drive.

Since

1.0.0-pre

Constructors

Link copied to clipboard
constructor(constants: DriveConstants, coefficients: MecanumCoefficients, voltageSensor: HardwareMap.DeviceMapping<VoltageSensor>, @Nullable imu: IMU, fl: DcMotor, fr: DcMotor, bl: DcMotor, br: DcMotor)
Constructor for the MecanumRoadRunnerDrive class.
constructor(@Nullable telemetry: DualTelemetry, constants: DriveConstants, coefficients: MecanumCoefficients, voltageSensor: HardwareMap.DeviceMapping<VoltageSensor>, @Nullable imu: IMU, fl: DcMotor, fr: DcMotor, bl: DcMotor, br: DcMotor)
Constructor for the MecanumRoadRunnerDrive class.

Properties

Link copied to clipboard
Link copied to clipboard

Inherited properties

Link copied to clipboard
open var localizer: Localizer

Functions

Link copied to clipboard
open fun cancelTrajectory()
Abort the current trajectory.
Link copied to clipboard
open fun followTrajectory(trajectory: Trajectory)
Follow a trajectory.
Link copied to clipboard
open fun followTrajectoryAsync(trajectory: Trajectory)
Follow a trajectory asynchronously.
Link copied to clipboard
open fun followTrajectorySequence(trajectorySequence: TrajectorySequence)
Follow a trajectory sequence.
Link copied to clipboard
Follow a trajectory sequence asynchronously.
Link copied to clipboard
Link copied to clipboard
open fun getLastError(): Pose2d
Get the last reported pose error from the drive.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun isBusy(): Boolean
Link copied to clipboard
open fun setMode(runMode: DcMotor.RunMode)
Set the run mode of all motors.
Link copied to clipboard
open fun setMotorPowers(powers: Array<Double>)
Set the motor powers for each motor on this drive.
open fun setMotorPowers(v: Double, v1: Double, v2: Double, v3: Double)
Link copied to clipboard
open fun setPIDFCoefficients(runMode: DcMotor.RunMode, coefficients: PIDFCoefficients)
Set the PIDF coefficients for the drive motors.
Link copied to clipboard
open fun setRotationPriorityWeightedDrivePower(drivePowerRotationPriority: Pose2d)
Set a drive power with axial weights.
Link copied to clipboard
open fun setWeightedDrivePower(drivePower: Pose2d)
Set a drive power with axial weights.
Link copied to clipboard
open fun setZeroPowerBehavior(zeroPowerBehavior: DcMotor.ZeroPowerBehavior)
Set the zero power behaviour of all motors.
Link copied to clipboard
open fun stop()
Stop the drive immediately.
Link copied to clipboard
open fun trajectoryBuilder(startPose: Pose2d): TrajectoryBuilder
open fun trajectoryBuilder(startPose: Pose2d, reversed: Boolean): TrajectoryBuilder
open fun trajectoryBuilder(startPose: Pose2d, startHeading: Double): TrajectoryBuilder
Get a trajectory builder for the drive.
Link copied to clipboard
Get a trajectory sequence builder for the drive.
Link copied to clipboard
open fun turn(angle: Double)
Turn the drive.
Link copied to clipboard
open fun turnAsync(angle: Double)
Turn the drive asynchronously.
Link copied to clipboard
open fun update()
Update the drive with latest motor powers and odometry.
Link copied to clipboard
open fun waitForIdle()
Run current trajectory blocking until it is complete.

Inherited functions

Link copied to clipboard
open fun getAccelerationConstraint(maxAccel: Double): TrajectoryAccelerationConstraint
Get an acceleration constraint for the drive.
Link copied to clipboard
Link copied to clipboard
fun getPoseEstimate(): Pose2d
abstract fun getPoseEstimate(): Pose2d
Link copied to clipboard
fun getPoseVelocity(): Pose2d
abstract fun getPoseVelocity(): Pose2d
Link copied to clipboard
open fun getVelocityConstraint(maxVel: Double, maxAngularVel: Double, trackWidth: Double): TrajectoryVelocityConstraint
Get a velocity constraint for the drive.
Link copied to clipboard
open fun setDrivePower(drivePower: Pose2d)

abstract fun setDrivePower(drivePower: Pose2d)
Set a drive power.
Link copied to clipboard
open fun setDriveSignal(driveSignal: DriveSignal)

abstract fun setDriveSignal(driveSignal: DriveSignal)
Set a drive velocity and/or acceleration target.
Link copied to clipboard

abstract fun setExternalHeading(value: Double)
Assert the heading of the robot.
Link copied to clipboard
fun setPoseEstimate(value: Pose2d)

abstract fun setPoseEstimate(value: Pose2d)
Assert the position of the robot.
Link copied to clipboard

abstract fun updatePoseEstimate()
Update the pose estimate of the drive.
Link copied to clipboard
Set a remembered pose from memory in another OpMode.