Other sensors#
This page collects the remaining built-in sensors that do not fit the contact, tactile, IMU, camera, or raycaster families: a surface-distance probe, a thermal grid, and a joint-torque sensor.
Create each one from its gs.sensors.* options object with scene.add_sensor(); the call returns the sensor handle whose read() gives the measured value. For the attach-and-read model, batched reads, and configuration with noise, delay, and history, see the sensors overview.
SurfaceDistanceProbe#
Reports the nearest distance from each probe point to the mesh surfaces of a set of tracked rigid links, clamped to probe_radius when nothing is in range. The matching nearest points are available on the nearest_points attribute. See the proximity guide.
- class genesis.options.sensors.options.SurfaceDistanceProbe(*, history_length: int = 0, delay: float = 0.0, jitter: float = 0.0, draw_debug: bool = False, entity_idx: int = -1, probe_local_pos: tuple[tuple[float, float, float], ...] | tuple[tuple[tuple[float, float, float], ...], ...] = ((0.0, 0.0, 0.0),), probe_radius: tuple[float, ...] | float = 0.5, probe_radius_noise: float = 0.0, debug_probe_color: tuple[float, float, float] = (0.2, 0.4, 1.0), debug_probe_center_radius: float = 0.0008, debug_probe_sphere_opacity: float = 0.3, resolution: tuple[float, ...] | float = 0.0, bias: tuple[float, ...] | float = 0.0, noise: tuple[float, ...] | float = 0.0, random_walk: tuple[float, ...] | float = 0.0, link_idx_local: int = 0, pos_offset: tuple[float, float, float] = (0.0, 0.0, 0.0), euler_offset: tuple[float, float, float] = (0.0, 0.0, 0.0), track_link_idx: tuple[int, ...] = <factory>) None[source]#
Surface distance probe that reports nearest distances from probe positions to tracked mesh surfaces.
The read() output will provide the distances, and the nearest points can be accessed with sensor.nearest_points.
Attached to a rigid entity link. Takes a list of local probe positions and a list of global link indices to track; for each probe, outputs the distance and nearest point (world frame) to the closest mesh surface among the tracked links. If no mesh is within max_range, reports max_range and the probe position as nearest point.
- Parameters:
probe_local_pos (array-like[array-like[float, float, float]]) – Probe positions in link-local frame. One (x, y, z) per probe.
probe_radius (float | array-like[float]) – Maximum sensing range in meters. When no mesh is within this distance, distance is clamped to the probe radius and nearest points is the probe position. Default: 0.5. Also controls the outer debug sphere.
track_link_idx (array-like[int]) – Global link indices (solver link space) whose mesh geoms are used for distance queries.
- class genesis.engine.sensors.surface_distance_probe.SurfaceDistanceProbeSensor(options: SurfaceDistanceProbe, idx: int, shared_context, shared_metadata, manager: SensorManager)[source]#
Bases:
ProbeSensorMixin[SurfaceDistanceProbeMetadata],RigidSensorMixin[SurfaceDistanceProbeMetadata],SimpleSensor[SurfaceDistanceProbe,None,SurfaceDistanceProbeMetadata,tuple]Surface distance probe: distance and nearest point from probe positions to tracked mesh surfaces.
- build()[source]#
Initialize all shared metadata needed to update all noisy sensors.
Time-related state (
delays_ts,jitter_ts) is pushed bySensor.build(); this method adds the imperfection-parameter state.
- classmethod reset(shared_metadata: SurfaceDistanceProbeMetadata, shared_ground_truth_cache: Tensor, envs_idx)[source]#
Reset the sensor.
This method is called by SensorManager when the scene is reset by scene.reset().
- Parameters:
shared_metadata (SharedSensorMetadata) – The shared metadata for the sensor class.
shared_ground_truth_cache (torch.Tensor) – The shared ground truth cache for the sensor class.
envs_idx (array_like) – The indices of the environments to reset. The envs_idx should already be sanitized by SensorManager.
- property nearest_points: Tensor#
Nearest mesh points for the measured (noisy-radius) query, aligned with
read()– a gridprobe_local_pos(M, N, 3) reads back as (…, M, N, 3), a flat layout as (…, n_probes, 3).
- property nearest_points_ground_truth: Tensor#
Nearest mesh points for the nominal-radius ground-truth query, aligned with
read_ground_truth().
TemperatureGrid#
Overlays a 3D voxel grid on one rigid link and reports the temperature of every cell, in degrees Celsius, evolving each cell from contact conduction, radiation, convection, and optional per-cell heat generation. See the temperature grid guide.
Material properties are supplied through a properties_dict mapping a global rigid-link index to a TemperatureProperties entry.
- class genesis.options.sensors.options.TemperatureProperties(base_temperature: float = 21.0, conductivity: float = 50.0, density: float = 1000.0, specific_heat: float = 1.0, emissivity: float = 0.9)[source]#
Material properties for temperature sensor.
- Parameters:
base_temperature (float) – The base temperature of the material in Celsius.
conductivity (float) – The conductivity of the material in W/(m*K)
density (float) – The density of the material in kilograms per cubic meter.
specific_heat (float) – The specific heat of the material in J/(kg*C).
emissivity (float) – The emissivity of the material, between 0 and 1.
- class genesis.options.sensors.options.TemperatureGrid(*, history_length: int = 0, delay: float = 0.0, jitter: float = 0.0, draw_debug: bool = False, entity_idx: int = -1, resolution: tuple[float, ...] | float = 0.0, bias: tuple[float, ...] | float = 0.0, noise: tuple[float, ...] | float = 0.0, random_walk: tuple[float, ...] | float = 0.0, link_idx_local: int = 0, pos_offset: tuple[float, float, float] = (0.0, 0.0, 0.0), euler_offset: tuple[float, float, float] = (0.0, 0.0, 0.0), properties_dict: dict[int, genesis.options.sensors.options.TemperatureProperties] = <factory>, ambient_temperature: float | None = None, convection_coefficient: float | None = None, simulate_all_link_temperatures: bool = False, grid_size: tuple[int, int, int] = (1, 1, 1), heat_generation: tuple[tuple[tuple[float, ...], ...], ...] | None = None, sensor_time_constant: float = 0.0, contact_depth_weight: float = 1.0, debug_temperature_range: tuple[float, float] = (0.0, 100.0)) None[source]#
Sensor that returns the temperature in Celsius of the associated RigidLink in its local frame.
Temperature is computed based on object contacts and their material properties provided to these options.
- Parameters:
properties_dict (dict[int, TemperatureProperties]) – A dictionary which maps link indices to their temperature-related material properties. Key -1 is used as the default for links not present in the dict; if omitted, unlisted links are ignored in contacts. This parameter is shared across all Temperature sensors (dicts will be merged).
ambient_temperature (float) – The ambient temperature in Celsius. Default is 21 degrees C. This parameter is shared across all Temperature sensors (the last one set will be used).
convection_coefficient (float) – Convection coefficient h in W/(m^2*K) for surface cooling. Default 1.0. This parameter is shared across all Temperature sensors (the last one set will be used).
simulate_all_link_temperatures (bool) – If True, the temperatures of all links with temperature properties will be simulated. When False, other links are treated as adiabatic (no heat transfer, always at base temperature). This parameter is shared across all Temperature sensors (setting True for one sets it for all).
grid_size (tuple[int, int, int]) – The size of the grid in the x, y, and z directions which determines the sensor resolution by spatially discretizing the bounding box of the rigid entity link.
heat_generation (Grid3DFloatType | None) – The heat generation rate in Watts per square meter for each cell in the grid.
sensor_time_constant (float) – The time constant of the sensor in seconds.
contact_depth_weight (float) – The weight of the contact depth in the temperature calculation.
debug_temperature_range (tuple[float, float], optional) – The range of temperatures to visualize in the debug mode. Defaults to (0.0, 100.0).
- class genesis.engine.sensors.temperature.TemperatureGridSensor(options: TemperatureGrid, idx: int, shared_context, shared_metadata, manager: SensorManager)[source]#
Bases:
RigidSensorMixin[TemperatureGridSensorMetadata],SimpleSensor[TemperatureGrid,None,TemperatureGridSensorMetadata,TemperatureGridSensorMetadata]- build()[source]#
Initialize all shared metadata needed to update all noisy sensors.
Time-related state (
delays_ts,jitter_ts) is pushed bySensor.build(); this method adds the imperfection-parameter state.
- classmethod reset(shared_metadata: TemperatureGridSensorMetadata, current_ground_truth_data_T: Tensor, envs_idx)[source]#
Reset the sensor.
This method is called by SensorManager when the scene is reset by scene.reset().
- Parameters:
shared_metadata (SharedSensorMetadata) – The shared metadata for the sensor class.
shared_ground_truth_cache (torch.Tensor) – The shared ground truth cache for the sensor class.
envs_idx (array_like) – The indices of the environments to reset. The envs_idx should already be sanitized by SensorManager.
- property link_temperatures: Tensor#
JointTorque#
Measures the generalized effort delivered at each selected actuator’s output shaft: torque for revolute dofs, force for prismatic dofs. Because it reads the constraint-solved effort, external contacts show up implicitly as a change in joint load.
- class genesis.options.sensors.options.JointTorque(*, history_length: int = 0, delay: float = 0.0, jitter: float = 0.0, draw_debug: bool = False, entity_idx: int = -1, resolution: tuple[float, ...] | float = 0.0, bias: tuple[float, ...] | float = 0.0, noise: tuple[float, ...] | float = 0.0, random_walk: tuple[float, ...] | float = 0.0, link_idx_local: int = 0, pos_offset: tuple[float, float, float] = (0.0, 0.0, 0.0), euler_offset: tuple[float, float, float] = (0.0, 0.0, 0.0), dofs_idx_local: tuple[int, ...] | None = None) None[source]#
Actuator output effort sensor for rigid entities (torque for revolute DOFs, force for prismatic DOFs).
Models the generalized effort at each joint’s gearbox output shaft:
actuator_force = tau_control - armature * qacc + tau_frictionloss + tau_damping
where
qaccis the constraint-solved joint acceleration,armaturethe per-DOF armature inertia,tau_frictionlossthe Coulomb friction constraint effort (negative when opposing motion), andtau_damping = -damping * velthe viscous passive effort. Gravity, Coriolis and contact loads are thus captured implicitly.- Parameters:
entity_idx (int) – Scene-level index of the RigidEntity to sense. Must be >= 0.
dofs_idx_local (array-like[int] | None, optional) – Local DOF indices within the entity.
None(default) selects all DOFs.
- class genesis.engine.sensors.joint_torque.JointTorqueSensor(options: JointTorque, idx: int, shared_context: None, shared_metadata: JointTorqueSensorMetadata, manager: SensorManager)[source]#
Bases:
SimpleSensor[JointTorque,None,JointTorqueSensorMetadata,tuple]Measures the generalized effort transmitted from each actuator to its joint output shaft (torque for revolute DOFs, force for prismatic DOFs).
The reading is the commanded actuator effort minus the gearbox losses, derived from Newton’s 3rd law at the gearbox interface:
actuator_force = tau_control - armature * qacc + tau_frictionloss + tau_damping
where
tau_damping = -damping * velis the viscous passive effort. Gravity, Coriolis and contact loads are captured implicitly through the constraint-solved accelerationqacc.
See also#
Sensors: Sensor overview
Contact sensors: Contact and contact-force sensing
Raycaster sensor: Ray-based distance measurement