public static void createRandomTreeRobotAndSetJointPositionsAndVelocities(Robot robot, HashMap<RevoluteJoint, PinJoint> jointMap, ReferenceFrame worldFrame, RigidBodyBasics elevator, int numberOfJoints, double gravity, boolean useRandomVelocity, boolean useRandomAcceleration, Random random) robot.setGravity(gravity);
public void initializeRobot(Robot robot, DRCRobotModel robotModel, YoGraphicsListRegistry yoGraphicsListRegistry) { robot.setGravity(gravity); LinearGroundContactModel groundContactModel = new LinearGroundContactModel(robot, robot.getRobotsYoVariableRegistry()); robotModel.getContactPointParameters().setupGroundContactModelParameters(groundContactModel); // if ((commonTerrain.getSteppingStones() != null) && (yoGraphicsListRegistry != null)) // commonTerrain.registerSteppingStonesArtifact(yoGraphicsListRegistry); // groundContactModel.setGroundProfile(commonTerrain.getGroundProfile()); if (groundProfile3D != null) groundContactModel.setGroundProfile3D(groundProfile3D); // TODO: change this to scs.setGroundContactModel(groundContactModel); robot.setGroundContactModel(groundContactModel); }
public void initializeRobot(Robot robot, DRCRobotModel robotModel, YoGraphicsListRegistry yoGraphicsListRegistry) { robot.setGravity(gravity); LinearGroundContactModel groundContactModel = new LinearGroundContactModel(robot, robot.getRobotsYoVariableRegistry()); robotModel.getContactPointParameters().setupGroundContactModelParameters(groundContactModel); // if ((commonTerrain.getSteppingStones() != null) && (yoGraphicsListRegistry != null)) // commonTerrain.registerSteppingStonesArtifact(yoGraphicsListRegistry); // groundContactModel.setGroundProfile(commonTerrain.getGroundProfile()); if (groundProfile3D != null) groundContactModel.setGroundProfile3D(groundProfile3D); // TODO: change this to scs.setGroundContactModel(groundContactModel); robot.setGroundContactModel(groundContactModel); }
@Test// timeout=300000 public void testFloatingJointAndPinJointWithMassiveBody() throws UnreasonableAccelerationException { Random random = new Random(1659L); Robot robot = new Robot("r1"); robot.setGravity(0.0); FloatingJoint root1 = new FloatingJoint("root1", new Vector3D(), robot); robot.addRootJoint(root1); Link floatingBody = new Link("floatingBody"); floatingBody.setMass(random.nextDouble()); floatingBody.setComOffset(random.nextDouble(), random.nextDouble(), random.nextDouble()); floatingBody.setMomentOfInertia(getRotationalInertiaMatrixOfSolidEllipsoid(floatingBody.getMass(), random.nextDouble(), random.nextDouble(), random.nextDouble())); root1.setLink(floatingBody); Vector3D offset = EuclidCoreRandomTools.nextVector3D(random); PinJoint pin1 = new PinJoint("pin1", offset, robot, EuclidCoreRandomTools.nextVector3D(random)); pin1.setLink(massiveLink()); root1.addJoint(pin1); pin1.setTau(random.nextDouble()); robot.doDynamicsButDoNotIntegrate(); double scalarInertiaAboutJointAxis = computeScalarInertiaAroundJointAxis(floatingBody, pin1); double torqueFromDynamics = scalarInertiaAboutJointAxis * pin1.getQDDYoVariable().getDoubleValue(); assertEquals(pin1.getTauYoVariable().getDoubleValue(), torqueFromDynamics, pin1.getTauYoVariable().getDoubleValue() * 1e-3); }
private static void createRandomChainRobotAndSetJointPositionsAndVelocities(Robot robot, HashMap<RevoluteJoint, PinJoint> jointMap, ReferenceFrame worldFrame, RigidBodyBasics elevator, Vector3D[] jointAxes, double gravity, boolean useRandomVelocity, boolean useRandomAcceleration, Random random) robot.setGravity(gravity);
@ContinuousIntegrationAnnotations.ContinuousIntegrationTest(estimatedDuration = 11.3) @Test(timeout=3000000) public void testLinearAndAngularMomentumAreConverved() { int numberOfRobotsToTest = 5; int minNumberOfAxes = 2; int maxNumberOfAxes = 10; Robot[] robots = new Robot[numberOfRobotsToTest]; for (int i = 0; i < numberOfRobotsToTest; i++) { Robot robot = new RobotTools.SCSRobotFromInverseDynamicsRobotModel("robot" + i, getRandomFloatingChain(minNumberOfAxes, maxNumberOfAxes).getRootJoint()); robot.setGravity(0.0, 0.0, 0.0); robot.setController(new ConservedQuantitiesChecker(robot)); robot.setController(new SinusoidalTorqueController(robot)); robots[i] = robot; } SimulationConstructionSet scs = new SimulationConstructionSet(robots, simulationTestingParameters); scs.startOnAThread(); BlockingSimulationRunner blockingSimulationRunner = new BlockingSimulationRunner(scs, 30.0); try { blockingSimulationRunner.simulateAndBlock(8.0); } catch(BlockingSimulationRunner.SimulationExceededMaximumTimeException | ControllerFailureException e) { e.printStackTrace(); fail(); } }
public void initializeRobot(Robot robot, DRCRobotModel robotModel, YoGraphicsListRegistry yoGraphicsListRegistry) { robot.setGravity(gravity); LinearGroundContactModel groundContactModel = new LinearGroundContactModel(robot, robot.getRobotsYoVariableRegistry()); robotModel.getContactPointParameters().setupGroundContactModelParameters(groundContactModel, simulateDT); if (enableGroundSlipping) groundContactModel.enableSlipping(); if (Double.isFinite(groundAlphaStick) && Double.isFinite(groundAlphaSlip)) groundContactModel.setAlphaStickSlip(groundAlphaStick, groundAlphaSlip); if (groundProfile3D != null) groundContactModel.setGroundProfile3D(groundProfile3D); robot.setGroundContactModel(groundContactModel); }
robot.setController(toolboxUpdater); robot.setDynamic(false); robot.setGravity(0); ghost = new RobotFromDescription(ghostRobotDescription); ghost.setDynamic(false); ghost.setGravity(0);
robot.setGravity(gravity);
robot.setGravity(gravity);
robot.setGravity(gravity);
robot.setGravity(gravity);
robot.setGravity(gravity);
robot.setGravity(gravity);
robot.addRootJoint(jointTwo); robot.setGravity(0.0);
private void createFloatingRobot() { Robot floatingRobot = new Robot("floatingRobot"); Vector3D position = new Vector3D(0.0, 0.02, 1.1); double length = 0.01; floatingRobot.setGravity(0.0, 0.0, 0.0); horizontalJoint = new SliderJoint("y", position, floatingRobot, Axis.Y); floatingRobot.addRootJoint(horizontalJoint); Link linkHorizontal = new Link("linkHorizontal"); linkHorizontal.setMass(0.5); linkHorizontal.setComOffset(length / 2.0, 0.0, 0.0); linkHorizontal.setMomentOfInertia(0.0, 0.01, 0.0); Graphics3DObject linkHorizontalGraphics = new Graphics3DObject(); linkHorizontalGraphics.addCylinder(length * 10, 0.005, YoAppearance.Orange()); linkHorizontal.setLinkGraphics(linkHorizontalGraphics); horizontalJoint.setLink(linkHorizontal); verticalJoint = new SliderJoint("z", new Vector3D(0.0, 0.0, 0.0), floatingRobot, Axis.Z); Link linkVertical = new Link("linkVertical"); linkVertical.setMass(0.5); linkVertical.setComOffset(length / 2.0, 0.0, 0.0); linkVertical.setMomentOfInertia(0.0, 0.01, 0.0); Graphics3DObject linkVerticalGraphics = new Graphics3DObject(); linkVerticalGraphics.addCylinder(length, 0.005, YoAppearance.Blue()); linkVertical.setLinkGraphics(linkVerticalGraphics); verticalJoint.setLink(linkVertical); horizontalJoint.addJoint(verticalJoint); createFloatingRobotController(); robots[0] = floatingRobot; robots[0].setController(floatingRobotController); }
pin2.setLink(link12); robot1.setGravity(0.0); robot2.setGravity(0.0);
robot.addRootJoint(rootJoint); robot.setGravity(0.0); rootJoint.setAngularVelocityInBody(rotationAxis);
Random random = new Random(1776L); Robot robot = RandomRobotGenerator.generateRandomLinearChainRobot(name, startWithFloatingJoint, numberOfPinJoints, random); robot.setGravity(0.0, 0.0, 0.0);