Skip to main content

Pipeline for converting mesh files into simulation assets

Project description

mesh-to-sim-asset

Pipeline for converting mesh files into simulation assets

Installation

This repository uses uv for dependency management.

  1. Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Install the dependencies into .venv:
uv sync
  1. Activate the virtual env:
source .venv/bin/activate
  1. Install wine:
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine
  1. Install the pre-commit hocks:
pre-commit install
  1. Install git-lfs:
git-lfs install
git-lfs pull
  1. Install blender:
sudo snap install blender --classic
  1. Ensure that the OPENAI_API_KEY environment variable is set to your OpenAI key.

[Optional] Install usd2sdf

Only required for running make_asset_drake_compatible.py with USD inputs.

See here for installation instructions.

Usage

Geometry/ Mesh to Drake SDF Simulation Asset

Pipeline for converting geometry mesh files into Drake simulation assets with visual geometries, collision geometries, and physical properties. Non-specified properties are estimated with a VLM.

The pipeline entrypoint is create_drake_asset_from_geometry.py. Please see that script for argument documentation.

Example:

python main.py \
    input_dir_path \
    -o output_dir_path \
    -mck

Simulation Asset (USD, URDF, SDF, MJX) to Drake SDF Simulation Asset

Pipeline for converting existing simulation assets (e.g., articulated objects) into Drake simulation assets with visual geometries, collision geometries, and physical properties. Non-specified properties are estimated with a VLM.

The pipeline entrypoint is make_asset_drake_compatible.py. Please see that script for argument documentation.

Validate Static Equilibrium

Simulation assets should at least be statically stable. We can validate this by placing them onto a flat floor:

python scripts/test_mesh_sim.py \
    asset_name.sdf \
    --position "0, 0, 0.1" \
    --rotation "0, 0, 0"

Use the --use_ramp argument to test rolling down a ramp. We recommend --position "0, 0, 0.3" for the ramp setting.

Build a new wheel and publish it to PyPi

Build the wheel:

uv build

Publish it:

uv publish --token $PYPI_TOKEN

where PYPI_TOKEN refers to the PyPi API token.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mesh_to_sim_asset-0.1.1.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mesh_to_sim_asset-0.1.1-py3-none-any.whl (64.5 kB view details)

Uploaded Python 3

File details

Details for the file mesh_to_sim_asset-0.1.1.tar.gz.

File metadata

  • Download URL: mesh_to_sim_asset-0.1.1.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for mesh_to_sim_asset-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4122964f7ccb4d35f7de0b39180be23978a628332592dfbdefa1d0e983baf746
MD5 83d1741f0ccb5807ee89e9f7a3aafbae
BLAKE2b-256 4dcd9ddb0bbe0b5dfb4339005cc88a6fb7b5aa0e3ddf9faa72d842f168152a14

See more details on using hashes here.

File details

Details for the file mesh_to_sim_asset-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mesh_to_sim_asset-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9309e348659e7bdaf61d92b8bfafd8be64d6626a87ebd75889d5912d9280c941
MD5 30e19f2818dfa975161ff2ad60abf9d2
BLAKE2b-256 233b388dbefcacc3bd669a82ce7612f419e933a6da7467694464325856aaa137

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page