8 #error This class is not to be included by the user directly. Use SVelocityf.h or SVelocityd.h instead.
28 SVELOCITY(REAL ax, REAL ay, REAL az, REAL lx, REAL ly, REAL lz, boost::shared_ptr<const POSE3>
pose = boost::shared_ptr<const POSE3>()) :
SVECTOR6(ax, ay, az, lx, ly, lz,
pose) {};
31 SVELOCITY(REAL ax, REAL ay, REAL az, REAL lx, REAL ly, REAL lz, boost::shared_ptr<POSE3>
pose) :
SVECTOR6(ax, ay, az, lx, ly, lz, pose) {};
34 SVELOCITY(
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) {}
37 SVELOCITY(
const REAL* array, boost::shared_ptr<POSE3>
pose) :
SVECTOR6(array[0], array[1], array[2], array[3], array[4], array[5], pose) {}
52 V& transpose_to_vector(V& v)
const
54 const unsigned SPATIAL_DIM = 6;
55 v.resize(SPATIAL_DIM);
56 REAL* vdata = v.data();
57 const REAL* d = data();
58 vdata[0] = d[3]; vdata[1] = d[4]; vdata[2] = d[5];
59 vdata[3] = d[0]; vdata[4] = d[1]; vdata[5] = d[2];
64 static SVELOCITY from_vector(
const V& v, boost::shared_ptr<const POSE3>
pose = boost::shared_ptr<const POSE3>())
66 const unsigned SPATIAL_DIM = 6;
67 if (v.size() != SPATIAL_DIM)
68 throw MissizeException();
70 REAL* tdata = t.data();
71 const REAL* vdata = v.data();
72 CBLAS::copy(SPATIAL_DIM, vdata, v.inc(), tdata, 1);
77 static SVELOCITY from_vector(
const V& v, boost::shared_ptr<POSE3>
pose)
79 const unsigned SPATIAL_DIM = 6;
80 if (v.size() != SPATIAL_DIM)
81 throw MissizeException();
83 REAL* tdata = t.data();
84 const REAL* vdata = v.data();
85 CBLAS::copy(SPATIAL_DIM, vdata, v.inc(), tdata, 1);
104 v._data[0] = -_data[0];
105 v._data[1] = -_data[1];
106 v._data[2] = -_data[2];
107 v._data[3] = -_data[3];
108 v._data[4] = -_data[4];
109 v._data[5] = -_data[5];
119 throw FrameException();
122 _data[0] -= v._data[0];
123 _data[1] -= v._data[1];
124 _data[2] -= v._data[2];
125 _data[3] -= v._data[3];
126 _data[4] -= v._data[4];
127 _data[5] -= v._data[5];
136 throw FrameException();
139 _data[0] += v._data[0];
140 _data[1] += v._data[1];
141 _data[2] += v._data[2];
142 _data[3] += v._data[3];
143 _data[4] += v._data[4];
144 _data[5] += v._data[5];
161 inline std::ostream& operator<<(std::ostream& out,
const SVELOCITY& t)
163 out <<
"velocity (linear= " << t.get_linear() <<
", angular= " << t.get_angular() <<
") frame: " << t.
pose;
void set_lower(const VECTOR3 &lower)
Sets the lower 3-dimensional vector.
Definition: SVector6.cpp:241
SVELOCITY(REAL ax, REAL ay, REAL az, REAL lx, REAL ly, REAL lz, boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a velocity from six values (first three linear, next three angular) and a pose...
Definition: SVelocity.h:28
SVELOCITY cross(const SVELOCITY &v) const
Returns the spatial cross product between two velocity vectors.
Definition: SVelocity.cpp:38
SVELOCITY(boost::shared_ptr< POSE3 > pose)
Constructs a velocity with zero linear and zero angular components.
Definition: SVelocity.h:22
static SVELOCITY zero(boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Returns a zero velocity.
Definition: SVelocity.h:46
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
SVELOCITY(REAL ax, REAL ay, REAL az, REAL lx, REAL ly, REAL lz, boost::shared_ptr< POSE3 > pose)
Constructs a velocity from six values (first three linear, next three angular) and a pose...
Definition: SVelocity.h:31
void set_upper(const VECTOR3 &upper)
Sets the upper 3-dimensional vector.
Definition: SVector6.cpp:249
static SVELOCITY zero(boost::shared_ptr< POSE3 > pose)
Returns a zero velocity.
Definition: SVelocity.h:49
VECTOR3 get_upper() const
Gets the upper 3-dimensional vector.
Definition: SVector6.cpp:235
SVELOCITY(const SVECTOR6 &v)
Constructs a velocity from a SVector6.
Definition: SVelocity.h:25
SVECTOR6 & operator=(const SVECTOR6 &source)
Copies this vector from another SVECTOR6.
Definition: SVector6.cpp:257
A spatial velocity (a twist)
Definition: SVelocity.h:15
A 6-dimensional floating-point vector for use with spatial algebra.
Definition: SVector6.h:22
SVELOCITY(boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a velocity with zero linear and zero angular components.
Definition: SVelocity.h:19
VECTOR3 get_lower() const
Gets the lower 3-dimensional vector.
Definition: SVector6.cpp:229
SVELOCITY(const VECTOR3 &angular, const VECTOR3 &linear, boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a velocity from linear and angular components and a pose.
Definition: SVelocity.h:40
A three-dimensional floating point vector used for representing points and vectors in 3D with associa...
Definition: Vector3.h:15
SVELOCITY(const REAL *array, boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a velocity from six values (first three angular, next three linear) and a pose...
Definition: SVelocity.h:34
A spatial force (a wrench)
Definition: SForce.h:14
SVELOCITY(const VECTOR3 &angular, const VECTOR3 &linear, boost::shared_ptr< POSE3 > pose)
Constructs a velocity from linear and angular components and a pose.
Definition: SVelocity.h:43
SVELOCITY(const REAL *array, boost::shared_ptr< POSE3 > pose)
Constructs a velocity from six values (first three angular, next three linear) and a pose...
Definition: SVelocity.h:37
SVELOCITY operator-() const
Returns the negation of this vector.
Definition: SVelocity.h:101
REAL dot(const SFORCE &f) const
Computes the dot product between a velocity and a force.
Definition: SVelocity.cpp:23