Object

class eagerx.core.specs.ObjectSpec(params)[source]

A parameter specification of an object.

gui(engine_cls, interactive=True, resolution=None, filename=None)[source]

Opens a graphical user interface of the object’s engine implementation.

Note

Requires eagerx-gui:

pip3 install eagerx-gui
Parameters:
  • engine_cls (Type[Engine]) – The class engine (not instance!) that was used to register the engine implementation (e.g. “PybulletEngine”).

  • interactive (Optional[bool]) – If True, an interactive application is launched. Otherwise, an RGB render of the GUI is returned. This could be useful when using a headless machine.

  • resolution (Optional[List[int]]) – Specifies the resolution of the returned render when interactive is False. If interactive is True, this argument is ignored.

  • filename (Optional[str]) – If provided, the GUI is rendered to an svg file with this name. If interactive is True, this argument is ignored.

Return type:

Optional[ndarray]

Returns:

RGB render of the GUI if interactive is False.

property actuators: SpecView

Provides an API to set/get the parameters of registered eagerx.core.register.actuators().

The mutable parameters are:

  • Spec.actuators.<name>.rate: float = 1.0

    Rate (Hz) at which the actuator’s callback() is called.

  • Spec.actuators.<name>.window: int = 1

    A non-negative number that specifies the number of messages to pass to the node’s callback().

    • window = 1: Only the last received input message.

    • window = x > 1: The trailing last x received input messages.

    • window = 0: All input messages received since the last call to the node’s callback().

    Note

    With window = 0, the number of input messages may vary and can even be zero.

  • Spec.actuators.<name>.space: dict = None

    This space defines the format of valid messages.

  • Spec.actuators.<name>.delay: float = 0.0

    A non-negative simulated delay (seconds). This delay is ignored if simulate_delays = True in the engine’s spec().

  • Spec.actuators.<name>.skip: bool = False

    Skip the dependency on this input during the first call to the node’s callback(). May be necessary to ensure that the connected graph is directed and acyclic.

Returns:

API to get/set parameters.

property config: SpecView

Provides an API to set/get the parameters to initialize.

The default parameters are:

  • Additional parameters registered with the eagerx.core.register.config() decorator.

  • Spec.config.name: str

    User specified unique object name.

  • Spec.config.actuators: list

    List with selected actuators. Must be a subset of the registered eagerx.core.register.actuators().

  • Spec.config.sensors: list

    List with selected sensors. Must be a subset of the registered eagerx.core.register.sensors().

  • Spec.config.states: list

    List with selected engine_states. Must be a subset of the registered eagerx.core.register.engine_states().

Returns:

API to get/set parameters.

property engine: SpecView

Provides an API to set/get the parameters of an engine-specific implementation.

The mutable parameters are:

Returns:

API to get/set parameters.

property sensors: SpecView

Provides an API to set/get the parameters of registered eagerx.core.register.sensors().

The mutable parameters are:

  • Spec.sensors.<name>.rate: float = 1.0

    Rate (Hz) at which the sensor’s callback() is called.

  • Spec.sensors.<name>.space: dict = None

    This space defines the format of valid messages.

Returns:

API to get/set parameters.

property states: SpecView

Provides an API to set/get the parameters of registered eagerx.core.register.engine_states().

The mutable parameters are:

  • Spec.states.<name>.space: dict = None

    This space defines the format of valid messages.

Returns:

API to get/set parameters.