Agent#

class blueprints.Agent[source]#

Bases: AgentType, Body

This class emulates a Body which serves as an interface for sensors, cameras and actuators of an Agent. It provides uniform access to the observation and action relevant Things.

Attributes Summary

action_shape

The shapes of both action types (activations and forces)

activation

All activations of Actuators that have an activation state.

actuators

Instead of returning just the children all descending Actuators are returned.

cameras

Instead of returning just the children all descending Cameras are returned.

force

All forces of Actuators of the Agent

name

The returned name might differ from the user specification by an enumerations scheme that is applied if two Things of the same type in a kinematic tree share the same name.

observation

The dictionary contains the name of all observables and their data.

observation_shape

The dictionary contains the names of all observables and their shapes.

sensors

Instead of returning just the children all descending Sensors are returned.

Attributes Documentation

action_shape#

The shapes of both action types (activations and forces)

Return type:

dict

activation#

All activations of Actuators that have an activation state. Actuators with 'dyntype' == 'none' do not have an activation.

Return type:

list

actuators#

Instead of returning just the children all descending Actuators are returned.

Returns:

The view is routed to all actuators of the agent (instead of just those that follow directly in the kinematic hierarchy).

Return type:

View

cameras#

Instead of returning just the children all descending Cameras are returned.

Returns:

The view is routed to all cameras of the agent (instead of just those that follow directly in the kinematic hierarchy).

Return type:

View

force#

All forces of Actuators of the Agent

Return type:

list

name#

The returned name might differ from the user specification by an enumerations scheme that is applied if two Things of the same type in a kinematic tree share the same name.

Returns:

possibly extended name of the Thing

Return type:

str

observation#

The dictionary contains the name of all observables and their data.

Return type:

dict

observation_shape#

The dictionary contains the names of all observables and their shapes.

Return type:

dict

sensors#

Instead of returning just the children all descending Sensors are returned.

Returns:

The view is routed to all sensors of the agent (instead of just those that follow directly in the kinematic hierarchy).

Return type:

View

__init__(pos=[0.0, 0.0, 0.0], alpha=0.0, beta=0.0, gamma=0.0, geoms=None, sites=None, joints=None, bodies=None, lights=None, cameras=None, actuators=None, placeholders=None, name=None, copy=True, x=None, y=None, z=None, quat=None, **kwargs)#
Parameters:
  • pos (list[int | float] | np.ndarray, 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.

  • geoms (list[blue.ThingType] | blue.ThingType | None, optional) – The geoms argument mus either be a list of Geoms or a single Geom.

  • sites (list[blue.ThingType] | blue.ThingType | None, optional) – The sites argument mus either be a list of Sites or a single Site.

  • joints (list[blue.ThingType] | blue.ThingType | None, optional) – The joints argument mus either be a list of Joints or a single Joint.

  • bodies (list[blue.ThingType] | blue.ThingType | None, optional) – The bodies argument mus either be a list of Bodies or a single Body.

  • lights (list[blue.ThingType] | blue.ThingType | None, optional) – The lights argument mus either be a list of Lights or a single Light.

  • cameras (list[blue.ThingType] | blue.ThingType | None, optional) – The cameras argument mus either be a list of Cameras or a single Camera.

  • actuators (list[blue.ThingType] | blue.ThingType | None, optional) – The actuators argument mus either be a list of Actuators or a single Actuator.

  • placeholders (list[blue.ThingType] | blue.ThingType | None, optional) – The placeholders argument mus either be a list of Placeholders or a single Placeholder.

  • name (str | None, optional) – The user specified name of the Body. In the case of a naming conflict the name is appended by an enumeration scheme.

  • copy (bool, optional) – This argument indicates whether the children should be copied before they are attached. If copy if set to False this will result in graph cycles if a parent of the Body is attached resulting in further errors.

  • 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__.

Return type:

None

classmethod __new__(*args, **kwargs)#