Vestibular system
Abstract base class for the vestibular system. |
|
A simple implementation directly reading MuJoCo sensors. |
mimoVestibular.vestibular
This module defines the interface for the vestibular module and a simple implementation.
The interface is defined as an abstract class in Vestibular.
A simple implementation treating using one 3D gyro and one 3D accelerometer is in
SimpleVestibular.
- class mimoVestibular.vestibular.Vestibular(env, vestibular_parameters)
Bases:
objectAbstract base class for the vestibular system.
This class defines the functions that all implementing classes must provide. The constructor takes two arguments: env, which is the environment we are working with, and vestibular_parameters, which can be used to supply implementation specific parameters.
There is only one function that implementations must provide:
get_vestibular_obs()should produce the sensor outputs that will be returned to the environment. These outputs should also be stored insensor_outputs.- env
The environment to which this module will be attached.
- Type
MujocoEnv
- vestibular_parameters
A dictionary containing the configuration. The exact from will depend on the specific implementation.
- Type
Dict
- sensor_outputs
A list of outputs corresponding to the configuration dictionary. This should be populated by
get_vestibular_obs().- Type
np.ndarray
- get_vestibular_obs()
Produce the vestibular sensor outputs.
This function should perform the whole sensory pipeline and return the vestibular output as defined in
vestibular_parameters. Exact return value and functionality will depend on the implementation, but should always be a flat numpy array.- Returns
An array containing the vestibular sensations.
- Return type
np.ndarray
- class mimoVestibular.vestibular.SimpleVestibular(env, vestibular_parameters)
Bases:
mimoVestibular.vestibular.VestibularA simple implementation directly reading MuJoCo sensors.
This class reads all sensors provided in the configuration and stores their outputs in
sensor_outputs. The constructor takes two arguments: env, the environment we are working with, and vestibular_parameters, which is a dictionary containing the configuration. The dictionary structure should be a single entry ‘sensors’ containing a list with the sensor names to be used for the output:{ "sensors": ["vestibular_acc", "vestibular_gyro"], }
The default model has two sensors, ‘vestibular_acc’ and ‘vestibular_gyro’, that can be used for the accelerometer and the gyro, both located in the head.
- env
The environment to which this module should be attached.
- Type
MujocoEnv
- sensor_outputs
A list of outputs corresponding to the configuration dictionary. This is populated by
get_vestibular_obs().- Type
np.ndarray
- get_vestibular_obs()
Produce the vestibular sensor outputs.
Directly reads the sensor values from the MuJoCo sensors provided in the configuration.
- Returns
An array containing the concatenated sensor values.
- Return type
np.ndarray