@Override public YoArtifactPosition createArtifact() { return new YoArtifactPosition(getName(), x, y, type, getColor(), scale); }
public YoArtifactPosition createArtifact() { return new YoArtifactPosition(getName(), x, y, type, this.getColor(), scale); }
private static YoArtifactPosition yoArtifactPositionFromMessage(String name, YoVariable<?>[] vars, double[] consts, AppearanceDefinition appearance) { return new YoArtifactPosition(name, (YoDouble) vars[0], (YoDouble) vars[1], YoGraphicPosition.GraphicType.values()[(int) (double) consts[1]], appearance.getColor().get(), consts[0]); }
@Override public YoArtifact duplicate(YoVariableRegistry newRegistry) { return new YoArtifactPosition(getName(), point.duplicate(newRegistry), graphicType, color, radii.getX()); } }
public SmartCMPProjector(YoGraphicsListRegistry graphicsListRegistry, YoVariableRegistry parentRegistry) { activeProjection.set(ProjectionMethod.NONE); if (parentRegistry != null) parentRegistry.addChild(registry); if (graphicsListRegistry != null) { YoArtifactPosition desiredCMPViz = new YoArtifactPosition("Desired CMP Position", yoDesiredCMP, GraphicType.SOLID_BALL, DarkRed().getAwtColor(), 0.008); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), desiredCMPViz); YoArtifactPosition projectedCMPViz = new YoArtifactPosition("Projected CMP Position", yoProjectedCMP, GraphicType.BALL_WITH_ROTATED_CROSS, DarkRed().getAwtColor(), 0.01); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), projectedCMPViz); YoArtifactPolygon projectionAreaViz = new YoArtifactPolygon("CMP Projection Area", yoProjectionArea, Blue().getAwtColor(), false); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), projectionAreaViz); } }
public ActualCMPComputer(boolean createViz, SimulationConstructionSet scs, FloatingRootJointRobot 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; } }
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; } }
YoArtifactPosition capturePointViz = new YoArtifactPosition("Capture Point", yoCapturePoint, GraphicType.BALL_WITH_ROTATED_CROSS, Blue().getAwtColor(), 0.01); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), capturePointViz); YoArtifactPosition desiredCMPViz = new YoArtifactPosition("Desired CMP Position", yoDesiredCMP, GraphicType.SOLID_BALL, DarkRed().getAwtColor(), 0.008); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), desiredCMPViz); YoArtifactPosition projectedCMPViz = new YoArtifactPosition("Projected CMP Position", yoProjectedCMP, GraphicType.BALL_WITH_ROTATED_CROSS, DarkRed().getAwtColor(), 0.01); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), projectedCMPViz); YoArtifactPosition expectedCMPViz = new YoArtifactPosition("Expected Projection", yoExpectedCMP, GraphicType.BALL, LawnGreen().getAwtColor(), 0.01); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), expectedCMPViz); YoArtifactPosition finalCapturePointViz = new YoArtifactPosition("Final Capture Point", yoFinalCapturePoint, GraphicType.BALL_WITH_ROTATED_CROSS, Beige().getAwtColor(), 0.01); graphicsListRegistry.registerArtifact(getClass().getSimpleName(), finalCapturePointViz);
public ExplorationHelper(ContactableFoot contactableFoot, FootControlHelper footControlHelper, String prefix, YoVariableRegistry registry) { footholdExplorationActive = new BooleanYoVariable(prefix + "FootholdExplorationActive", registry); timeExploring = new DoubleYoVariable(prefix + "TimeExploring", registry); startTime = new DoubleYoVariable(prefix + "StartTime", registry); yoCurrentCorner = new IntegerYoVariable(prefix + "CurrentCornerExplored", registry); centerOfPressureCommand.setContactingRigidBody(contactableFoot.getRigidBody()); explorationParameters = footControlHelper.getWalkingControllerParameters().getOrCreateExplorationParameters(registry); if (explorationParameters != null) copCommandWeight = explorationParameters.getCopCommandWeight(); else copCommandWeight = null; soleFrame = footControlHelper.getContactableFoot().getSoleFrame(); partialFootholdControlModule = footControlHelper.getPartialFootholdControlModule(); YoGraphicsListRegistry graphicObjectsListRegistry = footControlHelper.getMomentumBasedController().getDynamicGraphicObjectsListRegistry(); if (graphicObjectsListRegistry != null) { yoDesiredCop = new YoFramePoint2d(prefix + "DesiredExplorationCop", ReferenceFrame.getWorldFrame(), registry); String name = prefix + "Desired Center of Pressure for Exploration"; YoArtifactPosition artifact = new YoArtifactPosition(name, yoDesiredCop.getYoX(), yoDesiredCop.getYoY(), GraphicType.BALL, Color.BLUE, 0.003); graphicObjectsListRegistry.registerArtifact(prefix + getClass().getSimpleName(), artifact); } else { yoDesiredCop = null; } }
return new YoArtifactPosition(name, (DoubleYoVariable) vars[0], (DoubleYoVariable) vars[1], YoGraphicPosition.GraphicType.values()[(int) (double) consts[1]], appearance.getColor().get(), consts[0]);
artifacts.add(new YoArtifactPosition("Capture Point For Momentum", yoCapturePoint.getYoX(), yoCapturePoint.getYoY(), GraphicType.BALL, Color.BLUE, 0.01));
plotter.addArtifact(new YoArtifactPolygon("onePointPolygon", polygon2, Color.MAGENTA, false)); plotter.addArtifact(new YoArtifactPolygon("twoPointPolygon", polygon3, Color.BLUE, true)); plotter.addArtifact(new YoArtifactPosition("pointZ", pointZ, GraphicType.BALL, Color.DARK_GRAY, 0.1)); plotter.addArtifact(new YoArtifactPosition("point4", point4, GraphicType.BALL_WITH_CROSS, Color.DARK_GRAY, 0.1)); plotter.addArtifact(new YoArtifactPosition("point5", point5, GraphicType.BALL_WITH_ROTATED_CROSS, Color.DARK_GRAY, 0.1)); plotter.addArtifact(new YoArtifactPosition("point6", point6, GraphicType.CROSS, Color.DARK_GRAY, 0.1)); plotter.addArtifact(new YoArtifactPosition("point7", point7, GraphicType.DIAMOND, Color.DARK_GRAY, 0.1)); plotter.addArtifact(new YoArtifactPosition("point8", point8, GraphicType.DIAMOND_WITH_CROSS, Color.DARK_GRAY, 0.1)); plotter.addArtifact(new YoArtifactPosition("point9", point9, GraphicType.ELLIPSOID, Color.DARK_GRAY, 0.1)); plotter.addArtifact(new YoArtifactPosition("point10", point10, GraphicType.ROTATED_CROSS, Color.DARK_GRAY, 0.1)); plotter.addArtifact(new YoArtifactPosition("point11", point11, GraphicType.SOLID_BALL, Color.DARK_GRAY, 0.1)); plotter.addArtifact(new YoArtifactPosition("point12", point12, GraphicType.SQUARE, Color.DARK_GRAY, 0.1)); plotter.addArtifact(new YoArtifactPosition("point13", point13, GraphicType.SQUARE_WITH_CROSS, Color.DARK_GRAY, 0.1));
yoGraphicsListRegistry.registerArtifact(graphicListName, capturePointViz.createArtifact()); YoArtifactPosition copViz = new YoArtifactPosition("Controller CoP", yoCenterOfPressure.getYoX(), yoCenterOfPressure.getYoY(), GraphicType.DIAMOND, Color.BLACK , 0.005); yoGraphicsListRegistry.registerArtifact(graphicListName, copViz);