mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpimath] Add affine transformation constructors and getters to geometry API (#7509)
Fixes #7429.
This commit is contained in:
@@ -131,7 +131,10 @@ public final class StateSpaceUtil {
|
||||
*
|
||||
* @param pose A pose to convert to a vector.
|
||||
* @return The given pose in vector form, with the third element, theta, in radians.
|
||||
* @deprecated Create the vector manually instead. If you were using this as an intermediate step
|
||||
* for constructing affine transformations, use {@link Pose2d#toMatrix()} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "2025")
|
||||
public static Matrix<N3, N1> poseToVector(Pose2d pose) {
|
||||
return VecBuilder.fill(pose.getX(), pose.getY(), pose.getRotation().getRadians());
|
||||
}
|
||||
@@ -180,7 +183,10 @@ public final class StateSpaceUtil {
|
||||
*
|
||||
* @param pose A pose to convert to a vector.
|
||||
* @return The given pose in as a 4x1 vector of x, y, cos(theta), and sin(theta).
|
||||
* @deprecated Create the vector manually instead. If you were using this as an intermediate step
|
||||
* for constructing affine transformations, use {@link Pose2d#toMatrix()} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "2025")
|
||||
public static Matrix<N4, N1> poseTo4dVector(Pose2d pose) {
|
||||
return VecBuilder.fill(
|
||||
pose.getTranslation().getX(),
|
||||
@@ -194,7 +200,10 @@ public final class StateSpaceUtil {
|
||||
*
|
||||
* @param pose A pose to convert to a vector.
|
||||
* @return The given pose in vector form, with the third element, theta, in radians.
|
||||
* @deprecated Create the vector manually instead. If you were using this as an intermediate step
|
||||
* for constructing affine transformations, use {@link Pose2d#toMatrix()} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "2025")
|
||||
public static Matrix<N3, N1> poseTo3dVector(Pose2d pose) {
|
||||
return VecBuilder.fill(
|
||||
pose.getTranslation().getX(),
|
||||
|
||||
Reference in New Issue
Block a user