WPILibC++ 2024.3.2
frc::CoordinateSystem Class Reference

A helper class that converts Pose3d objects between different standard coordinate frames. More...

#include <frc/geometry/CoordinateSystem.h>

Public Member Functions

 CoordinateSystem (const CoordinateAxis &positiveX, const CoordinateAxis &positiveY, const CoordinateAxis &positiveZ)
 Constructs a coordinate system with the given cardinal directions for each axis. More...
 
 CoordinateSystem (const CoordinateSystem &)=default
 
CoordinateSystemoperator= (const CoordinateSystem &)=default
 
 CoordinateSystem (CoordinateSystem &&)=default
 
CoordinateSystemoperator= (CoordinateSystem &&)=default
 

Static Public Member Functions

static const CoordinateSystemNWU ()
 Returns an instance of the North-West-Up (NWU) coordinate system. More...
 
static const CoordinateSystemEDN ()
 Returns an instance of the East-Down-North (EDN) coordinate system. More...
 
static const CoordinateSystemNED ()
 Returns an instance of the NED coordinate system. More...
 
static Translation3d Convert (const Translation3d &translation, const CoordinateSystem &from, const CoordinateSystem &to)
 Converts the given translation from one coordinate system to another. More...
 
static Rotation3d Convert (const Rotation3d &rotation, const CoordinateSystem &from, const CoordinateSystem &to)
 Converts the given rotation from one coordinate system to another. More...
 
static Pose3d Convert (const Pose3d &pose, const CoordinateSystem &from, const CoordinateSystem &to)
 Converts the given pose from one coordinate system to another. More...
 
static Transform3d Convert (const Transform3d &transform, const CoordinateSystem &from, const CoordinateSystem &to)
 Converts the given transform from one coordinate system to another. More...
 

Detailed Description

A helper class that converts Pose3d objects between different standard coordinate frames.

Constructor & Destructor Documentation

◆ CoordinateSystem() [1/3]

frc::CoordinateSystem::CoordinateSystem ( const CoordinateAxis positiveX,
const CoordinateAxis positiveY,
const CoordinateAxis positiveZ 
)

Constructs a coordinate system with the given cardinal directions for each axis.

Parameters
positiveXThe cardinal direction of the positive x-axis.
positiveYThe cardinal direction of the positive y-axis.
positiveZThe cardinal direction of the positive z-axis.
Exceptions
std::domain_errorif the coordinate system isn't special orthogonal

◆ CoordinateSystem() [2/3]

frc::CoordinateSystem::CoordinateSystem ( const CoordinateSystem )
default

◆ CoordinateSystem() [3/3]

frc::CoordinateSystem::CoordinateSystem ( CoordinateSystem &&  )
default

Member Function Documentation

◆ Convert() [1/4]

static Pose3d frc::CoordinateSystem::Convert ( const Pose3d pose,
const CoordinateSystem from,
const CoordinateSystem to 
)
static

Converts the given pose from one coordinate system to another.

Parameters
poseThe pose to convert.
fromThe coordinate system the pose starts in.
toThe coordinate system to which to convert.
Returns
The given pose in the desired coordinate system.

◆ Convert() [2/4]

static Rotation3d frc::CoordinateSystem::Convert ( const Rotation3d rotation,
const CoordinateSystem from,
const CoordinateSystem to 
)
static

Converts the given rotation from one coordinate system to another.

Parameters
rotationThe rotation to convert.
fromThe coordinate system the rotation starts in.
toThe coordinate system to which to convert.
Returns
The given rotation in the desired coordinate system.

◆ Convert() [3/4]

static Transform3d frc::CoordinateSystem::Convert ( const Transform3d transform,
const CoordinateSystem from,
const CoordinateSystem to 
)
static

Converts the given transform from one coordinate system to another.

Parameters
transformThe transform to convert.
fromThe coordinate system the transform starts in.
toThe coordinate system to which to convert.
Returns
The given transform in the desired coordinate system.

◆ Convert() [4/4]

static Translation3d frc::CoordinateSystem::Convert ( const Translation3d translation,
const CoordinateSystem from,
const CoordinateSystem to 
)
static

Converts the given translation from one coordinate system to another.

Parameters
translationThe translation to convert.
fromThe coordinate system the translation starts in.
toThe coordinate system to which to convert.
Returns
The given translation in the desired coordinate system.

◆ EDN()

static const CoordinateSystem & frc::CoordinateSystem::EDN ( )
static

Returns an instance of the East-Down-North (EDN) coordinate system.

The +X axis is east, the +Y axis is down, and the +Z axis is north.

◆ NED()

static const CoordinateSystem & frc::CoordinateSystem::NED ( )
static

Returns an instance of the NED coordinate system.

The +X axis is north, the +Y axis is east, and the +Z axis is down.

◆ NWU()

static const CoordinateSystem & frc::CoordinateSystem::NWU ( )
static

Returns an instance of the North-West-Up (NWU) coordinate system.

The +X axis is north, the +Y axis is west, and the +Z axis is up.

◆ operator=() [1/2]

CoordinateSystem & frc::CoordinateSystem::operator= ( const CoordinateSystem )
default

◆ operator=() [2/2]

CoordinateSystem & frc::CoordinateSystem::operator= ( CoordinateSystem &&  )
default

The documentation for this class was generated from the following file: