wpimath functions

wpimath.angleModulus(angle: wpimath.units.radians) wpimath.units.radians
wpimath.applyDeadband(value: SupportsFloat, deadband: SupportsFloat, maxMagnitude: SupportsFloat = 1.0) float

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

Parameters:
  • value – Value to clip.

  • deadband – Range around zero.

  • maxMagnitude – The maximum magnitude of the input (defaults to 1). Can be infinite.

Returns:

The value after the deadband is applied.

wpimath.floorDiv(x: SupportsInt, y: SupportsInt) int

Returns the largest (closest to positive infinity) int value that is less than or equal to the algebraic quotient.

Parameters:
  • x – the dividend

  • y – the divisor

Returns:

the largest (closest to positive infinity) int value that is less than or equal to the algebraic quotient.

wpimath.floorMod(x: SupportsInt, y: SupportsInt) int

Returns the floor modulus of the int arguments.

The floor modulus is r = x - (floorDiv(x, y) * y), has the same sign as the divisor y or is zero, and is in the range of -std::abs(y) < r < +std::abs(y).

Parameters:
  • x – the dividend

  • y – the divisor

Returns:

the floor modulus x - (floorDiv(x, y) * y)

wpimath.inputModulus(input: SupportsFloat, minimumInput: SupportsFloat, maximumInput: SupportsFloat) float

Returns modulus of input.

Parameters:
  • input – Input value to wrap.

  • minimumInput – The minimum value expected from the input.

  • maximumInput – The maximum value expected from the input.

wpimath.objectToRobotPose(objectInField: wpimath.geometry._geometry.Pose3d, cameraToObject: wpimath.geometry._geometry.Transform3d, robotToCamera: wpimath.geometry._geometry.Transform3d) wpimath.geometry._geometry.Pose3d