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

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

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

Robot.getTime介绍

暂无

代码示例

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

private boolean didSimulationsGetToEndTime(double simulationTime, ArrayList<SimulationConstructionSet> simulationConstructionSets)
  {
   double endTime0 = simulationConstructionSets.get(0).getRobots()[0].getTime();
   double endTime1 = simulationConstructionSets.get(0).getRobots()[0].getTime();
   
   double errorTime0 = Math.abs(simulationTime - endTime0);
   double errorTime1 = Math.abs(simulationTime - endTime1);
   
//      System.out.println("errorTime0 = " + errorTime0);
//      System.out.println("errorTime1 = " + errorTime1);
   
   if (errorTime0 > 1e-3) return false;
   if (errorTime1 > 1e-3) return false;
   
   return true;
  }

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

@Override
  public void doControl()
  {
   if (robots[0].getTime() < 1.0)
   {
     horizontalJoint.setqDesired(-0.05);
     verticalJoint.setqDesired(0.0);
   }
   else if (robots[0].getTime() >= 1.0 && robots[0].getTime() < 2.0)
   {
     horizontalJoint.setqDesired(-0.1);
     verticalJoint.setqDesired(-0.05);
   }
  }
};

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

@Override
public void doControl()
{      
  variableOne.set(Math.cos(robot.getTime()));
  variableTwo.set(robot.getTime());
  variableThree.set(variableOne.getDoubleValue());
  variableFour.set(1.2);
}

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

@Override
   public void doControl()
   {
     super.doControl();
          if (robot.getTime() > lastTimeChanged + timeBetweenChanges)
     {
      lastTimeChanged = robot.getTime();
      nonRegisteredVariable = nonRegisteredVariable + 1.0;
      
//            System.out.println("Changed nonRegisteredVariable to " + nonRegisteredVariable + ", time = " + robot.getTime());
     }
          if (robot.getTime() > lastTimeUpdated.getDoubleValue() + timeBetweenUpdates)
     {
      lastTimeUpdated.set(robot.getTime());
      
      variableTwo.set(nonRegisteredVariable);
      variableThree.set(3.0);
      variableFour.set(nonRegisteredVariable * 2);
      
//            System.out.println("Changed a bunch of variables. time = " + robot.getTime());
     }
   }
  }

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

@Override
public void doControl()
{
 if (doFreezeFrame.getBooleanValue() && (robot.getTime() > nextFreezeTime.getDoubleValue()))
 {
   nextFreezeTime.set(robot.getTime() + freezeInterval.getDoubleValue());
   graphics3dAdapter.freezeFrame(rootJoint);
 }
}

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

private double getExpectedFinalTime(SimulationConstructionSet scs)
{
 double initialTime = scs.getRobots()[0].getTime();
 double recordFreq = scs.getRecordFreq();
 double DT = scs.getDT();
 return initialTime + recordFreq * DT;
}

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

@Override
  public void processData()
  {
   double time = robot.getTime();
   variableOne.set(time);
   variableTwo.set(1.1);
   variableThree.set(9.23);
  }
};

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

@Override
 public void doControl()
 {
   super.doControl();
      if (robot.getTime() >= 1.0)
   {
    nonRegisteredVariable = nonRegisteredVariable + 1.0;
    variableTwo.set(nonRegisteredVariable);
    variableFour.set(nonRegisteredVariable * 2.0);
   }
 }
}

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

boolean differenceFound = false;
Robot robotToUseForTime = simulationConstructionSets.get(0).getRobots()[0];
double time = robotToUseForTime.getTime();
while (!differenceFound && (time < maxSimulationTime))
  time = robotToUseForTime.getTime();

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

BlockingSimulationRunner.waitForSimulationToFinish(scss.get(0), maximumClockRunTimeInSeconds, true);
assertEquals("indices not the same", scss.get(0).getIndex(), scss.get(1).getIndex());
assertEquals("times not the same", scss.get(0).getRobots()[0].getTime(), scss.get(1).getRobots()[0].getTime(), epsilon);
boolean result = comparer.compare(scss.get(0), scss.get(1));

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

@Override
 public void doControl()
 {
   if(firstTick)
   {
    robot.computeCOMMomentum(rootJoint, new Point3D(), initialLinearMomentum, initialAngularMomentum);
    firstTick = false;
   }
   Vector3D currentLinearMomentum = new Vector3D();
   Vector3D currentAngularMomentum = new Vector3D();
   robot.computeCOMMomentum(rootJoint, new Point3D(), currentLinearMomentum, currentAngularMomentum);
   EuclidCoreTestTools.assertTuple3DEquals(
      "Linear momentum hasn't been conserved. p(t=0)=" + EuclidCoreIOTools.getTuple3DString("%6.8f", initialLinearMomentum) + ", p(t=" + robot
         .getTime() + ")=" + EuclidCoreIOTools.getTuple3DString("%6.8f", currentLinearMomentum), initialLinearMomentum, currentLinearMomentum,
      epsilon);
   EuclidCoreTestTools.assertTuple3DEquals(
      "Angular momentum hasn't been conserved. L(t=0)=" + EuclidCoreIOTools.getTuple3DString("%6.8f", initialAngularMomentum) + ", L(t=" + robot
         .getTime() + ")=" + EuclidCoreIOTools.getTuple3DString("%6.8f", currentAngularMomentum), initialAngularMomentum, currentAngularMomentum,
      epsilon);
 }
}

代码示例来源:origin: us.ihmc/ihmc-simulation-toolkit

public void visualizeFootstep(ContactablePlaneBody bipedFoot, Footstep footstep)
{
 bagOfSingleFootstepVisualizers.visualizeFootstep(footstep, bipedFoot);
 nullRobot.setTime(nullRobot.getTime() + scs.getDT());
 FramePoint3D solePositon = new FramePoint3D(footstep.getSoleReferenceFrame());
 solePositon.changeFrame(worldFrame);
 updateFocus(solePositon);
 scs.setCameraFix(focusX, focusY, 0.0);
 scs.setCameraPosition(focusX, focusY - 1.5, 6.0);
 scs.tickAndUpdate();
}

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

public void visualizeFootstep(ContactablePlaneBody bipedFoot, Footstep footstep)
{
 bagOfSingleFootstepVisualizers.visualizeFootstep(footstep, bipedFoot);
 nullRobot.setTime(nullRobot.getTime() + scs.getDT());
 FramePoint solePositon = new FramePoint(footstep.getSoleReferenceFrame());
 solePositon.changeFrame(worldFrame);
 updateFocus(solePositon);
 scs.setCameraFix(focusX, focusY, 0.0);
 scs.setCameraPosition(focusX, focusY - 1.5, 6.0);
 scs.tickAndUpdate();
}

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

assertEquals(numberOfTicksBeforeUpdatingGraphs2, numberOfTicksBeforeUpdatingGraphsFromSCS2);
double initialTime = scs.getRobots()[0].getTime();
double DT = scs.getDT();
callSCSMethodSimulateOneTimeStep(scs);
double finalTime = scs.getRobots()[0].getTime();
assertEquals(initialTime + DT, finalTime, epsilon);
double finalTime2 = scs.getRobots()[0].getTime();
assertEquals(expectedFinalTime2, finalTime2, epsilon);
double finalTime3 = scs.getRobots()[0].getTime();
assertEquals(expectedFinalTime3, finalTime3, epsilon);

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

assertEquals(variableOne.getDoubleValue(), robot.getTime(), 1e-7);
assertEquals(variableTwo.getDoubleValue(), 1.1, 1e-7);
assertEquals(variableThree.getDoubleValue(), 9.23, 1e-7);

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

robot.setTime(robot.getTime() + 0.001);

相关文章