RobotDriveBase

class wpilib.drive.RobotDriveBase[source]

Bases: wpilib.SendableBase, wpilib.MotorSafety

Common base class for drive platforms

class MotorType[source]

Bases: object

The location of a motor on the robot for the purpose of driving.

kBack = 2

Back

kFrontLeft = 0

Front left

kFrontRight = 1

Front right

kLeft = 0

Left

kRearLeft = 2

Rear left

kRearRight = 3

Rear right

kRight = 1

Right

static applyDeadband(value, deadband)[source]

Returns 0.0 if the given value is within the specified range around zero. The remaining range between the deadband and 1.0 is scaled from 0.0 to 1.0.

Parameters:
  • value – value to clip
  • deadband – range around zero
kDefaultDeadband = 0.02
kDefaultMaxOutput = 1.0
static limit(value)[source]

Limit motor values to the -1.0 to +1.0 range.

static normalize(wheelSpeeds)[source]

Normalize all wheel speeds if the magnitude of any wheel is greater than 1.0.

Parameters:wheelSpeeds – Iterable of wheelspeeds to normalize
setDeadband(deadband)[source]

Change the value for deadband scaling.

The default value is kDefaultDeadband. Values smaller than the deadband are set to 0, while values larger than the deadband are scaled from 0.0 to 1.0. See applyDeadband().

Parameters:deadband (float) – The deadband to set
setMaxOutput(maxOutput)[source]

Configure the scaling factor for using drive methods with motor controllers in a mode other than PercentVbus or to limit the maximum output.

The default value is kDefaultMaxOutput.

Parameters:maxOutput (float) – Multiplied with the output percentage computed by the drive functions.