本文整理了Java中us.ihmc.robotics.graphics.YoGraphicPlanarRegionsList
类的一些代码示例,展示了YoGraphicPlanarRegionsList
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoGraphicPlanarRegionsList
类的具体详情如下:
包路径:us.ihmc.robotics.graphics.YoGraphicPlanarRegionsList
类名称:YoGraphicPlanarRegionsList
[英]YoGraphic that can display PlanarRegionsList locally, with SCS for instance, and remotely, with SCSVisualizer for instance. The implementation is complex because the overall number of vertices of a PlanarRegionsList tends to get really big overtime. Instead of creating a gazillion of YoVariables to store all vertices of any given PlanarRegionsList, a small buffer of vertices is used to update only a portion of the given PlanarRegionsList.
In addition to the complexity due to the constantly growing number of vertices, some synchronization has to be done when displaying this YoGraphic remotely. When the display thread is rendering at a slower pace than the YoVariables are being updated, without any synchronization, only portions of the meshes will be rendered.
Usage of this YoGraphic:
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
/**
* Processes the queue of lists of planar regions to render and updates the graphics.
* This method need to called every update tick in the caller.
*/
public void processPlanarRegionsListQueue()
{
processPlanarRegionsListQueue(true);
}
代码示例来源:origin: us.ihmc/robot-environment-awareness-application
public void handlePacket(PlanarRegionsListMessage message)
{
if (message != null)
yoGraphicPlanarRegionsList.submitPlanarRegionsListToRender(PlanarRegionMessageConverter.convertToPlanarRegionsList(message));
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
/** {@inheritDoc} */
@Override
public YoGraphicPlanarRegionsList duplicate(YoVariableRegistry newRegistry)
{
return new YoGraphicPlanarRegionsList(getName(), getVariables(), getConstants());
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public void clear()
{
clear.set(true);
planarRegionsListsDeque.clear();
clearYoVariables();
update();
}
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
yoGraphicPlanarRegionsList.submitPlanarRegionsListToRender(planarRegionsList);
yoGraphicPlanarRegionsList.processPlanarRegionsListQueue();
yoGraphicPlanarRegionsList.clear();
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
/**
* Create a YoGraphic for remote visualization.
* @param name name of this YoGraphic.
* @param yoVariables the list of YoVariables needed for this YoGraphic expected to be in the same order as packed in {@link #getVariables()}.
* @param constants the list of constants (variables that will never change) needed for this YoGraphic expected to be in the same order as packed in {@link #getConstants()}.
* @return a YoGraphic setup for remote visualization.
*/
static YoGraphicPlanarRegionsList createAsRemoteYoGraphic(String name, YoVariable<?>[] yoVariables, double[] constants)
{
return new YoGraphicPlanarRegionsList(name, yoVariables, constants);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
/**
* @return a new mesh given the current values of the YoVariables. The mesh belongs to a single region but can contain several polygons.
*/
private MeshDataHolder createCurrentMesh()
{
ModifiableMeshDataHolder modifiableMeshDataHolder = new ModifiableMeshDataHolder();
int firstVertexIndex = 0;
boolean isDoneExtractingPolygons = false;
while (!isDoneExtractingPolygons)
{
int numberOfVertices = findPolygonSize(firstVertexIndex);
modifiableMeshDataHolder.add(createPolygonMesh(firstVertexIndex, numberOfVertices), true);
firstVertexIndex += numberOfVertices + 1;
if (firstVertexIndex >= vertexBufferSize)
{
isDoneExtractingPolygons = true;
}
else
{
isDoneExtractingPolygons = vertexBuffer.get(firstVertexIndex).containsNaN();
}
}
return modifiableMeshDataHolder.createMeshDataHolder();
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
MeshDataHolder polygonMesh = createCurrentMesh();
polygonMesh.setName("PlanarRegion");
AppearanceDefinition appearance = getCurrentAppearance();
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
/**
* Submit a new list of planar regions to eventually render.
* This method does NOT update any YoVariables and does not update any graphics.
* Once a list of planar regions is submitted, the method {@link #processPlanarRegionsListQueue()} has to be called every update tick in the caller.
* @param planarRegionsList the list of planar regions to be eventually rendered.
*/
public void submitPlanarRegionsListToRender(PlanarRegionsList planarRegionsList)
{
if (planarRegionsList == null)
{
//TODO: Clear the viz when the planarRegionsList is null;
return;
}
if (planarRegionsListsDeque.size() > MAX_PLANAR_REGIONS_LIST_DEQUE_SIZE)
return;
// This YoGraphic modifies the planarRegionsList.
// A full depth copy has to be created to prevent changing the argument.
PlanarRegionsList copy = planarRegionsList.copy();
PlanarRegionsList filteredPlanarRegionsList = filterEmptyRegionsAndEmptyPolygons(copy);
if (filteredPlanarRegionsList != null)
planarRegionsListsDeque.addLast(filteredPlanarRegionsList);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
public RoboticsRemoteYoGraphicFactory()
{
registerBuilder(YoGraphicPlanarRegionsList.class,
(name, vars, consts, appearance) -> YoGraphicPlanarRegionsList.createAsRemoteYoGraphic(name, vars, consts));
registerBuilder(YoGraphicPolynomial3D.class, (name, vars, consts, appearance) -> YoGraphicPolynomial3D.createAsRemoteYoGraphic(name, vars, consts));
}
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
currentRegionPose = new YoFramePose3D(name + "CurrentRegionPose", worldFrame, registry);
clearYoVariables();
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
yoGraphicPlanarRegionsList.submitPlanarRegionsListToRender(planarRegionsList);
yoGraphicPlanarRegionsList.processPlanarRegionsListQueue();
yoGraphicPlanarRegionsList.clear();
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
public FootstepPlanningToolboxController(RobotContactPointParameters<RobotSide> contactPointParameters, FootstepPlannerParameters footstepPlannerParameters,
VisibilityGraphsParameters visibilityGraphsParameters, StatusMessageOutputManager statusOutputManager,
YoVariableRegistry parentRegistry, YoGraphicsListRegistry graphicsListRegistry, double dt)
{
super(statusOutputManager, parentRegistry);
this.dt = dt;
this.yoGraphicPlanarRegionsList = new YoGraphicPlanarRegionsList("FootstepPlannerToolboxPlanarRegions", 200, 30, registry);
SideDependentList<ConvexPolygon2D> contactPointsInSoleFrame;
if (contactPointParameters == null)
contactPointsInSoleFrame = PlannerTools.createDefaultFootPolygons();
else
contactPointsInSoleFrame = createFootPolygonsFromContactPoints(contactPointParameters);
footstepPlanningParameters = new YoFootstepPlannerParameters(registry, footstepPlannerParameters);
this.visibilityGraphsParameters = new YoVisibilityGraphParameters(visibilityGraphsParameters, registry);
plannerMap.put(FootstepPlannerType.PLANAR_REGION_BIPEDAL, createPlanarRegionBipedalPlanner(contactPointsInSoleFrame));
plannerMap.put(FootstepPlannerType.PLAN_THEN_SNAP, new PlanThenSnapPlanner(new TurnWalkTurnPlanner(), contactPointsInSoleFrame));
plannerMap.put(FootstepPlannerType.A_STAR, createAStarPlanner(contactPointsInSoleFrame));
plannerMap
.put(FootstepPlannerType.SIMPLE_BODY_PATH, new SplinePathWithAStarPlanner(footstepPlanningParameters, contactPointsInSoleFrame, parentRegistry, null));
plannerMap.put(FootstepPlannerType.VIS_GRAPH_WITH_A_STAR,
new VisibilityGraphWithAStarPlanner(footstepPlanningParameters, this.visibilityGraphsParameters, contactPointsInSoleFrame,
graphicsListRegistry, parentRegistry));
activePlanner.set(FootstepPlannerType.PLANAR_REGION_BIPEDAL);
graphicsListRegistry.registerYoGraphic("footstepPlanningToolbox", yoGraphicPlanarRegionsList);
isDone.set(true);
planId.set(FootstepPlanningRequestPacket.NO_PLAN_ID);
}
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
clearYoVariables();
return;
if (planarRegionsListsDeque.isEmpty())
clearYoVariables();
return;
clearYoVariables();
return;
update();
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
yoGraphicPlanarRegionsList.submitPlanarRegionsListToRender(planarRegionsList.get());
yoGraphicPlanarRegionsList.processPlanarRegionsListQueue();
yoGraphicPlanarRegionsList.clear();
代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit
/**
* Submit a new list of planar regions to eventually render.
* This method does NOT update any YoVariables and does not update any graphics.
* Once a list of planar regions is submitted, the method {@link #processPlanarRegionsListQueue()} has to be called every update tick in the caller.
* @param planarRegionsList the list of planar regions to be eventually rendered.
* @param requestedAppearance appearance to render the planar regions
*/
public void submitPlanarRegionsListToRender(PlanarRegionsList planarRegionsList, Color requestedColor)
{
for(int i = 0; i < planarRegionsList.getNumberOfPlanarRegions(); i++)
{
int index = i + currentMeshIndex.getIntegerValue();
if(index < 0 || index >= planarRegionsColorBuffer.length)
break;
planarRegionsColorBuffer[index].set(requestedColor.getRGB());
}
submitPlanarRegionsListToRender(planarRegionsList);
}
代码示例来源:origin: us.ihmc/robot-environment-awareness-application
yoGraphicPlanarRegionsList.processPlanarRegionsListQueue();
代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces
this.statusOutputManager = statusOutputManager;
this.tickDurationMs = tickDurationMs;
this.yoGraphicPlanarRegionsList = new YoGraphicPlanarRegionsList("FootstepPlannerPlanarRegions", 200, 30, registry);
goalRecommendationHandler = new PlannerGoalRecommendationHandler(allStepPlanningStages, stepPlanningStagesInProgress);
内容来源于网络,如有侵权,请联系作者删除!