Setup

In [1]:
# disabling contracts for speed
import contracts
contracts.disable_all()
In [2]:
import duckietown_world as dw
# reducing the verbosity to critical
# dw.logger.setLevel(50)
from duckietown_world.svg_drawing.ipython_utils import ipython_draw_svg, ipython_draw_html
INFO:dt-world:duckietown-world 1.0.15

Map conventions for slots

It is possible to place things in "slots" in each tile.

By convention some of these slots are actually outside the tile.

In [3]:
tile = dw.Tile('asphalt', True)
In [4]:
print(dw.get_object_tree(tile, attributes=True, spatial_relations=True))
Tile

 kind: asphalt
 drivable: true
 

└ slots ┐ PlacedObject
        │ 
        │ ├ 1 ┐ SignSlot
        │ │   └───────────
        │ ├ 0 ┐ SignSlot
        │ │   └───────────
        │ ├ 3 ┐ SignSlot
        │ │   └───────────
        │ ├ 2 ┐ SignSlot
        │ │   └───────────
        │ ├ 5 ┐ SignSlot
        │ │   └───────────
        │ ├ 4 ┐ SignSlot
        │ │   └───────────
        │ ├ 7 ┐ SignSlot
        │ │   └───────────
        │ └ 6 ┐ SignSlot
        │     └───────────
        │ 
        │ - from "." to "0"  SE2Transform([-0.3, -0.45],0.0)
        │ - from "." to "1"  SE2Transform([-0.45, -0.3],0.0)
        │ - from "." to "2"  SE2Transform([-0.55, -0.3],0.0)
        │ - from "." to "3"  SE2Transform([-0.7, -0.45],0.0)
        │ - from "." to "4"  SE2Transform([-0.7, -0.55],0.0)
        │ - from "." to "5"  SE2Transform([-0.55, -0.7],0.0)
        │ - from "." to "6"  SE2Transform([-0.45, -0.7],0.0)
        │ - from "." to "7"  SE2Transform([-0.3, -0.55],0.0)
        └─────────────────────────────────────────────────────

- from "." to "slots"  SE2Transform([0.0, 0.0],0.0) 
In [5]:
B=0.9
area = dw.RectangularArea([-B,-B], [B,B])
ipython_draw_html(tile, area=area);
INFO:dt-world:area: RectangularArea(pmin=[-0.9 -0.9],pmax=[ 0.9  0.9])
INFO:dt-world:Written SVG to out/ipython_draw_html/4400060752/drawing.svg
INFO:dt-world:Written HTML to out/ipython_draw_html/4400060752/drawing.html