Representation for a 2D pose (3 degrees of freedom). More...
#include <pose2d.hpp>
Public Types | |
typedef geometry::Pose2DMath< Float, RotationAngleStorage > | RotationAngleMath |
Rotational math specific to rotational angles. More... | |
typedef geometry::Pose2DMath< Float, Storage > | RotationMath |
Rotational math specific to this storage type. More... | |
typedef ecl::linear_algebra::Matrix< Float, 2, 2 > | RotationMatrix |
The type used to represent rotation matrices. More... | |
typedef geometry::Pose2DMath< Float, RotationMatrixStorage > | RotationMatrixMath |
Rotational math specific to rotational matrices. More... | |
typedef ecl_traits< Pose2D< Float, Storage, typename enable_if< is_float< Float > >::type > >::RotationType | RotationType |
The type used for storage of the rotation/angle. More... | |
typedef ecl::linear_algebra::Matrix< Float, 2, 1 > | Translation |
The type used to represent translations. More... | |
Public Member Functions | |
void | heading (const Angle< Float > &value) |
Sets the heading. More... | |
Angle< Float > | heading () const |
Get the heading. More... | |
Pose2D< Float, Storage > | inverse () const |
Calculate the inverse pose. More... | |
template<enum Pose2DStorageType Storage_> | |
Pose2D< Float, Storage > | operator* (const Pose2D< Float, Storage_ > &pose) const |
Combine this pose with the incoming pose. More... | |
Pose2D< Float > & | operator*= (const Pose2D< Float > &pose) |
Transform this pose by the specified input pose. More... | |
template<enum Pose2DStorageType Storage_> | |
Pose2D< Float, Storage > & | operator= (const Pose2D< Float, Storage_ > &pose) |
Assign from another Pose2D instance. More... | |
Pose2D () | |
Default constructor. More... | |
Pose2D (const Float &x, const Float &y, const Angle< Float > &angle) | |
Construct the pose using scalars for position and rotation angle. More... | |
template<typename Rot , typename Trans > | |
Pose2D (const ecl::linear_algebra::MatrixBase< Rot > &R, const ecl::linear_algebra::MatrixBase< Trans > &T) | |
Construct the pose using a rotation matrix and a translation vector. More... | |
template<typename Trans > | |
Pose2D (const Angle< Float > &angle, const ecl::linear_algebra::MatrixBase< Trans > &T) | |
Construct the pose using a rotational angle and a translation vector. More... | |
template<enum Pose2DStorageType Storage_> | |
Pose2D (const Pose2D< Float, Storage_ > &pose) | |
Copy constructor that works for copies from any pose type. More... | |
template<enum Pose2DStorageType Storage_> | |
Pose2D< Float, Storage > | relative (const Pose2D< Float, Storage_ > &pose) const |
Relative pose between this pose and another. More... | |
void | rotation (const Angle< Float > &heading) |
Set the rotational component with a heading angle. More... | |
void | rotation (const RotationMatrix &rotation_matrix) |
Set the rotational component with a rotation matrix. More... | |
RotationType & | rotation () |
const RotationType & | rotation () const |
Return a mutable handle to the translation vector. More... | |
template<typename Rot > | |
void | rotationMatrix (const ecl::linear_algebra::MatrixBase< Rot > &rotation_matrix) |
Set the rotational component. More... | |
RotationMatrix | rotationMatrix () const |
void | setIdentity () |
Set this pose to zero rotation and zero translation. More... | |
void | setPose (const Float &x, const Float &y, const Angle< Float > &heading) |
Sets the pose with a triplet. More... | |
void | translation (const Float &x, const Float &y) |
Set the translation vector from a pair of x,y values. More... | |
template<typename Trans > | |
void | translation (const ecl::linear_algebra::MatrixBase< Trans > &T) |
Set the translation vector. More... | |
Translation & | translation () |
Return a mutable handle to the rotational storage component. More... | |
const Translation & | translation () const |
Return a const handle to the rotational storage component. More... | |
void | x (const Float &value) |
Sets the x-coordinate. More... | |
Float | x () const |
Return a const handle to the translation vector. More... | |
void | y (const Float &value) |
Sets the y-coordinate. More... | |
Float | y () const |
Get the y-coordinate. More... | |
virtual | ~Pose2D () |
Static Public Member Functions | |
static Pose2D< Float, Storage > | Identity () |
Static function for returning the idenitity pose, eigen style. More... | |
Public Attributes | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef Float | Scalar |
Eigen style declaration of the element type. More... | |
Private Attributes | |
RotationType | rot |
Translation | trans |
Friends | |
template<typename OutputStream , typename Float_ , enum Pose2DStorageType Storage_> | |
OutputStream & | operator<< (OutputStream &ostream, const Pose2D< Float_, Storage_ > &pose) |
Insertion operator for output streams. More... | |
Representation for a 2D pose (3 degrees of freedom).
This represents a transformation typical of that of an object in 2D, e.g. a mobile robot on a horizontal plane. There are two storage types for this object, the default is rotation matrix, but scalar angular storage can be selected by supplying a second template parameter to the type:
Float | : must be a float type (e.g. float, double, float32, float64) |
Storage | : type of storage (RotationMatrixStorage, RotationAngleStorage). |
Definition at line 169 of file pose2d.hpp.
typedef geometry::Pose2DMath<Float,RotationAngleStorage> ecl::Pose2D< Float, Storage, enable_if< is_float< Float > >::type >::RotationAngleMath |
Rotational math specific to rotational angles.
Definition at line 182 of file pose2d.hpp.
typedef geometry::Pose2DMath<Float,Storage> ecl::Pose2D< Float, Storage, enable_if< is_float< Float > >::type >::RotationMath |
Rotational math specific to this storage type.
Definition at line 180 of file pose2d.hpp.
typedef ecl::linear_algebra::Matrix<Float,2,2> ecl::Pose2D< Float, Storage, enable_if< is_float< Float > >::type >::RotationMatrix |
The type used to represent rotation matrices.
Definition at line 184 of file pose2d.hpp.
typedef geometry::Pose2DMath<Float,RotationMatrixStorage> ecl::Pose2D< Float, Storage, enable_if< is_float< Float > >::type >::RotationMatrixMath |
Rotational math specific to rotational matrices.
Definition at line 181 of file pose2d.hpp.
typedef ecl_traits< Pose2D<Float,Storage,typename enable_if<is_float<Float> >::type> >::RotationType ecl::Pose2D< Float, Storage, enable_if< is_float< Float > >::type >::RotationType |
The type used for storage of the rotation/angle.
Definition at line 183 of file pose2d.hpp.
typedef ecl::linear_algebra::Matrix<Float,2,1> ecl::Pose2D< Float, Storage, enable_if< is_float< Float > >::type >::Translation |
The type used to represent translations.
Definition at line 185 of file pose2d.hpp.
|
inline |
Default constructor.
Initialises the pose with zero rotation and zero translation. Might be worth dropping the setting here (aka eigen style) if we need speed, not safety. If we do so, maybe a debug mode is_initialised flag? Also, if we do so make sure to update the Identity static function.
Definition at line 198 of file pose2d.hpp.
|
inline |
Construct the pose using scalars for position and rotation angle.
x,y | : position (origin) of the target frame |
angle | : initial heading angle (double is compatible)(radians). |
Definition at line 206 of file pose2d.hpp.
|
inline |
Construct the pose using a rotation matrix and a translation vector.
This accepts arbitrary eigen types to use as a rotation matrix and translation vector.
R | : 2x2 rotation matrix. |
T | : 2x1 translation vector (will compile error if incorrect size). |
Rot | : any compatible eigen 2x2 matrix type (e.g. Matrix<Float,2,2>). |
Trans | : any compatible eigen 2x1 matrix type (e.g. Matrix<Float,2,1>). |
Definition at line 223 of file pose2d.hpp.
|
inline |
Construct the pose using a rotational angle and a translation vector.
This accepts an angle (or its Float equivalent) and an arbitrary eigen type to use as a translation vector.
angle | : initial heading angle (double is compatible)(radians). |
T | : 2x1 translation vector (will compile error if incorrect size). |
Trans | : any compatible eigen 2x1 matrix type (e.g. Matrix<Float,2,1>). |
Definition at line 238 of file pose2d.hpp.
|
inline |
Copy constructor that works for copies from any pose type.
This works regardless of whatever storage the incoming pose is in.
pose | : the pose to copy. |
Definition at line 250 of file pose2d.hpp.
|
inlinevirtual |
Definition at line 255 of file pose2d.hpp.
|
inline |
Sets the heading.
Definition at line 345 of file pose2d.hpp.
|
inline |
Get the heading.
Definition at line 374 of file pose2d.hpp.
|
inlinestatic |
Static function for returning the idenitity pose, eigen style.
Definition at line 335 of file pose2d.hpp.
|
inline |
Calculate the inverse pose.
This calculates the reverse transformation between frames.
Definition at line 387 of file pose2d.hpp.
|
inline |
Combine this pose with the incoming pose.
pose | : differential (wrt this pose's frame). |
Definition at line 400 of file pose2d.hpp.
|
inline |
Transform this pose by the specified input pose.
pose | : a pose differential (wrt this pose's frame). |
Definition at line 408 of file pose2d.hpp.
|
inline |
Assign from another Pose2D instance.
pose | : another pose2D, storage type is irrelevant. |
Definition at line 266 of file pose2d.hpp.
|
inline |
Relative pose between this pose and another.
Evaluates and returns the pose of this pose, relative to the specified pose.
pose | : reference frame for the relative pose. |
Definition at line 428 of file pose2d.hpp.
|
inline |
Set the rotational component with a heading angle.
This accepts an input heading angle to configure the internal rotational storage.
heading | : configure the rotation from an input heading angle. |
Definition at line 283 of file pose2d.hpp.
|
inline |
Set the rotational component with a rotation matrix.
This accepts an input rotation matrix to configure the internal rotational storage.
rotation_matrix | : input to copy across to the internal rotational storage. |
Definition at line 294 of file pose2d.hpp.
|
inline |
Definition at line 364 of file pose2d.hpp.
|
inline |
|
inline |
Set the rotational component.
This accepts arbitrary eigen types to use as a rotation matrix. Eigen will emit the appropriate compile time error if it is incompatible.
rotation_matrix | : 2x2 rotation matrix. |
Rot | : any compatible eigen 2x2 matrix type (e.g. Matrix<Float,2,2>). |
Definition at line 357 of file pose2d.hpp.
|
inline |
Representation of the rotation in matrix form.
Definition at line 375 of file pose2d.hpp.
|
inline |
Set this pose to zero rotation and zero translation.
Definition at line 325 of file pose2d.hpp.
|
inline |
Sets the pose with a triplet.
Definition at line 342 of file pose2d.hpp.
|
inline |
Set the translation vector from a pair of x,y values.
This accepts x, y values to set the pose translation.
x | : x translation. |
y | : y translation. |
Definition at line 305 of file pose2d.hpp.
|
inline |
Set the translation vector.
This accepts an arbitrary eigen types to use as a translation vector. Eigen will emit the appropriate compile time error if it is incompatible.
T | : 2x1 translation vector. |
Trans | : any compatible eigen 2x1 matrix type (e.g. Matrix<Float,2,1>). |
Definition at line 318 of file pose2d.hpp.
|
inline |
Return a mutable handle to the rotational storage component.
>
Definition at line 365 of file pose2d.hpp.
|
inline |
Return a const handle to the rotational storage component.
>
Definition at line 367 of file pose2d.hpp.
|
inline |
Sets the x-coordinate.
Definition at line 343 of file pose2d.hpp.
|
inline |
Return a const handle to the translation vector.
>Get the x-coordinate.
Definition at line 372 of file pose2d.hpp.
|
inline |
Sets the y-coordinate.
Definition at line 344 of file pose2d.hpp.
|
inline |
Get the y-coordinate.
Definition at line 373 of file pose2d.hpp.
|
friend |
Insertion operator for output streams.
Note that the output heading angle is formatted in degrees.
ostream | : stream satisfying the ecl stream concept. |
pose | : the inserted pose. |
Definition at line 456 of file pose2d.hpp.
|
private |
Definition at line 439 of file pose2d.hpp.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef Float ecl::Pose2D< Float, Storage, enable_if< is_float< Float > >::type >::Scalar |
Eigen style declaration of the element type.
Definition at line 179 of file pose2d.hpp.
|
private |
Definition at line 440 of file pose2d.hpp.