/** * Sets this joint current torque. * <p> * This method assumes that the given torque is the torque at the {@code frameAfterJoint}'s origin. * </p> * <p> * This method is ineffective for joints that cannot rotate. * </p> * <p> * As for the other spatial setters, this method's common implementation is to project the given 3D * torque to this joint's motion subspace. For instance, a {@code RevoluteJoint} that can rotate * around the y-axis will extract the torque around the y-axis from the given 3D torque to update * its torque. * </p> * * @param jointTorque the new torque for this joint. Unused if this joint cannot rotate. Not * modified. * @throws ReferenceFrameMismatchException if the given vector is not expressed in * {@code frameAfterJoint}. */ default void setJointTorque(FrameVector3DReadOnly jointTorque) { jointTorque.checkReferenceFrameMatch(getFrameAfterJoint()); setJointTorque((Vector3DReadOnly) jointTorque); }
/** * Sets this joint current force/torque to the given wrench. * <p> * As for the other spatial setters, this method's common implementation is to project the given * wrench to this joint's motion subspace. For instance, a {@code RevoluteJoint} that can rotate * around the y-axis will extract the torque around the y-axis from the given wrench to update its * torque. * </p> * * @param jointWrench the new wrench for this joint. Not modified. * @throws ReferenceFrameMismatchException if the given wrench does not have the following frames: * <ul> * <li>{@code bodyFrame} is {@code successor.getBodyFixedFrame()}. * <li>{@code expressedInFrame} is {@code frameAfterJoint}. * </ul> */ default void setJointWrench(WrenchReadOnly jointWrench) { jointWrench.checkBodyFrameMatch(getSuccessor().getBodyFixedFrame()); jointWrench.checkExpressedInFrameMatch(getFrameAfterJoint()); setJointTorque((Vector3DReadOnly) jointWrench.getAngularPart()); setJointForce((Vector3DReadOnly) jointWrench.getLinearPart()); }
break; case EFFORT: joint.setJointTorque(EuclidCoreRandomTools.nextVector3D(random)); joint.setJointForce(EuclidCoreRandomTools.nextVector3D(random)); break;