wpimath Package

wpimath functions

ArmFeedforward(kS, kG, kV[, kA, dt])

A helper class that computes feedforward outputs for a simple arm (modeled as a motor acting against the force of gravity on a beam suspended at an angle).

BangBangController([tolerance])

Implements a bang-bang controller, which outputs either 0 or 1 depending on whether the measurement is less than the setpoint.

CentripetalAccelerationConstraint(...)

A constraint on the maximum absolute centripetal acceleration allowed when traversing a trajectory.

ChassisAccelerations([ax, ay, alpha])

Represents robot chassis accelerations.

ChassisVelocities([vx, vy, omega])

Represents robot chassis velocities.

ControlAffinePlantInversionFeedforward_1_1(...)

Constructs a control-affine plant inversion model-based feedforward from given model dynamics.

ControlAffinePlantInversionFeedforward_2_1(...)

Constructs a control-affine plant inversion model-based feedforward from given model dynamics.

ControlAffinePlantInversionFeedforward_2_2(...)

Constructs a control-affine plant inversion model-based feedforward from given model dynamics.

CoordinateAxis(x, y, z)

A class representing a coordinate system axis within the NWU coordinate system.

CoordinateSystem(positiveX, positiveY, positiveZ)

A helper class that converts Pose3d objects between different standard coordinate frames.

CubicHermiteSpline(xInitialControlVector, ...)

Represents a hermite spline of degree 3.

DCMotor(nominalVoltage, stallTorque, ...[, ...])

Holds the constants for a DC motor.

Debouncer(debounceTime, type)

A simple debounce filter for boolean streams.

DifferentialDriveAccelerationLimiter(*args, ...)

Filters the provided voltages to limit a differential drive's linear and angular acceleration.

DifferentialDriveFeedforward(*args, **kwargs)

A helper class which computes the feedforward outputs for a differential drive drivetrain.

DifferentialDriveKinematics(trackwidth)

Helper class that converts a chassis velocity (dx and dtheta components) to left and right wheel velocities for a differential drive.

DifferentialDriveKinematicsBase()

Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual wheel velocities.

DifferentialDriveKinematicsConstraint(...)

A class that enforces constraints on the differential drive kinematics.

DifferentialDriveOdometry(gyroAngle, ...[, ...])

Class for differential drive odometry.

DifferentialDriveOdometry3d(gyroAngle, ...)

Class for differential drive odometry.

DifferentialDriveOdometry3dBase(kinematics, ...)

Class for odometry.

DifferentialDriveOdometryBase(kinematics, ...)

Class for odometry.

DifferentialDrivePoseEstimator(*args, **kwargs)

This class wraps an Unscented Kalman Filter to fuse latency-compensated vision measurements with differential drive encoder measurements.

DifferentialDrivePoseEstimator3d(*args, **kwargs)

This class wraps Differential Drive Odometry to fuse latency-compensated vision measurements with differential drive encoder measurements.

DifferentialDrivePoseEstimator3dBase(...)

This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.

DifferentialDrivePoseEstimatorBase(...)

This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.

DifferentialDriveVoltageConstraint(...)

A class that enforces constraints on differential drive voltage expenditure based on the motor dynamics and the drive kinematics.

DifferentialDriveWheelAccelerations([left, ...])

Represents the wheel accelerations for a differential drive drivetrain.

DifferentialDriveWheelPositions()

Represents the wheel positions for a differential drive drivetrain.

DifferentialDriveWheelVelocities([left, right])

Represents the wheel velocities for a differential drive drivetrain.

DifferentialDriveWheelVoltages([left, right])

Motor voltages for a differential drive.

EdgeCounterFilter(requiredEdges, windowTime)

A rising edge counter for boolean streams.

ElevatorFeedforward(kS, kG, kV[, kA, dt])

A helper class that computes feedforward outputs for a simple elevator (modeled as a motor acting against the force of gravity).

Ellipse2d(*args, **kwargs)

Represents a 2d ellipse space containing translational, rotational, and scaling components.

EllipticalRegionConstraint(ellipse, constraint)

Enforces a particular constraint only within an elliptical region.

ExponentialProfileMeterVolts(constraints)

A Exponential-shaped velocity profile.

ExtendedKalmanFilter_1_1_1(*args, **kwargs)

A Kalman filter combines predictions from a model and measurements to give an estimate of the true system state.

ExtendedKalmanFilter_2_1_1(*args, **kwargs)

A Kalman filter combines predictions from a model and measurements to give an estimate of the true system state.

ExtendedKalmanFilter_2_1_2(*args, **kwargs)

A Kalman filter combines predictions from a model and measurements to give an estimate of the true system state.

ExtendedKalmanFilter_2_2_2(*args, **kwargs)

A Kalman filter combines predictions from a model and measurements to give an estimate of the true system state.

ImplicitModelFollower_1_1(*args, **kwargs)

Contains the controller coefficients and logic for an implicit model follower.

ImplicitModelFollower_2_1(*args, **kwargs)

Contains the controller coefficients and logic for an implicit model follower.

ImplicitModelFollower_2_2(*args, **kwargs)

Contains the controller coefficients and logic for an implicit model follower.

KalmanFilter_1_1_1(plant, stateStdDevs, ...)

A Kalman filter combines predictions from a model and measurements to give an estimate of the true system state.

KalmanFilter_2_1_1(plant, stateStdDevs, ...)

A Kalman filter combines predictions from a model and measurements to give an estimate of the true system state.

KalmanFilter_2_1_2(plant, stateStdDevs, ...)

A Kalman filter combines predictions from a model and measurements to give an estimate of the true system state.

KalmanFilter_2_2_2(plant, stateStdDevs, ...)

A Kalman filter combines predictions from a model and measurements to give an estimate of the true system state.

KalmanFilter_3_2_3(plant, stateStdDevs, ...)

A Kalman filter combines predictions from a model and measurements to give an estimate of the true system state.

LTVDifferentialDriveController(plant, ...)

The linear time-varying differential drive controller has a similar form to the LQR, but the model used to compute the controller gain is the nonlinear differential drive model linearized around the drivetrain's current state.

LTVUnicycleController(*args, **kwargs)

The linear time-varying unicycle controller has a similar form to the LQR, but the model used to compute the controller gain is the nonlinear unicycle model linearized around the drivetrain's current state.

LinearFilter(ffGains, fbGains)

This class implements a linear, digital filter.

LinearPlantInversionFeedforward_1_1(A, B, dt)

Constructs a plant inversion model-based feedforward from a LinearSystem.

LinearPlantInversionFeedforward_2_1(A, B, dt)

Constructs a plant inversion model-based feedforward from a LinearSystem.

LinearPlantInversionFeedforward_2_2(A, B, dt)

Constructs a plant inversion model-based feedforward from a LinearSystem.

LinearPlantInversionFeedforward_3_2(A, B, dt)

Constructs a plant inversion model-based feedforward from a LinearSystem.

LinearQuadraticRegulator_1_1(*args, **kwargs)

Contains the controller coefficients and logic for a linear-quadratic regulator (LQR).

LinearQuadraticRegulator_2_1(*args, **kwargs)

Contains the controller coefficients and logic for a linear-quadratic regulator (LQR).

LinearQuadraticRegulator_2_2(*args, **kwargs)

Contains the controller coefficients and logic for a linear-quadratic regulator (LQR).

LinearQuadraticRegulator_3_2(*args, **kwargs)

Contains the controller coefficients and logic for a linear-quadratic regulator (LQR).

LinearSystemLoop_1_1_1(*args, **kwargs)

Combines a controller, feedforward, and observer for controlling a mechanism with full state feedback.

LinearSystemLoop_2_1_1(*args, **kwargs)

Combines a controller, feedforward, and observer for controlling a mechanism with full state feedback.

LinearSystemLoop_2_1_2(*args, **kwargs)

Combines a controller, feedforward, and observer for controlling a mechanism with full state feedback.

LinearSystemLoop_2_2_2(*args, **kwargs)

Combines a controller, feedforward, and observer for controlling a mechanism with full state feedback.

LinearSystemLoop_3_2_3(*args, **kwargs)

Combines a controller, feedforward, and observer for controlling a mechanism with full state feedback.

LinearSystem_1_1_1(A, B, C, D)

A plant defined using state-space notation.

LinearSystem_1_1_2(A, B, C, D)

A plant defined using state-space notation.

LinearSystem_1_1_3(A, B, C, D)

A plant defined using state-space notation.

LinearSystem_2_1_1(A, B, C, D)

A plant defined using state-space notation.

LinearSystem_2_1_2(A, B, C, D)

A plant defined using state-space notation.

LinearSystem_2_1_3(A, B, C, D)

A plant defined using state-space notation.

LinearSystem_2_2_1(A, B, C, D)

A plant defined using state-space notation.

LinearSystem_2_2_2(A, B, C, D)

A plant defined using state-space notation.

LinearSystem_2_2_3(A, B, C, D)

A plant defined using state-space notation.

LinearSystem_3_2_1(A, B, C, D)

A plant defined using state-space notation.

LinearSystem_3_2_2(A, B, C, D)

A plant defined using state-space notation.

LinearSystem_3_2_3(A, B, C, D)

A plant defined using state-space notation.

MaxVelocityConstraint(maxVelocity)

Represents a constraint that enforces a max velocity.

MecanumDriveKinematics(frontLeftWheel, ...)

Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual wheel velocities.

MecanumDriveKinematicsBase()

Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual wheel velocities.

MecanumDriveKinematicsConstraint(kinematics, ...)

A class that enforces constraints on the mecanum drive kinematics.

MecanumDriveOdometry(kinematics, gyroAngle, ...)

Class for mecanum drive odometry.

MecanumDriveOdometry3d(kinematics, ...[, ...])

Class for mecanum drive odometry.

MecanumDriveOdometry3dBase(kinematics, ...)

Class for odometry.

MecanumDriveOdometryBase(kinematics, ...)

Class for odometry.

MecanumDrivePoseEstimator(*args, **kwargs)

This class wraps an Unscented Kalman Filter to fuse latency-compensated vision measurements with mecanum drive encoder velocity measurements.

MecanumDrivePoseEstimator3d(*args, **kwargs)

This class wraps Mecanum Drive Odometry to fuse latency-compensated vision measurements with mecanum drive encoder velocity measurements.

MecanumDrivePoseEstimator3dBase(kinematics, ...)

This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.

MecanumDrivePoseEstimatorBase(kinematics, ...)

This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.

MecanumDriveWheelAccelerations([frontLeft, ...])

Represents the wheel accelerations for a mecanum drive drivetrain.

MecanumDriveWheelPositions([frontLeft, ...])

Represents the wheel positions for a mecanum drive drivetrain.

MecanumDriveWheelVelocities([frontLeft, ...])

Represents the wheel velocities for a mecanum drive drivetrain.

MedianFilter(size)

A class that implements a moving-window median filter.

Models()

Linear system factories.

PIDController(Kp, Ki, Kd[, period])

Implements a PID control loop.

Pose2d(*args, **kwargs)

Represents a 2D pose containing translational and rotational elements.

Pose3d(*args, **kwargs)

Represents a 3D pose containing translational and rotational elements.

ProfiledPIDController(Kp, Ki, Kd, constraints)

Implements a PID control loop whose setpoint is constrained by a trapezoid profile.

ProfiledPIDControllerRadians(Kp, Ki, Kd, ...)

Implements a PID control loop whose setpoint is constrained by a trapezoid profile.

Quaternion(*args, **kwargs)

Represents a quaternion.

QuinticHermiteSpline(xInitialControlVector, ...)

Represents a hermite spline of degree 5.

Rectangle2d(*args, **kwargs)

Represents a 2d rectangular space containing translational, rotational, and scaling components.

RectangularRegionConstraint(rectangle, ...)

Enforces a particular constraint only within a rectangular region.

Rotation2d(*args, **kwargs)

A rotation in a 2D coordinate frame represented by a point on the unit circle (cosine and sine).

Rotation3d(*args, **kwargs)

A rotation in a 3D coordinate frame, represented by a quaternion.

SimpleMotorFeedforwardMeters(kS, kV[, kA, dt])

A helper class that computes feedforward voltages for a simple permanent-magnet DC motor.

SimpleMotorFeedforwardRadians(kS, kV[, kA, dt])

A helper class that computes feedforward voltages for a simple permanent-magnet DC motor.

SimulatedAnnealing(initialTemperature, ...)

An implementation of the Simulated Annealing stochastic nonlinear optimization method.

SlewRateLimiter(*args, **kwargs)

A class that limits the rate of change of an input value.

Spline3()

Represents a two-dimensional parametric spline that interpolates between two points.

Spline5()

Represents a two-dimensional parametric spline that interpolates between two points.

SplineHelper()

Helper class that is used to generate cubic and quintic splines from user provided waypoints.

SplineParameterizer

Class used to parameterize a spline by its arc length.

SwerveDrive2Kinematics(arg0, arg1)

Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual module states (velocity and angle).

SwerveDrive2KinematicsBase()

Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual wheel velocities.

SwerveDrive2KinematicsConstraint(kinematics, ...)

A class that enforces constraints on the swerve drive kinematics.

SwerveDrive2Odometry(kinematics, gyroAngle, ...)

Class for swerve drive odometry.

SwerveDrive2Odometry3d(kinematics, ...[, ...])

Class for swerve drive odometry.

SwerveDrive2Odometry3dBase(kinematics, ...)

Class for odometry.

SwerveDrive2OdometryBase(kinematics, ...)

Class for odometry.

SwerveDrive2PoseEstimator(*args, **kwargs)

This class wraps Swerve Drive Odometry to fuse latency-compensated vision measurements with swerve drive encoder distance measurements.

SwerveDrive2PoseEstimator3d(*args, **kwargs)

This class wraps Swerve Drive Odometry to fuse latency-compensated vision measurements with swerve drive encoder distance measurements.

SwerveDrive2PoseEstimator3dBase(kinematics, ...)

This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.

SwerveDrive2PoseEstimatorBase(kinematics, ...)

This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.

SwerveDrive3Kinematics(arg0, arg1, arg2)

Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual module states (velocity and angle).

SwerveDrive3KinematicsBase()

Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual wheel velocities.

SwerveDrive3KinematicsConstraint(kinematics, ...)

A class that enforces constraints on the swerve drive kinematics.

SwerveDrive3Odometry(kinematics, gyroAngle, ...)

Class for swerve drive odometry.

SwerveDrive3Odometry3d(kinematics, ...[, ...])

Class for swerve drive odometry.

SwerveDrive3Odometry3dBase(kinematics, ...)

Class for odometry.

SwerveDrive3OdometryBase(kinematics, ...)

Class for odometry.

SwerveDrive3PoseEstimator(*args, **kwargs)

This class wraps Swerve Drive Odometry to fuse latency-compensated vision measurements with swerve drive encoder distance measurements.

SwerveDrive3PoseEstimator3d(*args, **kwargs)

This class wraps Swerve Drive Odometry to fuse latency-compensated vision measurements with swerve drive encoder distance measurements.

SwerveDrive3PoseEstimator3dBase(kinematics, ...)

This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.

SwerveDrive3PoseEstimatorBase(kinematics, ...)

This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.

SwerveDrive4Kinematics(arg0, arg1, arg2, arg3)

Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual module states (velocity and angle).

SwerveDrive4KinematicsBase()

Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual wheel velocities.

SwerveDrive4KinematicsConstraint(kinematics, ...)

A class that enforces constraints on the swerve drive kinematics.

SwerveDrive4Odometry(kinematics, gyroAngle, ...)

Class for swerve drive odometry.

SwerveDrive4Odometry3d(kinematics, ...[, ...])

Class for swerve drive odometry.

SwerveDrive4Odometry3dBase(kinematics, ...)

Class for odometry.

SwerveDrive4OdometryBase(kinematics, ...)

Class for odometry.

SwerveDrive4PoseEstimator(*args, **kwargs)

This class wraps Swerve Drive Odometry to fuse latency-compensated vision measurements with swerve drive encoder distance measurements.

SwerveDrive4PoseEstimator3d(*args, **kwargs)

This class wraps Swerve Drive Odometry to fuse latency-compensated vision measurements with swerve drive encoder distance measurements.

SwerveDrive4PoseEstimator3dBase(kinematics, ...)

This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.

SwerveDrive4PoseEstimatorBase(kinematics, ...)

This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.

SwerveDrive6Kinematics(arg0, arg1, arg2, ...)

Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual module states (velocity and angle).

SwerveDrive6KinematicsBase()

Helper class that converts a chassis velocity (dx, dy, and dtheta components) into individual wheel velocities.

SwerveDrive6KinematicsConstraint(kinematics, ...)

A class that enforces constraints on the swerve drive kinematics.

SwerveDrive6Odometry(kinematics, gyroAngle, ...)

Class for swerve drive odometry.

SwerveDrive6Odometry3d(kinematics, ...[, ...])

Class for swerve drive odometry.

SwerveDrive6Odometry3dBase(kinematics, ...)

Class for odometry.

SwerveDrive6OdometryBase(kinematics, ...)

Class for odometry.

SwerveDrive6PoseEstimator(*args, **kwargs)

This class wraps Swerve Drive Odometry to fuse latency-compensated vision measurements with swerve drive encoder distance measurements.

SwerveDrive6PoseEstimator3d(*args, **kwargs)

This class wraps Swerve Drive Odometry to fuse latency-compensated vision measurements with swerve drive encoder distance measurements.

SwerveDrive6PoseEstimator3dBase(kinematics, ...)

This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.

SwerveDrive6PoseEstimatorBase(kinematics, ...)

This class wraps odometry to fuse latency-compensated vision measurements with encoder measurements.

SwerveModuleAcceleration([acceleration, angle])

Represents the accelerations of one swerve module.

SwerveModulePosition([distance, angle])

Represents the position of one swerve module.

SwerveModuleVelocity([velocity, angle])

Represents the velocity of one swerve module.

TimeInterpolatableFloatBuffer(*args, **kwargs)

The TimeInterpolatableBuffer provides an easy way to estimate past measurements.

TimeInterpolatablePose2dBuffer(*args, **kwargs)

The TimeInterpolatableBuffer provides an easy way to estimate past measurements.

TimeInterpolatablePose3dBuffer(*args, **kwargs)

The TimeInterpolatableBuffer provides an easy way to estimate past measurements.

TimeInterpolatableRotation2dBuffer(*args, ...)

The TimeInterpolatableBuffer provides an easy way to estimate past measurements.

TimeInterpolatableRotation3dBuffer(*args, ...)

The TimeInterpolatableBuffer provides an easy way to estimate past measurements.

TimeInterpolatableTranslation2dBuffer(*args, ...)

The TimeInterpolatableBuffer provides an easy way to estimate past measurements.

TimeInterpolatableTranslation3dBuffer(*args, ...)

The TimeInterpolatableBuffer provides an easy way to estimate past measurements.

Trajectory(*args, **kwargs)

Represents a time-parameterized trajectory.

TrajectoryConfig(maxVelocity, maxAcceleration)

Represents the configuration for generating a trajectory.

TrajectoryConstraint()

An interface for defining user-defined velocity and acceleration constraints while generating trajectories.

TrajectoryGenerator()

Helper class used to generate trajectories with various constraints.

TrajectoryParameterizer()

Class used to parameterize a trajectory by time.

Transform2d(*args, **kwargs)

Represents a transformation for a Pose2d in the pose's frame.

Transform3d(*args, **kwargs)

Represents a transformation for a Pose3d in the pose's frame.

Translation2d(*args, **kwargs)

Represents a translation in 2D space.

Translation3d(*args, **kwargs)

Represents a translation in 3D space.

TrapezoidProfile(constraints)

A trapezoid-shaped velocity profile.

TrapezoidProfileRadians(constraints)

A trapezoid-shaped velocity profile.

TravelingSalesman(*args, **kwargs)

Given a list of poses, this class finds the shortest possible route that visits each pose exactly once and returns to the origin pose.

Twist2d([dx, dy, dtheta])

A change in distance along a 2D arc since the last pose update.

Twist3d([dx, dy, dz, rx, ry, rz])

A change in distance along a 3D arc since the last pose update.