Cartesian

class Cartesian

Rotational utilities for Pose2d and Vector2d, including conversion from Cartesian to Robot space.

The Cartesian Coordinate System is a 2D coordinate system where the x-axis goes to the right (pos X) and the y-axis goes up/forward (pos Y). Angles on the Cartesian Coordinate System are measured clockwise from the positive y-axis.

The Robot Coordinate System is a 2D coordinate system where the x-axis goes up/forward (pos X) and the y-axis goes left (pos Y), and the angles are measured anti-clockwise from the positive x-axis. This is the coordinate system used by the RoadRunner library, and perfectly models a Unit Circle.

Author

Lucas Bubner, 2023

Since

1.0.0-pre

Functions

Link copied to clipboard
open fun fromPose(pose: Pose2d): Pose2d
open fun fromPose(x: Double, y: Double, heading: Double): Pose2d
Link copied to clipboard
open fun fromVector(vector: Vector2d): Vector2d
open fun fromVector(x: Double, y: Double): Vector2d
Link copied to clipboard
open fun rotate(cartesianVec: Vector2d, rot: Measure<Angle>): Vector2d
Rotate a Cartesian vector.
Link copied to clipboard
open fun toPose(pose: Pose2d): Pose2d
open fun toPose(x: Double, y: Double, heading: Double): Pose2d
Link copied to clipboard
open fun toVector(vector: Vector2d): Vector2d
open fun toVector(x: Double, y: Double): Vector2d