Transform2d
- class wpimath.geometry.Transform2d(*args, **kwargs)
Bases:
pybind11_object
Represents a transformation for a Pose2d in the pose’s frame.
Overloaded function.
__init__(self: wpimath.geometry._geometry.Transform2d, initial: wpimath.geometry._geometry.Pose2d, final: wpimath.geometry._geometry.Pose2d) -> None
Constructs the transform that maps the initial pose to the final pose.
- Parameters:
initial – The initial pose for the transformation.
final – The final pose for the transformation.
__init__(self: wpimath.geometry._geometry.Transform2d, translation: wpimath.geometry._geometry.Translation2d, rotation: wpimath.geometry._geometry.Rotation2d) -> None
Constructs a transform with the given translation and rotation components.
- Parameters:
translation – Translational component of the transform.
rotation – Rotational component of the transform.
__init__(self: wpimath.geometry._geometry.Transform2d, x: wpimath.units.meters, y: wpimath.units.meters, rotation: wpimath.geometry._geometry.Rotation2d) -> None
Constructs a transform with x and y translations instead of a separate Translation2d.
- Parameters:
x – The x component of the translational component of the transform.
y – The y component of the translational component of the transform.
rotation – The rotational component of the transform.
__init__(self: wpimath.geometry._geometry.Transform2d) -> None
Constructs the identity transform – maps an initial pose to itself.
__init__(self: wpimath.geometry._geometry.Transform2d, x: wpimath.units.meters, y: wpimath.units.meters, angle: wpimath.units.radians) -> None
- WPIStruct = <capsule object "WPyStruct">
- X() wpimath.units.meters
Returns the X component of the transformation’s translation.
- Returns:
The x component of the transformation’s translation.
- Y() wpimath.units.meters
Returns the Y component of the transformation’s translation.
- Returns:
The y component of the transformation’s translation.
- static fromFeet(x: wpimath.units.feet, y: wpimath.units.feet, angle: wpimath.units.radians) wpimath.geometry._geometry.Transform2d
- static fromMatrix(matrix: numpy.ndarray[numpy.float64[3, 3]]) wpimath.geometry._geometry.Transform2d
Constructs a pose with the specified affine transformation matrix.
- Parameters:
matrix – The affine transformation matrix. @throws std::domain_error if the affine transformation matrix is invalid.
- inverse() wpimath.geometry._geometry.Transform2d
Invert the transformation. This is useful for undoing a transformation.
- Returns:
The inverted transformation.
- rotation() wpimath.geometry._geometry.Rotation2d
Returns the rotational component of the transformation.
- Returns:
Reference to the rotational component of the transform.
- toMatrix() numpy.ndarray[numpy.float64[3, 3]]
Returns an affine transformation matrix representation of this transformation.
- translation() wpimath.geometry._geometry.Translation2d
Returns the translation component of the transformation.
- Returns:
Reference to the translational component of the transform.
- property x
- property x_feet
- property y
- property y_feet