class
registryregistry is a central source of truth in Habitat-Sim
Taken from Pythia, it is inspired from Redux’s concept of global store. registry maintains mappings of various information to unique keys. Special functions in registry can be used as decorators to register different kind of classes.
Import the global registry object using from habitat_sim import registry
.
Then use various decorators for registering
different kind of classes with unique keys
- Register a movement function :
@registry.register_move_fn
Class methods
- def get_move_fn(name: str)
- Retrieve the move_fn register under
name
- def get_noise_model(name: str)
- Retrieve the noise_model registered under
name
- def register_move_fn(controller: typing.Optional[typing.Type] = None, *, name: typing.Optional[str] = None, body_action: typing.Optional[bool] = None)
- Registers a new control with Habitat-Sim. Registered controls can then be retrieved via get_move_fn()
- def register_noise_model(noise_model: typing.Optional[typing.Type] = None, *, name: typing.Optional[str] = None)
- Registers a new sensor noise model with Habitat-Sim
Method documentation
def habitat_sim. registry. get_move_fn(name: str) classmethod
Retrieve the move_fn register under name
Parameters | |
---|---|
name | The name provided to register_move_fn |
def habitat_sim. registry. get_noise_model(name: str) classmethod
Retrieve the noise_model registered under name
Parameters | |
---|---|
name | The name provided to register_noise_model |
def habitat_sim. registry. register_move_fn(controller: typing.Optional[typing.Type] = None, *,
name: typing.Optional[str] = None,
body_action: typing.Optional[bool] = None) classmethod
Registers a new control with Habitat-Sim. Registered controls can then be retrieved via get_move_fn()
See new-actions for an example of how to add new actions outside the core habitat_sim package.
- param controller:
- The class of the controller to register. Must inherit from agent.SceneNodeControl.
If
None
, will return a wrapper for use with decorator syntax. - param name:
- The name to register the control with. If
None
, will register with the name of the controller converted to snake case, i.e. a controller with class nameMoveForward
will be registered asmove_forward
. - param body_action:
- Whether or not this action manipulates the agent's body (thereby also moving the sensors) or manipulates just the sensors. This is a non-optional keyword arguement and must be set (this is done for readability).
def habitat_sim. registry. register_noise_model(noise_model: typing.Optional[typing.Type] = None, *,
name: typing.Optional[str] = None) classmethod
Registers a new sensor noise model with Habitat-Sim
Parameters | |
---|---|
noise_model | The class of the noise model to register If None, will return a wrapper for use with decorator syntax |
name | The name to register the noise model with If None, will register with the name of the noise_model |