/** * Create a Bag of Balls with alternating ball color going through the cycle of the colors of the rainbow. * * @param numberOfBalls int Number of balls to create. * @param sizeInMeters double Size of each ball in meters. * @param name String Name of the BagOfBalls to create. * @param parentYoVariableRegistry YoVariableRegistry to register the BagOfBalls with. * @param yoGraphicsListRegistry DynamicGraphicObjectsListRegistry to register the BagOfBalls with. * @return BagOfBalls */ public static BagOfBalls createRainbowBag(int numberOfBalls, double sizeInMeters, String name, YoVariableRegistry parentYoVariableRegistry, YoGraphicsListRegistry yoGraphicsListRegistry) { AppearanceDefinition[] rainbow = YoAppearance.getStandardRoyGBivRainbow(); ArrayList<AppearanceDefinition> appearances = new ArrayList<AppearanceDefinition>(); for (int i = 0; i < numberOfBalls; i++) { appearances.add(rainbow[i % rainbow.length]); } return new BagOfBalls(sizeInMeters, name, appearances, parentYoVariableRegistry, yoGraphicsListRegistry); }
/** * Create a Bag of Balls with alternating ball color going through the cycle of the colors of the * rainbow. * * @param numberOfBalls int Number of balls to create. * @param sizeInMeters double Size of each ball in meters. * @param name String Name of the BagOfBalls to create. * @param parentYoVariableRegistry YoVariableRegistry to register the BagOfBalls with. * @param yoGraphicsListRegistry YoGraphicsListRegistry to register the BagOfBalls * with. * @return BagOfBalls */ public static BagOfBalls createRainbowBag(int numberOfBalls, double sizeInMeters, String name, YoVariableRegistry parentYoVariableRegistry, YoGraphicsListRegistry yoGraphicsListRegistry) { AppearanceDefinition[] rainbow = YoAppearance.getStandardRoyGBivRainbow(); ArrayList<AppearanceDefinition> appearances = new ArrayList<>(); for (int i = 0; i < numberOfBalls; i++) { appearances.add(rainbow[i % rainbow.length]); } return new BagOfBalls(sizeInMeters, name, appearances, parentYoVariableRegistry, yoGraphicsListRegistry); }
private void setupTrackBallsVisualization() { comTrack = new BagOfBalls(numberOfTrackBalls, trackBallSize, "CoMTrack", new YoAppearanceRGBColor(comPointsColor, 0.0), registry, graphicsListRegistry); icpTrack = new BagOfBalls(numberOfTrackBalls, trackBallSize, "ICPTrack", new YoAppearanceRGBColor(icpPointsColor, 0.0), registry, graphicsListRegistry); cmpTrack = new BagOfBalls(numberOfTrackBalls, trackBallSize, "CMPTrack", new YoAppearanceRGBColor(cmpPointsColor, 0.0), registry, graphicsListRegistry); copTrack = new BagOfBalls(numberOfTrackBalls, trackBallSize, "CoPTrack", new YoAppearanceRGBColor(copPointsColor, 0.0), registry, graphicsListRegistry); }
private void setupCornerPointBallsVisualization() { comInitialCornerPoints = new BagOfBalls(numberOfCornerPoints, cornerPointBallSize * 1.5, "CoMInitialCornerPoint", new YoAppearanceRGBColor(comPointsColor, 0.5), GraphicType.BALL, registry, graphicsListRegistry); comFinalCornerPoints = new BagOfBalls(numberOfCornerPoints, cornerPointBallSize, "CoMFinalCornerPoint", new YoAppearanceRGBColor(comPointsColor, 0.0), GraphicType.BALL, registry, graphicsListRegistry); icpInitialCornerPoints = new BagOfBalls(numberOfCornerPoints, cornerPointBallSize * 1.5, "ICPInitialCornerPoint", new YoAppearanceRGBColor(icpPointsColor, 0.5), GraphicType.BALL, registry, graphicsListRegistry); icpFinalCornerPoints = new BagOfBalls(numberOfCornerPoints, cornerPointBallSize, "ICPFinalCornerPoint", new YoAppearanceRGBColor(icpPointsColor, 0.0), GraphicType.BALL, registry, graphicsListRegistry); copCornerPoints = new BagOfBalls(numberOfCornerPoints, cornerPointBallSize, "CoPCornerPoint", new YoAppearanceRGBColor(copPointsColor, 0.0), GraphicType.BALL, registry, graphicsListRegistry); }
/** * Create a Bag of Balls with alternating ball color going through Red, White, and Blue. * * @param numberOfBalls int Number of balls to create. * @param sizeInMeters double Size of each ball in meters. * @param name String Name of the BagOfBalls to create. * @param parentYoVariableRegistry YoVariableRegistry to register the BagOfBalls with. * @param yoGraphicsListRegistry DynamicGraphicObjectsListRegistry to register the BagOfBalls with. * @return BagOfBalls */ public static BagOfBalls createPatrioticBag(int numberOfBalls, double sizeInMeters, String name, YoVariableRegistry parentYoVariableRegistry, YoGraphicsListRegistry yoGraphicsListRegistry) { AppearanceDefinition[] redWhiteBlue = new AppearanceDefinition[] { YoAppearance.Red(), YoAppearance.White(), YoAppearance.Blue() }; ArrayList<AppearanceDefinition> appearances = new ArrayList<AppearanceDefinition>(); for (int i = 0; i < numberOfBalls; i++) { appearances.add(redWhiteBlue[i % redWhiteBlue.length]); } return new BagOfBalls(sizeInMeters, name, appearances, parentYoVariableRegistry, yoGraphicsListRegistry); }
/** * Create a Bag of Balls with alternating ball color going through Red, White, and Blue. * * @param numberOfBalls int Number of balls to create. * @param sizeInMeters double Size of each ball in meters. * @param name String Name of the BagOfBalls to create. * @param parentYoVariableRegistry YoVariableRegistry to register the BagOfBalls with. * @param yoGraphicsListRegistry YoGraphicsListRegistry to register the BagOfBalls * with. * @return BagOfBalls */ public static BagOfBalls createPatrioticBag(int numberOfBalls, double sizeInMeters, String name, YoVariableRegistry parentYoVariableRegistry, YoGraphicsListRegistry yoGraphicsListRegistry) { AppearanceDefinition[] redWhiteBlue = new AppearanceDefinition[] {YoAppearance.Red(), YoAppearance.White(), YoAppearance.Blue()}; ArrayList<AppearanceDefinition> appearances = new ArrayList<>(); for (int i = 0; i < numberOfBalls; i++) { appearances.add(redWhiteBlue[i % redWhiteBlue.length]); } return new BagOfBalls(sizeInMeters, name, appearances, parentYoVariableRegistry, yoGraphicsListRegistry); }
public TwoWaypointSwingGenerator(String namePrefix, double minSwingHeight, double maxSwingHeight, YoVariableRegistry parentRegistry, YoGraphicsListRegistry yoGraphicsListRegistry) { registry = new YoVariableRegistry(namePrefix + getClass().getSimpleName()); parentRegistry.addChild(registry); stepTime = new DoubleYoVariable(namePrefix + "StepTime", registry); timeIntoStep = new DoubleYoVariable(namePrefix + "TimeIntoStep", registry); isDone = new BooleanYoVariable(namePrefix + "IsDone", registry); trajectoryType = new EnumYoVariable<>(namePrefix + "TrajectoryType", registry, TrajectoryType.class); swingHeight = new DoubleYoVariable(namePrefix + "SwingHeight", registry); swingHeight.set(minSwingHeight); this.maxSwingHeight = new DoubleYoVariable(namePrefix + "MaxSwingHeight", registry); this.maxSwingHeight.set(maxSwingHeight); this.minSwingHeight = new DoubleYoVariable(namePrefix + "MinSwingHeight", registry); this.minSwingHeight.set(minSwingHeight); WaypointTrajectoryGenerator trajectory = new Position2dOptimizedSwingTrajectoryGenerator(namePrefix + "2d", registry, yoGraphicsListRegistry, maxTimeIterations); WaypointTrajectoryGenerator trajectoryForCustomWaypoints = new PositionOptimizedTrajectoryGenerator(namePrefix + "3d", registry, yoGraphicsListRegistry, maxTimeIterations); trajectoryMap.put(TrajectoryType.DEFAULT, trajectory); trajectoryMap.put(TrajectoryType.OBSTACLE_CLEARANCE, trajectory); trajectoryMap.put(TrajectoryType.CUSTOM, trajectoryForCustomWaypoints); for (int i = 0; i < numberWaypoints; i++) waypointPositions.add(new FramePoint()); if (yoGraphicsListRegistry != null) waypointViz = new BagOfBalls(numberWaypoints, 0.02, namePrefix + "Waypoints", YoAppearance.White(), registry, yoGraphicsListRegistry); else waypointViz = null; }
trajectoryViz = new BagOfBalls(markers, 0.01, namePrefix + "Trajectory", YoAppearance.Black(), registry, graphicsListRegistry); else trajectoryViz = null;
trajectoryBagOfBalls = new BagOfBalls(numberOfVisualizationMarkers, 0.01, namePrefix + "TrajectoryBagOfBalls", registry, yoGraphicsListRegistry); fixedPointBagOfBalls = new BagOfBalls(6, 0.02, namePrefix + "WaypointBagOfBalls", registry, yoGraphicsListRegistry);
trajectoryViz = new BagOfBalls(markers, 0.01, namePrefix + "Trajectory", YoAppearance.Black(), registry, graphicsListRegistry); else trajectoryViz = null;
bagOfBalls = new BagOfBalls(maxNumberOfBallsInBag, ballSize, registry, yoGraphicsListRegistry);
public PushRecoveryTrajectoryGenerator(String namePrefix, ReferenceFrame referenceFrame, DoubleProvider swingTimeProvider, DoubleProvider swingTimeRemainingProvider, PositionProvider initialPositionProvider, VectorProvider initialVelocityProvider, PositionProvider finalPositionProvider, YoVariableRegistry parentRegistry, YoGraphicsListRegistry yoGraphicsListRegistry, PositionTrajectoryGenerator nominalTrajectoryGenerator) { registry = new YoVariableRegistry(namePrefix + namePostFix); parentRegistry.addChild(registry); this.swingTimeRemainingProvider = swingTimeRemainingProvider; this.swingTimeProvider = swingTimeProvider; positionSources[0] = initialPositionProvider; positionSources[1] = finalPositionProvider; velocitySources[0] = initialVelocityProvider; xPolynomial = new YoPolynomial(namePrefix + "PolynomialX", 6, registry); yPolynomial = new YoPolynomial(namePrefix + "PolynomialY", 6, registry); swingTime = new DoubleYoVariable(namePrefix + "SwingTime", registry); swingTime.set(swingTimeProvider.getValue()); timeIntoStep = new DoubleYoVariable(namePrefix + "TimeIntoStep", registry); desiredPosition = new YoFramePoint(namePrefix + "DesiredPosition", referenceFrame, registry); desiredVelocity = new YoFrameVector(namePrefix + "DesiredVelocity", referenceFrame, registry); desiredAcceleration = new YoFrameVector(namePrefix + "DesiredAcceleration", referenceFrame, registry); this.visualize = new BooleanYoVariable(namePrefix + "Visualize", registry); this.visualize.set(VISUALIZE); this.nominalTrajectoryGenerator = nominalTrajectoryGenerator; this.bagOfBalls = new BagOfBalls(numberOfBallsInBag, 0.01, namePrefix + "SwingTrajectoryBagOfBalls", registry, yoGraphicsListRegistry); }
yoGraphicsListRegistry.registerYoGraphic("Plane", planePointViz); pointListBalls = new BagOfBalls(1000, 0.01, registry, yoGraphicsListRegistry); footstepVisualizer.startVisualizer();
yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList); bagOfBalls = new BagOfBalls(numberOfBalls, 0.01, yoGraphicsList.getLabel(), registry, yoGraphicsListRegistry);
yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList); bagOfBalls = new BagOfBalls(numberOfBalls, 0.01, yoGraphicsList.getLabel(), registry, yoGraphicsListRegistry);
yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList); bagOfBalls = new BagOfBalls(numberOfBalls, 0.01, yoGraphicsList.getLabel(), registry, yoGraphicsListRegistry);
BagOfBalls bagOfBalls = new BagOfBalls(points.size(), ballSize, registry, yoGraphicsListRegistry); ReferenceFrame worldFrame = ReferenceFrame.getWorldFrame(); YoFramePoint3D queryPoint = new YoFramePoint3D("queryPoint", worldFrame, registry);
this.footswitchCOPBagOfBalls = new BagOfBalls(1, copVisualizerSize, namePrefix + "FootswitchCOP", registry, yoGraphicsListRegistry);
yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList); bagOfBalls = new BagOfBalls(numberOfBalls, 0.01, yoGraphicsList.getLabel(), registry, yoGraphicsListRegistry);
yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList); bagOfBalls = new BagOfBalls(numberOfBalls, 0.01, yoGraphicsList.getLabel(), registry, yoGraphicsListRegistry);