/** * Performs a deep copy of the given {@code originalJoints} then filters the cloned joint to return * only the ones implementing {@code OneDoFJoint}. * <p> * The {@code originalJoints} must represent a continuous kinematic chain. The joints must be stored * in order starting from the joint that is the closest to the root, to end with the joint the * closest to an end-effector. * </p> * <p> * The clone of the kinematic chain has its own root body which reference frame is child of the * frame after the parent joint of {@code originalJoints[0]}. As a result, the clone is an * independent multi-body system but its root is following the original multi-body system. * </p> * * @param originalJoints the kinematic chain to clone. Not modified. * @return the clone kinematic chain. */ public static OneDoFJointBasics[] cloneOneDoFJointKinematicChain(OneDoFJointBasics[] originalJoints) { return cloneKinematicChainAndFilter(originalJoints, OneDoFJointBasics.class); }
/** * Performs a deep copy of the kinematic chain described by the given {@code start} and {@code end}, * then filters the cloned joint to return only the ones implementing {@code OneDoFJoint}. * <p> * The clone of the kinematic chain has its own root body which reference frame is child of the * frame after the parent joint of {@code start}. As a result, the clone is an independent * multi-body system but its root is following the original multi-body system. * </p> * * @param start the rigid-body from where the kinematic chain starts. * @param end the rigid-body where the kinematic chain ends. * @return the clone kinematic chain. */ public static OneDoFJointBasics[] cloneOneDoFJointKinematicChain(RigidBodyBasics start, RigidBodyBasics end) { return cloneKinematicChainAndFilter(MultiBodySystemTools.createOneDoFJointPath(start, end), OneDoFJointBasics.class); }