Question

I have an NXT robot. I want to map a room without any obstacles, and "give" this map to the robot. I have this sample code:

// Create a rudimentary map:
Line[] lines = new Line[3];
lines[0] = new Line(75f, 100f, 100f, 100f);
lines[1] = new Line(100, 100, 87, 75);
lines[2] = new Line(87, 75, 75, 100);
lejos.geom.Rectangle bounds = new Rectangle(-50, -50, 250, 250); //(x,y,height,width)
LineMap myMap = new LineMap(lines, bounds); //create map

In this code, the lines create a triangle, that suppose to be an obstacle, and the bounds is the room walls.

The problem is that LineMap get lines and bounds, but the bounds is rectangle. My type of room is without obstacles(so I don't need lines, or I can build a fake obstacle), and with 5 walls (Pentagon).

Does anyone know if there is any method that takes bounds of any kind and not just Rectangles? If I can give the robot the lines as walls and not as obstacles it would be great.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top