Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script and tutorial for generating procedural datasets with Blender #1412

Merged
merged 30 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8fb5f17
Add script for creation of procedural datasets with Blender
AndrejOrsula Mar 25, 2022
800eda6
Add tutorial for creation of procedural datasets with Blender
AndrejOrsula Mar 25, 2022
a54be30
Add Future Work section for procedural datasets with Blender
AndrejOrsula Apr 7, 2022
61b6689
Use absolute links in tutorial for prodedural datasets with Blender
AndrejOrsula Apr 7, 2022
e54a450
Improve phrasing in tutorial for procedural datasets with Blender
AndrejOrsula Apr 7, 2022
adec670
Fix error in case an object has no modifiers
AndrejOrsula Apr 7, 2022
cc210d1
Indicate in main() how to export a single model
AndrejOrsula Apr 7, 2022
f9f2133
Place all default parameters at the beginning of script
AndrejOrsula May 23, 2022
c2b6de2
Enable ignore of some objects during export of visual/collision mesh
AndrejOrsula May 23, 2022
08800a5
Add support for simple generation of thumbnails
AndrejOrsula May 23, 2022
9a2ca45
Add Wavefront (.obj) exporter
AndrejOrsula May 23, 2022
3dbc7c2
Add option to specify kwargs
AndrejOrsula May 23, 2022
b565c50
Update script in the example blend file
AndrejOrsula May 23, 2022
a2574f6
Remove finished items from Future Work
AndrejOrsula May 23, 2022
8930433
Fix forward axis for Wavefront (.obj) exporter
AndrejOrsula May 24, 2022
630ae54
Bump LAST_TESTED_VERSION to Blender 3.1.2
AndrejOrsula May 25, 2022
c0c5b81
Set default export directory relative to .blend file
AndrejOrsula May 25, 2022
b8c9498
Support headless generation of datasets
AndrejOrsula May 25, 2022
7abb656
Merge branch 'ign-gazebo6' into blender_procedural_datasets
mabelzhang Jul 14, 2022
e92554e
Apply suggestions from code review
AndrejOrsula Aug 27, 2022
2ab07d4
Add parsing of CLI args and simplify usage
AndrejOrsula Aug 27, 2022
2780dd2
Print cmd to set GZ_SIM_RESOURCE_PATH after the export is finished
AndrejOrsula Aug 27, 2022
d7ebd3a
Default to Wavefront (.obj) file format for visual geometry
AndrejOrsula Aug 28, 2022
dd9480c
Update rock.blend project
AndrejOrsula Aug 29, 2022
5076d9c
Add garden.blend project
AndrejOrsula Aug 29, 2022
bd6b89d
Make script executable
AndrejOrsula Aug 29, 2022
f33a54b
Update tutorial
AndrejOrsula Aug 29, 2022
1ca8e55
Rename `garden.blend` to `woodland.blend`
AndrejOrsula Aug 30, 2022
6c81587
Add attribution for assets used in `woodland.blend`
AndrejOrsula Aug 30, 2022
26686cf
Merge remote-tracking branch 'origin/ign-gazebo6' into blender_proced…
mjcarroll Oct 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename garden.blend to woodland.blend
Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
  • Loading branch information
AndrejOrsula committed Oct 10, 2022
commit 1ca8e55b44202ab90eb885d7dc1e51852b73f355
20 changes: 10 additions & 10 deletions tutorials/blender_procedural_datasets.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ In order to demonstrate the generation of procedural datasets, the following two

- [rock.blend](https://github.com/gazebosim/gz-sim/tree/gz-sim7/tutorials/files/blender_procedural_datasets/rock.blend)
— Models of randomized rocks for Gazebo that robots can interact with
- [garden.blend](https://github.com/gazebosim/gz-sim/tree/gz-sim7/tutorials/files/blender_procedural_datasets/garden.blend)
- [woodland.blend](https://github.com/gazebosim/gz-sim/tree/gz-sim7/tutorials/files/blender_procedural_datasets/woodland.blend)
— Static environments of natural scenery with randomly scattered assets of
low-poly trees, rocks, grass and flowers

Expand All @@ -140,7 +140,7 @@ that either manually on GitHub or via `wget`/`curl`.

```bash
wget https://raw.githubusercontent.com/gazebosim/gz-sim/gz-sim7/tutorials/files/blender_procedural_datasets/rock.blend
wget https://raw.githubusercontent.com/gazebosim/gz-sim/gz-sim7/tutorials/files/blender_procedural_datasets/garden.blend
wget https://raw.githubusercontent.com/gazebosim/gz-sim/gz-sim7/tutorials/files/blender_procedural_datasets/woodland.blend
```

### Try Demo Files
Expand All @@ -151,12 +151,12 @@ directly from the console and configure CLI arguments as desired.

```bash
blender rock.blend --python-text procedural_dataset_generator.py -- -o sdf_models/rock
blender garden.blend --python-text procedural_dataset_generator.py -- -o sdf_models/garden
blender woodland.blend --python-text procedural_dataset_generator.py -- -o sdf_models/woodland
```

@image html https://github.com/gazebosim/gz-sim/tree/gz-sim7/tutorials/files/blender_procedural_datasets/demo_blender_rock.gif "Example of generating a dataset of rock SDF models" width=100%

@image html https://github.com/gazebosim/gz-sim/tree/gz-sim7/tutorials/files/blender_procedural_datasets/demo_blender_garden.gif "Example of generating a dataset of garden SDF models" width=100%
@image html https://github.com/gazebosim/gz-sim/tree/gz-sim7/tutorials/files/blender_procedural_datasets/demo_blender_woodland.gif "Example of generating a dataset of woodland SDF models" width=100%

You can configure the script in several ways (see
`blender rock.blend --python-text procedural_dataset_generator.py -- -h`). For
Expand Down Expand Up @@ -193,9 +193,9 @@ each model.
│ └── model.sdf # SDF description of the model
├── rock1/ # SDF Model directory of the 2nd model
└── ...
└── garden/ # Identical structure for the dataset of garden models ...
 ├── garden0/
├── garden1/
└── woodland/ # Identical structure for the dataset of woodland models ...
 ├── woodland0/
├── woodland1/
└── ...
```

Expand All @@ -210,18 +210,18 @@ exact path after the export of models is finished.

```bash
export GZ_SIM_RESOURCE_PATH="${PWD}/sdf_models/rock${GZ_SIM_RESOURCE_PATH:+:${GZ_SIM_RESOURCE_PATH}}"
export GZ_SIM_RESOURCE_PATH="${PWD}/sdf_models/garden${GZ_SIM_RESOURCE_PATH:+:${GZ_SIM_RESOURCE_PATH}}"
export GZ_SIM_RESOURCE_PATH="${PWD}/sdf_models/woodland${GZ_SIM_RESOURCE_PATH:+:${GZ_SIM_RESOURCE_PATH}}"
```

### Spawn Models in Gazebo

Hereafter, you can spawn the generated models inside Gazebo with your preferred
approach, e.g. via the Resource Spawner GUI plugin. Below are some examples of
Gazebo environments using the rock and garden SDF models.
Gazebo environments using the rock and woodland SDF models.

@image html https://github.com/gazebosim/gz-sim/tree/gz-sim7/tutorials/files/blender_procedural_datasets/demo_gazebo_rock.png "Example of the generated rock SDF models in Gazebo" width=100%

@image html https://github.com/gazebosim/gz-sim/tree/gz-sim7/tutorials/files/blender_procedural_datasets/demo_gazebo_garden.png "Example of the generated garden SDF models in Gazebo" width=100%
@image html https://github.com/gazebosim/gz-sim/tree/gz-sim7/tutorials/files/blender_procedural_datasets/demo_gazebo_woodland.png "Example of the generated woodland SDF models in Gazebo" width=100%

Every object that uses Geometry Nodes in these projects has several input
attributes that can be configured. You can open the `.blend` projects again,
Expand Down
Binary file not shown.
Binary file not shown.