Ravelin
Transform3.h
1 /****************************************************************************
2  * Copyright 2013 Evan Drumwright
3  * This library is distributed under the terms of the Apache V2.0
4  * License (obtainable from http://www.apache.org/licenses/LICENSE-2.0).
5  ****************************************************************************/
6 
7 #ifndef TRANSFORM3
8 #error This class is not to be included by the user directly. Use Transform3d.h or Transform3f.h instead.
9 #endif
10 
11 class POSE3;
12 
15 {
16  public:
17  TRANSFORM3();
18  TRANSFORM3(const TRANSFORM3& source) { operator=(source); }
19  TRANSFORM3(const AANGLE& a);
20  TRANSFORM3(const MATRIX3& m);
21  TRANSFORM3(const QUAT& q);
22  TRANSFORM3(const AANGLE& a, const ORIGIN3& v);
23  TRANSFORM3(const MATRIX3& m, const ORIGIN3& v);
24  TRANSFORM3(const QUAT& q, const ORIGIN3& v);
25  TRANSFORM3(const ORIGIN3& v);
26  static ORIGIN3 interpolate_transform_vector(const TRANSFORM3& T1, const TRANSFORM3& T2, REAL t, const ORIGIN3& o);
27  static ORIGIN3 interpolate_transform_point(const TRANSFORM3& T1, const TRANSFORM3& T2, REAL t, const ORIGIN3& o);
28  static ORIGIN3 interpolate_inverse_transform_vector(const TRANSFORM3& T1, const TRANSFORM3& T2, REAL t, const ORIGIN3& o);
29  static ORIGIN3 interpolate_inverse_transform_point(const TRANSFORM3& T1, const TRANSFORM3& T2, REAL t, const ORIGIN3& o);
30  static TRANSFORM3 identity() { TRANSFORM3 T; T.set_identity(); return T; }
31  bool is_identity() const;
32  static bool rel_equal(const TRANSFORM3& p1, const TRANSFORM3& p2, REAL tol = EPS);
33  POSE3 transform(const POSE3& p) const;
34  POSE3 inverse_transform(const POSE3& p) const;
35  VECTOR3 transform_point(const VECTOR3& p) const;
36  VECTOR3 transform_vector(const VECTOR3& v) const;
37  VECTOR3 inverse_transform_point(const VECTOR3& p) const;
39  SFORCE transform(const SFORCE& w) const;
40  SFORCE inverse_transform(const SFORCE& w) const;
41  SMOMENTUM transform(const SMOMENTUM& t) const;
42  SMOMENTUM inverse_transform(const SMOMENTUM& t) const;
43  SVELOCITY transform(const SVELOCITY& t) const;
44  SVELOCITY inverse_transform(const SVELOCITY& t) const;
45  SACCEL transform(const SACCEL& t) const;
46  SACCEL inverse_transform(const SACCEL& t) const;
52  TRANSFORM3& invert();
53  TRANSFORM3 inverse() const { return invert(*this); }
54  static TRANSFORM3 invert(const TRANSFORM3& m);
55  TRANSFORM3& set(const AANGLE& a);
56  TRANSFORM3& set(const MATRIX3& m);
57  TRANSFORM3& set(const QUAT& q);
58  TRANSFORM3& set(const AANGLE& a, const ORIGIN3& v);
59  TRANSFORM3& set(const MATRIX3& m, const ORIGIN3& v);
60  TRANSFORM3& set(const QUAT& q, const ORIGIN3& v);
61  TRANSFORM3& operator=(const TRANSFORM3& source);
62  TRANSFORM3 operator*(const TRANSFORM3& m) const;
63  POSE3 apply_transform() const;
65 
68 
71 
73  boost::shared_ptr<const POSE3> source;
74 
76  boost::shared_ptr<const POSE3> target;
77 
78  private:
79  void transform_spatial(const SVECTOR6& w, SVECTOR6& result) const;
80  void inverse_transform_spatial(const SVECTOR6& w, SVECTOR6& result) const;
81 }; // end class
82 
83 std::ostream& operator<<(std::ostream& out, const TRANSFORM3& m);
84 
POSE3 inverse_transform(const POSE3 &p) const
Transforms a pose.
Definition: Transform3.cpp:320
TRANSFORM3 & set(const AANGLE &a)
Sets this transformation from a axis-angle object only (translation will be zero'd) ...
Definition: Transform3.cpp:210
static bool rel_equal(const TRANSFORM3 &p1, const TRANSFORM3 &p2, REAL tol=EPS)
Determines whether two transformations in 3D are relatively equivalent.
Definition: Transform3.cpp:154
QUAT q
the relative orientation
Definition: Transform3.h:67
Quaternion class used for orientation.
Definition: Quat.h:21
ORIGIN3 x
the relative origin
Definition: Transform3.h:70
bool is_identity() const
Determines whether the transform is identity.
Definition: Transform3.cpp:59
VECTOR3 transform_vector(const VECTOR3 &v) const
Transforms a vector from one pose to another.
Definition: Transform3.cpp:337
A spatial (six dimensional) momentum.
Definition: SMomentum.h:12
POSE3 apply_inverse_transform() const
Applies the inverse transform to a pose.
Definition: Transform3.cpp:293
Class for representation of orientation by an angle around an axis.
Definition: AAngle.h:15
static ORIGIN3 interpolate_inverse_transform_point(const TRANSFORM3 &T1, const TRANSFORM3 &T2, REAL t, const ORIGIN3 &o)
Tranforms a point with the inverse of an interpolated pose (between poses T1 and T2) ...
Definition: Transform3.cpp:141
VECTOR3 inverse_transform_point(const VECTOR3 &p) const
Transforms a point from one pose to another.
Definition: Transform3.cpp:370
A spatial velocity (a twist)
Definition: SVelocity.h:15
POSE3 apply_transform() const
Applies a transform to a pose.
Definition: Transform3.cpp:277
TRANSFORM3 & set_identity()
Sets this matrix to identity.
Definition: Transform3.cpp:226
A rigid body pose.
Definition: Pose3.h:15
A 6-dimensional floating-point vector for use with spatial algebra.
Definition: SVector6.h:22
TRANSFORM3()
Default constructor.
Definition: Transform3.cpp:11
A 6x6 spatial algebra matrix typically used for dynamics calculations.
Definition: SpatialABInertia.h:20
TRANSFORM3 operator*(const TRANSFORM3 &m) const
Multiplies this transformation by another.
Definition: Transform3.cpp:259
static ORIGIN3 interpolate_transform_vector(const TRANSFORM3 &T1, const TRANSFORM3 &T2, REAL t, const ORIGIN3 &o)
Tranforms a vector with an interpolated transform (between transforms T1 and T2)
Definition: Transform3.cpp:87
A 6x6 spatial algebra matrix used for dynamics calculations.
Definition: SpatialRBInertia.h:25
A spatial (six dimensional) acceleration.
Definition: SAccel.h:14
POSE3 transform(const POSE3 &p) const
Transforms a pose.
Definition: Transform3.cpp:304
static ORIGIN3 interpolate_inverse_transform_vector(const TRANSFORM3 &T1, const TRANSFORM3 &T2, REAL t, const ORIGIN3 &o)
Tranforms a vector with the inverse of an interpolated transform (between transforms T1 and T2) ...
Definition: Transform3.cpp:124
A three-dimensional floating point vector used for representing points and vectors in 3D with associa...
Definition: Vector3.h:15
boost::shared_ptr< const POSE3 > source
the "source" pose
Definition: Transform3.h:73
A spatial force (a wrench)
Definition: SForce.h:14
VECTOR3 inverse_transform_vector(const VECTOR3 &v) const
Transforms a vector from one pose to another.
Definition: Transform3.cpp:348
A three-dimensional floating point vector used for representing points and vectors in 3D and without ...
Definition: Origin3.h:16
VECTOR3 transform_point(const VECTOR3 &p) const
Transforms a point from one pose to another.
Definition: Transform3.cpp:359
TRANSFORM3 & invert()
Special method for inverting a transformation in place.
Definition: Transform3.cpp:234
boost::shared_ptr< const POSE3 > target
the "target" pose
Definition: Transform3.h:76
A transformation between two rigid body poses.
Definition: Transform3.h:14
A 3x3 matrix that may be used for orientation, inertia tensors, etc.
Definition: Matrix3.h:20
static ORIGIN3 interpolate_transform_point(const TRANSFORM3 &T1, const TRANSFORM3 &T2, REAL t, const ORIGIN3 &o)
Tranforms a point with an interpolated pose (between poses T1 and T2)
Definition: Transform3.cpp:104