Isaac Sensor Extension [omni.isaac.isaac_sensor]

The Isaac Sensor Extension provides a set of simulated physics based sensors like contact sensor, inertial measurement unit (IMU) sensor and interfaces to access them in the simulator

Contact Sensor

This submodule provides an interface to a simulated contact sensor. A simplified command is provided to create a contact sensor in the stage:

commands.IsaacSensorCreateContactSensor(parent: str = None, visualize: bool = False, min_threshold: float = 0, max_threshold: float = 100000, color: pxr.Gf.Vec4f = Gf.Vec4f(1.0, 1.0, 1.0, 1.0), radius: float = - 1, sensor_period: float = - 1, translation: pxr.Gf.Vec3d = Gf.Vec3d(0.0, 0.0, 0.0))

Base class for all Commands.

Once the contact sensor is created, you must first acquire this interface and then you can use this interface to access the contact sensor

Also, the offset of the contact sensor is also affect by the parent’s transformations.

1
2
from omni.isaac.isaac_sensor import _isaac_sensor
_cs = _isaac_sensor.acquire_contact_sensor_interface()

Please note: if the contact sensor is not initially created under a valid rigid body parent, the contact sensor will not output any valid data even if the contact sensor is later attached to a valid rigid body parent.

Acquiring Extension Interface

_isaac_sensor.acquire_contact_sensor_interface(plugin_name: str = None, library_path: str = None)omni::isaac::isaac_sensor::ContactSensorInterface

Acquire Contact Sensor interface. This is the base object that all of the Contact Sensor functions are defined on

_isaac_sensor.release_contact_sensor_interface(arg0: omni::isaac::isaac_sensor::ContactSensorInterface)None

Release Contact Sensor interface. Generally this does not need to be called, the Contact Sensor interface is released on extension shutdown

To collect the most recent reading, call the interface get_sensor_sim_reading(/path/to/sensor). The result will be most recent sensor reading.

reading = _cs.get_sensor_sim_reading("/World/Cube/Contact_Sensor")

To collect the readings, call the interface get_sensor_readings(/path/to/sensor). The result will be the accumulated readings since last frame of the simulator. Each reading is timestamped, and contains a boolean flag to tell if the sensor is triggered.

readings = _cs.get_sensor_readings("/World/Cube/Contact_Sensor")

To collect raw reading, call the interface get_contact_sensor_raw_data(/path/to/sensor). The result will return a list of raw contact data for that body.

raw_Contact = _cs.get_contact_sensor_raw_data("/World/Cube/Contact_Sensor")

Output Types

class CsSensorReading

Contact Sensor Reading

property inContact

boolean that flags if the sensor registers a contact. (bool)

property time

timestamp of the reading, in seconds . (float)

property value

sensor force reading value. (float)

class CsRawData

Contact Raw Data

property body0

Body 0 name handle, (int)

property body1

Body 1 name handle, (int)

property dt

timestep during this contact report, (float)

property impulse

impulse, global coordinates , (carb.Float3)

property normal

normal, global coordinates , (carb.Float3)

property position

position, global coordinates, (carb.Float3)

property time

simulation timestamp, (float)

Interface Methods

class ContactSensorInterface
decode_body_name(self: omni.isaac.isaac_sensor._isaac_sensor.ContactSensorInterface, arg0: int)str

Decodes the body name pointers from the contact raw data into a string :param arg0: body name handle :type arg0: int

Returns

The body name.

Return type

str

get_contact_sensor_raw_data(self: omni.isaac.isaac_sensor._isaac_sensor.ContactSensorInterface, arg0: str)object
Parameters

arg0 (str) – USD Path to contact sensor as string

Returns

The list of contact raw data that contains the specified body that the contact sensor is attached to.

Return type

numpy.array

get_rigid_body_raw_data(self: omni.isaac.isaac_sensor._isaac_sensor.ContactSensorInterface, arg0: str)object

Get raw data from a rigid body that have contact report API enabled :param arg0: USD Path to rigid body as string :type arg0: str

Returns

The list of contact raw data that contains the specified body.

Return type

numpy.array

get_sensor_readings(self: omni.isaac.isaac_sensor._isaac_sensor.ContactSensorInterface, arg0: str)object

Gets the list of sensor readings for the given sensor, clears the reading buffer once values are acquired :param arg0: USD Path to sensor as string :type arg0: str

Returns

The list of readings for the sensor ready on the buffer.

Return type

numpy.array

get_sensor_readings_size(self: omni.isaac.isaac_sensor._isaac_sensor.ContactSensorInterface, arg0: str)int

Gets the number of readings ready on the buffer :param arg0: USD Path to sensor as string :type arg0: str

Returns

Number of readings ready on the buffer.

Return type

int

get_sensor_sim_reading(self: omni.isaac.isaac_sensor._isaac_sensor.ContactSensorInterface, arg0: str)omni.isaac.isaac_sensor._isaac_sensor.CsSensorReading
Parameters

arg0 (str) – USD Path to sensor as string

Returns

The reading for the current simulation time.

Return type

numpy.array

is_contact_sensor(self: omni.isaac.isaac_sensor._isaac_sensor.ContactSensorInterface, arg0: str)bool
Parameters

arg0 (str) – USD Path to sensor as string

Returns

True for is contact sensor, False for not contact sensor.

Return type

bool

IMU sensor

This submodule provides an interface to a simulate IMU sensor, which provides linear acceleration and angular velocity data.

A simplified command is provided to create an IMU sensor:

commands.IsaacSensorCreateImuSensor(parent: str = None, visualize: bool = False, sensor_period: float = - 1, translation: pxr.Gf.Vec3d = Gf.Vec3d(0.0, 0.0, 0.0), orientation: pxr.Gf.Quatd = Gf.Quatd(1.0, Gf.Vec3d(0.0, 0.0, 0.0)))

Base class for all Commands.

Similiarly, once an IMU sensor is created, you can use this interface to interact with the simulated IMU sensor. You must first call the acquire_imu_sensor_interface.

1
2
from omni.isaac.isaac_sensor import _isaac_sensor
_is = _isaac_sensor.acquire_imu_sensor_interface()

Please note: if the IMU sensor is not initially created under a valid rigid body parent, the IMU sensor will not output any valid data even if the IMU sensor is later attached to a valid rigid body parent. Also, the offset and orientation of the IMU sensor is also affect by the parent’s transformations.

Acquiring Extension Interface

_isaac_sensor.acquire_imu_sensor_interface(plugin_name: str = None, library_path: str = None)omni::isaac::isaac_sensor::ImuSensorInterface

Acquire Contact Sensor interface. This is the base object that all of the Contact Sensor functions are defined on

_isaac_sensor.release_imu_sensor_interface(arg0: omni::isaac::isaac_sensor::ImuSensorInterface)None

Release Contact Sensor interface. Generally this does not need to be called, the Contact Sensor interface is released on extension shutdown

To collect the most recent reading, call the interface get_sensor_sim_reading(/path/to/sensor). The result will be most recent sensor reading.

reading = _is.get_sensor_sim_reading("/World/Cube/Imu_Sensor")

To collect the readings, call the interface get_sensor_readings(/path/to/sensor). The result will be the accumulated readings since last frame of the simulator. Each reading is timestamped, and contains a boolean flag to tell if the sensor is triggered.

readings = _is.get_sensor_readings("/World/Cube/Imu_Sensor")

Output Types

class IsSensorReading

Imu Sensor Reading

property ang_vel_x

Gyroscope reading value x axis, in rad/s. (float)

property ang_vel_y

Gyroscope reading value y axis, in rad/s. (float)

property ang_vel_z

Gyroscope reading value z axis, in rad/s. (float)

property lin_acc_x

Accelerometer reading value x axis, in m/s^2. (float)

property lin_acc_y

Accelerometer reading value y axis, in m/s^2. (float)

property lin_acc_z

Accelerometer reading value z axis, in m/s^2. (float)

property orientation

Orientation quaternion reading (x, y, z, w). (carb.Float4)

property time

timestamp of the reading, in seconds . (float)

Interface Methods

class ImuSensorInterface
get_sensor_readings(self: omni.isaac.isaac_sensor._isaac_sensor.ImuSensorInterface, arg0: str)object

Gets the list of sensor readings for the given sensor. Clears the reading buffer once values are acquired. :param arg0: the sensor path :type arg0: char*

Returns

The list of readings for the sensor ready on the buffer.

Return type

numpy.array

get_sensor_readings_size(self: omni.isaac.isaac_sensor._isaac_sensor.ImuSensorInterface, arg0: str)int

Gets the number of readings ready on the buffer :param arg0: the sensor path :type arg0: char*

Returns

Number of readings ready on the buffer.

Return type

int

get_sensor_sim_reading(self: omni.isaac.isaac_sensor._isaac_sensor.ImuSensorInterface, arg0: str)omni.isaac.isaac_sensor._isaac_sensor.IsSensorReading
Parameters

arg0 (char*) – the sensor path

Returns

The reading for the current simulation time.

Return type

numpy.array

is_imu_sensor(self: omni.isaac.isaac_sensor._isaac_sensor.ImuSensorInterface, arg0: str)bool
Parameters

arg0 (str) – USD Path to sensor as string

Returns

True for is imu sensor, False for not imu sensor.

Return type

bool