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

x33g5p2x  于2022-01-30 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(174)

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

SimulationConstructionSet.tickAndUpdate介绍

暂无

代码示例

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

@Override
  public void run()
  {   
   while (true)
   {
     coactiveElement.updateMachineSide();
     scs.tickAndUpdate();
     sleep(millisecondsBetweenDataWrites);       
   }
  }
};

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

@Override
  public void run()
  {
   while (true)
   {
     coactiveElement.updateUserInterfaceSide();
     if (showSCS)
      scs.tickAndUpdate();
     sleep(millisecondsBetweenDataWrites);
   }
  }
};

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

@Override
  public void run()
  {   
   while (true)
   {
     coactiveElement.updateMachineSide();
     scs.tickAndUpdate();
     sleep(millisecondsBetweenDataWrites);       
   }
  }
};

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

public void addFootstepsAndTickAndUpdate(SimulationConstructionSet scs, List<Footstep> footsteps, List<ContactablePlaneBody> contactablePlaneBodies)
{
 for (int i = 0; i < footsteps.size(); i++)
 {
   Footstep footstep = footsteps.get(i);
   ContactablePlaneBody contactablePlaneBody = contactablePlaneBodies.get(i);
   addFootstep(footstep, contactablePlaneBody);
   scs.tickAndUpdate();
 }
}

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

@Override
  public void run()
  {
   while (true)
   {
     coactiveElement.updateUserInterfaceSide();
     if (showSCS)
      scs.tickAndUpdate();
     sleep(millisecondsBetweenDataWrites);
   }
  }
};

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

@Override
 public void didAnInverseKinemticsStep(double errorScalar)
 {
   yoErrorScalar.set(errorScalar);
   jointAnglesWriter.updateRobotConfigurationBasedOnFullRobotModel();
   scs.tickAndUpdate();
 }
};

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

@Override
public void receivedTimestampAndData(long timestamp, ByteBuffer buffer)
{
 long delay = TimeTools.nanoSecondsToMillis(lastTimestamp - timestamp);
 delayValue.setText(delayFormat.format(delay));
 
 if (recording)
 {
   for (int i = 0; i < jointUpdaters.size(); i++)
   {
    jointUpdaters.get(i).update();
   }
   scs.setTime(TimeTools.nanoSecondstoSeconds(timestamp));
   scs.tickAndUpdate();
 }
}

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

@Override
public void receivedTimestampAndData(long timestamp, ByteBuffer buffer)
{
 long delay = TimeTools.nanoSecondsToMillis(lastTimestamp - timestamp);
 delayValue.setText(delayFormat.format(delay));
 if (recording)
 {
   for (int i = 0; i < jointUpdaters.size(); i++)
   {
    jointUpdaters.get(i).update();
   }
   scs.setTime(TimeTools.nanoSecondstoSeconds(timestamp));
   scs.tickAndUpdate();
 }
}

代码示例来源:origin: us.ihmc/ihmc-robot-data-visualizer

@Override
public void receivedTimestampAndData(long timestamp)
{
 if(++counter % displayOneInNPackets == 0)
 {
   long delay = Conversions.nanosecondsToMilliseconds(lastTimestamp - timestamp);
   delayValue.setText(delayFormat.format(delay));
   for (int i = 0; i < jointUpdaters.size(); i++)
   {
    jointUpdaters.get(i).update();
   }
   scs.setTime(Conversions.nanosecondsToSeconds(timestamp));
   updateLocalVariables();
   scs.tickAndUpdate();
 }
}

代码示例来源:origin: us.ihmc/ihmc-footstep-planning-test

@Override
public void tickAndUpdate()
{
 scs.setTime(time.getDoubleValue());
 scs.tickAndUpdate();
 time.add(1.0);
}

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

public void startVisualizer()
{
 scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
 scs.addYoVariableRegistry(registry);
 scs.setupGraphGroup("step times", new String[][]
 {
   {"t"}
 });
 scs.startOnAThread();
 scs.tickAndUpdate();
}

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

public void startVisualizer()
{
 scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
 scs.addYoVariableRegistry(registry);
 scs.setupGraphGroup("step times", new String[][]
 {
   {"t"}
 });
 scs.startOnAThread();
 scs.tickAndUpdate();
}

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

public void variableChanged(YoVariable yoVariable)
   {
     PlaybackPose pose = new PlaybackPose(fullRobotModelForSlider, sdfRobot);

     if (previousPose != null)
     {
      if (pose.epsilonEquals(previousPose, 1e-3, 1.0))
      {
        return;
      }
     }

     System.out.println("Adding pose to sequence list: " + pose);
     posePlaybackRobotPoseSequence.addPose(pose);  
     //         FramePoint location = new FramePoint(ReferenceFrame.getWorldFrame(), Math.random(), Math.random(), Math.random());
//         balls.setBall(location);

     double dt = 0.01;
     double morphTime = 1.0;
     for (double time = 0.0; time < morphTime; time = time + dt)
     {
      scs.setTime(time);
      scs.tickAndUpdate();
     }

     previousPose = pose;
   }

代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test

private void updateVisualizePerTick()
{
 updateCoMTrack();
 updateICPTrack();
 updateCMPTrack();
 updateCoPTrack();
 updatePositionGraphics();
 scs.tickAndUpdate();
}

代码示例来源:origin: us.ihmc/ihmc-footstep-planning-test

public void addPlanarRegionsList(PlanarRegionsList planarRegions, AppearanceDefinition... appearances)
{
 Graphics3DObject graphics3DObject = new Graphics3DObject();
 Graphics3DObjectTools.addPlanarRegionsList(graphics3DObject, planarRegions, appearances);
 scs.addStaticLinkGraphics(graphics3DObject);
 scs.setTime(scs.getTime() + 1.0);
 scs.tickAndUpdate();
}

代码示例来源:origin: us.ihmc/ihmc-footstep-planning-test

public void addPolygon(RigidBodyTransform transform, ConvexPolygon2D polygon, AppearanceDefinition appearance)
{
 Graphics3DObject graphics3DObject = new Graphics3DObject();
 graphics3DObject.transform(transform);
 graphics3DObject.addPolygon(polygon, appearance);
 scs.addStaticLinkGraphics(graphics3DObject);
 scs.setTime(scs.getTime() + 1.0);
 scs.tickAndUpdate();
}

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

private void playLoadedSequence()
{
 PlaybackPose morphedPose = interpolator.getPose(frameByframeTime);
 while (!interpolator.isDone())
 {
   frameByframeTime = frameByframeTime + controlDT;
   morphedPose = interpolator.getPose(frameByframeTime);
   previousPose = morphedPose;
   scs.setTime(frameByframeTime);
   scs.tickAndUpdate();
   //morphedPose.setRobotAtPose(sdfRobot);//don't update scs while playing back and connected to gazebo to avoid slider actuation delays
   {
    System.out.println("pose #: " + frameByframePoseNumber++ + " \t pausing for " + interpolator.getNextTransitionTimeDelay());
    if (playOnlyOnePose)
    {
      morphedPose.setRobotAtPose(sdfRobot);// make sure scs ends in last pose
      return;
    }
   }
   ThreadTools.sleep((long) (controlDT * 1000));
 }
 morphedPose.setRobotAtPose(sdfRobot);// make sure scs ends in last pose
 System.out.println("End of Play back");
}

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

private void update(double dt)
{
 solePose.setFromReferenceFrame(swingOverPlanarRegionsTrajectoryExpander.getSolePoseReferenceFrame());
 for (SwingOverPlanarRegionsTrajectoryCollisionType swingOverPlanarRegionsTrajectoryCollisionType : SwingOverPlanarRegionsTrajectoryCollisionType.values())
 {
   intersectionMap.get(swingOverPlanarRegionsTrajectoryCollisionType)
          .setPosition(swingOverPlanarRegionsTrajectoryExpander.getClosestPolygonPoint(swingOverPlanarRegionsTrajectoryCollisionType));
 }
 double sphereRadius = swingOverPlanarRegionsTrajectoryExpander.getSphereRadius();
 collisionSphere.setRadii(new Vector3D(sphereRadius, sphereRadius, sphereRadius));
 collisionSphere.update();
 scs.tickAndUpdate(scs.getTime() + dt);
}

代码示例来源: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/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();
}

相关文章

SimulationConstructionSet类方法