/** * Sets the linear velocity of this joint. * <p> * This method assumes that the given velocity describes the linear velocity of the * {@code frameAfterJoint}'s origin. * </p> * <p> * This method is ineffective for joints that cannot translate. * </p> * <p> * As for configuration setters, the common implementation here is to project the given linear * velocity onto the motion subspace of this joint such that not all the components of the given * velocity may necessarily be used. * </p> * <p> * When updating the velocity the joints of a robot, it is important to then call * {@link #updateFramesRecursively()} on the root joint to update all the reference frames to the * new robot motion. * </p> * * @param jointLinearVelocity the new linear velocity for this joint. Unused if this joint cannot * translate. Not modified. * @throws ReferenceFrameMismatchException if the given vector is not expressed in * {@code frameAfterJoint}. */ default void setJointLinearVelocity(FrameVector3DReadOnly jointLinearVelocity) { jointLinearVelocity.checkReferenceFrameMatch(getFrameAfterJoint()); setJointLinearVelocity((Vector3DReadOnly) jointLinearVelocity); }
/** * Sets this joint current velocity to the given twist. * <p> * As for configuration setters, the common implementation here is to project the given twist onto * the motion subspace of this joint such that not all the components of the given twist may * necessarily be used. * </p> * <p> * When updating the velocity the joints of a robot, it is important to then call * {@link #updateFramesRecursively()} on the root joint to update all the reference frames to the * new robot motion. * </p> * * @param jointTwist the new twist for this joint. Not modified. * @throws ReferenceFrameMismatchException if the given twist does not have the following frames: * <ul> * <li>{@code bodyFrame} is {@code afterJointFrame}. * <li>{@code baseFrame} is {@code beforeJointFrame}. * <li>{@code expressedInFrame} is {@code afterJointFrame}. * </ul> */ default void setJointTwist(TwistReadOnly jointTwist) { jointTwist.checkBodyFrameMatch(getFrameAfterJoint()); jointTwist.checkBaseFrameMatch(getFrameBeforeJoint()); jointTwist.checkExpressedInFrameMatch(getFrameAfterJoint()); setJointAngularVelocity((Vector3DReadOnly) jointTwist.getAngularPart()); setJointLinearVelocity((Vector3DReadOnly) jointTwist.getLinearPart()); }
case VELOCITY: joint.setJointAngularVelocity(EuclidCoreRandomTools.nextVector3D(random)); joint.setJointLinearVelocity(EuclidCoreRandomTools.nextVector3D(random)); break; case ACCELERATION: