Giter Club home page Giter Club logo

models_to_sdf's Introduction

What this setup will do

Folder structure based on the SDF requirements for the Model Database Structure

  1. Manipulate folders:
  • copies contents from the original folder into the specified folder
  • move the contents into a created "meshes" folder
  1. Creates SDF templates based on the folder and model names
  • Copies existing sdf from the script
  • Edits the sdf to the name of the folder and models

Before using Example

Artist exports models with textures into one folder

Folder contents:

  • Model base meshes (supports .obj only)
  • Model joints/wheels or parts meshes
  • Collision model meshes (low poly)
  • Model textures (recommended to use .png)

Example folder might look like this:

Sesto

  • Sesto.obj
  • Sesto.mtl
  • Sesto_Col.obj
  • Sesto_Col.mtl
  • SestoWheel.obj
  • SestoWheel.mtl
  • SestoWheel_Col.obj
  • SestoWheel_Col.mtl
  • Sesto_Diffuse.png, etc

Take note of the above:

  • Model and folder has the same name.
  • Collision model has a _Col at the end of the name.

How to use - Linux

Make sure this folder doesn't exist in the output directory.

  1. Open a terminal from the models_to_sdf/ directory
  2. Type in python3 models_to_sdf.py
  3. Type in the --input directory where the models and textures are exported. Eg: ~/Documents/models/robots/sesto
  4. Type out the --output directory where the gazebo models are exported. Eg: ~/Dropbox/models/

Your line should look something like this:

python3 models_to_sdf.py --input ~/Documents/models/robots/sesto --output ~/Dropbox/models/

How to use - Windows

  1. Open a terminal from the models_to_sdf\ directory
  2. Run py -3 models_to_sdf.py
  3. Type in the --input directory where the models and textures are exported. Eg: C:\Documents\models\robots\sesto
  4. Type out the --output directory where the gazebo models are exported. Eg: C:\Dropbox\models
py -3 models_to_sdf.py --input C:\Documents\models\robots\sesto --output C:\Dropbox\models

In case you come across any issues - https://stackoverflow.com/a/26616078

To-dos

  • clean it up
  • get it to check if the folder exists or not

models_to_sdf's People

Contributors

luca-della-vedova avatar mxgrey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.