This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: imaqine, 99jonathan, roger

Active User
Posts: 121
Joined: Thu Feb 10, 2011 5:47 pm
Location: London, Earth.


Postby Rickz2020 » Sun Feb 19, 2012 10:04 pm

Hi guys,

Just reading through the mapping classes and have a question.

In classes such as there is mentions of "lines".

Code: Select all

                // 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);
      LineMap myMap = new LineMap(lines, bounds);

These lines, do they represent obstacles? At first I thought they may be the lines dividing Rectangle into smaller squares to form a gridmap, but when I look at the values shown above, it just doesn't seem right.

If they do not represent obstacles, then what?

Posts: 381
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Re: LineMap

Postby roger » Wed Feb 22, 2012 8:32 pm

From the Javadocs for the class:
"A map of a room or other closed environment, represented by line segments"

Yes, the lines represent obstacles as well as the walls of the room. The ShortestPathFinder finds a path that does not cross any lines.

Return to “NXJ Software”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest