mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[wpimath] Add CoordinateSystem conversion for Transform3d (#4443)
I also refactored Pose3d's conversion implementation to use the Translation3d and Rotation3d conversions, thereby giving Translation3d and Rotation3d test coverage. No changes were made to the expected values of the Pose3d conversion tests. The expected values of the Transform3d conversion tests were copied from the Pose3d conversion tests without modification.
This commit is contained in:
@@ -94,6 +94,18 @@ class WPILIB_DLLEXPORT CoordinateSystem {
|
||||
static Pose3d Convert(const Pose3d& pose, const CoordinateSystem& from,
|
||||
const CoordinateSystem& to);
|
||||
|
||||
/**
|
||||
* Converts the given transform from one coordinate system to another.
|
||||
*
|
||||
* @param transform The transform to convert.
|
||||
* @param from The coordinate system the transform starts in.
|
||||
* @param to The coordinate system to which to convert.
|
||||
* @return The given transform in the desired coordinate system.
|
||||
*/
|
||||
static Transform3d Convert(const Transform3d& transform,
|
||||
const CoordinateSystem& from,
|
||||
const CoordinateSystem& to);
|
||||
|
||||
private:
|
||||
// Rotation from this coordinate system to NWU coordinate system
|
||||
Rotation3d m_rotation;
|
||||
|
||||
Reference in New Issue
Block a user