DifferentialDriveWheelVelocities

class wpimath.DifferentialDriveWheelVelocities(left: wpimath.units.meters_per_second = 0, right: wpimath.units.meters_per_second = 0)

Bases: pybind11_object

Represents the wheel velocities for a differential drive drivetrain.

WPIStruct = <capsule object "WPyStruct">
desaturate(attainableMaxVelocity: wpimath.units.meters_per_second) wpimath._wpimath.DifferentialDriveWheelVelocities

Renormalizes the wheel velocities if either side is above the specified maximum.

Sometimes, after inverse kinematics, the requested velocity from one or more wheels may be above the max attainable velocity for the driving motor on that wheel. To fix this issue, one can reduce all the wheel velocities to make sure that all requested module velocities are at-or-below the absolute threshold, while maintaining the ratio of velocities between wheels.

Parameters:

attainableMaxVelocity – The absolute max velocity that a wheel can reach.

Returns:

The desaturated DifferentialDriveWheelVelocities.

static fromFeet(left: wpimath.units.feet_per_second, right: wpimath.units.feet_per_second) wpimath._wpimath.DifferentialDriveWheelVelocities
property left_fps
property right_fps