TrajoptLib
Library for generating time-optimal trajectories for FRC robots.
Loading...
Searching...
No Matches
trajopt::Pose2< T > Class Template Reference

Represents a 2D pose with translation and rotation. More...

#include <trajopt/geometry/pose2.hpp>

Public Member Functions

constexpr Pose2 ()=default
 Constructs a pose at the origin facing toward the positive x-axis.
constexpr Pose2 (Translation2< T > translation, Rotation2< T > rotation)
constexpr Pose2 (T x, T y, Rotation2< T > rotation)
template<typename U>
constexpr Pose2 (const Pose2< U > &other)
constexpr const Translation2< T > & translation () const
constexpr const T & x () const
constexpr const T & y () const
constexpr const Rotation2< T > & rotation () const
constexpr Pose2< T > rotate_by (const Rotation2< T > &rotation) const

Detailed Description

template<typename T>
class trajopt::Pose2< T >

Represents a 2D pose with translation and rotation.

Constructor & Destructor Documentation

◆ Pose2() [1/3]

template<typename T>
trajopt::Pose2< T >::Pose2 ( Translation2< T > translation,
Rotation2< T > rotation )
inlineconstexpr

Constructs a pose with the specified translation and rotation.

Parameters
translationThe translational component of the pose.
rotationThe rotational component of the pose.

◆ Pose2() [2/3]

template<typename T>
trajopt::Pose2< T >::Pose2 ( T x,
T y,
Rotation2< T > rotation )
inlineconstexpr

Constructs a pose with x and y translations instead of a separate translation.

Parameters
xThe x component of the translational component of the pose.
yThe y component of the translational component of the pose.
rotationThe rotational component of the pose.

◆ Pose2() [3/3]

template<typename T>
template<typename U>
trajopt::Pose2< T >::Pose2 ( const Pose2< U > & other)
inlineexplicitconstexpr

Coerces one pose type into another.

Parameters
otherThe other pose type.

Member Function Documentation

◆ rotate_by()

template<typename T>
Pose2< T > trajopt::Pose2< T >::rotate_by ( const Rotation2< T > & rotation) const
inlineconstexpr

Rotates the pose around the origin and returns the new pose.

Parameters
rotationThe rotation to transform the pose by.
Returns
The rotated pose.

◆ rotation()

template<typename T>
const Rotation2< T > & trajopt::Pose2< T >::rotation ( ) const
inlineconstexpr

Returns the underlying rotation.

Returns
Reference to the rotational component of the pose.

◆ translation()

template<typename T>
const Translation2< T > & trajopt::Pose2< T >::translation ( ) const
inlineconstexpr

Returns the underlying translation.

Returns
Reference to the translational component of the pose.

◆ x()

template<typename T>
const T & trajopt::Pose2< T >::x ( ) const
inlineconstexpr

Returns the X component of the pose's translation.

Returns
The x component of the pose's translation.

◆ y()

template<typename T>
const T & trajopt::Pose2< T >::y ( ) const
inlineconstexpr

Returns the Y component of the pose's translation.

Returns
The y component of the pose's translation.

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