gpt4 book ai didi

us.ihmc.robotics.time.YoStopwatch类的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 07:45:31 26 4
gpt4 key购买 nike

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

YoStopwatch介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

@Override
public void onBehaviorResumed()
{
 timer.reset();
}

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

WaitState(YoDouble yoTime)
{
  stopwatch = new YoStopwatch("waitStopWatch", yoTime, registry);
  stopwatch.start();
  waitTime.set(initialWaitTime);
}

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

public double lapElapsed()
{
 return lapElapsed(now());
}

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

double averageLap = stopwatch.averageLap();
assertEquals("averageLap incorrect", Double.NaN, averageLap, 1e-2);
stopwatch.start();
double lapElapsed = stopwatch.lapElapsed();
double totalElapsed = stopwatch.totalElapsed();
averageLap = stopwatch.averageLap();
assertEquals("lapElapsed incorrect", 0.0, lapElapsed, 1e-2);
assertEquals("totalElapsed incorrect", 0.0, totalElapsed, 1e-2);
double lap = stopwatch.lap();
averageLap = stopwatch.averageLap();
assertEquals("lap incorrect", sleepTime1, lap, 1e-2);
assertEquals("averageLap incorrect", sleepTime1, averageLap, 1e-2);
lap = stopwatch.lap();
averageLap = stopwatch.averageLap();
assertEquals("lap incorrect", sleepTime2, lap, 1e-2);
assertEquals("averageLap incorrect", (sleepTime1 + sleepTime2) / 2.0, averageLap, 1e-2);
stopwatch.resetLap();
lapElapsed = stopwatch.lapElapsed();
assertEquals("lapElapsed incorrect", 0.0, lapElapsed, 1e-2);
lap = stopwatch.lap();
averageLap = stopwatch.averageLap();
assertEquals("lap incorrect", 0.0, lap, 1e-2);
assertEquals("averageLap incorrect", (sleepTime1 + sleepTime2) / 3.0, averageLap, 1e-2);

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

@Override
public void doControl()
{
 if (timer.totalElapsed() > sendInterval)
 {
   publishTextToSpeack("Sending messages.");
   sendFootsteps();
   sendChestTrajectory();
   sendArmTrajectory();
   timer.reset();
 }
}

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

public double lap()
{
 double now = now();
 double lapDuration = lapElapsed(now);
 if (yoLapStart == null)
 {
   lapStart = now;
   resetSuspension();
   // for average lap
   lapCount++;
   recordedLapTotal += lapDuration;
 }
 else
 {
   yoLapStart.set(now);
   resetSuspension();
   // for average lap
   yoLapCount.add(1);
   yoRecordedLapTotal.add(lapDuration);
 }
 return lapDuration;
}

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

public SleepBehavior(String robotName, Ros2Node ros2Node, YoDouble yoTime, double sleepTime)
{
 super(robotName, ros2Node);
 this.sleepTime = new YoDouble("sleepTime", registry);
 this.sleepTime.set(sleepTime);
 stopwatch = new YoStopwatch(yoTime);
}

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

boolean isDoneWaiting()
 {
   return stopwatch.totalElapsed() >= waitTime.getDoubleValue();
 }
}

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

@Override
  public void onBehaviorResumed()
  {
   stopwatch.resume();
  }
}

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

@Override
public void onBehaviorPaused()
{
 stopwatch.suspend();
}

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

@Override
public void doControl()
 if (!(timer.totalElapsed() > sleepTime.getDoubleValue()))
   return;
 timer.reset();

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

public TestGarbageGenerationBehavior(String robotName, Ros2Node ros2Node, HumanoidReferenceFrames referenceFrames, YoDouble yoTime)
{
 super(robotName, ros2Node);
 this.referenceFrames = referenceFrames;
 timer = new YoStopwatch(yoTime);
 armPublisher = createPublisherForController(ArmTrajectoryMessage.class);
 chestPublisher = createPublisherForController(ChestTrajectoryMessage.class);
 footstepPublisher = createPublisherForController(FootstepDataListMessage.class);
}

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

@Override
public boolean isDone()
{
 return (stopwatch.totalElapsed() > sleepTime.getDoubleValue());
}

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

public YoStopwatch start()
{
 reset();
 return this;
}

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

public double totalElapsed()
{
 if (yoLapStart == null)
 {
   return recordedLapTotal + lapElapsed(now());
 }
 else
 {
   return yoRecordedLapTotal.getDoubleValue() + lapElapsed(now());
 }
}

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

@ContinuousIntegrationTest(estimatedDuration = 0.0)
@Test(timeout = 30000)
public void testStopwatch()
{
 YoVariableRegistry registry = new YoVariableRegistry("test");
 YoDouble yoTime = new YoDouble("t", registry);
 
 testStopwatch(yoTime, new YoStopwatch(yoTime));
 testStopwatch(yoTime, new YoStopwatch("timerTest", yoTime, registry));
}

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

@Override
public void onBehaviorEntered()
{
 stopwatch.reset();
}

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

public TestICPOptimizationBehavior(String robotName, Ros2Node ros2Node, HumanoidReferenceFrames referenceFrames, YoDouble yoTime)
{
 super(robotName, ros2Node);
 this.referenceFrames = referenceFrames;
 swingTime.set(1.2);
 transferTime.set(0.6);
 sleepTime.set(10.0);
 stepLength.set(0.3);
 timer = new YoStopwatch(yoTime);
 publisher = createPublisherForController(FootstepDataListMessage.class);
}

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

@Override
public void onBehaviorEntered()
{
 publishTextToSpeack("Starting GC behavior.");
 timer.reset();
}

代码示例来源:origin: us.ihmc/ihmc-humanoid-behaviors

@Override
public void onEntry()
{
  lookDown();
  clearPlanarRegionsList();
  stopwatch.reset();
  if (hasWalkedBetweenWaiting.getBooleanValue())
  {
   waitTime.set(initialWaitTime);
   hasWalkedBetweenWaiting.set(false);
  }
  else
  {
   waitTime.set(Math.min(maxWaitTime, 2.0 * waitTime.getDoubleValue()));
  }
  sendTextToSpeechPacket("Waiting for " + waitTime.getDoubleValue() + " seconds");
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com