BaseGeom#

class blueprints.BaseGeom[source]#

Bases: GeomType, NodeThing, MoveableThing, ColoredThing

Geoms introduce physical matter into the simulation. For different Geom shapes individual Geom classes are available, with shape depended size attributes. All other attributes are specified in BaseGeom.

Note

Though units are not bound to one specific system of measurements, it is highly recommended to use MKS, since all defaults are defined based on meters, kilograms and seconds and most mujoco models online also use the metric system. If you want to switch from the imperial to the metric system the following resource might be of interest to convert units from imperial to metric. If you insist on using imperial units, take a look at the following resource to convert units from metric to imperial.

Most attribute descriptions are partially taken from Mujoco.

Attributes Summary

density

Unit defaults are set in SI units, but the physical properties can in principle be interpreted in any system of measurements.

friction

Contact friction parameters for dynamically generated contact pairs.

margin

Margin defines the minimum distance used to detect a contact.

mass

If this attribute is specified, the density attribute below is ignored and the geom density is computed from the given mass, using the geom shape and the assumption of uniform density.

rolling_friction

Friction parameter for rolling used to computed the forces on contact pairs.

shellinertia

If shellinertia is True all mass will be distributed along the surface of the object.

sliding_friction

Friction parameter for sliding used to computed the forces on contact pairs.

torsional_friction

Friction parameter for torsion used to computed the forces on contact pairs.

type

This is a derived attribute, which is used to specify the type attribute in the mujoco geom tag.

Attributes Documentation

density#

Unit defaults are set in SI units, but the physical properties can in principle be interpreted in any system of measurements.

Material density used to compute the geom mass and inertia. The computation is based on the geom shape and the assumption of uniform density. The internal default of 1000 is the density of water in SI units. This attribute is used only when the mass attribute above is unspecified.

Returns:

Density is either volumetric if shellinertia is false, otherwise its planar.

Return type:

float

friction#

Contact friction parameters for dynamically generated contact pairs. The first number is the sliding friction, acting along both axes of the tangent plane. The second number is the torsional friction, acting around the contact normal. The third number is the rolling friction, acting around both axes of the tangent plane.

Returns:

Individual components are found in sliding_friction, torsional_friction and rolling_friction.

Return type:

np.ndarray

margin#

Margin defines the minimum distance used to detect a contact.

Returns:

Default units are interpreted in meters.

Return type:

float

mass#

If this attribute is specified, the density attribute below is ignored and the geom density is computed from the given mass, using the geom shape and the assumption of uniform density. The computed density is then used to obtain the geom inertia. Recall that the geom mass and inertia are only used during compilation, to infer the body mass and inertia if necessary.

Unit defaults are set in SI units, but the physical properties can in principle be interpreted in any system of measurements.

Returns:

The default unit convention is kilogram.

Return type:

float

rolling_friction#

Friction parameter for rolling used to computed the forces on contact pairs.

Returns:

Third component of friction.

Return type:

float

shellinertia#

If shellinertia is True all mass will be distributed along the surface of the object. Changing this attribute also changes the effect of density from volumetric to planar.

Returns:

Indicates whether mass is concentrated on the surface.

Return type:

bool

sliding_friction#

Friction parameter for sliding used to computed the forces on contact pairs.

Returns:

First component of friction.

Return type:

float

torsional_friction#

Friction parameter for torsion used to computed the forces on contact pairs.

Returns:

Second component of friction.

Return type:

float

type#

This is a derived attribute, which is used to specify the type attribute in the mujoco geom tag.

Returns:

The type is the lower case name of the Geom class.

Return type:

str

__init__(pos=[0.0, 0.0, 0.0], alpha=0, beta=0, gamma=0, material=None, mass=None, density=1000.0, margin=0.0, gap=0.0, sliding_friction=1, torsional_friction=0.005, rolling_friction=0.0001, shellinertia=None, color=None, name=None, x=None, y=None, z=None, quat=None, **kwargs)[source]#
Parameters:
  • pos (list[int | float] | np.ndarray | None, optional) – Represents the position of the object. Changing this attribute also changes the properties x, y and z.

  • alpha (int | float | None, optional) – (Improper) euler angle of rotation around the x-axis in radian. Changing this value also changes the euler property.

  • beta (int | float | None, optional) – (Improper) euler angle of rotation around the y-axis in radian. Changing this value also changes the euler property.

  • gamma (int | float | None, optional) – (Improper) euler angle of rotation around the z-axis in radian. Changing this value also changes the euler property.

  • material (blue.MaterialType, optional) – The Material of the Geom. :class:`Textures <blueprints.texture.BaseTexture> are applied via Materials.

  • density (int | float | None, optional) – Material density used to compute the geom mass and inertia. The computation is based on the geom shape and the assumption of uniform density. The internal default of 1000 is the density of water in SI units. This attribute is used only when the mass attribute above is unspecified.

  • margin (int | float | None, optional) – A contact is considered active only if the distance between the two geom surfaces is below margin-gap.

  • gap (int | float | None, optional) – This attribute is used to enable the generation of inactive contacts, i.e., contacts that are ignored by the constraint solver but are included in mjData.contact for the purpose of custom computations. When this value is positive, geom distances between margin and margin-gap correspond to such inactive contacts.

  • mass (int | float | None, optional) – If this attribute is specified, the density attribute below is ignored and the geom density is computed from the given mass, using the geom shape and the assumption of uniform density. The computed density is then used to obtain the geom inertia. Recall that the geom mass and inertia are only used during compilation, to infer the body mass and inertia if necessary.

  • shellinertia (bool | None, optional) – If true, the geom’s inertia is computed assuming that all the mass is concentrated on the boundary. In this case density is interpreted as surface density rather than volumetric density.

  • sliding_friction (int | float, optional) – Friction parameter for sliding used to compute the forces on contact pairs.

  • torsional_friction (int | float, optional) – Friction parameter for torsion used to compute the forces on contact pairs.

  • rolling_friction (int | float, optional) – Friction parameter for rolling used to compute the forces on contact pairs.

  • color (blue.ColorType) – The color of the Geom. For a detailed description see :class:`Color `

  • name (str | None, optional) – The user specified name might potentially be altered to avoid a naming conflict by appending an enumeration scheme.

  • x (int | float |np.int32 | np.int64 | np.float32 | np.float64 | None, optional) – If pos is not specified, this argument sets the X position coordinate.

  • y (int | float |np.int32 | np.int64 | np.float32 | np.float64 | None, optional) – If pos is not specified, this argument sets the Y position coordinate.

  • z (int | float |np.int32 | np.int64 | np.float32 | np.float64 | None, optional) – If pos is not specified, this argument sets the Z position coordinate.

  • quat (list [ int | float ] | np.ndarray | None, optional) – If set, the quaternion orientation overwrites the euler angles alpha, beta and gamma.

  • **kwargs – Keyword arguments are passed to super().__init__.

classmethod __new__(*args, **kwargs)#