Documentation Index
Fetch the complete documentation index at: https://mintlify.com/saquer916/odyssey/llms.txt
Use this file to discover all available pages before exploring further.
Pose2d represents a 2D robot pose — x and y coordinates in millimetres plus a heading in radians. The heading is always normalized to the half-open interval (−π, π] via MathUtils.normalizeAngle in every constructor, so you never need to clamp it manually. Pose2d is used throughout Odyssey wherever a complete robot state is required: localization output, path targets, and error computation in the Follower.
Package: org.firstinspires.ftc.teamcode.odyssey.geometry
Constructors
Convenience overload that unpacks a
Vector2d for the position. Internally reads vector2d.getX() and vector2d.getY(), then normalizes heading identically to the primary constructor.Position vector whose x and y components are used.
Robot heading in radians. Automatically normalized to (−π, π].
Methods
Returns the x coordinate of the pose in millimetres.
Returns the y coordinate of the pose in millimetres.
Returns the heading in radians, already normalized to (−π, π]. This value is fixed at construction and does not change.
Returns the translational component of this pose as a
Vector2d(x, y). Useful when you need a position vector to pass into geometry operations.Transforms a point expressed in the field frame into the robot frame. The implementation first subtracts the robot’s field position, then rotates by Use this when you need to express a field-frame target in the robot’s local coordinate system (e.g. for PID error computation).
−heading:A point in field-frame coordinates (mm).
Transforms a point expressed in the robot frame into the field frame — the inverse of
toRobotFrame. Rotates the point by +heading and then adds the robot’s field position.A point in robot-frame coordinates (mm).
Expresses
this pose relative to other. The translational component is obtained by calling other.toRobotFrame(this.getPosition()); the heading component is this.heading − other.heading, normalized. Primarily used by Follower to compute the pose error between the current robot pose and the target pose on the path.The reference pose to measure relative to.
Returns a human-readable string in the format
"Pose2d(x=..., y=..., heading=...)". Useful for telemetry logging.Example
The constructor always normalizes heading. Passing
3π/2 radians (270°) produces a stored heading of −π/2 (−90°). Use getHeading() rather than caching the raw value you passed in.