Skip to main content

Compute inertial parameters for a mesh using pymeshlab and return the URDF inertial tag for links.

Project description

urdf-mesh-inertia

Compute inertial parameters for a mesh using pymeshlab and return the URDF inertial tag for links.

Installation

Using pipx

The best way to install urdf-mesh-inertia is using pipx:

$ pipx install urdf-mesh-inertia

Using pip

When using pip it's suggested to work inside a virtualenv.

$ python -m pip install urdf-mesh-inertia

From source

urdf-mesh-inertia uses Poetry as dependency management and packaging tool, you need to install it first.

Then:

  1. Clone this repository.
  2. From the root of the repository run:
    $ poetry build
    
  3. Install using pipx or pip (it's better to use pipx):
    $ pipx install dist/urdf_mesh_inertia-0.1.0-py3-none-any.whl
    

Usage

 Usage: urdf-mesh-inertia [OPTIONS] MESH_PATH MASS

 Compute inertial parameters for a mesh.
 Calculation is made using pymeshlab and the URDF inertial tag for links is
 returned.

╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│ *    mesh_path      PATH   Path of the mesh. [default: None] [required]      │
│ *    mass           FLOAT  Mass of the mesh in kg. [default: None]           │
│                            [required]                                        │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --precision        INTEGER  Rounding at specified decimal digit.             │
│                             [default: None]                                  │
│ --help                      Show this message and exit.                      │
╰──────────────────────────────────────────────────────────────────────────────╯

For example:

$ urdf-mesh-inertia --precision 8 ~/devel/ros/darwin_description/meshes/head_coll.stl 0.158

Will give us:

<inertial>
  <origin xyz="0.0025258 -0.0244761 6.7e-07"/>
  <mass value="0.158"/>
  <inertia ixx="0.0001567" ixy="2.494e-05" ixz="-0.0" iyy="0.00016806" iyz="0.0" izz="0.00017144"/>
</inertial>

--precision round at the specified decimal position. If you don't want rounding run the command without it.

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

urdf_mesh_inertia-0.2.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

urdf_mesh_inertia-0.2.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file urdf_mesh_inertia-0.2.0.tar.gz.

File metadata

  • Download URL: urdf_mesh_inertia-0.2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.9 Linux/6.7.12-amd64

File hashes

Hashes for urdf_mesh_inertia-0.2.0.tar.gz
Algorithm Hash digest
SHA256 11a729b2db68c1201f1c37777827fe05216eea0bd50477779be42c37b7f19338
MD5 dd3f4c26d2a60680d48a137774e434ab
BLAKE2b-256 8b63de99c3fdc9ee2e23695f60649e8ac5841806511afaff2f613bf8b6712103

See more details on using hashes here.

File details

Details for the file urdf_mesh_inertia-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for urdf_mesh_inertia-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d22a15add5ff4d6f25239e2040659b40dd934f42ed5db77d4e0812ff9ed16b51
MD5 97d829201e0be16e8e5007e7df84b2cf
BLAKE2b-256 82fa7cdab071be72e5b6e84dc8d3597d0aad6edaad701dd5981d365ea458a8c0

See more details on using hashes here.

Supported by

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