wpimath Package

wpimath functions

AntiTipping(kp, tipping_threshold, ...)

AntiTipping provides a proportional correction system to prevent the robot from tipping over during operation.

ArmFeedforward(s, g, v[, a, 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.

BiquadFilter(sections)

This class implements a cascade of second-order IIR filter sections (biquads) in Direct Form II Transposed.

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(positive_x, positive_y, ...)

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

CubicHermiteSpline(x_initial_control_vector, ...)

Represents a hermite spline of degree 3.

DCMotor(nominal_voltage, stall_torque, ...)

Holds the constants for a DC motor.

Debouncer(debounce_time, 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(gyro_angle, ...[, ...])

Class for differential drive odometry.

DifferentialDriveOdometry3d(gyro_angle, ...)

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.

DifferentialSample(*args, **kwargs)

Represents a single sample in a differential drive trajectory.

DifferentialTrajectory(samples)

A trajectory for differential drive robots with drivetrain-specific interpolation.

DifferentialTrajectoryBase(samples)

Represents a trajectory consisting of a list of samples, kinematically interpolating between them.

DrivetrainSplineSample(*args, **kwargs)

Represents a single sample in a spline-based drivetrain trajectory.

DrivetrainSplineTrajectory(samples)

A trajectory for spline-based path following.

DrivetrainSplineTrajectoryBase(samples)

Represents a trajectory consisting of a list of samples, kinematically interpolating between them.

EdgeCounterFilter(required_edges, window_time)

A rising edge counter for boolean streams.

ElevatorFeedforward(s, g, v[, a, 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.

HolonomicSample(*args, **kwargs)

Represents a single sample in a drivetrain trajectory.

HolonomicTrajectory(samples)

A trajectory for holonomic (omni-directional) drive robots.

HolonomicTrajectoryBase(samples)

Represents a trajectory consisting of a list of samples, kinematically interpolating between them.

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, state_std_devs, ...)

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

KalmanFilter_2_1_1(plant, state_std_devs, ...)

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

KalmanFilter_2_1_2(plant, state_std_devs, ...)

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

KalmanFilter_2_2_2(plant, state_std_devs, ...)

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

KalmanFilter_3_2_3(plant, state_std_devs, ...)

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(ff_gains, fb_gains)

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(max_velocity)

Represents a constraint that enforces a max velocity.

MecanumDriveKinematics(front_left_wheel, ...)

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, gyro_angle, ...)

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([front_left, ...])

Represents the wheel accelerations for a mecanum drive drivetrain.

MecanumDriveWheelPositions([front_left, ...])

Represents the wheel positions for a mecanum drive drivetrain.

MecanumDriveWheelVelocities([front_left, ...])

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(...)

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(s, v[, a, dt])

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

SimpleMotorFeedforwardRadians(s, v[, a, dt])

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

SimulatedAnnealing(initial_temperature, ...)

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, gyro_angle, ...)

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, gyro_angle, ...)

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, gyro_angle, ...)

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, gyro_angle, ...)

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.

TrajectoryConfig(max_velocity, max_acceleration)

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 spline-based trajectories with various constraints.

TrajectoryParameterizer()

Class used to parameterize a spline trajectory by time.

TrajectorySample(*args, **kwargs)

Represents a single sample in a trajectory.

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.