Contact sensors#
Sensors that report contact on a rigid link, for manipulation, grasping, and physical-interaction tasks. For usage and how to scope a reading with filter_link_idx, see the contact sensing guide.
gs.sensors.ContactForce#
The total contact force on the associated link, in its local frame.
- class genesis.options.sensors.options.ContactForce(*, history_length: int = 0, delay: float = 0.0, jitter: float = 0.0, draw_debug: bool = False, entity_idx: int = -1, resolution: tuple[float, 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), filter_link_idx: tuple[int, ...] = <factory>, min_force: tuple[float, float, float] = 0.0, max_force: tuple[float, float, float] = inf, debug_color: tuple[float, float, float, float] = (1.0, 0.0, 1.0, 0.5), debug_scale: float = 0.01) None[source]#
Sensor that returns the total contact force being applied to the associated RigidLink in its local frame.
- Parameters:
min_force (float | array-like[float, float, float], optional) – The minimum detectable absolute force per each axis. Values below this will be treated as 0. Default is 0.
max_force (float | array-like[float, float, float], optional) – The maximum output absolute force per each axis. Values above this will be clipped. Default is infinity.
debug_color (array-like[float, float, float, float], optional) – The rgba color of the debug arrow. Defaults to (1.0, 0.0, 1.0, 0.5).
debug_scale (float, optional) – The scale factor for the debug force arrow. Defaults to 0.01.
- class genesis.engine.sensors.contact_force.ContactForceSensor(options: ContactForce, idx: int, shared_context, shared_metadata, manager: SensorManager)[source]#
Bases:
RigidSensorMixin[ContactForceSensorMetadata],SimpleSensor[ContactForce,None,ContactForceSensorMetadata,tuple]Sensor that returns the total contact force being applied to the associated RigidLink in its local frame.
gs.sensors.Contact#
A boolean: whether the associated link is in contact.
- class genesis.options.sensors.options.Contact(*, 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), filter_link_idx: tuple[int, ...] = <factory>, threshold: float = 0.0, debug_sphere_radius: float = 0.05, debug_color: tuple[float, float, float, float] = (1.0, 0.0, 1.0, 0.5)) None[source]#
Sensor that returns bool based on whether associated RigidLink is in contact.
- Parameters:
threshold (float, optional) – The bool-conversion threshold applied at read time to the underlying float contact magnitude (kernel produces float). A bin reads
Trueiff its magnitude exceeds this value. Default0.0so any positive magnitude registers as contact.debug_sphere_radius (float, optional) – The radius of the debug sphere. Defaults to 0.05.
debug_color (array-like[float, float, float, float], optional) – The rgba color of the debug sphere. Defaults to (1.0, 0.0, 1.0, 0.5).
See also#
Sensors: sensor overview.
Contact and force sensors: the contact sensing guide.
Rigid entity: RigidEntity and links.