mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpimath] Add an operator for composing two Transform2ds (#3527)
This commit is contained in:
@@ -56,6 +56,15 @@ public class Transform2d {
|
||||
return new Transform2d(m_translation.times(scalar), m_rotation.times(scalar));
|
||||
}
|
||||
|
||||
/**
|
||||
* Composes two transformations.
|
||||
*
|
||||
* @param other The transform to compose with this one.
|
||||
*/
|
||||
public Transform2d plus(Transform2d other) {
|
||||
return new Transform2d(new Pose2d(), new Pose2d().transformBy(this).transformBy(other));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the translation component of the transformation.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user