Geometry

package com.arcrobotics.ftclib.geometry

FTCLib provides access to geometry classes taken from WPILib. Since we like copy-pasting straight from WPILib instead of linking to the original material, that's what we're gonna do.

Translation

You can get the distance to another Translation2d object by using the getDistance(Translation2d other), which returns the distance to another Translation2d by using the Pythagorean theorem.

Rotation

Rotation in 2 dimensions is represented by FTCLib’s Rotation2d class. This class has an angle component, which represents the robot’s rotation relative to an axis on a 2-dimensional coordinate system. Positive rotations are counterclockwise.

Pose

Vector

Unlike a Translation2d, there are a few different methods and features.

Transform and Twist

Both classes can be used to estimate robot location. Twist2d is used in some of the FTCLib odometry classes to update the robot’s pose based on movement, while Transform2d can be used to estimate the robot’s global position from vision data.

Last updated