Object

class eagerx.core.entities.Object[source]

Baseclass for objects.

Use this baseclass to implement objets that consist of sensors, actuators, and/or engine states.

Users must call make() to make the object subclass’ specification.

Subclasses must implement the following methods:

For every supported Engine, an implementation method must be added. This method must have the same signature as example_engine():

  • pybullet() (example)

  • ode_engine() (example)

example_engine(spec, graph)[source]

An example of an engine-specific implementation of an object’s registered sensors, actuators, and/or states.

See engine how engine specific parameters can be set/get.

This method must be decorated with eagerx.core.register.engine() to register the engine implementation of the object.

Note

This is an example method for documentation purposes only.

Parameters
  • spec (ObjectSpec) – A (mutable) specification.

  • graph (EngineGraph) – A graph containing the object’s registered (disconnected) sensors & actuators. Users should add nodes that inherit from EngineNode, and connect them to the sensors & actuators. As such, the engine nodes become the engine-specific implementation of the agnostic sensors & actuator definition.

Return type

None

classmethod info(method=None)

A helper method to get info on a method of the specified subclass.

Parameters

method (Union[List[str], str, None]) – The registered method we would like to receive info on. If no method is specified, it provides info on the class itself.

Return type

str

Returns

Info on the subclass’ method.

abstract classmethod make(*args, **kwargs)[source]

An abstract method that makes the specification (also referred to as spec) of this object.

See ObjectSpec how sensor/actuator/engine state parameters can be set.

This method should be decorated with:

Parameters
  • args (Any) – Arguments to the subclass’ make function.

  • kwargs (Any) – Optional Arguments to the subclass’ make function.

Returns

A (mutable) spec that can be used to build and subsequently initialize the entity (e.g. node, object, …).