Skip to content

Commit

Permalink
Remove 3D mesh and occ. grid generation
Browse files Browse the repository at this point in the history
  • Loading branch information
argenos committed Nov 7, 2024
1 parent e71dda7 commit 08ce86d
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 362 deletions.
12 changes: 0 additions & 12 deletions config.yaml

This file was deleted.

17 changes: 0 additions & 17 deletions config/setup.cfg

This file was deleted.

48 changes: 1 addition & 47 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Important *required* options of the command:
Install all the requirements:

```shell
sudo apt-get install blender python3-pip python3-venv -y
sudo apt-get install python3-pip python3-venv -y
```

First, create a virtual environment and activate it:
Expand All @@ -49,11 +49,6 @@ First, create a virtual environment and activate it:
python -m venv .venv
source .venv/bin/activate
```
For Blender to regonize the virtual environment, add it to your `PYTHONPATH`:

```shell
export PYTHONPATH=<Path to .venv directory>/lib/python3.11/site-packages
```

From the root directory of the repo, install the python packages by running:

Expand All @@ -79,47 +74,6 @@ floorplan-variation -> floorplan-v2floorplan-dsl[1.1.0] Generate variat

## Getting started

### Generating 3D meshes and occupancy grid maps

> [!WARNING]
> The generation of 3D meshes and occupancy grid maps is currently being moved to the [scenery_builder](https://github.com/secorolab/scenery_builder) repository. The instructions below may not work and/or may be outdated.
This tool is currently in active development. To use the tool you can execute the following command:

```
blender --background --python src/exsce_floorplan/exsce_floorplan.py --python-use-system-env -- <model_path>
```

Optionally, you can remove the `--background` flag to see directly the result opened in Blender.

***Note**: The `--` before `<model_path>` is intentional and important.*

#### Example

![3D asset generated from the environment description](images/hospital_no_brackground.png)

An example model for a building is available [here](../models/examples/hospital.floorplan). To generate the 3D mesh and occupancy grid:


```
blender --background --python src/exsce_floorplan/exsce_floorplan.py --python-use-system-env -- models/examples/hospital.floorplan
```

That should generate the following files:

```
.
├── map
│   ├── hospital.pgm
│   └── hospital.yaml
└── mesh
└── hospital.stl
```

The output path for the generated models in configurable (see [confg/setup.cfg](../config/setup.cfg) and note they are relative paths from where you're calling the command).

The `.stl` mesh can now be used to specify the Gazebo models and included in a Gazebo world. See, for example, [this tutorial](https://classic.gazebosim.org/tutorials?tut=import_mesh&cat=build_robot).

### Generating the composable model representation

To generate the JSON-LD representation of the FloorPlan model, simply use textX's language generators:
Expand Down
12 changes: 0 additions & 12 deletions docs/Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,3 @@ Two entryways and one window are modelled, each with a unique name. In the case
```

At the very end of the model the default values for all the spaces must be specified.

## How to generate 3D files and occupancy grid maps

Once all requirements are installed, as specified [here](https://github.com/sesame-project/FloorPlan-DSL), you can get artefacts generated.
To interpret the model and get artefacts, you only need to run one command:

```sh
blender --python src/floorplan_dsl/generators/floorplan.py --background
--python-use-system-env -- <path to model>
```

The `--` after the variable paths are important to distinguish the blender parameters and the parameters for the tooling. You will obtain an occupancy grid map and a `.stl` file with the 3D mesh of the environment.
Binary file removed docs/images/hospital_no_brackground.png
Binary file not shown.
Empty file.
64 changes: 0 additions & 64 deletions src/floorplan_dsl/blender/blender.py

This file was deleted.

Loading

0 comments on commit 08ce86d

Please sign in to comment.