wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
Loading...
Searching...
No Matches
SpatialForce.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <type_traits>
4#include <utility>
5
11
12namespace wuzp {
13
27template <template <typename, int, int> typename ValuesT_, typename ValueT_, EuclideanCoordinateSystem FrameT_,
30class SpatialForce : public SpatialVector<SpatialForce<ValuesT_, ValueT_, FrameT_, PointT_, ExpressedInT_>,
31 TorqueVector3<ValuesT_, ValueT_, ExpressedInT_>, ForceVector3<ValuesT_, ValueT_, ExpressedInT_>> {
32 using BaseT =
34
35 public:
37 using FrameT = FrameT_;
39 using PointT = PointT_;
41 using ExpressedInT = ExpressedInT_;
44
45 SpatialForce() = default;
46
49 template <typename TorqueOtherT_, typename ForceOtherT_>
51 SpatialForce(TorqueOtherT_&& torque, ForceOtherT_&& force)
52 : BaseT(std::forward<TorqueOtherT_>(torque), std::forward<ForceOtherT_>(force)) {}
53
60 template <EuclideanCoordinateSystem PointOtherT_, AnyTensor OffsetOtherT_>
62 return {this->getRotational() - OffsetT{offset}.crossProduct(this->getTranslational()), this->getTranslational()};
63 }
64};
65
75template <typename FromT_, typename ToT_, typename RotationT_, typename TranslationT_, template <typename, int, int> typename ValuesT_,
76 typename ValueT_, typename FrameT_, typename PointT_, typename ExpressedInT_>
79 return internal::adjointMap(transformation, force);
80}
81
82namespace internal {
83
84template <template <typename, int, int> typename ValuesT_, typename ValueT_, typename FrameT_, typename PointT_, typename ExpressedInT_,
85 typename NewExpressedInT_>
86struct WithExpressedIn<SpatialForce<ValuesT_, ValueT_, FrameT_, PointT_, ExpressedInT_>, NewExpressedInT_> {
87 using type = SpatialForce<ValuesT_, ValueT_, FrameT_, PointT_, NewExpressedInT_>;
88};
89
90} // namespace internal
91
92template <template <typename, int, int> typename ValuesT_, typename ValueT_, typename FrameT_, typename PointT_, typename ExpressedInT_>
93struct GetCoordinateSystem<SpatialForce<ValuesT_, ValueT_, FrameT_, PointT_, ExpressedInT_>> {
94 using type = ExpressedInT_;
95};
96
97} // namespace wuzp
A passive proper rigid transformation from From to To, which first rotates, then translates: p -> R p...
The spatial force (wrench) F_Bp_E on the frame B, about the point Bp, expressed in the coordinate sys...
PositionVector3< ValuesT_, ValueT_, ExpressedInT_ > OffsetT
The position vector from one point to another, expressed in E, by which shift() shifts.
FrameT_ FrameT
The frame B the force acts on.
SpatialForce()=default
SpatialForce< ValuesT_, ValueT_, FrameT_, PointOtherT_, ExpressedInT_ > shift(const OffsetOtherT_ &offset) const
The spatial force F_Bq about another point Bq, PointOtherT_, given the position vector p_BpBq from Bp...
PointT_ PointT
The point Bp the torque is about.
SpatialForce(TorqueOtherT_ &&torque, ForceOtherT_ &&force)
The spatial force with the torque tau_Bp and the force f, which are converted into the torque and the...
ExpressedInT_ ExpressedInT
The coordinate system E both parts are expressed in.
Any tensor: a specialization of Tensor, including points, vectors and their aliases.
Definition concepts.hpp:118
The alias template ValueMatrix<ValueT_, RowsV_, ColsV_> of any value matrix backend,...
Definition concepts.hpp:89
A coordinate system with the Euclidean metric, the default, e.g. CoordinateSystem<World>: the coordin...
Definition concepts.hpp:35
ForceVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > ForceVector3
Definition Tensor.hpp:1038
PositionVector< 3, ValuesT_, ValueT_, CoordinateSystemT_ > PositionVector3
Definition Tensor.hpp:997
auto adjoint(const PassiveProperRigidTransformationTemplate< FromT_, ToT_, RotationT_, TranslationT_ > &, const SpatialAcceleration< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ > &)
Rejected with a message: the adjoint map of a rigid transformation maps spatial velocities and spatia...