private CombinedTerrainObject3D setUpGround(String name) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); combinedTerrainObject.addBox(-0.18, wallMinY, 0.2, wallMaxY, -0.05, 0.0, YoAppearance.Gold()); combinedTerrainObject.addBox(-0.5, wallMinY - 1.5, 0.5, wallMinY, -0.05, 0.0, YoAppearance.Gold()); combinedTerrainObject.addBox(-0.5, wallMaxY, 0.5, wallMaxY + 1.5, -0.05, 0.0, YoAppearance.Gold()); // URL fileURL = DRCDemo01NavigationEnvironment.class.getClassLoader().getResource("Textures/ground2.png"); // YoAppearanceTexture texture = new YoAppearanceTexture("Textures/ground2.png"); // // Transform3D location = new Transform3D(); // location.setTranslation(new Vector3d(0, 0, -0.5)); // // RotatableBoxTerrainObject newBox = new RotatableBoxTerrainObject(new Box3d(location, 45, 45, 1), texture); // combinedTerrainObject.addTerrainObject(newBox); // RotatableBoxTerrainObject newBox2 = new RotatableBoxTerrainObject(new Box3d(location, 200, 200, 0.75), YoAppearance.DarkGray()); // combinedTerrainObject.addTerrainObject(newBox2); return combinedTerrainObject; }
private CombinedTerrainObject3D setupGround() { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D("Ground"); combinedTerrainObject.addBox(-0.2, -0.5, 0.2, 0.5, -0.05, 0.0, YoAppearance.Gold()); return combinedTerrainObject; }
public JointAxisVisualizer(RigidBodyBasics rootBody, YoGraphicsListRegistry yoGraphicsListRegistry, double length) { YoGraphicsList yoGraphicsList = new YoGraphicsList(name); List<JointBasics> jointStack = new ArrayList<JointBasics>(rootBody.getChildrenJoints()); while (!jointStack.isEmpty()) { JointBasics joint = jointStack.get(0); if(joint instanceof OneDoFJointBasics) { FrameVector3DReadOnly jAxis=((OneDoFJointBasics)joint).getJointAxis(); ReferenceFrame referenceFrame = GeometryTools.constructReferenceFrameFromPointAndZAxis(joint.getName()+"JointAxis", new FramePoint3D(jAxis.getReferenceFrame()), new FrameVector3D(jAxis.getReferenceFrame(),jAxis)); YoGraphicReferenceFrame yoGraphicReferenceFrame = new YoGraphicReferenceFrame(referenceFrame , registry, false, length, YoAppearance.Gold()); yoGraphicsList.add(yoGraphicReferenceFrame); yoGraphicReferenceFrames.add(yoGraphicReferenceFrame); } List<? extends JointBasics> childrenJoints = joint.getSuccessor().getChildrenJoints(); jointStack.addAll(childrenJoints); jointStack.remove(joint); } yoGraphicsListRegistry.registerYoGraphicsList(yoGraphicsList); }
private ImmutablePair<CombinedTerrainObject3D, Double> createRandomBlocks() { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D("RandomBlocks"); Random random = new Random(1776L); int numberOfBoxes = 200; double xMin = -0.2, xMax = 5.0; double yMin = -1.0, yMax = 1.0; double maxLength = 0.4; double maxHeight = 0.06; combinedTerrainObject.addBox(xMin - 2.0, yMin-maxLength, xMax + 2.0, yMax + maxLength, -0.01, 0.0, YoAppearance.Gold()); for (int i=0; i<numberOfBoxes; i++) { double xStart = RandomNumbers.nextDouble(random, xMin, xMax); double yStart = RandomNumbers.nextDouble(random, yMin, yMax); double xEnd = xStart + RandomNumbers.nextDouble(random, maxLength*0.1, maxLength); double yEnd = yStart + RandomNumbers.nextDouble(random, maxLength*0.1, maxLength); double zStart = 0.0; double zEnd = zStart + RandomNumbers.nextDouble(random, maxHeight*0.1, maxHeight); combinedTerrainObject.addBox(xStart, yStart, xEnd, yEnd, zStart, zEnd, YoAppearance.Green()); } return new ImmutablePair<CombinedTerrainObject3D, Double>(combinedTerrainObject, xMax); }
private Link exampleMeshDataShape() { Link ret = new Link("exampleArcTorusShape"); Graphics3DObject linkGraphics = new Graphics3DObject(); // Mesh Data linkGraphics.translate(OFFSET, 0.0, 0.0); linkGraphics.addCoordinateSystem(COORD_LENGTH); MeshDataHolder meshData = MeshDataGenerator.Wedge(WEDGE_X, WEDGE_Y, WEDGE_Z); AppearanceDefinition meshAppearance = YoAppearance.Gold(); linkGraphics.addMeshData(meshData, meshAppearance); ret.setLinkGraphics(linkGraphics); return ret; }
private CombinedTerrainObject3D setupHandHolds(String name) { double height = 0.9; double radius = 0.1; CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); AppearanceDefinition appearance = YoAppearance.Gold(); appearance.setTransparency(0.25); double xCenter = 0.5; double yCenter = 0.4; RigidBodyTransform location = new RigidBodyTransform(); location.setTranslation(new Vector3D(xCenter, -yCenter, height/2.0)); combinedTerrainObject.addCylinder(location, height, radius, appearance); location = new RigidBodyTransform(); location.setTranslation(new Vector3D(xCenter, yCenter, height/2.0)); combinedTerrainObject.addCylinder(location, height, radius, appearance); return combinedTerrainObject; }
rightRejectedFootstep.setConvexPolygon2d(rightFootInSoleFrame); leftFootstepStartViz = new YoGraphicPolygon("leftFootstepStartViz", leftFootstepStart, "leftFootstepStartPose", "", registry, 1.0, YoAppearance.Gold()); rightFootstepStartViz = new YoGraphicPolygon("rightFootstepStartViz", rightFootstepStart, "rightFootstepStartPose", "", registry, 1.0, YoAppearance.Gold()); leftFootstepGoalViz = new YoGraphicPolygon("leftFootstepGoalViz", leftFootstepGoal, "leftFootstepGoalPose", "", registry, 1.0, YoAppearance.Chocolate()); rightFootstepGoalViz = new YoGraphicPolygon("rightFootstepGoalViz", rightFootstepGoal, "rightFootstepGoalPose", "", registry, 1.0, YoAppearance.Chocolate());
linkGraphics.addCoordinateSystem(COORD_LENGTH); MeshDataHolder meshData = MeshDataGenerator.Wedge(WEDGE_X, WEDGE_Y, WEDGE_Z); AppearanceDefinition meshAppearance = YoAppearance.Gold(); linkGraphics.addMeshData(meshData, meshAppearance);
YoGraphicPosition pointOnBViz = new YoGraphicPosition("pointOnB", "_" + i, robot.getRobotsYoVariableRegistry(), 0.03, YoAppearance.Gold());
0.023, YoAppearance.Gold()); final YoGraphicPosition initialPositionViz = new YoGraphicPosition(namePrefix + "InitialPosition", yoInitialPositionWorld, 0.02, YoAppearance.BlueViolet());
polygonSnapperVisualizer.addPlanarRegionsList(planarRegionsList, YoAppearance.Gold(), YoAppearance.Purple(), YoAppearance.Brown(), YoAppearance.Blue(), YoAppearance.Chartreuse());
link.addEllipsoidFromMassProperties(YoAppearance.Gold()); link.addEllipsoidFromMassProperties2(YoAppearance.Green());
YoAppearance.Blue()); final YoGraphicPosition currentAdjustedPositionViz = new YoGraphicPosition(namePrefix + "CurrentAdjustedSteeringPosition", yoCurrentAdjustedPositionWorld, 0.023, YoAppearance.Gold()); final YoGraphicPosition initialPositionViz = new YoGraphicPosition(namePrefix + "InitialSteeringPosition", yoInitialPositionWorld, 0.02, YoAppearance.BlueViolet());
yoGraphicsListRegistry.registerYoGraphic("CoMHeightTrajectoryGenerator", pointSNextMaxViz); YoGraphicPosition desiredCoMPositionViz = new YoGraphicPosition("desiredCoMPosition", desiredCoMPosition, 1.1 * pointSize, YoAppearance.Gold()); yoGraphicsListRegistry.registerYoGraphic("CoMHeightTrajectoryGenerator", desiredCoMPositionViz);