TeamCode / org.firstinspires.ftc.teamcode.movement / MecanumDrive

MecanumDrive

open class MecanumDrive : DriveMotors

Class representing four DcMotors that comprise a Mecanum drive; in other words, the drive we're using on our robot.

Types

Motor

open class Motor

Class representing a motor used in a mecanum drive.

PowerBehavior

class PowerBehavior

An enum representing what to do when a power exceeds a motor's limits.

TurnBehavior

class TurnBehavior

An enum representing how turning should be calculated.

Constructors

<init>

MecanumDrive(motors: Array<Motor>)

Constructs a MecanumDrive using the specified set of motors

Properties

powerBehavior

var powerBehavior: PowerBehavior

What to do when a power exceeds a motor's limits.

Functions

forwardWithPower

open fun forwardWithPower(power: Double): Unit

forwardWithSpeed

open fun forwardWithSpeed(power: Double): Unit

getMotors

open fun getMotors(): Array<DcMotor>

move

open fun move(power: Double, vector: Vector2D, turn: Double, turnBehavior: TurnBehavior): Unit

Moves in a given direction at a given power while turning towards a given direction

open fun move(power: Double, vector: Vector2D, turn: Double): Unit

Moves in a given direction at a given power while turning towards a given direction. Uses MULTIPLY for the turn behavior.

reset

open fun reset(): Unit

Stops and resets each of the motors and their encoders.

setMotorMode

open fun setMotorMode(mode: RunMode): Unit

Sets each of the drive's motors to a given mode.

standard

open static fun standard(hardwareMap: HardwareMap): MecanumDrive

Given only a hardware map, constructs a ready-to-use mecanum drive with preset motors.

steerWithPower

open fun steerWithPower(power: Double, turn: Double): Unit

steerWithSpeed

open fun steerWithSpeed(speed: Double, turn: Double): Unit

stop

open fun stop(): Unit

strafeLeftWithPower

open fun strafeLeftWithPower(power: Double): Unit

Strafes left at a given power (i.e. without encoder).

strafeLeftWithSpeed

open fun strafeLeftWithSpeed(speed: Double): Unit

Strafes left at a given speed (i.e. with encoder).

strafeRightWithPower

open fun strafeRightWithPower(power: Double): Unit

Strafes right at a given power (i.e. without encoder).

strafeRightWithSpeed

open fun strafeRightWithSpeed(speed: Double): Unit

Strafes right at a given speed (i.e. with encoder).