IMU Sensor Extension [omni.isaac.imu_sensor]

The IMU Sensor Extension provides a set of utilities to simulate inertial sensors and read sensor data. The API of the IMU sensor is a lot like that of the contact sensor.

Basic Usage

Setting Up a Sensor

First, aquire the sensor interface. This sensor interface governs all IMU sensors installed on various prims in the stage.

1
2
from omni.isaac.imu_sensor import _imu_sensor
_is = _imu_sensor.acquire_imu_sensor_interface()

Then, Create a SensorProperties object, and set the values according to the sensor specifications:

1
2
3
4
props = _imu_sensor.SensorProperties()
props.position = carb.Float3(0, 0, 0)          # Position relative to the parent body where the sensor is placed
props.orientation = carb.Float4(0, 0, 0, 1)    # Quaternion orientation (x,y,z,w) relative to the parent body where the sensor is placed
props.sensorPeriod = 1 / 500                   # Sensor reading period in seconds. zero means sync with simulation timestep

Finally, add it to the desired rigid body using its prim path:

1
sensor_handle = _is.add_sensor_on_body("/path/to/rigid_body", props)

To collect the readings, call the interface get_sensor_sim_reading. the result will be the accumulated readings since last time the sensor was read. Each reading is timestamped, and contains a boolean flag to tell if the sensor is triggered.

1
readings = _is.get_sensor_readings(sensor_handle)

Acquiring Extension Interface

_imu_sensor.acquire_imu_sensor_interface(plugin_name: str = None, library_path: str = None)omni::isaac::imu_sensor::IMUSensorInterface

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

_imu_sensor.release_imu_sensor_interface(arg0: omni::isaac::imu_sensor::IMUSensorInterface)None

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

IMU Sensor API

Input Types

class SensorProperties

Sensor Properties

property orientation

Quaternion orientation (x,y,z,w) relative to the parent body where the sensor is placed. (carb.Float4)

property position

Position relative to the parent body where the sensor is placed. (carb.Float3)

property sensorPeriod

Sensor reading period in seconds. zero means sync with simulation timestep (float)

Output Types

class SensorReading

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 time

timestamp of the reading, in seconds . (float)

Interface Methods

class IMUSensorInterface
add_sensor_on_body(self: omni.isaac.imu_sensor._imu_sensor.IMUSensorInterface, arg0: str, arg1: omni.isaac.imu_sensor._imu_sensor.SensorProperties)int
Parameters

arg0 (SensorProperties) – the sensor properties

Returns

The sensor handle

Return type

int

get_num_sensors_on_body(self: omni.isaac.imu_sensor._imu_sensor.IMUSensorInterface, arg0: str)int

Gets the number of sensors that were attached to the given body. :param arg0: USD Path to body as string :type arg0: str

Returns

The number of sensors attached to body.

Return type

int

get_sensor_readings(self: omni.isaac.imu_sensor._imu_sensor.IMUSensorInterface, arg0: int)object

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

Returns

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

Return type

numpy.array

get_sensor_readings_size(self: omni.isaac.imu_sensor._imu_sensor.IMUSensorInterface, arg0: int)int

Gets the number of readings ready on the buffer :param arg0: the sensor handle :type arg0: int

Returns

Number of readings ready on the buffer.

Return type

int

get_sensor_sim_reading(self: omni.isaac.imu_sensor._imu_sensor.IMUSensorInterface, arg0: int)omni.isaac.imu_sensor._imu_sensor.SensorReading
Parameters

arg0 (int) – the sensor handle

Returns

The reading for the current simulation time.

Return type

numpy.array

get_sensors_on_body(self: omni.isaac.imu_sensor._imu_sensor.IMUSensorInterface, arg0: str)object

Gets the list of sensor handles attached to a given body. :param arg0: USD Path to body as string :type arg0: str

Returns

The list of sensor handles on a body.

Return type

numpy.array

remove_sensor(self: omni.isaac.imu_sensor._imu_sensor.IMUSensorInterface, arg0: int)bool
Parameters

arg0 (int) – the sensor handle

Returns

True if succesful, False otherwise.

Return type

boolean