private CombinedTerrainObject3D setUpGround(String name) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); combinedTerrainObject.addBox(-10.0, -10.0, 10.0, 10.0, -0.05, 0.0, YoAppearance.Gray()); combinedTerrainObject.addBox(FORWARD_OFFSET,HATCH_OPENING_WIDTH/2, FORWARD_OFFSET+HATCH_THICKNESS,(HATCH_OPENING_WIDTH/2)+0.5f, 0, HATCH_UPENING_HEIGHT+HATCH_UPENING_HEIGHT_OFF_GROUND, YoAppearance.DarkGray()); combinedTerrainObject.addBox(FORWARD_OFFSET,-HATCH_OPENING_WIDTH/2, FORWARD_OFFSET+HATCH_THICKNESS,-(HATCH_OPENING_WIDTH/2)-0.5f, 0, HATCH_UPENING_HEIGHT+HATCH_UPENING_HEIGHT_OFF_GROUND, YoAppearance.DarkGray()); combinedTerrainObject.addBox(FORWARD_OFFSET,(HATCH_OPENING_WIDTH/2)+0.5f, FORWARD_OFFSET+HATCH_THICKNESS,-(HATCH_OPENING_WIDTH/2)-0.5f, 0, HATCH_UPENING_HEIGHT_OFF_GROUND, YoAppearance.DarkGray()); combinedTerrainObject.addBox(FORWARD_OFFSET,(HATCH_OPENING_WIDTH/2)+0.5f, FORWARD_OFFSET+HATCH_THICKNESS,-(HATCH_OPENING_WIDTH/2)-0.5f, HATCH_UPENING_HEIGHT+ HATCH_UPENING_HEIGHT_OFF_GROUND, HATCH_UPENING_HEIGHT+ HATCH_UPENING_HEIGHT_OFF_GROUND+HATCH_THICKNESS, YoAppearance.DarkGray()); // combinedTerrainObject.addBox(2.0, -0.05, 3.0, 0.05, 2.0, YoAppearance.Beige()); // combinedTerrainObject.addBox(3.0 + ContactableDoorRobot.DEFAULT_DOOR_DIMENSIONS.getX(), -0.05, 4.0 + ContactableDoorRobot.DEFAULT_DOOR_DIMENSIONS.getX(), 0.05, 2.0, YoAppearance.Beige()); return combinedTerrainObject; }
private CombinedTerrainObject3D setUpGround(String name) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); combinedTerrainObject.addBox(-5.0, -30.0, 5.0, 5.0, -0.05, 0.0, YoAppearance.DarkGray()); return combinedTerrainObject; }
private CombinedTerrainObject3D setUpGround(String name) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); combinedTerrainObject.addBox(-10.0, -10.0, 10.0, 10.0, -0.05, 0.0, YoAppearance.DarkGray()); return combinedTerrainObject; }
private void setupGround() { double robotStartingPointX = 1.0; BoxTerrainObject groundTerrainObject = new BoxTerrainObject(-robotStartingPointX, -ROBOT_AREA_WIDTH_IN_METERS / 2, ROBOT_AREA_LENGTH_IN_METERS - robotStartingPointX, ROBOT_AREA_WIDTH_IN_METERS / 2, -0.5, 0.0, YoAppearance.DarkGray()); combinedTerrainObject3D.addTerrainObject(groundTerrainObject); }
private static void addRock(CombinedTerrainObject3D combinedTerrainObject, Vector3d normal, double centroidHeight, double[][] vertices) { AppearanceDefinition color = YoAppearance.DarkGray(); ArrayList<Point2d> vertexPoints = new ArrayList<Point2d>(); for (double[] point : vertices) { Point2d point2d = new Point2d(point); vertexPoints.add(point2d); } ConvexPolygon2d convexPolygon = new ConvexPolygon2d(vertexPoints); RotatableConvexPolygonTerrainObject rock = new RotatableConvexPolygonTerrainObject(normal, convexPolygon, centroidHeight, color); combinedTerrainObject.addTerrainObject(rock); }
private static void addRock3D(CombinedTerrainObject3D combinedTerrainObject, Vector3d normal, double centroidHeight, double[][] vertices) { AppearanceDefinition color = YoAppearance.DarkGray(); ArrayList<Point2d> vertexPoints = new ArrayList<Point2d>(); for (double[] point : vertices) { Point2d point2d = new Point2d(point); vertexPoints.add(point2d); } ConvexPolygon2d convexPolygon = new ConvexPolygon2d(vertexPoints); RotatableConvexPolygonTerrainObject rock = new RotatableConvexPolygonTerrainObject(normal, convexPolygon, centroidHeight, color); combinedTerrainObject.addTerrainObject(rock); }
private CombinedTerrainObject3D createSingleBoxGroundProfile() { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D("stairs"); AppearanceDefinition color = YoAppearance.DarkGray(); combinedTerrainObject.addBox(0.0, 0.0, 1.0, 1.0, 1.0, color); combinedTerrainObject.addBox(-100.0, -100.0, 100.0, 100.0, 0.001, color); return combinedTerrainObject; }
private CombinedTerrainObject3D setUpPath5NarrowDoor(String name) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); AppearanceDefinition color = YoAppearance.DarkGray(); // angled Door // door1 setUpWall(combinedTerrainObject, new double[] {0.769f, -9.293f}, 0.973f, 0.157f, 2.5f, -115.0f, color); // door2 setUpWall(combinedTerrainObject, new double[] {-.642f, -8.635f}, 0.973f, 0.157f, 2.54f, -115.0f, color); // box2 setUpWall(combinedTerrainObject, new double[] {-0.485f, -6.573f}, 0.5f, 0.5f, 1.0f, -45, color); // box1 setUpWall(combinedTerrainObject, new double[] {0.515f, -4.972f}, 0.5f, 0.5f, 1.0f, -110.0f, color); return combinedTerrainObject; }
private CombinedTerrainObject3D setUpPath5NarrowDoor(String name) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); AppearanceDefinition color = YoAppearance.DarkGray(); // angled Door // door1 setUpWall(combinedTerrainObject, new double[] {0.769f, -9.293f}, 0.973f, 0.157f, 2.5f, -115.0f, color); // door2 setUpWall(combinedTerrainObject, new double[] {-.642f, -8.635f}, 0.973f, 0.157f, 2.54f, -115.0f, color); // box2 setUpWall(combinedTerrainObject, new double[] {-0.485f, -6.573f}, 0.5f, 0.5f, 1.0f, -45, color); // box1 setUpWall(combinedTerrainObject, new double[] {0.515f, -4.972f}, 0.5f, 0.5f, 1.0f, -110.0f, color); return combinedTerrainObject; }
private CombinedTerrainObject3D setUpPallet(String name, Point2D location) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); AppearanceDefinition appearance = YoAppearance.DarkGray(); combinedTerrainObject.addBox(location.getX() - palletLength / 2, location.getY() - palletWidth / 2, location.getX() + palletLength / 2, location.getY() + palletWidth / 2, palletHeight, appearance); return combinedTerrainObject; }
private CombinedTerrainObject3D setUpGround(String name) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); combinedTerrainObject.addBox(-5.0, -30.0, 5.0, 5.0, -0.05, 0.0, YoAppearance.DarkGray()); combinedTerrainObject.addBox(-1.2192, -0.025, 0, 0.025, WALL_HEIGHT, YoAppearance.Beige()); combinedTerrainObject.addBox(0.0 + ContactableDoorRobot.DEFAULT_DOOR_DIMENSIONS.getX(), -0.025, 1.2192 + ContactableDoorRobot.DEFAULT_DOOR_DIMENSIONS.getX(), 0.025, WALL_HEIGHT, YoAppearance.Beige()); return combinedTerrainObject; }
private static void addLimboBar(CombinedTerrainObject3D combinedTerrainObject) { double height = 1; double width = 1.5; AppearanceDefinition color = YoAppearance.DarkGray(); setUpWall(combinedTerrainObject, new double[] {1, width / 2}, 0.125, 0.125, height, 0, color); setUpWall(combinedTerrainObject, new double[] {1, -width / 2}, 0.125, 0.125, height, 0, color); combinedTerrainObject.getLinkGraphics().translate(0, width / 2, height); combinedTerrainObject.getLinkGraphics().addCube(0.125, width, 0.125, color); combinedTerrainObject.getLinkGraphics().translate(0, -width / 2, -height); }
public static CombinedTerrainObject3D setUpGround(String name) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); RigidBodyTransform location = new RigidBodyTransform(); location.setTranslation(new Vector3D(0, 0, -0.5)); RotatableBoxTerrainObject newBox2 = new RotatableBoxTerrainObject(new Box3D(location, 45, 45, 1), YoAppearance.DarkGray()); combinedTerrainObject.addTerrainObject(newBox2); return combinedTerrainObject; }
private CombinedTerrainObject3D setUpGround(String name) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); combinedTerrainObject.addBox(-10.0, -10.0, 10.0, 10.0, -0.05, 0.0, YoAppearance.DarkGray()); combinedTerrainObject.addBox(2.0, -0.05, 3.0, 0.05, 2.0, YoAppearance.Beige()); combinedTerrainObject.addBox(3.0 + ContactableDoorRobot.DEFAULT_DOOR_DIMENSIONS.getX(), -0.05, 4.0 + ContactableDoorRobot.DEFAULT_DOOR_DIMENSIONS.getX(), 0.05, 2.0, YoAppearance.Beige()); return combinedTerrainObject; }
private static void addLimboBar(CombinedTerrainObject3D combinedTerrainObject) { double height = 1; double width = 1.5; AppearanceDefinition color = YoAppearance.DarkGray(); setUpWall(combinedTerrainObject, new double[] {1, width / 2}, 0.125, 0.125, height, 0, color); setUpWall(combinedTerrainObject, new double[] {1, -width / 2}, 0.125, 0.125, height, 0, color); combinedTerrainObject.getLinkGraphics().translate(0, width / 2, height); combinedTerrainObject.getLinkGraphics().addCube(0.125, width, 0.125, color); combinedTerrainObject.getLinkGraphics().translate(0, -width / 2, -height); }
private CombinedTerrainObject3D createOddTerrainProfile() { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D("stairs"); AppearanceDefinition color = YoAppearance.DarkGray(); combinedTerrainObject.addBox(-100.0, -100.0, 100.0, 100.0, 0.001, color); combinedTerrainObject.addBox(0.0, 0.0, 0.5, 0.5, 0.5, color); combinedTerrainObject.addBox(0.57, 0.00, 1.0, 0.1, 0.5, color); combinedTerrainObject.addBox(0.57, 0.15, 1.0, 0.2, 0.5, color); combinedTerrainObject.addBox(0.57, 0.25, 1.0, 0.3, 0.5, color); combinedTerrainObject.addBox(0.57, 0.35, 1.0, 0.4, 0.5, color); combinedTerrainObject.addBox(0.57, 0.45, 1.0, 0.5, 0.5, color); combinedTerrainObject.addRamp(0, -0.5, 0.8, 0.0, 0.5, color); combinedTerrainObject.addBox(.8, -0.5, 1.0, 0.0, 0.5, color); return combinedTerrainObject; }
public CarEgressEnvironment() { RigidBodyTransform locationStep = new RigidBodyTransform(); locationStep.setTranslation(new Vector3d(edgeOfStepX + 0.5 * stepDimensions.getX(), edgeOfStepY + 0.5 * stepDimensions.getY(), stepDimensions.getZ() / 2.0)); Box3d stepBox = new Box3d(locationStep, stepDimensions.getX(), stepDimensions.getY(), stepDimensions.getZ()); terrain.addTerrainObject(new RotatableCinderBlockTerrainObject(stepBox, YoAppearance.DarkGray())); RigidBodyTransform locationCar = new RigidBodyTransform(); locationCar.setTranslation(new Vector3d(edgeOfStepX + 0.5 * stepDimensions.getX(), edgeOfStepY + stepDimensions.getY() + 0.5 * carDimensions.getY(), carDimensions.getZ() / 2.0)); Box3d carBox = new Box3d(locationCar, carDimensions.getX(), carDimensions.getY(), carDimensions.getZ()); terrain.addTerrainObject(new RotatableCinderBlockTerrainObject(carBox, YoAppearance.DarkGray())); terrain.addTerrainObject(setUpGround("ground")); RigidBodyTransform polarisTransform = new RigidBodyTransform(); polarisTransform.setTranslation(polarisPosition); robots.add(new PolarisRobot("polaris", polarisTransform)); }
public CarEgressEnvironment() { RigidBodyTransform locationStep = new RigidBodyTransform(); locationStep.setTranslation(new Vector3D(edgeOfStepX + 0.5 * stepDimensions.getX(), edgeOfStepY + 0.5 * stepDimensions.getY(), stepDimensions.getZ() / 2.0)); Box3D stepBox = new Box3D(locationStep, stepDimensions.getX(), stepDimensions.getY(), stepDimensions.getZ()); terrain.addTerrainObject(new RotatableCinderBlockTerrainObject(stepBox, YoAppearance.DarkGray())); RigidBodyTransform locationCar = new RigidBodyTransform(); locationCar.setTranslation(new Vector3D(edgeOfStepX + 0.5 * stepDimensions.getX(), edgeOfStepY + stepDimensions.getY() + 0.5 * carDimensions.getY(), carDimensions.getZ() / 2.0)); Box3D carBox = new Box3D(locationCar, carDimensions.getX(), carDimensions.getY(), carDimensions.getZ()); terrain.addTerrainObject(new RotatableCinderBlockTerrainObject(carBox, YoAppearance.DarkGray())); terrain.addTerrainObject(setUpGround("ground")); RigidBodyTransform polarisTransform = new RigidBodyTransform(); polarisTransform.setTranslation(polarisPosition); robots.add(new PolarisRobot("polaris", polarisTransform)); }
public static CombinedTerrainObject3D setUpGround(String name) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); // URL fileURL = DRCDemo01NavigationEnvironment.class.getClassLoader().getResource("Textures/ground2.png"); YoAppearanceTexture texture = new YoAppearanceTexture("Textures/ground2.png"); RigidBodyTransform location = new RigidBodyTransform(); 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 static CombinedTerrainObject3D setUpGround(String name) { CombinedTerrainObject3D combinedTerrainObject = new CombinedTerrainObject3D(name); // URL fileURL = DRCDemo01NavigationEnvironment.class.getClassLoader().getResource("Textures/ground2.png"); YoAppearanceTexture texture = new YoAppearanceTexture("Textures/ground2.png"); RigidBodyTransform location = new RigidBodyTransform(); 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; }