gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-20 01:52:31 26 4
gpt4 key购买 nike

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

YoTimer介绍

暂无

代码示例

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

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

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

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

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

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

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

@Override
public void doControl()
{
  if (planarRegionsListQueue.isNewPacketAvailable())
  {
   PlanarRegionsListMessage planarRegionsListMessage = planarRegionsListQueue.getLatestPacket();
   planarRegionsList = PlanarRegionMessageConverter.convertToPlanarRegionsList(planarRegionsListMessage);
   footstepPlanner.setPlanarRegions(planarRegionsList);
   receivedPlanarRegionsList.set(true);
   havePlanarRegionsBeenSet.set(true);
  }
  else if (requestNewPlanarRegionsTimer.totalElapsed() > planarRegionsResponseTimeout.getDoubleValue())
  {
   requestPlanarRegions();
   requestNewPlanarRegionsTimer.reset();
  }
}

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

public FindGoalBehavior(DoubleYoVariable yoTime, CommunicationBridge behaviorCommunicationBridge, FullHumanoidRobotModel fullRobotModel, HumanoidReferenceFrames referenceFrames,
            GoalDetectorBehaviorService fiducialDetectorBehaviorService)
{
 super(FollowFiducialBehavior.class.getSimpleName(), behaviorCommunicationBridge);
 this.fullRobotModel = fullRobotModel;
 this.referenceFrames = referenceFrames;
 foundFiducialYoFramePose = new YoFramePoseUsingQuaternions(prefix + "FoundGoalPose", ReferenceFrame.getWorldFrame(), registry);
 this.fiducialDetectorBehaviorService = fiducialDetectorBehaviorService;
 addBehaviorService(fiducialDetectorBehaviorService);
 headPitchToFindFucdicial.set(0.6);
 headTrajectorySentTimer = new YoTimer(yoTime);
 headTrajectorySentTimer.start();
 //      behaviorCommunicationBridge.attachNetworkListeningQueue(robotConfigurationDataQueue, RobotConfigurationData.class);
 //      behaviorCommunicationBridge.attachNetworkListeningQueue(footstepStatusQueue, FootstepStatus.class);
 //      behaviorCommunicationBridge.attachNetworkListeningQueue(walkingStatusQueue, WalkingStatusMessage.class);
 //      behaviorCommunicationBridge.attachNetworkListeningQueue(planarRegionsListQueue, PlanarRegionsListMessage.class);
}

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

public SleepBehavior(CommunicationBridgeInterface outgoingCommunicationBridge, DoubleYoVariable yoTime, double sleepTime)
{
 super(outgoingCommunicationBridge);
 this.sleepTime = new DoubleYoVariable("sleepTime", registry);
 this.sleepTime.set(sleepTime);
 timer = new YoTimer(yoTime);
}

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

@Override
public void doControl()
{
 if (plannerTimer.totalElapsed() < 0.5)
   return;
 if (!requestedPlanarRegion.getBooleanValue() || (plannerTimer.totalElapsed() > 5.0))
 {
   clearAndRequestPlanarRegionsList();
   requestedPlanarRegion.set(true);
 }
 boolean planarRegionsListIsAvailable = updatePlannerIfPlanarRegionsListIsAvailable();
 if (!planarRegionsListIsAvailable)
 {
   return;
 }
 setGoalAndInitialStanceFootToBeClosestToGoal(goalPose);
 footstepPlanner.plan();
 plan = footstepPlanner.getPlan();
 plannerTimer.reset();
 requestedPlanarRegion.set(false);
 if (plan == null)
 {
   sendTextToSpeechPacket("No Plan was found! " + failIndex++);
   this.nextSideToSwing.set(this.nextSideToSwing.getEnumValue().getOppositeSide());
   return;
 }
 failIndex = 0;
 sendTextToSpeechPacket("Found plan!");
 foundPlan.set(true);
}

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

public PlanHumanoidFootstepsBehavior(DoubleYoVariable yoTime, CommunicationBridge behaviorCommunicationBridge, FullHumanoidRobotModel fullRobotModel,
                  HumanoidReferenceFrames referenceFrames)
{
 super(PlanHumanoidFootstepsBehavior.class.getSimpleName(), behaviorCommunicationBridge);
 shorterGoalLength.set(1.5);
 this.fullRobotModel = fullRobotModel;
 this.referenceFrames = referenceFrames;
 footstepPlanner = createFootstepPlanner();
 nextSideToSwing = new EnumYoVariable<>("nextSideToSwing", registry, RobotSide.class);
 nextSideToSwing.set(RobotSide.LEFT);
 plannerTimer = new YoTimer(yoTime);
 plannerTimer.start();
 footstepPlannerGoalPose = new YoFramePose(prefix + "FootstepGoalPose", ReferenceFrame.getWorldFrame(), registry);
 footstepPlannerInitialStepPose = new YoFramePose(prefix + "InitialStepPose", ReferenceFrame.getWorldFrame(), registry);
 attachNetworkListeningQueue(planarRegionsListQueue, PlanarRegionsListMessage.class);
 requestedPlanarRegion.set(false);
}

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

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

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

public TakeSomeStepsBehavior(DoubleYoVariable yoTime, CommunicationBridge behaviorCommunicationBridge, FullHumanoidRobotModel fullRobotModel, HumanoidReferenceFrames referenceFrames)
{
 super(TakeSomeStepsBehavior.class.getSimpleName(), behaviorCommunicationBridge);
 this.fullRobotModel = fullRobotModel;
 this.referenceFrames = referenceFrames;
 nextSideToSwing = new EnumYoVariable<>("nextSideToSwing", registry, RobotSide.class);
 nextSideToSwing.set(RobotSide.LEFT);
 doneTakingSteps = new BooleanYoVariable(prefix + "DoneTakingSteps", registry);
 currentlySwingingFoot = new EnumYoVariable<>("currentlySwingingFoot", registry, RobotSide.class, true);
 footstepSentTimer = new YoTimer(yoTime);
 footstepSentTimer.start();
 footstepPlannerGoalPose = new YoFramePose(prefix + "FootstepGoalPose", ReferenceFrame.getWorldFrame(), registry);
 footstepPlannerInitialStepPose = new YoFramePose(prefix + "InitialStepPose", ReferenceFrame.getWorldFrame(), registry);
 YoFramePose desiredLeftFootstepStatusPose = new YoFramePose(prefix + "DesiredLeftFootstepStatusPose", ReferenceFrame.getWorldFrame(), registry);
 YoFramePose desiredRightFootstepStatusPose = new YoFramePose(prefix + "DesiredRightFootstepStatusPose", ReferenceFrame.getWorldFrame(), registry);
 desiredFootStatusPoses = new SideDependentList<>(desiredLeftFootstepStatusPose, desiredRightFootstepStatusPose);
 YoFramePose leftFootstepStatusPose = new YoFramePose(prefix + "LeftFootstepStatusPose", ReferenceFrame.getWorldFrame(), registry);
 YoFramePose rightFootstepStatusPose = new YoFramePose(prefix + "RightFootstepStatusPose", ReferenceFrame.getWorldFrame(), registry);
 actualFootStatusPoses = new SideDependentList<>(leftFootstepStatusPose, rightFootstepStatusPose);
 latestFootstepStatus = new SideDependentList<>();
 EnumYoVariable<FootstepStatus.Status> leftFootstepStatus = new EnumYoVariable<FootstepStatus.Status>("leftFootstepStatus", registry,
    FootstepStatus.Status.class);
 EnumYoVariable<FootstepStatus.Status> rightFootstepStatus = new EnumYoVariable<FootstepStatus.Status>("rightFootstepStatus", registry,
    FootstepStatus.Status.class);
 latestFootstepStatusEnum = new SideDependentList<>(leftFootstepStatus, rightFootstepStatus);
 attachNetworkListeningQueue(footstepStatusQueue, FootstepStatus.class);
 attachNetworkListeningQueue(walkingStatusQueue, WalkingStatusMessage.class);
}

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

@Override
public void doControl()
{
 if (fiducialDetectorBehaviorService.getGoalHasBeenLocated())
 {
   fiducialDetectorBehaviorService.getReportedGoalPoseWorldFrame(foundFiducialPose);
   foundFiducialYoFramePose.set(foundFiducialPose);
   foundFiducial.set(true);
   Point3d position = new Point3d();
   foundFiducialPose.getPosition(position);
   sendTextToSpeechPacket("Target object located at " + position);
 } else {
   sendTextToSpeechPacket("Target object not located");
 }
 if (headTrajectorySentTimer.totalElapsed() < 2.0)
 {
   return;
 }
 pitchHeadToFindFiducial();
 //      pitchHeadToCenterFiducial();
}

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

@Override
public void onBehaviorEntered()
{
  receivedPlanarRegionsList.set(false);
  requestNewPlanarRegionsTimer.reset();
  requestPlanarRegions();
}

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

private void sendFootstepDataListMessage(FootstepDataListMessage footstepDataListMessage)
{
 footstepDataListMessage.setDestination(PacketDestination.UI);
 sendPacket(footstepDataListMessage);
 footstepDataListMessage.setDestination(PacketDestination.CONTROLLER);
 sendPacketToController(footstepDataListMessage);
 footstepSentTimer.reset();
}

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

private void sendHeadTrajectoryMessage(double trajectoryTime, Quat4d desiredOrientation)
{
 HeadTrajectoryMessage headTrajectoryMessage = new HeadTrajectoryMessage(trajectoryTime, desiredOrientation);
 headTrajectoryMessage.setDestination(PacketDestination.UI);
 sendPacket(headTrajectoryMessage);
 headTrajectoryMessage.setDestination(PacketDestination.CONTROLLER);
 sendPacketToController(headTrajectoryMessage);
 headTrajectorySentTimer.reset();
}

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