/** {@inheritDoc} */ @Override default void applyTransform(Transform transform) { getAngularPart().applyTransform(transform); getLinearPart().applyTransform(transform); }
/** * Transform this twist using the given transform. Effectively, the new twist * (T<sub>body</sub><sup>des, base</sup> = [ω<sub>new</sub>; ν<sub>new</sub>]) is * calculated as follows: * * <pre> * ω<sub>new</sub> = R ω * ν<sub>new</sub> = R ν + P × ω<sub>new</sub> * </pre> * * where: * <ul> * <li>ω and ν are the current angular and linear parts of this spatial vector, * <li>R and P are the rotation and translation parts of the given transform. * </ul> * </p> * * @param transform the transform to use on this. Not modified. */ default void applyTransform(RigidBodyTransform transform) { if (transform.hasRotation()) { getAngularPart().applyTransform(transform); getLinearPart().applyTransform(transform); } if (transform.hasTranslation()) addCrossToLinearPart(transform.getTranslationVector(), getAngularPart()); }
/** * Transform this spatial force using the given transform. * <p> * Effectively, the new spatial force F<sub>des</sub> = [τ<sub>new</sub>; f<sub>new</sub>] is * calculated as follows: * * <pre> * τ<sub>new</sub> = R τ + P × f<sub>new</sub> * f<sub>new</sub> = R f * </pre> * * where: * <ul> * <li>τ and f are the current angular and linear parts of this spatial vector, * <li>R and P are the rotation and translation of the given transform. * </ul> * </p> * * @param transform the transform to use on this. Not modified. */ default void applyTransform(RigidBodyTransform transform) { if (transform.hasRotation()) { getAngularPart().applyTransform(transform); getLinearPart().applyTransform(transform); } if (transform.hasTranslation()) addCrossToAngularPart(transform.getTranslationVector(), getLinearPart()); }
/** * Transforms this spatial inertia using the given transform. * <p> * See the Word™ document located in the document folder of this project for more * information about the transformation rule for spatial inertia. Also see Duindam, <i>Port-Based * Modeling and Control for Efficient Bipedal Walking Robots</i>, page 40, equation (2.57) from * which the equations here were derived. * </p> */ @Override public void applyTransform(Transform transform) { if (transform instanceof RigidBodyTransform) { applyTransform((RigidBodyTransform) transform); } else { translation.setToZero(); translation.applyTransform(transform); // Let's first apply the rotation onto the CoM and the mass moment of inertia: momentOfInertia.applyTransform(transform); centerOfMassOffset.applyTransform(transform); // Now we can simply apply the translation on the CoM and mass moment of inertia: MecanoTools.translateMomentOfInertia(mass, centerOfMassOffset, false, translation, momentOfInertia); centerOfMassOffset.add(translation); } }
/** * Transforms this spatial inertia using the given transform. * <p> * See the Word™ document located in the document folder of this project for more * information about the transformation rule for spatial inertia. Also see Duindam, <i>Port-Based * Modeling and Control for Efficient Bipedal Walking Robots</i>, page 40, equation (2.57) from * which the equations here were derived. * </p> * * @param transform the transform to use on this. Not modified. */ default void applyTransform(RigidBodyTransform transform) { if (transform.hasRotation()) { // Let's first apply the rotation onto the CoM and the mass moment of inertia: MecanoTools.transformSymmetricMatrix3D(transform.getRotationMatrix(), getMomentOfInertia()); getCenterOfMassOffset().applyTransform(transform); } if (transform.hasTranslation()) { // Now we can simply apply the translation on the CoM and mass moment of inertia: MecanoTools.translateMomentOfInertia(getMass(), getCenterOfMassOffset(), false, transform.getTranslationVector(), getMomentOfInertia()); getCenterOfMassOffset().add(transform.getTranslationVector()); } }