Skip to content
Alex Zastrow edited this page Jul 11, 2023 · 8 revisions

Overview

It is important for simulation models to have a mass distribution close to the original robot, which can be tricky to achieve. The obvious and surely simplest method is to assign the masses to the visual objects of the robot as custom properties. In most setups, the visual objects will represent the actual parts of a real robot and thus it is straightforward to weigh those parts and set the masses in Blender accordingly.

Now URDF/SDF do not support masses for visual or collision objects. What they do is demand the specification of one mass value per link, specified in a separate inertial element, so that masses of several physical objects belonging to that link have to be combined. URDF/SDF further demand that if there is an inertial object in the link, it also needs to define the resulting inertia tensor (as well as optionally a shifted center of mass location). Phobos takes care of all this and saves you from calculating all the masses and inertias of your links yourself. At least, a handful of different solutions to these issues are provided (beyond the obvious solution of not exporting mass and inertia information at all, which is of course possible).

Inertial objects

The general description for masses and inertias is taken from the URDF format, which provides all necessary information for a physical simulation, see the link description. The parameter of an inertial are:

  • Origin: The location and orientation of the inertial with respect to its parent link. Basically, this defines a frame of reference for the inertial.
  • Mass: Simply the weight associated with a point mass located at the origin.
  • Inertia: The inertia of the object, given at the point defined in origin and oriented in the orientation.

The inertia of an object is strongly depending on its mass and geometry. Phobos supports automatic calculation of primitive shapes and meshes, which are based on Finding the Inertia Tensor of a 3D Solid Body, Simply and Quickly (2004) by Jonathan Blow, taking the employed formulae for tetrahedron inertia calculation from Explicit Exact Formulas for the 3-D Tetrahedron Inertia Tensor in Terms of its Vertex Coordinates (2004) by F. Tonon.

Furthermore any inertial object is restricted by laws of physics. To not destroy the universe, phobos automatically handles and corrects not well defined inertials. We check the following:

  • Is the mass positive? Negative masses make no sense, at least for most URDF parser. One could enable such features for modeling, but the same effect can be achieved using several inertials.
  • Are the main entries, ixx, iyy, izz, of the inertia positive? This fact originates in the inertia calculation it-self.
  • Would the kinetic energy be positive for all velocities with the given inertial?

Correction handles all these possible errors. Minimal values of one gram or one gram times square metre are set to avoid such non-physical inertials. Implementation details on how the correction of the inertia tensor takes places is given below.

Phobos has three specific operators for handling inertial objects, as shown below.

Create Inertials

Calculate Mass

This is more of a convenience function. The operator returns the overall mass of the robot model.

Create Inertials

To define an inertial object, we first need a link which defines the parent frame. Select the visuals or collisions and parent them to the link with the Parent Objects operator. Then simply click on the Create Inertials operator within the Model Editing panel. You can choose to clear existing inertial objects, meaning either to delete all current inertials or to keep them. You can check whether to calculate the inertia from the geometry of the selected objects and if you selected both visual and collision objects which objects to use. At last, define a mass and click OK. The object is created at the interial layer.

Create Inertials

Note that the inertial is created at the origin of the link, parented accordingly. To define location and orientation of the inertial frame of reference, simply move the object around.

Edit Mass/Inertia

To edit an inertial object, simply call the Edit Mass/Inertia operator. In the opening dialog you can then define values for each of the inertial. Click Change mass or Change inertia to enable or disable these options and OK to apply.

Create Inertials

Note We do not correct unphysical values during edit. So the information stored in the model may defy the laws of nature. However, we handle these errornous terms during export.

Inertials during Export

During export, phobos gathers all inertial objects parented to a link and calculates a common center of mass and the inertia in the link frame. Hence, we reduce the parameter for any simulation engine to a minimum.

Also, if you unselect a link within the spanning tree of the model, but keep the inertia selected the inertia is assumed to be a child of its effective parent and added to this link.

The merged inertial object is checked once again and corrected if necessary and written into the according file format.