You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
1.1 KiB

import gymnasium as gym
class Sensor:
"""Base class for implementing sensors in the Gr00t framework.
A Sensor provides information about a specific sensor on the robot (e.g. camera, IMU,
force sensor). This abstract base class defines the interface that all concrete sensor
implementations must follow.
"""
def read(self, **kwargs) -> any:
"""Read the current sensor value.
Args:
**kwargs: Additional parameters specific to the sensor implementation
(e.g. camera resolution, sampling rate)
Returns:
The sensor reading value (e.g. image data, acceleration measurements)
"""
pass
def observation_space(self) -> gym.Space:
"""Get the observation space of this sensor.
Returns:
gym.Space: The observation space defining the shape and bounds of sensor readings
(e.g. image dimensions for camera, measurement ranges for IMU)
"""
pass
def close(self):
"""Clean up any resources used by the sensor."""
pass