本文整理了Java中us.ihmc.simulationconstructionset.SimulationConstructionSet.addYoGraphicsListRegistry()
方法的一些代码示例,展示了SimulationConstructionSet.addYoGraphicsListRegistry()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SimulationConstructionSet.addYoGraphicsListRegistry()
方法的具体详情如下:
包路径:us.ihmc.simulationconstructionset.SimulationConstructionSet
类名称:SimulationConstructionSet
方法名:addYoGraphicsListRegistry
暂无
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
@Override
public void addController(MultiThreadedRobotControlElement controller, int executionsPerControlTick, boolean skipFirstControlCycle)
{
controllers.add(new MultiThreadedRobotControllerExecutor(simulatedRobot, controller, executionsPerControlTick, skipFirstControlCycle, registry));
if(controller.getYoGraphicsListRegistry() != null)
{
scs.addYoGraphicsListRegistry(controller.getYoGraphicsListRegistry(), false);
}
}
代码示例来源:origin: us.ihmc/simulation-construction-set-tools
@Override
public void addController(MultiThreadedRobotControlElement controller, int executionsPerControlTick, boolean skipFirstControlCycle)
{
controllers.add(new SingleThreadedRobotControllerExecutor(simulatedRobot, controller, executionsPerControlTick, skipFirstControlCycle, registry));
if(scs != null && controller.getYoGraphicsListRegistry() != null)
{
scs.addYoGraphicsListRegistry(controller.getYoGraphicsListRegistry(), true);
}
}
代码示例来源:origin: us.ihmc/IHMCAvatarInterfaces
public final void setLogDataProcessor(LogDataProcessorFunction logDataProcessor)
{
YoGraphicsListRegistry yoGraphicsListRegistry = logDataProcessor.getYoGraphicsListRegistry();
if (yoGraphicsListRegistry != null)
{
yoGraphicsListRegistry.addArtifactListsToPlotter(plotter);
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
}
logDataProcessorWrapper.addLogDataProcessor(logDataProcessor);
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
public final void setLogDataProcessor(LogDataProcessorFunction logDataProcessor)
{
YoGraphicsListRegistry yoGraphicsListRegistry = logDataProcessor.getYoGraphicsListRegistry();
if (yoGraphicsListRegistry != null)
{
yoGraphicsListRegistry.addArtifactListsToPlotter(plotter);
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
}
logDataProcessorWrapper.addLogDataProcessor(logDataProcessor);
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
public final void setLogDataProcessor(LogDataProcessorFunction logDataProcessor)
{
YoGraphicsListRegistry yoGraphicsListRegistry = logDataProcessor.getYoGraphicsListRegistry();
if (yoGraphicsListRegistry != null)
{
yoGraphicsListRegistry.addArtifactListsToPlotter(plotter);
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
}
logDataProcessorWrapper.addLogDataProcessor(logDataProcessor);
}
代码示例来源: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/IHMCSimulationToolkit
public void startVisualizer()
{
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
scs.addYoVariableRegistry(registry);
scs.setupGraphGroup("step times", new String[][]
{
{"t"}
});
scs.startOnAThread();
scs.tickAndUpdate();
}
代码示例来源:origin: us.ihmc/IHMCSimulationToolkit
public ActualCMPComputer(boolean createViz, SimulationConstructionSet scs, HumanoidFloatingRootJointRobot simulatedRobot)
{
this.simulatedRobot = simulatedRobot;
simulateDT = scs.getDT();
gravity = simulatedRobot.getGravityZ();
momentumChange = FilteredVelocityYoFrameVector.createFilteredVelocityYoFrameVector("rateOfChangeLinearMomentum", "", alpha, simulateDT, registry, yoLinearMomentum);
if (createViz)
{
yoGraphicsListRegistry = new YoGraphicsListRegistry();
YoArtifactPosition cmpViz = new YoArtifactPosition("SimulationCMP", yoCmp.getYoX(), yoCmp.getYoY(),
GraphicType.BALL_WITH_CROSS, Color.RED , 0.005);
cmpViz.setVisible(visibleByDefault);
yoGraphicsListRegistry.registerArtifact(getClass().getSimpleName(), cmpViz);
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
}
else
{
yoGraphicsListRegistry = null;
}
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
public ActualCMPComputer(boolean createViz, SimulationConstructionSet scs, HumanoidFloatingRootJointRobot simulatedRobot)
{
this.simulatedRobot = simulatedRobot;
simulateDT = scs.getDT();
gravity = simulatedRobot.getGravityZ();
momentumChange = FilteredVelocityYoFrameVector.createFilteredVelocityYoFrameVector("rateOfChangeLinearMomentum", "", alpha, simulateDT, registry, yoLinearMomentum);
if (createViz)
{
yoGraphicsListRegistry = new YoGraphicsListRegistry();
YoArtifactPosition cmpViz = new YoArtifactPosition("SimulationCMP", yoCmp.getYoX(), yoCmp.getYoY(),
GraphicType.BALL_WITH_CROSS, Color.RED , 0.005);
cmpViz.setVisible(visibleByDefault);
yoGraphicsListRegistry.registerArtifact(getClass().getSimpleName(), cmpViz);
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
}
else
{
yoGraphicsListRegistry = null;
}
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
public static void main(String[] args)
{
YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
DRCDemoEnvironmentSimpleSteeringWheelContact env = new DRCDemoEnvironmentSimpleSteeringWheelContact(yoGraphicsListRegistry);
List<Robot> robots = env.getEnvironmentRobots();
Robot[] robotArray = new Robot[robots.size()];
robots.toArray(robotArray);
SimulationConstructionSetParameters parameters = new SimulationConstructionSetParameters();
parameters.setDataBufferSize(36000);
SimulationConstructionSet scs = new SimulationConstructionSet(robotArray, parameters);
scs.setDT(1e-4, 20);
TerrainObject3D terrainObject = env.getTerrainObject3D();
scs.addStaticLinkGraphics(terrainObject.getLinkGraphics());
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
scs.setGroundVisible(false);
scs.startOnAThread();
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
public static void visualizeFootsteps(Robot nullRobot, List<Footstep> footsteps, List<ContactablePlaneBody> contactablePlaneBodies)
{
SimulationConstructionSet scs = new SimulationConstructionSet(nullRobot);
scs.setDT(0.25, 1);
YoVariableRegistry rootRegistry = scs.getRootRegistry();
YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
int maxNumberOfContacts = 2;
int maxPointsPerContact = 4;
FootstepGeneratorVisualizer footstepGeneratorVisualizer = new FootstepGeneratorVisualizer(maxNumberOfContacts, maxPointsPerContact, rootRegistry,
yoGraphicsListRegistry);
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
footstepGeneratorVisualizer.addFootstepsAndTickAndUpdate(scs, footsteps, contactablePlaneBodies);
scs.startOnAThread();
deleteFirstDataPointAndCropData(scs);
}
代码示例来源:origin: us.ihmc/IHMCAvatarInterfaces
public static void main(String argv[]) throws FileNotFoundException, JAXBException, MalformedURLException
{
Robot robot = new Robot("robot");
SimulationConstructionSet scs = new SimulationConstructionSet(robot);
DRCVehicleSDFLoader drcVehicleSDFLoader = new DRCVehicleSDFLoader();
scs.addStaticLinkGraphics(drcVehicleSDFLoader.loadDRCVehicle(false));
RigidBodyTransform vehicleToWorldTransform = new RigidBodyTransform();
ReferenceFrame vehicleFrame = ReferenceFrame.constructFrameWithUnchangingTransformToParent("vehicle", ReferenceFrame.getWorldFrame(),
vehicleToWorldTransform, false, true, true);
VehicleModelObjects vehicleModelObjects = new VehicleModelObjects();
YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
YoVariableRegistry registry = scs.getRootRegistry();
VehicleModelObjectVisualizer vehicleModelObjectVisualizer = new VehicleModelObjectVisualizer(vehicleFrame, vehicleModelObjects, yoGraphicsListRegistry, registry);
vehicleModelObjectVisualizer.setVisible(true);
vehicleModelObjectVisualizer.update();
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
Thread thread = new Thread(scs);
thread.start();
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
public static void main(String argv[]) throws FileNotFoundException, JAXBException, MalformedURLException
{
Robot robot = new Robot("robot");
SimulationConstructionSet scs = new SimulationConstructionSet(robot);
DRCVehicleSDFLoader drcVehicleSDFLoader = new DRCVehicleSDFLoader();
scs.addStaticLinkGraphics(drcVehicleSDFLoader.loadDRCVehicle(false));
RigidBodyTransform vehicleToWorldTransform = new RigidBodyTransform();
ReferenceFrame vehicleFrame = ReferenceFrame.constructFrameWithUnchangingTransformToParent("vehicle", ReferenceFrame.getWorldFrame(),
vehicleToWorldTransform);
VehicleModelObjects vehicleModelObjects = new VehicleModelObjects();
YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
YoVariableRegistry registry = scs.getRootRegistry();
VehicleModelObjectVisualizer vehicleModelObjectVisualizer = new VehicleModelObjectVisualizer(vehicleFrame, vehicleModelObjects, yoGraphicsListRegistry, registry);
vehicleModelObjectVisualizer.setVisible(true);
vehicleModelObjectVisualizer.update();
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
Thread thread = new Thread(scs);
thread.start();
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
public static void main(String argv[]) throws FileNotFoundException, JAXBException, MalformedURLException
{
Robot robot = new Robot("robot");
SimulationConstructionSet scs = new SimulationConstructionSet(robot);
DRCVehicleSDFLoader drcVehicleSDFLoader = new DRCVehicleSDFLoader();
scs.addStaticLinkGraphics(drcVehicleSDFLoader.loadDRCVehicle(false));
RigidBodyTransform vehicleToWorldTransform = new RigidBodyTransform();
ReferenceFrame vehicleFrame = ReferenceFrame.constructFrameWithUnchangingTransformToParent("vehicle", ReferenceFrame.getWorldFrame(),
vehicleToWorldTransform, false, true, true);
VehicleModelObjects vehicleModelObjects = new VehicleModelObjects();
YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
YoVariableRegistry registry = scs.getRootRegistry();
VehicleModelObjectVisualizer vehicleModelObjectVisualizer = new VehicleModelObjectVisualizer(vehicleFrame, vehicleModelObjects, yoGraphicsListRegistry, registry);
vehicleModelObjectVisualizer.setVisible(true);
vehicleModelObjectVisualizer.update();
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
Thread thread = new Thread(scs);
thread.start();
}
代码示例来源:origin: us.ihmc/IHMCHumanoidBehaviors
public static PlanarRegionBipedalFootstepPlannerVisualizer createWithSimulationConstructionSet(double dtForViz,
SideDependentList<ConvexPolygon2d> footPolygonsInSoleFrame)
{
YoVariableRegistry registry = new YoVariableRegistry(PlanarRegionBipedalFootstepPlannerVisualizerFactory.class.getSimpleName());
YoGraphicsListRegistry graphicsListRegistry = new YoGraphicsListRegistry();
PlanarRegionBipedalFootstepPlannerVisualizer footstepPlannerVisualizer = new PlanarRegionBipedalFootstepPlannerVisualizer(10, footPolygonsInSoleFrame,
registry, graphicsListRegistry);
SimulationConstructionSet scs = new SimulationConstructionSet(new Robot("Test"));
footstepPlannerVisualizer.setTickAndUpdatable(scs);
scs.changeBufferSize(32000);
scs.addYoVariableRegistry(registry);
scs.addYoGraphicsListRegistry(graphicsListRegistry);
scs.setDT(dtForViz, 1);
scs.setGroundVisible(false);
scs.startOnAThread();
return footstepPlannerVisualizer;
}
代码示例来源:origin: us.ihmc/ihmc-common-walking-control-modules-test
private void startSCS()
{
scs.addYoVariableRegistry(registry);
scs.addYoGraphicsListRegistry(graphicsListRegistry);
scs.setPlaybackRealTimeRate(0.025);
Graphics3DObject linkGraphics = new Graphics3DObject();
linkGraphics.addCoordinateSystem(0.3);
scs.addStaticLinkGraphics(linkGraphics);
scs.setCameraFix(0.0, 0.0, 0.5);
scs.setCameraPosition(-0.5, 0.0, 1.0);
SimulationOverheadPlotterFactory simulationOverheadPlotterFactory = scs.createSimulationOverheadPlotterFactory();
simulationOverheadPlotterFactory.addYoGraphicsListRegistries(graphicsListRegistry);
simulationOverheadPlotterFactory.createOverheadPlotter();
scs.startOnAThread();
}
代码示例来源:origin: us.ihmc/DarpaRoboticsChallenge
public VisualizePoseWorkspace(DRCRobotModel robotModel) throws IOException
{
this.controlDT = robotModel.getControllerDT();
DRCRobotJointMap jointMap = robotModel.getJointMap();
HumanoidFloatingRootJointRobot sdfRobot = robotModel.createHumanoidFloatingRootJointRobot(false);
interpolator = new PlaybackPoseInterpolator(registry);
SimulationConstructionSet scs = new SimulationConstructionSet(sdfRobot);
scs.addYoVariableRegistry(registry);
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
fullRobotModelForSlider = robotModel.createFullRobotModel();
DRCRobotMidiSliderBoardPositionManipulation sliderBoard = new DRCRobotMidiSliderBoardPositionManipulation(scs, sdfRobot, fullRobotModelForSlider, yoGraphicsListRegistry);
posePlaybackRobotPoseSequence = new PlaybackPoseSequence(fullRobotModelForSlider);
CaptureSnapshotListener captureSnapshotListener = new CaptureSnapshotListener(sdfRobot, scs);
sliderBoard.addCaptureSnapshotListener(captureSnapshotListener);
SaveSequenceListener saveSequenceListener = new SaveSequenceListener();
sliderBoard.addSaveSequenceRequestedListener(saveSequenceListener);
LoadSequenceListener loadSequenceListener = new LoadSequenceListener(fullRobotModelForSlider, sdfRobot, scs);
sliderBoard.addLoadSequenceRequestedListener(loadSequenceListener);
scs.startOnAThread();
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
public VisualizePoseWorkspace(DRCRobotModel robotModel) throws IOException
{
this.controlDT = robotModel.getControllerDT();
DRCRobotJointMap jointMap = robotModel.getJointMap();
HumanoidFloatingRootJointRobot sdfRobot = robotModel.createHumanoidFloatingRootJointRobot(false);
interpolator = new PlaybackPoseInterpolator(registry);
SimulationConstructionSet scs = new SimulationConstructionSet(sdfRobot);
scs.addYoVariableRegistry(registry);
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
fullRobotModelForSlider = robotModel.createFullRobotModel();
DRCRobotMidiSliderBoardPositionManipulation sliderBoard = new DRCRobotMidiSliderBoardPositionManipulation(scs, sdfRobot, fullRobotModelForSlider, yoGraphicsListRegistry);
posePlaybackRobotPoseSequence = new PlaybackPoseSequence(fullRobotModelForSlider);
CaptureSnapshotListener captureSnapshotListener = new CaptureSnapshotListener(sdfRobot, scs);
sliderBoard.addCaptureSnapshotListener(captureSnapshotListener);
SaveSequenceListener saveSequenceListener = new SaveSequenceListener();
sliderBoard.addSaveSequenceRequestedListener(saveSequenceListener);
LoadSequenceListener loadSequenceListener = new LoadSequenceListener(fullRobotModelForSlider, sdfRobot, scs);
sliderBoard.addLoadSequenceRequestedListener(loadSequenceListener);
scs.startOnAThread();
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
private void setupSupportViz()
{
SimulationConstructionSet scs = drcSimulationTestHelper.getSimulationConstructionSet();
YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
supportPolygons = new SideDependentList<YoFrameConvexPolygon2D>();
supportPolygons.set(RobotSide.LEFT, new YoFrameConvexPolygon2D("FootPolygonLeft", "", worldFrame, 4, registry));
supportPolygons.set(RobotSide.RIGHT, new YoFrameConvexPolygon2D("FootPolygonRight", "", worldFrame, 4, registry));
footContactsInAnkleFrame = new SideDependentList<>();
footContactsInAnkleFrame.set(RobotSide.LEFT, null);
footContactsInAnkleFrame.set(RobotSide.RIGHT, null);
yoGraphicsListRegistry.registerArtifact("SupportLeft", new YoArtifactPolygon("SupportLeft", supportPolygons.get(RobotSide.LEFT), Color.BLACK, false));
yoGraphicsListRegistry.registerArtifact("SupportRight", new YoArtifactPolygon("SupportRight", supportPolygons.get(RobotSide.RIGHT), Color.BLACK, false));
scs.addYoVariableRegistry(registry);
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
drcSimulationTestHelper.addRobotControllerOnControllerThread(new VizUpdater());
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces-test
private void setupSupportViz()
{
SimulationConstructionSet scs = drcSimulationTestHelper.getSimulationConstructionSet();
YoGraphicsListRegistry yoGraphicsListRegistry = new YoGraphicsListRegistry();
supportPolygons = new SideDependentList<YoFrameConvexPolygon2D>();
supportPolygons.set(RobotSide.LEFT, new YoFrameConvexPolygon2D("FootPolygonLeft", "", worldFrame, 4, registry));
supportPolygons.set(RobotSide.RIGHT, new YoFrameConvexPolygon2D("FootPolygonRight", "", worldFrame, 4, registry));
footContactsInAnkleFrame = new SideDependentList<ArrayList<Point2D>>();
footContactsInAnkleFrame.set(RobotSide.LEFT, null);
footContactsInAnkleFrame.set(RobotSide.RIGHT, null);
yoGraphicsListRegistry.registerArtifact("SupportLeft", new YoArtifactPolygon("SupportLeft", supportPolygons.get(RobotSide.LEFT), Color.BLACK, false));
yoGraphicsListRegistry.registerArtifact("SupportRight", new YoArtifactPolygon("SupportRight", supportPolygons.get(RobotSide.RIGHT), Color.BLACK, false));
scs.addYoVariableRegistry(registry);
scs.addYoGraphicsListRegistry(yoGraphicsListRegistry);
drcSimulationTestHelper.addRobotControllerOnControllerThread(new VizUpdater());
}
内容来源于网络,如有侵权,请联系作者删除!