5 #ifndef __RDL_FORCE_VECTOR_HPP__
6 #define __RDL_FORCE_VECTOR_HPP__
29 template <
typename OtherDerived>
40 template <
typename OtherDerived>
73 Base::_check_template_params();
84 (*this) << f[0], f[1], f[2], f[3], f[4], f[5];
91 EIGEN_STRONG_INLINE
double&
mx()
93 return this->operator[](0);
100 EIGEN_STRONG_INLINE
double&
my()
102 return this->operator[](1);
109 EIGEN_STRONG_INLINE
double&
mz()
111 return this->operator[](2);
118 EIGEN_STRONG_INLINE
double mx()
const
120 return this->operator[](0);
127 EIGEN_STRONG_INLINE
double my()
const
129 return this->operator[](1);
136 EIGEN_STRONG_INLINE
double mz()
const
138 return this->operator[](2);
145 EIGEN_STRONG_INLINE
double&
fx()
147 return this->operator[](3);
154 EIGEN_STRONG_INLINE
double&
fy()
156 return this->operator[](4);
163 EIGEN_STRONG_INLINE
double&
fz()
165 return this->operator[](5);
172 EIGEN_STRONG_INLINE
double fx()
const
174 return this->operator[](3);
181 EIGEN_STRONG_INLINE
double fy()
const
183 return this->operator[](4);
190 EIGEN_STRONG_INLINE
double fz()
const
192 return this->operator[](5);
208 this->
setAngularPart(X.
E * (this->getAngularPart() - X.
r.cross(this->getLinearPart())));
237 (*this) << (this->
mx() += v.
mx()), (this->
my() += v.
my()), (this->
mz() += v.
mz()), (this->
fx() += v.
fx()), (this->
fy() += v.
fy()), (this->
fz() += v.
fz());
253 typedef std::vector<ForceVector, Eigen::aligned_allocator<ForceVector>>
ForceVectorV;
A ForceVector is a SpatialVector containing 3 moments and 3 linear forces.
Definition: ForceVector.hpp:23
ForceVector transform_copy(const SpatialTransform &X) const
Copy then transform a ForceVector by.
Definition: ForceVector.hpp:224
ForceVector(const double mx, const double my, const double mz, const double fx, const double fy, const double fz)
Constructor.
Definition: ForceVector.hpp:71
EIGEN_STRONG_INLINE double fx() const
Get copy of x-linear component.
Definition: ForceVector.hpp:172
EIGEN_STRONG_INLINE double mz() const
Get copy of z-angular component.
Definition: ForceVector.hpp:136
EIGEN_STRONG_INLINE double mx() const
Get copy of x-angular component.
Definition: ForceVector.hpp:118
EIGEN_STRONG_INLINE double & fx()
Get reference to x-linear component.
Definition: ForceVector.hpp:145
EIGEN_STRONG_INLINE ForceVector()
Empty constructor.
Definition: ForceVector.hpp:50
EIGEN_STRONG_INLINE double & my()
Get reference to y-angular component.
Definition: ForceVector.hpp:100
EIGEN_STRONG_INLINE double fz() const
Get copy of z-linear component.
Definition: ForceVector.hpp:190
EIGEN_STRONG_INLINE SpatialVector toSpatialVector() const
Get a copy of a ForceVector as type SpatialVector.
Definition: ForceVector.hpp:57
ForceVector & operator=(const Eigen::MatrixBase< OtherDerived > &other)
Definition: ForceVector.hpp:41
EIGEN_STRONG_INLINE void set(const ForceVector &f)
Setter.
Definition: ForceVector.hpp:82
EIGEN_STRONG_INLINE double & fy()
Get reference to y-linear component.
Definition: ForceVector.hpp:154
EIGEN_STRONG_INLINE double & mz()
Get reference to z-angular component.
Definition: ForceVector.hpp:109
EIGEN_STRONG_INLINE double & fz()
Get reference to z-linear component.
Definition: ForceVector.hpp:163
EIGEN_STRONG_INLINE double fy() const
Get copy of y-linear component.
Definition: ForceVector.hpp:181
ForceVector(const Eigen::MatrixBase< OtherDerived > &other)
Constructor.
Definition: ForceVector.hpp:31
void transform(const SpatialTransform &X)
Performs the following in place transform.
Definition: ForceVector.hpp:206
EIGEN_STRONG_INLINE double my() const
Get copy of y-angular component.
Definition: ForceVector.hpp:127
ForceVector operator+=(const ForceVector &v)
Overloaded plus-equals operator.
Definition: ForceVector.hpp:235
EIGEN_STRONG_INLINE double & mx()
Get reference to x-angular component.
Definition: ForceVector.hpp:91
Definition: rdl_eigenmath.hpp:187
SpatialVector & operator=(const Eigen::MatrixBase< OtherDerived > &other)
Definition: rdl_eigenmath.hpp:198
void setLinearPart(const Vector3d &v)
Definition: rdl_eigenmath.hpp:266
void setAngularPart(const Vector3d &v)
Definition: rdl_eigenmath.hpp:254
std::vector< ForceVector, Eigen::aligned_allocator< ForceVector > > ForceVectorV
Definition: ForceVector.hpp:253
ForceVector operator*(const SpatialTransform &X, ForceVector f)
Operator for transforming a ForceVector. Calls the ForceVector::transform method.
Definition: ForceVector.hpp:248
Namespace for all structures of the RobotDynamics library.
Definition: examples.hpp:19