Valkyrie 2026
Loading...
Searching...
No Matches
valor::geometry::Rotation2d Class Reference

Represents a 2D rotation matrix (2x2). More...

#include <valkyrie/util/geometry/Pose.h>

Inheritance diagram for valor::geometry::Rotation2d:
valor::EigenUnit::NamedPhysicalMatrix< Rotation2d, EigenUnit::PhysicalMatrix< EigenUnit::VectorN< units::dimensionless::scalar, 2 >, EigenUnit::VectorN< units::dimensionless::scalar, 2 > > > valor::EigenUnit::UnitMatrix< typename VecOut::UnitTuple, typename VecIn::UnitTuple >

Public Member Functions

 Rotation2d (const BaseMatrix &b)
template<class AngleUnit, std::enable_if_t< units::traits::is_angle_unit< AngleUnit >::value, int > = 0>
 Rotation2d (units::unit_t< AngleUnit > theta)
 Construct a Rotation2d from any angle unit (degrees, radians, etc.).
 Rotation2d (units::radian_t theta)
 Rotation2d (frc::Rotation2d frcRotation)
 Construct a Rotation2d from an frc::Rotation2d.
 Rotation2d (frc::Rotation3d frcRotation)
 Construct a Rotation2d from an frc::Rotation3d by extracting the yaw. Pitch and roll components are discarded.
 Rotation2d (const Rotation3d &rot)
 Construct a Rotation2d from a Rotation3d by extracting the yaw.
units::radian_t GetAngle () const
 Get the rotation angle.
Rotation2d operator- () const
 Unary negation — inverse rotation.
Rotation2d operator* (double scalar) const
 Scalar multiplication of the angle.
units::radian_t Log () const
 Logarithm map: SO(2) -> so(2).
Public Member Functions inherited from valor::EigenUnit::NamedPhysicalMatrix< Rotation2d, EigenUnit::PhysicalMatrix< EigenUnit::VectorN< units::dimensionless::scalar, 2 >, EigenUnit::VectorN< units::dimensionless::scalar, 2 > > >
 NamedPhysicalMatrix (const EigenUnit::PhysicalMatrix< EigenUnit::VectorN< units::dimensionless::scalar, 2 >, EigenUnit::VectorN< units::dimensionless::scalar, 2 > > &base)
Rotation2d Inverse () const
auto Block () const

Static Public Member Functions

static Rotation2d Exp (units::radian_t theta)
 Exponential map: so(2) -> SO(2).

Detailed Description

Represents a 2D rotation matrix (2x2).

Constructor & Destructor Documentation

◆ Rotation2d() [1/4]

template<class AngleUnit, std::enable_if_t< units::traits::is_angle_unit< AngleUnit >::value, int > = 0>
valor::geometry::Rotation2d::Rotation2d ( units::unit_t< AngleUnit > theta)
inline

Construct a Rotation2d from any angle unit (degrees, radians, etc.).

This template overload exists to resolve an ambiguity that arises when passing a non-radian angle (e.g. units::degree_t): both the Rotation2d(units::radian_t) constructor (via implicit unit conversion) and the Rotation2d(frc::Rotation2d) constructor (via frc's angle_unit constructor) would otherwise require exactly one user-defined conversion, making the call ambiguous. By matching the angle unit directly here, the compiler resolves the call with zero conversions.

Template Parameters
AngleUnitAny unit type satisfying units::traits::is_angle_unit.
Parameters
thetaThe rotation angle.

◆ Rotation2d() [2/4]

valor::geometry::Rotation2d::Rotation2d ( frc::Rotation2d frcRotation)
inlineexplicit

Construct a Rotation2d from an frc::Rotation2d.

Parameters
frcRotationThe frc rotation to convert.

◆ Rotation2d() [3/4]

valor::geometry::Rotation2d::Rotation2d ( frc::Rotation3d frcRotation)
inlineexplicit

Construct a Rotation2d from an frc::Rotation3d by extracting the yaw. Pitch and roll components are discarded.

Parameters
frcRotationThe frc 3D rotation whose yaw is used.

◆ Rotation2d() [4/4]

valor::geometry::Rotation2d::Rotation2d ( const Rotation3d & rot)
inlineexplicit

Construct a Rotation2d from a Rotation3d by extracting the yaw.

Parameters
rotThe 3D rotation.

The documentation for this class was generated from the following file:
  • src/main/include/valkyrie/util/geometry/Pose.h