gazebosim / sdformat

Simulation Description Format (SDFormat) parser and description files.
http://sdformat.org
Apache License 2.0
166 stars 92 forks source link

Consider declare meter-kilogram-second units officially as part of the specification. #1385

Open qingyouzhao opened 6 months ago

qingyouzhao commented 6 months ago

Context

In various documentations in the SDF spec, units kilograms, meters and seconds are used for different physical properties. For example:

Problem

This created some ambiguity around inferring units:

  1. In places where units are not clearly stated, for example in geometry, should one assume all geometries are defined in meters?
  2. In a included mesh in mesh_shape, should one assume mesh vertex locations are in meters even if the included mesh file might have another unit convention. For example, FBX files have implied centimeters although it is stated as an unit-less format.

Proposal

Let's discuss options. There are a few options I can think of.

  1. Define units in a centralized place and only document exceptions in individual schemas. This is the simplest way to disambiguate if everyone has been working with this assumption.
  2. Define units explicitly as part of the schema similar to angle vs radians in pose. This would be more tedious to implement but makes units more explicit
scpeters commented 6 months ago

Let's discuss options. There are a few options I can think of.

  1. Define units in a centralized place and only document exceptions in individual schemas. This is the simplest way to disambiguate if everyone has been working with this assumption.
  2. Define units explicitly as part of the schema similar to angle vs radians in pose. This would be more tedious to implement but makes units more explicit

I prefer option 1, and the we refer to ROS REP 103, which defines standard units for ROS.

azeey commented 5 months ago

I'd prefer option 1 as well. I think for mesh files, the mesh loader should be implemented such that if the file format has a convention of using a different unit (e.g. centimeters), it would convert the values to meters during import.