1
0
Fork 0
No description
  • Python 92.6%
  • OpenSCAD 3.9%
  • Just 3.5%
Find a file
Daniele Tricoli 0dcc677547
Some checks failed
lint / lint (push) Has been cancelled
test / test (push) Has been cancelled
Use pytest.approx
2024-12-29 16:14:07 +01:00
.github/workflows Run lint workflow on python 3.x only 2024-05-07 20:57:18 +02:00
extras Add a test using an ellipsoid 2024-07-04 01:10:43 +02:00
src/urdf_mesh_inertia Use arguments for mesh path and mass 2024-05-08 16:46:54 +02:00
tests Use pytest.approx 2024-12-29 16:14:07 +01:00
.editorconfig Add .editorconfig 2024-05-07 19:32:45 +02:00
.flake8 Add flake8 config 2024-05-07 19:33:01 +02:00
.gitignore Initial import 2024-05-07 19:32:13 +02:00
.pre-commit-config.yaml Add pre-commit-hook config 2024-05-07 19:38:23 +02:00
CHANGELOG.md Update CHANGELOG 2024-05-08 16:51:25 +02:00
justfile Fix names 2024-07-04 01:31:53 +02:00
LICENSE Initial import 2024-05-07 19:32:13 +02:00
poetry.lock Initial import 2024-05-07 19:32:13 +02:00
pyproject.toml Bump version to 0.2.0 2024-05-08 16:47:47 +02:00
README.md Use arguments for mesh path and mass 2024-05-08 16:46:54 +02:00

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.