cambrian.eyes.multi_eye¶
Defines a multi-eye system that procedurally generates multiple eyes and manages them.
Classes¶
Config for MjCambrianMultiEye. |
|
Defines a multi-eye system that procedurally generates multiple eyes and manages |
Module Contents¶
- class MjCambrianMultiEyeConfig[source]¶
Bases:
cambrian.eyes.eye.MjCambrianEyeConfig
Config for MjCambrianMultiEye.
Inherits from MjCambrianEyeConfig and adds attributes for procedural eye placement.
- Variables:
instance (Callable[[Self, str], MjCambrianEye]) – The class instance to use when creating the eye. Takes the config and the name of the eye as arguments.
single_eye (MjCambrianEyeConfig) – The config for a single eye. This is used as the base configuration for all eyes in the multi-eye system.
lat_range (Optional[Tuple[float, float]]) – The x range of the eye. This is used to determine the placement of the eye on the agent. Specified in degrees. This is the latitudinal/vertical range of the evenly placed eye about the agent’s bounding sphere.
lon_range (Optional[Tuple[float, float]]) – The y range of the eye. This is used to determine the placement of the eye on the agent. Specified in degrees. This is the longitudinal/horizontal range of the evenly placed eye about the agent’s bounding sphere.
num_eyes (Optional[Tuple[int, int]]) – The num of eyes to generate. If this is specified, then the eyes will be generated on a spherical grid. The first element is the number of eyes to generate latitudinally and the second element is the number of eyes to generate longitudinally. The eyes will be named sequentially starting from eye_0. Each eye will default to use the first eye config in the eyes attribute. eyes must have a length of 1 if this is specified. Each eye is named eye_{lat}_{lon} where lat is the latitude index and lon is the longitude index.
flatten_observation (Optional[bool]) – Whether to flatten the observation space of the multi-eye system. If True, the observation space will be a Box space with the shape (num_eyes * eye_observation_space,). If False, the observation space will be a Dict space with the keys as the eye names and the values as the eye observation spaces. Defaults to False.
- class MjCambrianMultiEye(config, name, disable_render=True)[source]¶
Bases:
cambrian.eyes.eye.MjCambrianEye
Defines a multi-eye system that procedurally generates multiple eyes and manages them.
Inherits from MjCambrianEye but manages multiple eyes.
- Parameters:
config (MjCambrianMultiEyeConfig) – Configuration for the multi-eye system.
name (str) – Base name for the eyes.
- render()[source]¶
This is a debug method which renders the eye’s as a composite image.
- Will appear as a compound eye. For example, if we have a 3x3 grid of eyes:
TL T TR ML M MR BL B BR
Each eye has a red border around it.
- property observation_space: gymnasium.spaces.Space[source]¶
Constructs the observation space for the multi-eye.
- property eyes: Dict[str, cambrian.eyes.eye.MjCambrianEye][source]¶
Returns the dictionary of eyes.