|
wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
|
The spatial force (wrench) F_Bp_E on the frame B, about the point Bp, expressed in the coordinate system E, in the monogram notation of Drake's SpatialForce (https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_spatial_force.html): the torque tau_Bp about Bp and the force f on B, both expressed in E, the rotational part first, like Drake and Modern Robotics (Lynch and Park, Cambridge University Press, 2017, section 3.4), where a wrench is (m, f). More...
#include <wuzp/trafo/SpatialForce.hpp>
Public Types | |
| using | FrameT = FrameT_ |
| The frame B the force acts on. | |
| using | PointT = PointT_ |
| The point Bp the torque is about. | |
| using | ExpressedInT = ExpressedInT_ |
| The coordinate system E both parts are expressed in. | |
| using | OffsetT = PositionVector3<ValuesT_, ValueT_, ExpressedInT_> |
| The position vector from one point to another, expressed in E, by which shift() shifts. | |
| Public Types inherited from wuzp::SpatialVector< SpatialForce< ValuesT_, ValueT_, FrameT_, PointT_, ExpressedInT_ >, TorqueVector3< ValuesT_, ValueT_, ExpressedInT_ >, ForceVector3< ValuesT_, ValueT_, ExpressedInT_ > > | |
| using | RotationalT |
| The rotational part, e.g. the angular velocity of a spatial velocity. | |
| using | TranslationalT |
| The translational part, e.g. the velocity of the point of a spatial velocity. | |
| using | ValueT |
| The value type of both parts, e.g. double. | |
Public Member Functions | |
| SpatialForce ()=default | |
| template<typename TorqueOtherT_, typename ForceOtherT_> requires (AnyTensor<std::remove_cvref_t<TorqueOtherT_>> && AnyTensor<std::remove_cvref_t<ForceOtherT_>>) | |
| 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 force vectors in E: e.g. swapped parts fail with "Units do not match.". | |
| template<EuclideanCoordinateSystem PointOtherT_, AnyTensor OffsetOtherT_> | |
| 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 to Bq, expressed in E: the force f is unchanged, and the torque about Bq is tau_Bq = tau_Bp - p_BpBq x f, like Drake's SpatialForce::Shift(). | |
| Public Member Functions inherited from wuzp::SpatialVector< SpatialForce< ValuesT_, ValueT_, FrameT_, PointT_, ExpressedInT_ >, TorqueVector3< ValuesT_, ValueT_, ExpressedInT_ >, ForceVector3< ValuesT_, ValueT_, ExpressedInT_ > > | |
| SpatialVector (const SpatialVector &)=default | |
| SpatialVector & | operator= (const SpatialVector &)=default |
| const RotationalT & | getRotational () const & |
| The rotational part, e.g. the angular velocity of a spatial velocity. | |
| const TranslationalT & | getTranslational () const & |
| The translational part, e.g. the velocity of the point of a spatial velocity. | |
| bool | isApprox (const SpatialVector< OtherT_, RotationalOtherT_, TranslationalOtherT_ > &other, const ValueT precision=Precision< ValueT >::value()) const |
| Whether both spatial vectors, which must have the same tags, are approximately equal: their rotational and their translational parts are compared separately, like tensors (see Tensor::isApprox()), so that the units of one part do not weigh against those of the other. | |
Additional Inherited Members | |
| Protected Member Functions inherited from wuzp::SpatialVector< SpatialForce< ValuesT_, ValueT_, FrameT_, PointT_, ExpressedInT_ >, TorqueVector3< ValuesT_, ValueT_, ExpressedInT_ >, ForceVector3< ValuesT_, ValueT_, ExpressedInT_ > > | |
| ~SpatialVector ()=default | |
The spatial force (wrench) F_Bp_E on the frame B, about the point Bp, expressed in the coordinate system E, in the monogram notation of Drake's SpatialForce (https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_spatial_force.html): the torque tau_Bp about Bp and the force f on B, both expressed in E, the rotational part first, like Drake and Modern Robotics (Lynch and Park, Cambridge University Press, 2017, section 3.4), where a wrench is (m, f).
Unlike the motion vectors, it has no frame it is measured in. Its tags are coordinate systems of wuzp, which must be Euclidean, like those of SpatialVelocity, and are checked at compile time: spatial forces are only added and compared if all their tags match, e.g. the forces on B about Bp, and shift() moves the point. A passive rotation or a passive proper rigid transformation re-expresses it about the same point, like a spatial velocity, active transformations do not transform it, and adjoint() maps it by a passive proper rigid transformation to the origin of To, like the wrenches of Modern Robotics. Its parts are vectors, like ForceVector and TorqueVector (see "Forces and torques" in DESIGN.md), and its power with a spatial velocity V_MBp_E of B about the same point is the sum of the dot products of the parts, tau . w + f . v, which neither shift() nor adjoint() changes.
Definition at line 30 of file SpatialForce.hpp.
| using wuzp::SpatialForce< ValuesT_, ValueT_, FrameT_, PointT_, ExpressedInT_ >::ExpressedInT = ExpressedInT_ |
The coordinate system E both parts are expressed in.
Definition at line 41 of file SpatialForce.hpp.
| using wuzp::SpatialForce< ValuesT_, ValueT_, FrameT_, PointT_, ExpressedInT_ >::FrameT = FrameT_ |
The frame B the force acts on.
Definition at line 37 of file SpatialForce.hpp.
| using wuzp::SpatialForce< ValuesT_, ValueT_, FrameT_, PointT_, ExpressedInT_ >::OffsetT = PositionVector3<ValuesT_, ValueT_, ExpressedInT_> |
The position vector from one point to another, expressed in E, by which shift() shifts.
Definition at line 43 of file SpatialForce.hpp.
| using wuzp::SpatialForce< ValuesT_, ValueT_, FrameT_, PointT_, ExpressedInT_ >::PointT = PointT_ |
The point Bp the torque is about.
Definition at line 39 of file SpatialForce.hpp.
|
default |
|
inline |
The spatial force with the torque tau_Bp and the force f, which are converted into the torque and the force vectors in E: e.g. swapped parts fail with "Units do not match.".
Definition at line 51 of file SpatialForce.hpp.
|
inline |
The spatial force F_Bq about another point Bq, PointOtherT_, given the position vector p_BpBq from Bp to Bq, expressed in E: the force f is unchanged, and the torque about Bq is tau_Bq = tau_Bp - p_BpBq x f, like Drake's SpatialForce::Shift().
The position vector is converted into a position vector in E, so that e.g. a force fails with "Units do not match." and a point with "Absolute/relative mismatch.".
Definition at line 61 of file SpatialForce.hpp.