接触传感器#
用于报告刚体连杆上接触情况的传感器,面向操作、抓取和物理交互任务。关于用法,以及如何用 filter_link_idx 限定读数范围,请参阅 接触传感指南。
gs.sensors.ContactForce#
作用在关联连杆上的总接触力,以其局部坐标系表示。
- 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: SensorOptions, idx: int, shared_context: SharedSensorContextT, shared_metadata: SharedSensorMetadataT, manager: SensorManager)[source]#
Bases:
RigidSensorMixin[ContactForceSensorMetadata],SimpleSensor[ContactForce,None,ContactForceSensorMetadata]Sensor that returns the total contact force being applied to the associated RigidLink in its local frame.
gs.sensors.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).