MecanumDrive
- class wpilib.MecanumDrive(*args, **kwargs)
Bases:
RobotDriveBase,SendableOverloaded function.
__init__(self: wpilib._wpilib.MecanumDrive, front_left_motor: wpilib._wpilib.MotorController, rear_left_motor: wpilib._wpilib.MotorController, front_right_motor: wpilib._wpilib.MotorController, rear_right_motor: wpilib._wpilib.MotorController) -> None
Construct a MecanumDrive.
If a motor needs to be inverted, do so before passing it in.
- Parameters:
front_left_motor – Front-left motor.
rear_left_motor – Rear-left motor.
front_right_motor – Front-right motor.
rear_right_motor – Rear-right motor.
__init__(self: wpilib._wpilib.MecanumDrive, front_left_motor: collections.abc.Callable[[typing.SupportsFloat | typing.SupportsIndex], None], rear_left_motor: collections.abc.Callable[[typing.SupportsFloat | typing.SupportsIndex], None], front_right_motor: collections.abc.Callable[[typing.SupportsFloat | typing.SupportsIndex], None], rear_right_motor: collections.abc.Callable[[typing.SupportsFloat | typing.SupportsIndex], None]) -> None
Construct a MecanumDrive.
If a motor needs to be inverted, do so before passing it in.
- Parameters:
front_left_motor – Front-left motor setter.
rear_left_motor – Rear-left motor setter.
front_right_motor – Front-right motor setter.
rear_right_motor – Rear-right motor setter.
- class WheelVelocities
Bases:
pybind11_objectWheel velocities for a mecanum drive.
Uses normalized voltage [-1.0..1.0].
- drive_cartesian(x_velocity: SupportsFloat | SupportsIndex, y_velocity: SupportsFloat | SupportsIndex, z_rotation: SupportsFloat | SupportsIndex, gyro_angle: wpimath._wpimath.Rotation2d = Rotation2d(0.000000)) None
Drive method for Mecanum platform.
Angles are measured counterclockwise from the positive X axis. The robot’s velocity is independent from its angle or rotation rate.
- Parameters:
x_velocity – The robot’s velocity along the X axis [-1.0..1.0]. Forward is positive.
y_velocity – The robot’s velocity along the Y axis [-1.0..1.0]. Left is positive.
z_rotation – The robot’s rotation rate around the Z axis [-1.0..1.0]. Counterclockwise is positive.
gyro_angle – The gyro heading around the Z axis. Use this to implement field-oriented controls.
- static drive_cartesian_ik(x_velocity: SupportsFloat | SupportsIndex, y_velocity: SupportsFloat | SupportsIndex, z_rotation: SupportsFloat | SupportsIndex, gyro_angle: wpimath._wpimath.Rotation2d = Rotation2d(0.000000)) wpilib._wpilib.MecanumDrive.WheelVelocities
Cartesian inverse kinematics for Mecanum platform.
Angles are measured counterclockwise from the positive X axis. The robot’s velocity is independent from its angle or rotation rate.
- Parameters:
x_velocity – The robot’s velocity along the X axis [-1.0..1.0]. Forward is positive.
y_velocity – The robot’s velocity along the Y axis [-1.0..1.0]. Left is positive.
z_rotation – The robot’s rotation rate around the Z axis [-1.0..1.0]. Counterclockwise is positive.
gyro_angle – The gyro heading around the Z axis. Use this to implement field-oriented controls.
- Returns:
Wheel velocities [-1.0..1.0].
- drive_polar(magnitude: SupportsFloat | SupportsIndex, angle: wpimath._wpimath.Rotation2d, z_rotation: SupportsFloat | SupportsIndex) None
Drive method for Mecanum platform.
Angles are measured counterclockwise from the positive X axis. The robot’s velocity is independent from its angle or rotation rate.
- Parameters:
magnitude – The robot’s velocity at a given angle [-1.0..1.0]. Forward is positive.
angle – The angle around the Z axis at which the robot drives.
z_rotation – The robot’s rotation rate around the Z axis [-1.0..1.0]. Counterclockwise is positive.
- get_description() str
- init_sendable(builder: wpiutil._wpiutil.SendableBuilder) None
- stop_motor() None