IContactSensor#
Fully qualified name: isaacsim::sensors::experimental::physics::IContactSensor
-
struct IContactSensor#
Carbonite interface for managing C++ contact sensors.
Processes raw PhysX contact reports to produce filtered sensor readings. Supports configurable radius filtering and force thresholds.
The plugin is self-driving: it subscribes to PhysX simulation events (eResumed / eStopped) and physics step events internally, so it initializes, discovers sensors, and processes each substep without any Python relay.
Lifecycle:
acquire via carb::getCachedInterface or pybind11 acquire function
createSensor() for each IsaacContactSensor prim (plugin self-initializes on eResumed)
getSensorReading() to read data (sensors update automatically each substep)
getRawContacts() to read raw contact data for a sensor
shutdown() on extension unload
Public Functions
-
virtual void shutdown() = 0#
Shut down the manager, destroying all sensors and freeing resources.
-
virtual bool createSensor(const char *primPath) = 0#
Create a contact sensor for the given IsaacContactSensor prim.
Finds the parent rigid body by walking up the prim hierarchy. If a sensor already exists for this prim path the call succeeds without creating a duplicate.
Note
Side effect: This method modifies the USD stage by applying PhysxSchemaPhysxContactReportAPI on the parent rigid body (with threshold=0 and sleepThreshold=0). This is required for PhysX getFullContactReport() to return contact data for this body.
- Parameters:
primPath – USD path to the IsaacContactSensor prim.
- Returns:
true on success (sensor created or already exists), false on failure.
-
virtual void removeSensor(const char *primPath) = 0#
Remove a sensor and free its resources.
- Parameters:
primPath – USD path used when the sensor was created.
-
virtual ContactSensorReading getSensorReading(const char *primPath) = 0#
Get the latest reading for a sensor.
- Parameters:
primPath – USD path used when the sensor was created.
- Returns:
Sensor reading. isValid is false if sensor is disabled or not found.
- virtual void getRawContacts(
- const char *primPath,
- const ContactRawData **outData,
- int32_t *outCount,
Get raw contact data for a sensor’s parent body.
- Parameters:
primPath – USD path used when the sensor was created.
outData – Pointer to receive the raw contact data array.
outCount – Pointer to receive the number of raw contact entries.