blueprints.sensors module#

class blueprints.sensors.BaseSensor[source]#

Bases: SensorType, BaseThing

Sensors can be used to as an interface for the agent to the World. Sensors that are part of the kinematic tree of an Agent are included in the Agents observations.

Most attribute descriptions are partially taken from Mujoco.

__init__(noise=0.0, cutoff=0.0, name=None, reference=None, **kwargs)[source]#
Parameters:
  • noise (float | int, optional) – The standard deviation of zero-mean Gaussian noise added to the sensor output.

  • cutoff (float | int, optional) – When this value is positive, it limits the absolute value of the sensor output.

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

  • reference (blue.ThingType | None, optional) – The reference of the Sensor attribute is the parent of the Sensor which is translated to the site, joint or actuator attributes for xml.

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

Raises:

TypeError – If the reference type is not valid an error is raised.

property observation: ndarray#

The live sensor data from the simulation.

Return type:

np.ndarray

property reference#

The reference of the Sensor attribute is the parent of the Sensor which is translated to the site, joint or actuator attributes for xml.

Returns:

The sensors refferenced Thing

Return type:

blue.ThingType

property type#

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

Returns:

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

Return type:

str

property noise: float#

The standard deviation of zero-mean Gaussian noise added to the sensor output.

Return type:

float

property cutoff: float#

When this value is positive, it limits the absolute value of the sensor output.

Return type:

float

class blueprints.sensors.SiteSensor[source]#

Bases: SiteSensorType, BaseSensor

Intermediate Sensor class used by Sensors that reference Sites.

property site#

The parent name of the Sensor which is translated to this attribute for xml construction.

Return type:

blue.ThingType

class blueprints.sensors.JointSensor[source]#

Bases: JointSensorType, BaseSensor

Intermediate Sensor class used by Sensors that reference Joints.

property joint#

The parent name of the Sensor which is translated to this attribute for xml construction.

Return type:

blue.ThingType

class blueprints.sensors.ActuatorSensor[source]#

Bases: ActuatorSensorType, BaseSensor

Intermediate Sensor class used by Sensors that reference Actuators.

property actuator#

The parent name of the Sensor which is translated to this attribute for xml construction.

Return type:

blue.ThingType

class blueprints.sensors.InfoLaser[source]#

Bases: InfoLaserType, SiteSensor

The InfoLaser is not a mujoco native object but a derived blueprints object, that will not appear in xml. Instead it uses the mujoco.mj_ray subroutine to cast a ray from the Sensors Site and returns the intersected object and the distance to it.

__init__(axis=[0.0, 0.0, 1.0], noise=0.0, cutoff=0.0, name=None, reference=None, **kwargs)[source]#
Parameters:
  • axis (np.ndarray) – The local axis along which the InfoLasers ray will be casted.

  • noise (float | int, optional) – The standard deviation of zero-mean Gaussian noise added to the sensor output.

  • cutoff (float | int, optional) – When this value is positive, it limits the absolute value of the sensor output.

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

  • reference (blue.ThingType | None, optional) – The reference of the Sensor attribute is the parent of the Sensor which is translated to the site, joint or actuator attributes for xml.

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

Raises:

TypeError – If the reference type is not valid an error is raised.

property observation: dict#

Computes the observation on runtime.

property axis: ndarray#

The local axis along which the InfoLasers ray will be casted.

Return type:

np.ndarray

class blueprints.sensors.Touch[source]#

Bases: SiteSensor

DIMENSIONS = 1#
class blueprints.sensors.Accelerometer[source]#

Bases: SiteSensor

DIMENSIONS = 3#
class blueprints.sensors.Velocimeter[source]#

Bases: SiteSensor

DIMENSIONS = 3#
class blueprints.sensors.Gyro[source]#

Bases: SiteSensor

DIMENSIONS = 3#
class blueprints.sensors.Force[source]#

Bases: SiteSensor

DIMENSIONS = 3#
class blueprints.sensors.Torque[source]#

Bases: SiteSensor

DIMENSIONS = 3#
class blueprints.sensors.Rangefinder[source]#

Bases: SiteSensor

DIMENSIONS = 1#
class blueprints.sensors.JointPos[source]#

Bases: JointSensor

DIMENSIONS = 1#
class blueprints.sensors.JointVel[source]#

Bases: JointSensor

DIMENSIONS = 1#
class blueprints.sensors.JointLimitPos[source]#

Bases: JointSensor

DIMENSIONS = 1#
class blueprints.sensors.JointLimitVel[source]#

Bases: JointSensor

DIMENSIONS = 1#
class blueprints.sensors.JointLimitFrc[source]#

Bases: JointSensor

DIMENSIONS = 1#
class blueprints.sensors.BallQuat[source]#

Bases: JointSensor

DIMENSIONS = 4#
class blueprints.sensors.BallAngVel[source]#

Bases: JointSensor

DIMENSIONS = 3#
class blueprints.sensors.ActuatorPos[source]#

Bases: ActuatorSensor

DIMENSIONS = 1#
class blueprints.sensors.ActuatorVel[source]#

Bases: ActuatorSensor

DIMENSIONS = 1#
class blueprints.sensors.ActuatorFrc[source]#

Bases: ActuatorSensor

DIMENSIONS = 1#