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

[ycb] Update inertias to use constant-density estimations from meshes #38

Open
jwnimmer-tri opened this issue Mar 20, 2024 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jwnimmer-tri
Copy link
Contributor

Transcribed from RobotLocomotion/drake#10704:


Follow-up from: RobotLocomotion/drake#10702

We should update the models to use an estimation from the mesh (if possible).

This may involve:

  • Simplifying / separating the inertial estimation from the current //manipulation/util:meshlab_to_sdf binary (e.g. just give it an OBJ, and it'll give you an <inertial/> with no frame adjustment)
  • Ensuring that the center of mass is accurate given the inertial adjustments.
@nepfaff
Copy link
Member

nepfaff commented Mar 20, 2024

What about something like the following: https://github.com/RussTedrake/manipulation/blob/master/manipulation/create_sdf_from_mesh.py#L20

or

mesh_o3d = o3d.io.read_triangle_mesh(args.mesh_path)
    vertices = np.asarray(mesh_o3d.vertices)
    triangles = np.asarray(mesh_o3d.triangles)

    triangles_drake = np.array([SurfaceTriangle(t[0], t[1], t[2]) for t in triangles])
    mesh_drake = TriangleSurfaceMesh(triangles_drake, vertices)

  # TODO: Compute density from mass and volume
    inertia = CalcSpatialInertia(mesh=mesh_drake, density=density)

I found these to work quite well in the past, even when the meshes aren't entirely (but close to) watertight.

@jwnimmer-tri
Copy link
Contributor Author

We would probably just run https://drake.mit.edu/pydrake/pydrake.multibody.mesh_to_model.html and manually tweak from there.

@jwnimmer-tri jwnimmer-tri added the help wanted Extra attention is needed label Mar 29, 2024
@jwnimmer-tri jwnimmer-tri added the enhancement New feature or request label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants