mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[wpimath] Add CoordinateSystem.convert() translation and rotation overloads (#4227)
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "frc/geometry/CoordinateAxis.h"
|
||||
#include "frc/geometry/Pose3d.h"
|
||||
#include "frc/geometry/Rotation3d.h"
|
||||
#include "frc/geometry/Translation3d.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
@@ -58,6 +59,30 @@ class WPILIB_DLLEXPORT CoordinateSystem {
|
||||
*/
|
||||
static const CoordinateSystem& NED();
|
||||
|
||||
/**
|
||||
* Converts the given translation from one coordinate system to another.
|
||||
*
|
||||
* @param translation The translation to convert.
|
||||
* @param from The coordinate system the translation starts in.
|
||||
* @param to The coordinate system to which to convert.
|
||||
* @return The given translation in the desired coordinate system.
|
||||
*/
|
||||
static Translation3d Convert(const Translation3d& translation,
|
||||
const CoordinateSystem& from,
|
||||
const CoordinateSystem& to);
|
||||
|
||||
/**
|
||||
* Converts the given rotation from one coordinate system to another.
|
||||
*
|
||||
* @param rotation The rotation to convert.
|
||||
* @param from The coordinate system the rotation starts in.
|
||||
* @param to The coordinate system to which to convert.
|
||||
* @return The given rotation in the desired coordinate system.
|
||||
*/
|
||||
static Rotation3d Convert(const Rotation3d& rotation,
|
||||
const CoordinateSystem& from,
|
||||
const CoordinateSystem& to);
|
||||
|
||||
/**
|
||||
* Converts the given pose from one coordinate system to another.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user