Go to the documentation of this file.
5 #ifndef __pinocchio_spatial_force_dense_hpp__
6 #define __pinocchio_spatial_force_dense_hpp__
11 template<
typename Derived>
17 template<
typename Derived,
typename MotionDerived>
23 template<
typename Derived>
36 using Base::operator=;
47 angular().setRandom();
54 return linear() == other.
linear() && angular() == other.
angular();
60 return other.
derived() == derived();
67 return derived().set(other.
derived());
72 return derived().set(other.
derived());
86 EIGEN_STATIC_ASSERT_VECTOR_ONLY(V6);
87 assert(
v.size() == 6);
88 linear() =
v.template segment<3>(LINEAR);
89 angular() =
v.template segment<3>(ANGULAR);
95 return derived().__opposite__();
100 return derived().__plus__(
f.derived());
102 template<
typename F1>
105 return derived().__minus__(
f.derived());
108 template<
typename F1>
111 return derived().__pequ__(
f.derived());
113 template<
typename F1>
116 f.derived().addTo(derived());
120 template<
typename M1>
123 return derived().__mequ__(
v.derived());
128 return ForcePlain(-linear(), -angular());
131 template<
typename M1>
134 return ForcePlain(linear() +
v.linear(), angular() +
v.angular());
137 template<
typename M1>
140 return ForcePlain(linear() -
v.linear(), angular() -
v.angular());
143 template<
typename M1>
146 linear() +=
v.linear();
147 angular() +=
v.angular();
151 template<
typename M1>
154 linear() -=
v.linear();
155 angular() -=
v.angular();
159 template<
typename OtherScalar>
162 return ForcePlain(
alpha * linear(),
alpha * angular());
165 template<
typename OtherScalar>
168 return derived().__mult__((OtherScalar)(1) /
alpha);
171 template<
typename F1>
174 return phi.
linear().dot(linear()) + phi.
angular().dot(angular());
177 template<
typename M1,
typename M2>
180 fout.
linear().noalias() =
v.angular().cross(linear());
181 fout.
angular().noalias() =
v.angular().cross(angular()) +
v.linear().cross(linear());
184 template<
typename M1>
192 template<
typename M2>
195 const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const
197 return derived().isApprox_impl(
f, prec);
200 template<
typename D2>
203 const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const
205 return linear().isApprox(
f.linear(), prec) && angular().isApprox(
f.angular(), prec);
210 return linear().isZero(prec) && angular().isZero(prec);
213 template<
typename S2,
int O2,
typename D2>
216 f.linear().noalias() =
m.rotation() * linear();
217 f.angular().noalias() =
m.rotation() * angular();
218 f.angular() +=
m.translation().cross(
f.linear());
221 template<
typename S2,
int O2>
229 template<
typename S2,
int O2,
typename D2>
232 f.linear().noalias() =
m.rotation().transpose() * linear();
233 f.angular().noalias() =
234 m.rotation().transpose() * (angular() -
m.translation().cross(linear()));
237 template<
typename S2,
int O2>
247 os <<
" f = " << linear().transpose() << std::endl
248 <<
"tau = " << angular().transpose() << std::endl;
254 return derived().ref();
265 template<
typename F1>
269 return f.derived() *
alpha;
274 #endif // ifndef __pinocchio_spatial_force_dense_hpp__
bool isEqual_impl(const ForceBase< D2 > &other) const
bool isZero_impl(const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
ConstLinearType linear() const
Return the linear part of the force vector.
ForcePlain operator-() const
ForcePlain __opposite__() const
ConstLinearType linear() const
Return the linear part of the force vector.
FORCE_TYPEDEF_TPL(Derived)
ForcePlain se3Action_impl(const SE3Tpl< S2, O2 > &m) const
Base interface for forces representation.
bool isApprox_impl(const ForceDense< D2 > &f, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
ForcePlain __minus__(const ForceDense< M1 > &v) const
bool isApprox(const ForceDense< M2 > &f, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
Derived & operator+=(const ForceBase< F1 > &f)
void se3ActionInverse_impl(const SE3Tpl< S2, O2 > &m, ForceDense< D2 > &f) const
SE3GroupAction< Derived >::ReturnType ReturnType
Return type of the ation of a Motion onto an object of type D.
TridiagonalSymmetricMatrixApplyOnTheLeftReturnType< LhsMatrixType, TridiagonalSymmetricMatrixTpl< S, O > > operator*(const Eigen::MatrixBase< LhsMatrixType > &lhs, const TridiagonalSymmetricMatrixTpl< S, O > &rhs)
ConstLinearType linear() const
traits< Derived >::ForceRefType ForceRefType
ForceBase< Derived > Base
ForcePlain operator+(const ForceDense< F1 > &f) const
ForcePlain __plus__(const ForceDense< M1 > &v) const
ForcePlain motionAction(const MotionDense< M1 > &v) const
Derived & __pequ__(const ForceDense< M1 > &v)
Derived & operator=(const Eigen::MatrixBase< V6 > &v)
ForcePlain operator-(const ForceDense< F1 > &f) const
void se3Action_impl(const SE3Tpl< S2, O2 > &m, ForceDense< D2 > &f) const
void disp_impl(std::ostream &os) const
Derived & operator-=(const ForceDense< M1 > &v)
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
bool isZero(const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
Derived & __mequ__(const ForceDense< M1 > &v)
ForcePlain __mult__(const OtherScalar &alpha) const
Scalar dot(const MotionDense< F1 > &phi) const
Derived & operator+=(const ForceDense< F1 > &f)
ForcePlain __div__(const OtherScalar &alpha) const
MotionAlgebraAction< Derived, MotionDerived >::ReturnType ReturnType
ForcePlain se3ActionInverse_impl(const SE3Tpl< S2, O2 > &m) const
Derived & set(const ForceDense< D2 > &other)
Common traits structure to fully define base classes for CRTP.
bool isApprox(const Derived &other, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
ConstAngularType angular() const
Return the angular part of the force vector.
void motionAction(const MotionDense< M1 > &v, ForceDense< M2 > &fout) const
Derived & operator=(const ForceDense< D2 > &other)
ConstAngularType angular() const
Return the angular part of the force vector.
Derived & operator=(const ForceDense &other)
ConstAngularType angular() const
bool isEqual_impl(const ForceDense< D2 > &other) const
Main pinocchio namespace.
pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:09