8 #error This class is not to be included by the user directly. Use SForced.h or SForcef.h instead.
29 SFORCE(REAL fx, REAL fy, REAL fz, REAL tx, REAL ty, REAL tz, boost::shared_ptr<const POSE3>
pose = boost::shared_ptr<const POSE3>()) :
SVECTOR6(fx, fy, fz, tx, ty, tz,
pose) {};
32 SFORCE(REAL fx, REAL fy, REAL fz, REAL tx, REAL ty, REAL tz, boost::shared_ptr<POSE3>
pose) :
SVECTOR6(fx, fy, fz, tx, ty, tz, pose) {};
35 SFORCE(
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) {}
38 SFORCE(
const REAL* array, boost::shared_ptr<POSE3>
pose) :
SVECTOR6(array[0], array[1], array[2], array[3], array[4], array[5], pose) {}
47 static SFORCE zero(boost::shared_ptr<const POSE3>
pose = boost::shared_ptr<const POSE3>()) {
SFORCE w(
pose); w.set_zero();
return w; }
53 static SFORCE from_vector(
const V& v, boost::shared_ptr<const POSE3>
pose = boost::shared_ptr<const POSE3>())
55 const unsigned SPATIAL_DIM = 6;
56 if (v.size() != SPATIAL_DIM)
57 throw MissizeException();
59 REAL* wdata = w.data();
60 const REAL* vdata = v.data();
61 CBLAS::copy(SPATIAL_DIM, vdata, v.inc(), wdata, 1);
66 static SFORCE from_vector(
const V& v, boost::shared_ptr<POSE3>
pose)
68 const unsigned SPATIAL_DIM = 6;
69 if (v.size() != SPATIAL_DIM)
70 throw MissizeException();
72 REAL* wdata = w.data();
73 const REAL* vdata = v.data();
74 CBLAS::copy(SPATIAL_DIM, vdata, v.inc(), wdata, 1);
79 REAL dot(
const SAXIS& s)
const;
93 v._data[0] = -_data[0];
94 v._data[1] = -_data[1];
95 v._data[2] = -_data[2];
96 v._data[3] = -_data[3];
97 v._data[4] = -_data[4];
98 v._data[5] = -_data[5];
108 throw FrameException();
111 _data[0] -= v._data[0];
112 _data[1] -= v._data[1];
113 _data[2] -= v._data[2];
114 _data[3] -= v._data[3];
115 _data[4] -= v._data[4];
116 _data[5] -= v._data[5];
125 throw FrameException();
128 _data[0] += v._data[0];
129 _data[1] += v._data[1];
130 _data[2] += v._data[2];
131 _data[3] += v._data[3];
132 _data[4] += v._data[4];
133 _data[5] += v._data[5];
142 SFORCE operator*(REAL scalar)
const {
SFORCE v = *
this; v*= scalar;
return v;}
143 SFORCE operator/(REAL scalar)
const {
SFORCE v = *
this; v/= scalar;
return v;}
150 inline std::ostream& operator<<(std::ostream& out,
const SFORCE& w)
152 out <<
"Wrench (force = " << w.get_force() <<
", torque = " << w.get_torque() <<
") frame: " << w.
pose;
void set_lower(const VECTOR3 &lower)
Sets the lower 3-dimensional vector.
Definition: SVector6.cpp:241
SFORCE(const VECTOR3 &f, const VECTOR3 &t, boost::shared_ptr< POSE3 > pose)
Constructs a spatial force using given force and torque and pose.
Definition: SForce.h:44
SFORCE(boost::shared_ptr< POSE3 > pose)
Constructs a spatial force with zero force and torque components.
Definition: SForce.h:23
SFORCE operator-() const
Returns the negation of this vector.
Definition: SForce.h:90
A spatial (six dimensional) momentum.
Definition: SMomentum.h:12
SFORCE(boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a spatial force with zero force and torque components.
Definition: SForce.h:20
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
static SFORCE zero(boost::shared_ptr< POSE3 > pose)
Constructs a zero spatial force.
Definition: SForce.h:50
SFORCE(const VECTOR3 &f, const VECTOR3 &t, boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a spatial force using given force and torque and pose.
Definition: SForce.h:41
static SFORCE zero(boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a zero spatial force.
Definition: SForce.h:47
SVECTOR6 & operator=(const SVECTOR6 &source)
Copies this vector from another SVECTOR6.
Definition: SVector6.cpp:257
A spatial velocity (a twist)
Definition: SVelocity.h:15
SFORCE(REAL fx, REAL fy, REAL fz, REAL tx, REAL ty, REAL tz, boost::shared_ptr< POSE3 > pose)
Constructs a spatial force using six values- first three force, second three torque- and a pose...
Definition: SForce.h:32
A 6-dimensional floating-point vector for use with spatial algebra.
Definition: SVector6.h:22
SFORCE(const SVECTOR6 &w)
Constructs a spatial force from the SVector6.
Definition: SForce.h:26
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
SFORCE(const REAL *array, boost::shared_ptr< POSE3 > pose)
Constructs a spatial force using six values- first three force, second three torque0 and a pose...
Definition: SForce.h:38
A spatial force (a wrench)
Definition: SForce.h:14
SFORCE(const REAL *array, boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a spatial force using six values- first three force, second three torque0 and a pose...
Definition: SForce.h:35
SFORCE(REAL fx, REAL fy, REAL fz, REAL tx, REAL ty, REAL tz, boost::shared_ptr< const POSE3 > pose=boost::shared_ptr< const POSE3 >())
Constructs a spatial force using six values- first three force, second three torque- and a pose...
Definition: SForce.h:29