open class TwoWheelDrive : DriveMotors
Class representing a simple, run-of-the-mill two wheel drive. We used to use this; now we are not.
This was one of the earliest classes made this year; I apologize in advance for the poor coding in this class.
Author
anli5005
TwoWheelDrive(leftDrive: DcMotor, rightDrive: DcMotor)
Constructs a TwoWheelDrive using two DcMotors. |
var leftDrive: DcMotor
The DcMotor mounted to the robot's left wheel. |
|
var powerMultiplier: Double
Number at which to multiply any powers passed in by. Useful for reversing a TwoWheelDrive. |
|
var rightDrive: DcMotor
The DcMotor mounted to the robot's right wheel |
open fun forwardWithPower(power: Double): Unit |
|
open fun forwardWithSpeed(speed: Double): Unit |
|
open fun getMotors(): Array<DcMotor> |
|
open fun |
|
open fun open fun |
|
open fun reset(): Unit
Stops and resets each of the motors and their encoders. |
|
open fun setDirections(left: Direction, right: Direction): Unit
Calls setDirection on each of the DcMotors. |
|
open fun setLeftMode(mode: RunMode): Unit
Sets the left motor to a given mode. |
|
open fun setLeftPower(power: Double): Unit
Moves the left motor at a given power (i.e. without encoder). |
|
open fun setLeftSpeed(speed: Double): Unit
Moves the left motor at a given speed (i.e. with encoder). |
|
open fun setMotorMode(mode: RunMode): Unit
Sets both motors to a given mode. |
|
open fun setPowers(left: Double, right: Double): Unit
Moves both motors at given powers (i.e. without encoder). |
|
open fun setRightMode(mode: RunMode): Unit
Sets the right motor to a given mode. |
|
open fun setRightPower(power: Double): Unit
Moves the right motor at a given power (i.e. without encoder). |
|
open fun setRightSpeed(speed: Double): Unit
Moves the right motor at a given speed (i.e. with encoder). |
|
open fun setSpeeds(left: Double, right: Double): Unit
Moves both motors at given speeds (i.e. with encoder). |
|
open static fun standard(hardwareMap: HardwareMap): TwoWheelDrive
Given only a hardware map, constructs a ready-to-use two wheel drive with preset motors and parameters. |
|
open fun steerWithPower(power: Double, turn: Double): Unit |
|
open fun steerWithSpeed(speed: Double, turn: Double): Unit |
|
open fun stop(): Unit |
|
open fun |