us.ihmc.simulationconstructionset.Robot.setGravity()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(8.5k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中us.ihmc.simulationconstructionset.Robot.setGravity方法的一些代码示例,展示了Robot.setGravity的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Robot.setGravity方法的具体详情如下:
包路径:us.ihmc.simulationconstructionset.Robot
类名称:Robot
方法名:setGravity

Robot.setGravity介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test

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);

代码示例来源:origin: us.ihmc/IHMCAvatarInterfaces

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);
  }

代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge

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);
  }

代码示例来源:origin: us.ihmc/simulation-construction-set-test

@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);
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test

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);

代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test

@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();
 }
}

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces

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);
}

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test

robot.setController(toolboxUpdater);
robot.setDynamic(false);
robot.setGravity(0);
ghost = new RobotFromDescription(ghostRobotDescription);
ghost.setDynamic(false);
ghost.setGravity(0);

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces

robot.setGravity(gravity);

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces

robot.setGravity(gravity);

代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test

robot.setGravity(gravity);

代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge

robot.setGravity(gravity);

代码示例来源:origin: us.ihmc/IHMCAvatarInterfaces

robot.setGravity(gravity);

代码示例来源:origin: us.ihmc/simulation-construction-set-test

robot.setGravity(0.0);

代码示例来源:origin: us.ihmc/simulation-construction-set-test

robot.setGravity(gravity);

代码示例来源:origin: us.ihmc/simulation-construction-set-test

robot.addRootJoint(jointTwo);
robot.setGravity(0.0);

代码示例来源:origin: us.ihmc/simulation-construction-set-tools-test

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);
}

代码示例来源:origin: us.ihmc/simulation-construction-set-test

pin2.setLink(link12);
robot1.setGravity(0.0);
robot2.setGravity(0.0);

代码示例来源:origin: us.ihmc/simulation-construction-set-test

robot.addRootJoint(rootJoint);
robot.setGravity(0.0);
rootJoint.setAngularVelocityInBody(rotationAxis);

代码示例来源:origin: us.ihmc/simulation-construction-set-test

Random random = new Random(1776L);
Robot robot = RandomRobotGenerator.generateRandomLinearChainRobot(name, startWithFloatingJoint, numberOfPinJoints, random);
robot.setGravity(0.0, 0.0, 0.0);

相关文章