World files are where one models an environment in the real world for use in the simulator. It allows specification of dimensions and obstacles for the robot to interact with
They have a very simple format, only accepting two types of statements:
- dimensions(width,height) sets the dimensions of the world (the outer boundaries do not wrap, since I have yet to find a place in the universe that has wrapping boundaries). The first line in a world file should always be a call to the dimensions procedure, and it should be the only call
- wall((startx, starty), (endx, endy)) creates a wall in the world (a line segment as viewed from above) through which the robot nor its sonars can pass
- initialRobotLoc(x,y) will place the robot when teh simulator is originally opened in a different spot than the default (exact middle of world)
Example world file:
dimensions(10,10)
wall((4,0),(4,4))
wall((6,6),(7,7))
wall((2,2),(8,2))
This world will look like this: