phobos icon indicating copy to clipboard operation
phobos copied to clipboard

Exporting URDF with 0 mass causes divide-by-zero error

Open kevinfoley opened this issue 1 year ago • 2 comments

Summary: If we try to export a URDF for a robot which has 0 mass for the base, the export fails with an error.

  1. Create a robot with Phobos (or, use the attached example Blend file and skip to step 3)
  2. When creating inertials for the base of the robot, set the mass to 0 (note: you must manually type 0 into the field. the default value is 0.001 which may be truncated to 0.0 in the UI but is a non-zero value).
  3. Export the robot as a URDF.

Expected result: URDF export succeeds Actual result: When we try to export the URDF, Phobos throws a divide-by-zero error and the export operation fails.

Additional notes: PyBullet treats an object with 0 mass as having infinite mass, which keeps it from moving around. For robots that should have a stationary base, it's very helpful to have the mass of the base set to 0. Currently, we have to manually edit the URDF file after exporting from Phobos.

Environment:

  • Windows 10 Pro 64-bit
  • Blender 3.3.15 (LTS)
  • Phobos 2.0.0

kevinfoley avatar Mar 12 '24 01:03 kevinfoley

@kevinfoley Thank you for reporting this. Please take a look at my commit.

AlpenAalAlex avatar Mar 13 '24 17:03 AlpenAalAlex

@AlpenAalAlex Your fix appears to work. Thanks!

kevinfoley avatar Mar 14 '24 01:03 kevinfoley