Cartesian

class Cartesian

Rotational utilities 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.

In general, using a simplified rotation matrix, converting to Robot space involves rotating the Cartesian coordinates by 90 degrees clockwise (x,y,r) -> (y,-x,-r). Conversion back to Cartesian space involves rotating the Robot coordinates by 90 degrees anti-clockwise (x,y,r) -> (-y,x,-r).

Author

Lucas Bubner, 2023

Since

1.0.0-pre

Functions

Link copied to clipboard
open fun toVec(cartesianX: Double, cartesianY: Double): Vector2d
Rotates these Cartesian coordinates by 90 degrees clockwise and converts them to a Robot Vector.
Link copied to clipboard
open fun toVel(cartesianXVel: Double, cartesianYVel: Double, cartesianAngVel: Double): PoseVelocity2d
Rotates these Cartesian coordinates by 90 degrees clockwise and converts them to a Robot Vector.