/** * Builds a new implementation of {@code SixDoFJointBasics}. * * @param name the joint name. * @param predecessor the predecessor of the joint. * @param transformToParent the transform to the frame after the parent joint. * @return the new 6-DoF joint. */ default SixDoFJointBasics buildSixDoFJoint(String name, RigidBodyBasics predecessor, RigidBodyTransform transformToParent) { return new SixDoFJoint(name, predecessor, transformToParent); }
/** * Generates a 6-DoF floating joint with random physical parameters and attaches it to the given * {@code predecessor}. * * @param random the random generator to use. * @param name the joint name. * @param predecessor the rigid-body to which the joint is added as a child. * @return the random joint. */ public static SixDoFJoint nextSixDoFJoint(Random random, String name, RigidBodyBasics predecessor) { RigidBodyTransform transformToParent = predecessor.isRootBody() ? null : EuclidCoreRandomTools.nextRigidBodyTransform(random); return new SixDoFJoint(name, predecessor, transformToParent); }
/** * Creates a new random multi-body system. * * @param random the random generator to use. * @param jointAxes array containing in order the axis for each revolute joint. The length of the * array also defines the number of revolute joints for the generated kinematic chain. */ public RandomFloatingRevoluteJointChain(Random random, Vector3D[] jointAxes) { elevator = new RigidBody("elevator", ReferenceFrame.getWorldFrame()); rootJoint = new SixDoFJoint("rootJoint", elevator); RigidBody rootBody = nextRigidBody(random, "rootBody", rootJoint); revoluteJoints = nextRevoluteJointChain(random, "test", rootBody, jointAxes); joints.add(rootJoint); joints.addAll(revoluteJoints); }
public TestingRobotModel() { worldFrame = ReferenceFrame.getWorldFrame(); elevator = new RigidBody("elevator", worldFrame); elevatorFrame = elevator.getBodyFixedFrame(); rootJoint = new SixDoFJoint("rootJoint", elevator); body = new RigidBody("body", rootJoint, Ixx, Iyy, Izz, mass, comOffset); bodyFrame = rootJoint.getFrameAfterJoint(); }
private void setupRobot() { robot = new RectangleRobot(); robot.setDynamic(false); robot.setGravity(0); registry = robot.getRobotsYoVariableRegistry(); floatingJoint = (FloatingJoint) robot.getRootJoints().get(0); refFrame = new ReferenceFrame("pelvis", ReferenceFrame.getWorldFrame(), true, false) { @Override protected void updateTransformToParent(RigidBodyTransform transformToParent) { transformToParent.set(robotPose); } }; RigidBodyBasics rigidBody = new RigidBody("pelvis", refFrame); sixDofPelvisJoint = new SixDoFJoint("pelvis", rigidBody); }
rootJoint = new SixDoFJoint("rootJoint", elevator); pelvis = MultiBodySystemRandomTools.nextRigidBody(random, "pelvis", rootJoint);
public static Pair<FloatingJointBasics, OneDoFJointBasics[]> createInverseDynamicsRobot(RobotDescription robotDescription) { RigidBodyBasics predecessor; RigidBodyBasics rootBody = new RigidBody("rootBody", ReferenceFrame.getWorldFrame()); FloatingJointBasics rootJoint; if (robotDescription.getRootJoints().get(0) instanceof FloatingJointBasics) { FloatingJointDescription rootJointDescription = (FloatingJointDescription) robotDescription.getRootJoints().get(0); rootJoint = new SixDoFJoint(rootJointDescription.getName(), rootBody); LinkDescription linkDescription = rootJointDescription.getLink(); predecessor = new RigidBody(rootJointDescription.getName(), rootJoint, linkDescription.getMomentOfInertiaCopy(), linkDescription.getMass(), linkDescription.getCenterOfMassOffset()); for (JointDescription jointDescription : rootJointDescription.getChildrenJoints()) { addJointsRecursively((OneDoFJointDescription) jointDescription, predecessor); } } else { rootJoint = null; predecessor = rootBody; addJointsRecursively((OneDoFJointDescription) robotDescription.getRootJoints().get(0), predecessor); } return new ImmutablePair<>(rootJoint, MultiBodySystemTools.filterJoints(MultiBodySystemTools.collectSubtreeJoints(predecessor), OneDoFJointBasics.class)); }
rootJoint = new SixDoFJoint(rootJointDescription.getName(), elevator);
ArrayList<RevoluteJoint> joints = new ArrayList<RevoluteJoint>(nJoints); RigidBodyBasics elevator = new RigidBody("elevator", ReferenceFrame.getWorldFrame()); SixDoFJoint sixDoFJoint = new SixDoFJoint("sixDoF", elevator); RigidBodyBasics floatingBody = new RigidBody("floatingBody", sixDoFJoint, RandomGeometry.nextDiagonalMatrix3D(random), random.nextDouble(), RandomGeometry.nextVector3D(random));
imuJoint = new SixDoFJoint("imu_joint", elevator); RigidBodyBasics imuBody = new RigidBody("imu_body", imuJoint, 0.1, 0.1, 0.1, 1.0, new Vector3D()); MovingReferenceFrame imuFrame = imuJoint.getFrameAfterJoint();
robot.addRootJoint(rootJoint); SixDoFJoint rootInverseDynamicsJoint = new SixDoFJoint("root", elevator);
RigidBodyBasics elevator = new RigidBody("elevator", worldFrame); ReferenceFrame elevatorFrame = elevator.getBodyFixedFrame(); SixDoFJoint sixDoFJoint = new SixDoFJoint("sixDoF", elevator); new RigidBody("body", sixDoFJoint, getRandomDiagonalMatrix(random), mass, new Vector3D()); SpatialAcceleration rootAcceleration = new SpatialAcceleration(elevatorFrame, worldFrame, elevatorFrame);
public static void main(String[] args) SixDoFJoint rootJoint = new SixDoFJoint("sixdof", elevator); RigidBodyTransform inertiaPose = new RigidBodyTransform(); Matrix3D momentOfInertia = new Matrix3D();
SixDoFJoint sixDoFJoint = new SixDoFJoint("sixDoFJoint", elevator); new RigidBody("rigidBody", sixDoFJoint, momentOfInertia, mass, comOffset);
FloatingJointBasics currentIDJoint = new SixDoFJoint(currentJoint.getName(), elevator); new RigidBody(link.getName(), currentIDJoint, momentOfInertia, mass, comOffset);
SixDoFJoint footJoint = new SixDoFJoint(prefix + "FootJoint", elevator); RigidBodyBasics foot = new RigidBody(prefix + "Foot", footJoint, new Matrix3D(), 1.0, new Vector3D()); ReferenceFrame ankleFrame = foot.getBodyFixedFrame();
SixDoFJoint rootJoint = new SixDoFJoint("pelvis", elevator);