Skip to content

mongodb_server

Structure

The helloric database is MongoDB database containing collections maps and tours.

Maps

Each document in this collection represents an individual map (primary key is name) with the following structure:

erDiagram

    MAP {
        string description
        string name
        int[3] origin
        float resolution
    }

    WALL {
        string name
        string type
    }

    AREA {
        string name
        string type
        string area_type
        int[3] color
    }

    MARKER {
        string name
        float radius
        int[3] color
    }

    DATA {
        float[3] size
    }

    POSE {
        float[3] position
        float[4] orientation
    }

    MAP ||--o{ WALL : contains_list_of
    MAP ||--o{ AREA : contains_list_of
    MAP ||--o{ MARKER : contains_list_of

    WALL ||--|| DATA : has
    AREA ||--|| DATA : has
    DATA ||--|| POSE : has
    MARKER ||--|| POSE : has

Tours

Each document in this collection represents an individual tour (primary key is tour_name) with the following structure:

erDiagram
    TOUR {
        string tour_name
        string map_name
    }

    STEP {
        uint16 index
        string desctribtion
        string destination
        string dialogue
    }

    TOUR ||--o{ STEP : contains_list_of

Start and test

To start the MongoDB server, simply open this repository in a Docker container (e.g., using VS Code).

Then go into the mongodb_server directory:

cd mongodb_server

In test.py, you’ll find two helper methods: - One to view the current documents in the database. - Another to clear (drop) the database.

To use them:

  1. Open the main() function in test.py.

  2. Uncomment the method you want to run.

  3. Execute the script inside the Docker container:

python3 test.py

Load maps inside the database

You can load maps using mongodb server as package and running 'mapdesc_persistence' node.

But also you can use the load_maps.py script in this repository to load maps into the database from yaml files:

  1. Store you yaml files in the maps folder

  2. In file load_maps.py change name of the yaml file (code line 117)

  3. Run the script inside the container:

python3 load_maps.py