|
wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
|
The spatial velocity (twist) V_MBp_E of the frame B, measured in the frame M, about the point Bp, expressed in the coordinate system E, in the monogram notation of Drake's SpatialVelocity (https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_spatial_velocity.html): the angular velocity w_MB of B relative to M and the velocity v_MBp of the point Bp, which moves with B, relative to M, both expressed in E, the rotational part first, like Drake and Modern Robotics (Lynch and Park, Cambridge University Press, 2017, section 3.3.2). More...
#include <wuzp/trafo/SpatialVelocity.hpp>
Public Types | |
| using | MeasuredInT = MeasuredInT_ |
| The frame M the motion is measured in. | |
| using | FrameT = FrameT_ |
| The frame B whose motion it is. | |
| using | PointT = PointT_ |
| The point Bp the spatial velocity is about, which is fixed to B. | |
| 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< SpatialVelocity< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >, AngularVelocityVector3< ValuesT_, ValueT_, ExpressedInT_ >, VelocityVector3< 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 | |
| SpatialVelocity ()=default | |
| template<typename AngularVelocityOtherT_, typename VelocityOtherT_> requires (AnyTensor<std::remove_cvref_t<AngularVelocityOtherT_>> && AnyTensor<std::remove_cvref_t<VelocityOtherT_>>) | |
| SpatialVelocity (AngularVelocityOtherT_ &&angularVelocity, VelocityOtherT_ &&velocity) | |
| The spatial velocity with the angular velocity w_MB and the velocity v_MBp, which are converted into the angular velocity and the velocity vectors in E: e.g. swapped parts fail with "Units do not match.". | |
| template<EuclideanCoordinateSystem PointOtherT_, AnyTensor OffsetOtherT_> | |
| SpatialVelocity< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointOtherT_, ExpressedInT_ > | shift (const OffsetOtherT_ &offset) const |
| The spatial velocity V_MBq about another point Bq fixed to B, PointOtherT_, given the position vector p_BpBq from Bp to Bq, expressed in E: w_MB is unchanged, and v_MBq = v_MBp + w_MB x p_BpBq (see velocityOfBodyFixedPoint()), like Drake's SpatialVelocity::Shift(). | |
| template<AnyTensor OffsetOtherT_, typename MeasuredInOtherT_, typename FrameOtherT_, typename PointOtherT_, typename ExpressedInOtherT_> | |
| SpatialVelocity< ValuesT_, ValueT_, MeasuredInT_, FrameOtherT_, PointOtherT_, ExpressedInT_ > | composeWithMovingFrameVelocity (const OffsetOtherT_ &offset, const SpatialVelocity< ValuesT_, ValueT_, MeasuredInOtherT_, FrameOtherT_, PointOtherT_, ExpressedInOtherT_ > &velocity) const |
| The spatial velocity V_MCq of the frame C, which moves relative to B, measured in M, given this spatial velocity V_MBp, the position vector p_BpCq from Bp to the point Cq of C, expressed in E, and the spatial velocity V_BCq of C measured in B about Cq, like Drake's SpatialVelocity::ComposeWithMovingFrameVelocity(): w_MC = w_MB + w_BC, and v_MCq = v_MBp + w_MB x p_BpCq + v_BCq, the velocity of the point of B at Cq plus the velocity of Cq relative to B. | |
| Public Member Functions inherited from wuzp::SpatialVector< SpatialVelocity< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >, AngularVelocityVector3< ValuesT_, ValueT_, ExpressedInT_ >, VelocityVector3< 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< SpatialVelocity< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >, AngularVelocityVector3< ValuesT_, ValueT_, ExpressedInT_ >, VelocityVector3< ValuesT_, ValueT_, ExpressedInT_ > > | |
| ~SpatialVector ()=default | |
The spatial velocity (twist) V_MBp_E of the frame B, measured in the frame M, about the point Bp, expressed in the coordinate system E, in the monogram notation of Drake's SpatialVelocity (https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_spatial_velocity.html): the angular velocity w_MB of B relative to M and the velocity v_MBp of the point Bp, which moves with B, relative to M, both expressed in E, the rotational part first, like Drake and Modern Robotics (Lynch and Park, Cambridge University Press, 2017, section 3.3.2).
The frames, the point and the coordinate system are coordinate systems of wuzp, which must be Euclidean: a point is the origin of a coordinate system, e.g. using Tip = CoordinateSystem<TipId>; for the tip of a tool fixed to B, and the origin Bo of B is B itself. The tags are checked at compile time: spatial velocities are only added and compared if all their tags match, and shift() and composeWithMovingFrameVelocity() change them (see "Spatial vectors" in DESIGN.md). A passive rotation or a passive proper rigid transformation from E to F re-expresses it in F, e.g. X_FE.transform(velocity), which rotates both parts, like vectors, and only changes E: the point stays Bp, unlike that of the adjoint map, adjoint(), which also moves the point to the origin of F. A coordinate system that moves needs composeWithMovingFrameVelocity() instead. Active transformations do not transform it. The angular velocity of PassiveSpatialRotation<From = B, To = A>, that of B relative to A, is the rotational part of a SpatialVelocity<A, B, P, E> with E = A or E = B, e.g. the result of angularVelocityFromMatrixDerivative(). adjoint() maps it by a passive proper rigid transformation, like the adjoint map of Modern Robotics. Its angular velocity is in 1/s, since angles are dimensionless (see "Angles are dimensionless" in DESIGN.md).
Definition at line 36 of file SpatialVelocity.hpp.
| using wuzp::SpatialVelocity< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >::ExpressedInT = ExpressedInT_ |
The coordinate system E both parts are expressed in.
Definition at line 50 of file SpatialVelocity.hpp.
| using wuzp::SpatialVelocity< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >::FrameT = FrameT_ |
The frame B whose motion it is.
Definition at line 46 of file SpatialVelocity.hpp.
| using wuzp::SpatialVelocity< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >::MeasuredInT = MeasuredInT_ |
The frame M the motion is measured in.
Definition at line 44 of file SpatialVelocity.hpp.
| using wuzp::SpatialVelocity< ValuesT_, ValueT_, MeasuredInT_, 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 52 of file SpatialVelocity.hpp.
| using wuzp::SpatialVelocity< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >::PointT = PointT_ |
The point Bp the spatial velocity is about, which is fixed to B.
Definition at line 48 of file SpatialVelocity.hpp.
|
default |
|
inline |
The spatial velocity with the angular velocity w_MB and the velocity v_MBp, which are converted into the angular velocity and the velocity vectors in E: e.g. swapped parts fail with "Units do not match.".
Definition at line 60 of file SpatialVelocity.hpp.
|
inline |
The spatial velocity V_MCq of the frame C, which moves relative to B, measured in M, given this spatial velocity V_MBp, the position vector p_BpCq from Bp to the point Cq of C, expressed in E, and the spatial velocity V_BCq of C measured in B about Cq, like Drake's SpatialVelocity::ComposeWithMovingFrameVelocity(): w_MC = w_MB + w_BC, and v_MCq = v_MBp + w_MB x p_BpCq + v_BCq, the velocity of the point of B at Cq plus the velocity of Cq relative to B.
The frames that meet, B of this spatial velocity and the frame V_BCq is measured in, must be the same ("Adjacent frames do not match."), like X_AB * X_BC. If C does not move relative to B, V_BCq is zero and the result is shift().
Definition at line 83 of file SpatialVelocity.hpp.
|
inline |
The spatial velocity V_MBq about another point Bq fixed to B, PointOtherT_, given the position vector p_BpBq from Bp to Bq, expressed in E: w_MB is unchanged, and v_MBq = v_MBp + w_MB x p_BpBq (see velocityOfBodyFixedPoint()), like Drake's SpatialVelocity::Shift().
The position vector is converted into a position vector in E, so that e.g. a velocity fails with "Units do not match." and a point with "Absolute/relative mismatch.".
Definition at line 70 of file SpatialVelocity.hpp.