|
wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
|
The spatial acceleration A_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 SpatialAcceleration (https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_spatial_acceleration.html): the angular acceleration alpha_MB of B relative to M and the acceleration a_MBp of the point Bp, which moves with B, relative to M, both the derivatives in M of the parts of the spatial velocity V_MBp, expressed in E, the rotational part first. More...
#include <wuzp/trafo/SpatialAcceleration.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 acceleration 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< SpatialAcceleration< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >, AngularAccelerationVector3< ValuesT_, ValueT_, ExpressedInT_ >, AccelerationVector3< 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 | |
| SpatialAcceleration ()=default | |
| template<typename AngularAccelerationOtherT_, typename AccelerationOtherT_> requires (AnyTensor<std::remove_cvref_t<AngularAccelerationOtherT_>> && AnyTensor<std::remove_cvref_t<AccelerationOtherT_>>) | |
| SpatialAcceleration (AngularAccelerationOtherT_ &&angularAcceleration, AccelerationOtherT_ &&acceleration) | |
| The spatial acceleration with the angular acceleration alpha_MB and the acceleration a_MBp, which are converted into the angular acceleration and the acceleration vectors in E: e.g. swapped parts fail with "Units do not match.". | |
| template<EuclideanCoordinateSystem PointOtherT_, AnyTensor OffsetOtherT_, typename MeasuredInVelocityT_, typename FrameVelocityT_, typename PointVelocityT_, typename ExpressedInVelocityT_> | |
| SpatialAcceleration< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointOtherT_, ExpressedInT_ > | shift (const OffsetOtherT_ &offset, const SpatialVelocity< ValuesT_, ValueT_, MeasuredInVelocityT_, FrameVelocityT_, PointVelocityT_, ExpressedInVelocityT_ > &velocity) const |
| The spatial acceleration A_MBq about another point Bq fixed to B, PointOtherT_, given the position vector p_BpBq from Bp to Bq, expressed in E, and the spatial velocity V_MB of B measured in M, about any point, expressed in E, whose angular velocity w_MB it takes: alpha_MB is unchanged, and a_MBq = a_MBp + alpha_MB x p_BpBq + w_MB x (w_MB x p_BpBq) (see accelerationOfBodyFixedPoint()), like Drake's SpatialAcceleration::Shift(). | |
| template<AnyTensor OffsetOtherT_, typename MeasuredInVelocityT_, typename FrameVelocityT_, typename PointVelocityT_, typename ExpressedInVelocityT_, typename MeasuredInRelativeT_, typename FrameRelativeT_, typename PointRelativeT_, typename ExpressedInRelativeT_, typename MeasuredInAccelerationT_, typename FrameAccelerationT_, typename PointAccelerationT_, typename ExpressedInAccelerationT_> | |
| SpatialAcceleration< ValuesT_, ValueT_, MeasuredInT_, FrameRelativeT_, PointRelativeT_, ExpressedInT_ > | composeWithMovingFrameAcceleration (const OffsetOtherT_ &offset, const SpatialVelocity< ValuesT_, ValueT_, MeasuredInVelocityT_, FrameVelocityT_, PointVelocityT_, ExpressedInVelocityT_ > &velocityOfThisFrame, const SpatialVelocity< ValuesT_, ValueT_, MeasuredInRelativeT_, FrameRelativeT_, PointRelativeT_, ExpressedInRelativeT_ > &velocity, const SpatialAcceleration< ValuesT_, ValueT_, MeasuredInAccelerationT_, FrameAccelerationT_, PointAccelerationT_, ExpressedInAccelerationT_ > &acceleration) const |
| The spatial acceleration A_MCq of the frame C, which moves relative to B, measured in M, given this spatial acceleration A_MBp, the position vector p_BpCq from Bp to the point Cq of C, expressed in E, the spatial velocity V_MB of B measured in M, about any point, and the spatial velocity V_BCq and the spatial acceleration A_BCq of C measured in B about Cq, like Drake's SpatialAcceleration::ComposeWithMovingFrameAcceleration(): alpha_MC = alpha_MB + alpha_BC + w_MB x w_BC and a_MCq = a_MBp + alpha_MB x p_BpCq + w_MB x (w_MB x p_BpCq) + 2 w_MB x v_BCq + a_BCq, the acceleration of the point of B at Cq, the Coriolis acceleration and the acceleration of Cq relative to B. | |
| Public Member Functions inherited from wuzp::SpatialVector< SpatialAcceleration< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >, AngularAccelerationVector3< ValuesT_, ValueT_, ExpressedInT_ >, AccelerationVector3< 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< SpatialAcceleration< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >, AngularAccelerationVector3< ValuesT_, ValueT_, ExpressedInT_ >, AccelerationVector3< ValuesT_, ValueT_, ExpressedInT_ > > | |
| ~SpatialVector ()=default | |
The spatial acceleration A_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 SpatialAcceleration (https://drake.mit.edu/doxygen_cxx/classdrake_1_1multibody_1_1_spatial_acceleration.html): the angular acceleration alpha_MB of B relative to M and the acceleration a_MBp of the point Bp, which moves with B, relative to M, both the derivatives in M of the parts of the spatial velocity V_MBp, expressed in E, the rotational part first.
The tags are those of SpatialVelocity, and are checked like them. Shifting it to another point needs the angular velocity w_MB of B, for the centripetal acceleration, which shift() and composeWithMovingFrameAcceleration() take as a spatial velocity of B measured in M, so that its tags are checked too. A passive rotation or a passive proper rigid transformation re-expresses it, like a spatial velocity, about the same point, and active transformations do not transform it. It has no adjoint map, since its shift needs the angular velocity: re-express it and shift() it instead (see adjoint()). These are the accelerations of Drake, the derivatives of the velocities of points, not the spatial accelerations of Featherstone, the derivatives of the spatial velocity about a point fixed in M (see "Spatial vectors" in DESIGN.md).
Definition at line 34 of file SpatialAcceleration.hpp.
| using wuzp::SpatialAcceleration< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >::ExpressedInT = ExpressedInT_ |
The coordinate system E both parts are expressed in.
Definition at line 48 of file SpatialAcceleration.hpp.
| using wuzp::SpatialAcceleration< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >::FrameT = FrameT_ |
The frame B whose motion it is.
Definition at line 44 of file SpatialAcceleration.hpp.
| using wuzp::SpatialAcceleration< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >::MeasuredInT = MeasuredInT_ |
The frame M the motion is measured in.
Definition at line 42 of file SpatialAcceleration.hpp.
| using wuzp::SpatialAcceleration< 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 50 of file SpatialAcceleration.hpp.
| using wuzp::SpatialAcceleration< ValuesT_, ValueT_, MeasuredInT_, FrameT_, PointT_, ExpressedInT_ >::PointT = PointT_ |
The point Bp the spatial acceleration is about, which is fixed to B.
Definition at line 46 of file SpatialAcceleration.hpp.
|
default |
|
inline |
The spatial acceleration with the angular acceleration alpha_MB and the acceleration a_MBp, which are converted into the angular acceleration and the acceleration vectors in E: e.g. swapped parts fail with "Units do not match.".
Definition at line 58 of file SpatialAcceleration.hpp.
|
inline |
The spatial acceleration A_MCq of the frame C, which moves relative to B, measured in M, given this spatial acceleration A_MBp, the position vector p_BpCq from Bp to the point Cq of C, expressed in E, the spatial velocity V_MB of B measured in M, about any point, and the spatial velocity V_BCq and the spatial acceleration A_BCq of C measured in B about Cq, like Drake's SpatialAcceleration::ComposeWithMovingFrameAcceleration(): alpha_MC = alpha_MB + alpha_BC + w_MB x w_BC and a_MCq = a_MBp + alpha_MB x p_BpCq + w_MB x (w_MB x p_BpCq) + 2 w_MB x v_BCq + a_BCq, the acceleration of the point of B at Cq, the Coriolis acceleration and the acceleration of Cq relative to B.
(The note of Drake's documentation starts the sum with a_BCo instead of a_MBo, a typo: its derivation, and the tests, have a_MBo.) V_MB is checked like for shift(), V_BCq and A_BCq must have the same tags ("Reference points do not match.", etc.), and the frame they are measured in must be B ("Adjacent frames do not match."). If C does not move relative to B, the result is shift().
Definition at line 95 of file SpatialAcceleration.hpp.
|
inline |
The spatial acceleration A_MBq about another point Bq fixed to B, PointOtherT_, given the position vector p_BpBq from Bp to Bq, expressed in E, and the spatial velocity V_MB of B measured in M, about any point, expressed in E, whose angular velocity w_MB it takes: alpha_MB is unchanged, and a_MBq = a_MBp + alpha_MB x p_BpBq + w_MB x (w_MB x p_BpBq) (see accelerationOfBodyFixedPoint()), like Drake's SpatialAcceleration::Shift().
The spatial velocity must be measured in M ("Measured-in frames do not match."), be that of B ("Frames do not match.") and be expressed in E ("Coordinate systems do not match.").
Definition at line 70 of file SpatialAcceleration.hpp.