8 #error This class is not to be included by the user directly. Use SMomentumd.h or SMomentumf.h instead.
27 SMOMENTUM(REAL lx, REAL ly, REAL lz, REAL ax, REAL ay, REAL az, boost::shared_ptr<const POSE3>
pose = boost::shared_ptr<const POSE3>()) :
SVECTOR6(lx, ly, lz, ax, ay, az,
pose) {};
30 SMOMENTUM(REAL lx, REAL ly, REAL lz, REAL ax, REAL ay, REAL az, boost::shared_ptr<POSE3>
pose) :
SVECTOR6(lx, ly, lz, ax, ay, az, pose) {};
33 SMOMENTUM(
const REAL* array, boost::shared_ptr<const POSE3>
pose = boost::shared_ptr<const POSE3>()) :
SVECTOR6(array[0], array[1], array[2], array[3], array[4], array[5],
pose) {}
36 SMOMENTUM(
const REAL* array, boost::shared_ptr<POSE3>
pose) :
SVECTOR6(array[0], array[1], array[2], array[3], array[4], array[5], pose) {}
51 static SMOMENTUM from_vector(
const V& v, boost::shared_ptr<const POSE3>
pose = boost::shared_ptr<const POSE3>())
53 const unsigned SPATIAL_DIM = 6;
54 if (v.size() != SPATIAL_DIM)
55 throw MissizeException();
57 REAL* wdata = w.data();
58 const REAL* vdata = v.data();
59 CBLAS::copy(SPATIAL_DIM, vdata, v.inc(), wdata, 1);
64 static SMOMENTUM from_vector(
const V& v, boost::shared_ptr<POSE3>
pose)
66 const unsigned SPATIAL_DIM = 6;
67 if (v.size() != SPATIAL_DIM)
68 throw MissizeException();
70 REAL* wdata = w.data();
71 const REAL* vdata = v.data();
72 CBLAS::copy(SPATIAL_DIM, vdata, v.inc(), wdata, 1);
91 v._data[0] = -_data[0];
92 v._data[1] = -_data[1];
93 v._data[2] = -_data[2];
94 v._data[3] = -_data[3];
95 v._data[4] = -_data[4];
96 v._data[5] = -_data[5];
106 throw FrameException();
109 _data[0] -= v._data[0];
110 _data[1] -= v._data[1];
111 _data[2] -= v._data[2];
112 _data[3] -= v._data[3];
113 _data[4] -= v._data[4];
114 _data[5] -= v._data[5];
123 throw FrameException();
126 _data[0] += v._data[0];
127 _data[1] += v._data[1];
128 _data[2] += v._data[2];
129 _data[3] += v._data[3];
130 _data[4] += v._data[4];
131 _data[5] += v._data[5];
148 inline std::ostream& operator<<(std::ostream& out,
const SMOMENTUM& w)
150 out <<
"Momentum (linear = " << w.get_linear() <<
", angular = " << w.get_angular() <<
") frame: " << w.
pose;
void set_lower(const VECTOR3 &lower)
Sets the lower 3-dimensional vector.
Definition: SVector6.cpp:241
A spatial (six dimensional) momentum.
Definition: SMomentum.h:12
boost::shared_ptr< const POSE3 > pose
The frame that this vector is defined in.
Definition: SVector6.h:96
SMOMENTUM(const REAL *array, boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a spatial momentum using six values- first three linear, second three angular and a pose...
Definition: SMomentum.h:33
void set_upper(const VECTOR3 &upper)
Sets the upper 3-dimensional vector.
Definition: SVector6.cpp:249
VECTOR3 get_upper() const
Gets the upper 3-dimensional vector.
Definition: SVector6.cpp:235
static SMOMENTUM zero(boost::shared_ptr< POSE3 > pose)
Constructs a zero spatial momentum.
Definition: SMomentum.h:48
SVECTOR6 & operator=(const SVECTOR6 &source)
Copies this vector from another SVECTOR6.
Definition: SVector6.cpp:257
SMOMENTUM(REAL lx, REAL ly, REAL lz, REAL ax, REAL ay, REAL az, boost::shared_ptr< POSE3 > pose)
Constructs a spatial momentum using six values- first three linear, second three angular- and a pose...
Definition: SMomentum.h:30
A spatial velocity (a twist)
Definition: SVelocity.h:15
SMOMENTUM(const REAL *array, boost::shared_ptr< POSE3 > pose)
Constructs a spatial momentum using six values- first three linear, second three angular and a pose...
Definition: SMomentum.h:36
A 6-dimensional floating-point vector for use with spatial algebra.
Definition: SVector6.h:22
static SMOMENTUM zero(boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a zero spatial momentum.
Definition: SMomentum.h:45
VECTOR3 get_lower() const
Gets the lower 3-dimensional vector.
Definition: SVector6.cpp:229
A three-dimensional floating point vector used for representing points and vectors in 3D with associa...
Definition: Vector3.h:15
SMOMENTUM(REAL lx, REAL ly, REAL lz, REAL ax, REAL ay, REAL az, boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a spatial momentum using six values- first three linear, second three angular- and a pose...
Definition: SMomentum.h:27
A spatial force (a wrench)
Definition: SForce.h:14
SMOMENTUM(boost::shared_ptr< POSE3 > pose)
Constructs a spatial momentum with zero linear and angular components.
Definition: SMomentum.h:21
SMOMENTUM(const VECTOR3 &l, const VECTOR3 &a, boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a spatial momentum using given linear and angular and pose.
Definition: SMomentum.h:39
SMOMENTUM operator-() const
Returns the negation of this vector.
Definition: SMomentum.h:88
SMOMENTUM(const VECTOR3 &l, const VECTOR3 &a, boost::shared_ptr< POSE3 > pose)
Constructs a spatial momentum using given linear and angular and pose.
Definition: SMomentum.h:42
SMOMENTUM(boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a spatial momentum with zero linear and angular components.
Definition: SMomentum.h:18
SMOMENTUM(const SVECTOR6 &w)
Constructs a spatial momentum from the SVector6.
Definition: SMomentum.h:24