8 #error This class is not to be included by the user directly. Use SForced.h, SForcef.h, SMomentumd.h, SMomentumf.h, SVelocityd.h, SVelocityf.h, SAcceld.h, or SAccelf.h instead.
27 SVECTOR6(boost::shared_ptr<POSE3> pose);
28 SVECTOR6(REAL x, REAL y, REAL z, REAL a, REAL b, REAL c);
29 SVECTOR6(REAL x, REAL y, REAL z, REAL a, REAL b, REAL c, boost::shared_ptr<const POSE3> pose);
30 SVECTOR6(REAL x, REAL y, REAL z, REAL a, REAL b, REAL c, boost::shared_ptr<POSE3> pose);
32 SVECTOR6(
const REAL* array, boost::shared_ptr<const POSE3> pose);
33 SVECTOR6(
const REAL* array, boost::shared_ptr<POSE3> pose);
37 unsigned size()
const {
return 6; }
38 static SVECTOR6 zero(boost::shared_ptr<const POSE3> pose = boost::shared_ptr<const POSE3>()) {
return SVECTOR6(0,0,0,0,0,0, pose); }
39 static SVECTOR6 zero(boost::shared_ptr<POSE3> pose = boost::shared_ptr<POSE3>()) {
return SVECTOR6(0,0,0,0,0,0, pose); }
40 SVECTOR6& set_zero() { std::fill_n(_data, 6, (REAL) 0.0);
return *
this; }
41 SVECTOR6& set_zero(boost::shared_ptr<const POSE3> pose) { std::fill_n(_data, 6, (REAL) 0.0); this->pose =
pose;
return *
this; }
47 REAL& operator[](
const unsigned i) { assert(i < 6);
return _data[i]; }
48 const REAL& operator[](
const unsigned i)
const { assert(i < 6);
return _data[i]; }
49 REAL* data() {
return _data; }
50 const REAL* data()
const {
return _data; }
54 unsigned rows()
const {
return 6; }
55 unsigned columns()
const {
return 1; }
56 SVECTOR6& resize(
unsigned rows,
unsigned columns) { assert ((rows == 6 && columns == 1) || (columns == 1 && rows == 6));
return *
this; }
57 SVECTOR6& resize(
unsigned rows) { assert (rows == 6);
return *
this; }
70 SVECTOR6& negate() { std::transform(_data, _data+6, _data, std::negate<REAL>());
return *
this; }
71 unsigned inc()
const {
return 1; }
72 unsigned leading_dim()
const {
return 6; }
75 V& to_vector(V& v)
const
77 const unsigned SPATIAL_DIM = 6;
78 v.resize(SPATIAL_DIM);
79 REAL* vdata = v.data();
80 CBLAS::copy(SPATIAL_DIM, _data, 1, vdata, inc());
96 boost::shared_ptr<const POSE3>
pose;
99 static SVECTOR6 from_vector(
const V& v, boost::shared_ptr<const POSE3> pose = boost::shared_ptr<const POSE3>())
101 const unsigned SPATIAL_DIM = 6;
102 if (v.size() != SPATIAL_DIM)
103 throw MissizeException();
105 REAL* sdata = s.data();
106 const REAL* vdata = v.data();
107 CBLAS::copy(SPATIAL_DIM, vdata, v.inc(), sdata, 1);
119 const unsigned SPATIAL_DIM = 6;
121 if (v.rows()*v.columns() != SPATIAL_DIM)
122 throw MissizeException();
129 inline std::ostream& operator<<(std::ostream& out,
const SVECTOR6& v)
131 out <<
"Spatial vector (upper = " << v.
get_upper() <<
", lower= " << v.
get_lower() <<
") frame: " << v.
pose;
COLUMN_ITERATOR column_iterator_begin()
Gets an iterator to the beginning of the data.
Definition: SVector6.cpp:148
void set_lower(const VECTOR3 &lower)
Sets the lower 3-dimensional vector.
Definition: SVector6.cpp:241
A construct for iterating over a rectangular block of a matrix.
Definition: RowIterator.h:210
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
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
ROW_ITERATOR row_iterator_begin()
Gets an iterator to the beginning of the data.
Definition: SVector6.cpp:202
SVECTOR6()
Constructs a zero vector.
Definition: SVector6.cpp:8
SVECTOR6 & operator=(const SVECTOR6 &source)
Copies this vector from another SVECTOR6.
Definition: SVector6.cpp:257
A spatial velocity (a twist)
Definition: SVelocity.h:15
SVECTOR6 & operator*=(REAL scalar)
Multiplies this vector by a scalar in place.
Definition: SVector6.cpp:270
A rigid body pose.
Definition: Pose3.h:15
A 6-dimensional floating-point vector for use with spatial algebra.
Definition: SVector6.h:22
A spatial (six dimensional) acceleration.
Definition: SAccel.h:14
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
COLUMN_ITERATOR column_iterator_end()
Gets an iterator to the end of the data.
Definition: SVector6.cpp:161
A spatial force (a wrench)
Definition: SForce.h:14
A construct for iterating over a rectangular block of a matrix.
Definition: ColumnIterator.h:12
A construct for iterating over a rectangular block of a matrix.
Definition: ColumnIterator.h:215
A construct for iterating over a rectangular block of a matrix.
Definition: RowIterator.h:12
ROW_ITERATOR row_iterator_end()
Gets an iterator to the end of the data.
Definition: SVector6.cpp:215