# EyeSim - World Format

A robot environment can be specified using the "world" file format (also used by "Pioneer Saphira").

### Basics

The environment is specified as an ASCII text file, which may contain comments starting with a semicolon ";" till the end of a line. First, the total world size has to be specified in mm:

Example:

    width 4680
    height 3240

Wall segments are specified as 2D lines [x1,y1, x2,y2], so just 4 integers specify each line:

Example:

    ;rectangle
    0 0 0 1440
    0 0 2880 0
    0 1440 2880 1440
    2880 0 2880 1440

### Change Orientation

Through an implicit stack, local poses (position & orientation) can be set. This allows an easier descrition of an object in object coordinates, which may be offset and rotated in world coordinates. To do so, the definition of an object (a collection of line segments) is being enclosed within a push and a pop statement. Push and pop may be nested; push has parameters [x,y, phi], pop has no parameters.

Example:

    push 100 100 45
    0 0 200 0
    0 0 200 200
    pop

### Robot Starting Position

The starting position and orientation of a robot may be specified as [x,y, phi].

Example:

    position 180 1260 -90