blueprints.mirrortypes module#

Note

If you found yourself here not being a dev, you should probably skip this section from or look up the correspinging docs page of the Thing you were looking after for which this module only implements its corresponding mirror types. A link to the docs page is to be found in the Types doc string.

This module is used to model the inheritance hierarchy and to define the different attribute types. Since blueprint specifies many values of different data types, the user will easily find themselves setting attributes to the wrong types. But for most attribute setters this would not be caught resulting in a downstream exception during the XML build. Those exceptions are not easily associated to a line in the users code, which violated a type constraint.

To prevent this, blueprints is type safe in attributes (which is most of the user accessable interface). The module typechecker is used to @restrict methods to only take arguments which satisfy the type of the method signature. In python those type hints are not binding, @restrict however will raise ValueError if a type hint is violated.

To make all types available during class definition for @restrict, the types module defines a mirror type for all Things. Those mirror types are to be used in the type hints for @restrict instead of the proper Thing class. Every Thing class in blueprints must inherit (as its first base class) from a Type class in this module. Type classes must mimic the inheritance of its corresponding class. This is used for type hints as well as to ensure that the inheritance structure is preserved, when isinstance or issubclass is used.

Additionally the mirror types are used to specify class properties like data type associations for attributes used to translate back and forth between mujoco xml and blueprints.

class blueprints.mirrortypes.PathType[source]#

Bases: object

This abstract base class is a used to represent the Tendon class in type hints. For a detailed description see blueprints.tendon.Path.

class blueprints.mirrortypes.FunctionHandleType[source]#

Bases: object

This abstract base class is a used to represent the FunctionHandle class in type hints. For a detailed description see blueprints.utils.view.FunctionHandle.

class blueprints.mirrortypes.ViewType[source]#

Bases: object

This abstract base class is a used to represent the View class in type hints. For a detailed description see blueprints.utils.view.View.

class blueprints.mirrortypes.AllViewType[source]#

Bases: ViewType

This abstract base class is a used to represent the AllView class in type hints. For a detailed description see blueprints.utils.view.AllView.

class blueprints.mirrortypes.LatticeType[source]#

Bases: object

This abstract base class is a used to represent the Lattice class in type hints. For a detailed description see blueprints.utils.lattice.Lattice.

class blueprints.mirrortypes.LatticeViewType[source]#

Bases: object

This abstract base class is a used to represent the LatticeView class in type hints. For a detailed description see blueprints.utils.view.LatticeView.

class blueprints.mirrortypes.ColorType[source]#

Bases: object

This abstract base class is a used to represent the View class in type hints. For a detailed description see blueprints.utils.view.View.

class blueprints.mirrortypes.ThingType[source]#

Bases: object

This abstract base class is a used to represent the Thing class in type hints. For a detailed description see blueprints.thing.base.BaseThing.

class blueprints.mirrortypes.NodeThingType[source]#

Bases: ThingType

This abstract base class is a used to represent the NodeThing class in type hints. For a detailed description see blueprints.thing.node.NodeThing.

class blueprints.mirrortypes.MoveableThingType[source]#

Bases: ThingType

This abstract base class is a used to represent the MoveableThing class in type hints. For a detailed description see blueprints.thing.moveable.MoveableThing.

class blueprints.mirrortypes.ColoredThingType[source]#

Bases: ThingType

This abstract base class is a used to represent the ColoredThing class in type hints. For a detailed description see blueprints.thing.colored.ColoredThing.

class blueprints.mirrortypes.CyclicalThingType[source]#

Bases: ThingType

This abstract base class is a used to represent the CyclicalThing class in type hints. For a detailed description see blueprints.thing.cyclical.CyclicalThing.

class blueprints.mirrortypes.UniqueThingType[source]#

Bases: ThingType

This abstract base class is a used to represent the UniqueThing class in type hints. For a detailed description see blueprints.thing.unique.UniqueThing.

class blueprints.mirrortypes.FocalThingType[source]#

Bases: ThingType

This abstract base class is a used to represent the FocalThing class in type hints. For a detailed description see blueprints.thing.unique.FocalThing.

class blueprints.mirrortypes.CacheType[source]#

Bases: UniqueThingType

This abstract base class is a used to represent the Cache class in type hints. For a detailed description see blueprints.cache.BaseCache.

class blueprints.mirrortypes.MeshCacheType[source]#

Bases: CacheType

This abstract base class is a used to represent the MeshCache class in type hints. For a detailed description see blueprints.cache.MeshCache.

class blueprints.mirrortypes.HFieldCacheType[source]#

Bases: CacheType

This abstract base class is a used to represent the MeshCache class in type hints. For a detailed description see blueprints.cache.MeshCache.

class blueprints.mirrortypes.AssetType[source]#

Bases: UniqueThingType

This abstract base class is a used to represent the Asset class in type hints. For a detailed description see blueprints.assets.BaseAsset.

class blueprints.mirrortypes.TextureAssetType[source]#

Bases: AssetType

This abstract base class is a used to represent the TextureAsset class in type hints. For a detailed description see blueprints.assets.TextureAsset.

class blueprints.mirrortypes.TextureType[source]#

Bases: ThingType

This abstract base class is a used to represent the Texture class in type hints. For a detailed description see blueprints.texture.BaseTexture.

class blueprints.mirrortypes.PlaneTextureType[source]#

Bases: TextureType

This abstract base class is a used to represent the Texture class in type hints. For a detailed description see blueprints.texture.Plane.

class blueprints.mirrortypes.BoxTextureType[source]#

Bases: TextureType

This abstract base class is a used to represent the Texture class in type hints. For a detailed description see blueprints.texture.Box.

class blueprints.mirrortypes.SkyboxTextureType[source]#

Bases: BoxTextureType

This abstract base class is a used to represent the Texture class in type hints. For a detailed description see blueprints.texture.Skybox.

class blueprints.mirrortypes.MaterialAssetType[source]#

Bases: AssetType, ColoredThingType

This abstract base class is a used to represent the MaterialAsset class in type hints. For a detailed description see blueprints.assets.MaterialAsset.

class blueprints.mirrortypes.MaterialType[source]#

Bases: NodeThingType

This abstract base class is a used to represent the Material class in type hints. For a detailed description see blueprints.Material.

class blueprints.mirrortypes.MeshAssetType[source]#

Bases: MoveableThingType, AssetType

This abstract base class is a used to represent the MeshAsset class in type hints. For a detailed description see blueprints.assets.MeshAsset.

class blueprints.mirrortypes.HFieldAssetType[source]#

Bases: MoveableThingType, AssetType

This abstract base class is a used to represent the MeshAsset class in type hints. For a detailed description see blueprints.assets.MeshAsset.

class blueprints.mirrortypes.WorldType[source]#

Bases: NodeThingType

This abstract base class is a used to represent the World class in type hints. For a detailed description see blueprints.world.World.

class blueprints.mirrortypes.BodyType[source]#

Bases: NodeThingType

This abstract base class is a used to represent the Body class in type hints. For a detailed description see blueprints.body.Body.

class blueprints.mirrortypes.PlaceholderType[source]#

Bases: MoveableThingType

This abstract base class is a used to represent the Placeholder class in type hints. For a detailed description see blueprints.placeholder.Placeholder.

class blueprints.mirrortypes.TubeType[source]#

Bases: ThingType

This abstract base class is a used to represent the Tube class in type hints. For a detailed description see blueprints.tube.BaseTube.

class blueprints.mirrortypes.GeomType[source]#

Bases: MoveableThingType, ColoredThingType, NodeThingType

This abstract base class is a used to represent the Geom class in type hints. For a detailed description see blueprints.geoms.BaseGeom.

class blueprints.mirrortypes.CapsuleGeomType[source]#

Bases: GeomType, TubeType

This abstract base class is a used to represent the CapsuleGeom class in type hints. For a detailed description see blueprints.geoms.Capsule.

class blueprints.mirrortypes.CylinderGeomType[source]#

Bases: GeomType, TubeType

This abstract base class is a used to represent the CylinderGeom class in type hints. For a detailed description see blueprints.geoms.Cylinder.

class blueprints.mirrortypes.BoxGeomType[source]#

Bases: GeomType, TubeType

This abstract base class is a used to represent the BoxGeom class in type hints. For a detailed description see blueprints.geoms.Box.

class blueprints.mirrortypes.PlaneGeomType[source]#

Bases: GeomType

This abstract base class is a used to represent the PlaneGeom class in type hints. For a detailed description see blueprints.geoms.Plane.

class blueprints.mirrortypes.SphereGeomType[source]#

Bases: GeomType

This abstract base class is a used to represent the SphereGeom class in type hints. For a detailed description see blueprints.geoms.Sphere.

class blueprints.mirrortypes.EllipsoidGeomType[source]#

Bases: GeomType

This abstract base class is a used to represent the EllipsoidGeom class in type hints. For a detailed description see blueprints.geoms.Ellipsoid.

class blueprints.mirrortypes.MeshGeomType[source]#

Bases: GeomType

This abstract base class is a used to represent the MeshGeom class in type hints. For a detailed description see blueprints.geoms.Mesh.

class blueprints.mirrortypes.HFieldGeomType[source]#

Bases: GeomType

This abstract base class is a used to represent the HfieldGeom class in type hints. For a detailed description see blueprints.geoms.Hfield.

class blueprints.mirrortypes.SiteType[source]#

Bases: MoveableThingType, NodeThingType

This abstract base class is a used to represent the Site class in type hints. For a detailed description see blueprints.sites.BaseSite.

class blueprints.mirrortypes.CapsuleSiteType[source]#

Bases: TubeType, SiteType

This abstract base class is a used to represent the CapsuleSite class in type hints. For a detailed description see blueprints.sites.Capsule.

class blueprints.mirrortypes.CylinderSiteType[source]#

Bases: TubeType, SiteType

This abstract base class is a used to represent the CylinderSite class in type hints. For a detailed description see blueprints.sites.Cylinder.

class blueprints.mirrortypes.BoxSiteType[source]#

Bases: TubeType, SiteType

This abstract base class is a used to represent the BoxSite class in type hints. For a detailed description see blueprints.sites.Box.

class blueprints.mirrortypes.SphereSiteType[source]#

Bases: SiteType

This abstract base class is a used to represent the SphereSite class in type hints. For a detailed description see blueprints.sites.Sphere.

class blueprints.mirrortypes.EllipsoidSiteType[source]#

Bases: SiteType

This abstract base class is a used to represent the EllipsoidSite class in type hints. For a detailed description see blueprints.sites.Ellipsoid.

class blueprints.mirrortypes.JointType[source]#

Bases: NodeThingType

This abstract base class is a used to represent the Joint class in type hints. For a detailed description see blueprints.joints.BaseJoint.

class blueprints.mirrortypes.HingeType[source]#

Bases: JointType

This abstract base class is a used to represent the Hinge class in type hints. For a detailed description see blueprints.joints.Hinge.

class blueprints.mirrortypes.SlideType[source]#

Bases: JointType

This abstract base class is a used to represent the Slide class in type hints. For a detailed description see blueprints.joints.Slide.

class blueprints.mirrortypes.BallType[source]#

Bases: JointType

This abstract base class is a used to represent the Ball class in type hints. For a detailed description see blueprints.joints.Ball.

class blueprints.mirrortypes.FreeType[source]#

Bases: JointType

This abstract base class is a used to represent the Free class in type hints. For a detailed description see blueprints.joints.Free.

class blueprints.mirrortypes.SensorType[source]#

Bases: ThingType

This abstract base class is a used to represent the Sensor class in type hints. For a detailed description see blueprints.sensors.BaseSensor.

class blueprints.mirrortypes.SiteSensorType[source]#

Bases: SensorType

This abstract base class is a used to represent the SiteSensor class in type hints. For a detailed description see blueprints.sensors.SiteSensor.

class blueprints.mirrortypes.JointSensorType[source]#

Bases: SensorType

This abstract base class is a used to represent the JointSensor class in type hints. For a detailed description see blueprints.sensors.JointSensor.

class blueprints.mirrortypes.ActuatorSensorType[source]#

Bases: SensorType

This abstract base class is a used to represent the ActuatorSensor class in type hints. For a detailed description see blueprints.sensors.ActuatorSensor.

class blueprints.mirrortypes.TendonType[source]#

Bases: FocalThingType

This abstract base class is a used to represent the Tendon class in type hints. For a detailed description see blueprints.tendon.Tendon.

class blueprints.mirrortypes.InfoLaserType[source]#

Bases: SiteSensorType

This abstract base class is a used to represent the InfoLaser class in type hints. For a detailed description see blueprints.sensors.InfoLaser.

class blueprints.mirrortypes.ActuatorType[source]#

Bases: CyclicalThingType, NodeThingType

This abstract base class is a used to represent the Actuator class in type hints. For a detailed description see blueprints.actuators.BaseActuator.

class blueprints.mirrortypes.PositionType[source]#

Bases: ActuatorType

This abstract base class is a used to represent the Actuator class in type hints. For a detailed description see blueprints.actuators.Position.

class blueprints.mirrortypes.VelocityType[source]#

Bases: ActuatorType

This abstract base class is a used to represent the Actuator class in type hints. For a detailed description see blueprints.actuators.Velocity.

class blueprints.mirrortypes.IntVelocityType[source]#

Bases: ActuatorType

This abstract base class is a used to represent the Actuator class in type hints. For a detailed description see blueprints.actuators.IntVelocity.

class blueprints.mirrortypes.DamperType[source]#

Bases: ActuatorType

This abstract base class is a used to represent the Actuator class in type hints. For a detailed description see blueprints.actuators.Damper.

class blueprints.mirrortypes.CylinderType[source]#

Bases: ActuatorType

This abstract base class is a used to represent the Actuator class in type hints. For a detailed description see blueprints.actuators.Cylinder.

class blueprints.mirrortypes.MuscleType[source]#

Bases: ActuatorType

This abstract base class is a used to represent the Actuator class in type hints. For a detailed description see blueprints.actuators.Muscle.

class blueprints.mirrortypes.AdhesionType[source]#

Bases: ActuatorType

This abstract base class is a used to represent the Actuator class in type hints. For a detailed description see blueprints.actuators.Adhesion.

class blueprints.mirrortypes.LightType[source]#

Bases: CyclicalThingType, MoveableThingType

This abstract base class is a used to represent the Light class in type hints. For a detailed description see blueprints.light.Light.

class blueprints.mirrortypes.CameraType[source]#

Bases: CyclicalThingType

This abstract base class is a used to represent the Camera class in type hints. For a detailed description see blueprints.camera.Camera.

class blueprints.mirrortypes.AgentType[source]#

Bases: BodyType

This abstract base class is a used to represent the Agent class in type hints. For a detailed description see blueprints.agent.Agent.