WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
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

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

Static Public Member Functions

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

Detailed Description

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

Constructor & Destructor Documentation

◆ CoordinateSystem()

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

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.
Throws:
std::domain_error if the coordinate system isn't special orthogonal

Member Function Documentation

◆ Convert() [1/4]

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

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 constexpr Rotation3d frc::CoordinateSystem::Convert ( const Rotation3d & rotation,
const CoordinateSystem & from,
const CoordinateSystem & to )
inlinestaticconstexpr

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 constexpr Transform3d frc::CoordinateSystem::Convert ( const Transform3d & transform,
const CoordinateSystem & from,
const CoordinateSystem & to )
inlinestaticconstexpr

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 constexpr Translation3d frc::CoordinateSystem::Convert ( const Translation3d & translation,
const CoordinateSystem & from,
const CoordinateSystem & to )
inlinestaticconstexpr

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 constexpr CoordinateSystem frc::CoordinateSystem::EDN ( )
inlinestaticconstexpr

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 constexpr CoordinateSystem frc::CoordinateSystem::NED ( )
inlinestaticconstexpr

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 constexpr CoordinateSystem frc::CoordinateSystem::NWU ( )
inlinestaticconstexpr

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.


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