How to use imu sensors in OmniIsaacGymEnv

Hello,

I have been trying to use IMU sensors in scripts from OmniIsaacGymEnv. I have created my imus in the usada, but then every sigle python line I’ve tried to acess the measurement don’t work.

For example, trying to put this code ANYWHERE, be in the main task code, the robot, articulation or view code :

from omni.isaac.sensor import _sensor
_imu_sensor_interface = _sensor.acquire_imu_sensor_interface()

inevitably leads to

" _imu_sensor_interface = _sensor.acquire_imu_sensor_interface()
RuntimeError: Failed to acquire interface: omni::isaac::sensor::ImuSensorInterface (pluginName: nullptr)
"
(and not much more explanation)

Are these supposed to work ? I know camera and lidar don’t work yet with RL systems, but I was expecting at least to be able to use IMUS quite straghtforwardly.

Thx

Were you able to figure it out?

no, i’m reimplementing the signal computation myself …

This worked for me:

Create IMU Sensor interfaces

def create_sensors(num_envs):
sensor_paths = [f"/World/envs/env_{i}/pinky/base_link/Imu_Sensor" for i in range( num_envs)]
sensors =
for path in sensor_paths:
sensor = IMUSensor(
prim_path=path,
name=“imu”,
frequency=60,
translation=np.array([0, 0, 0]),
orientation=np.array([1, 0, 0, 0]),
linear_acceleration_filter_size=10,
angular_velocity_filter_size=10,
orientation_filter_size=10,
)
sensors.append(sensor)
return sensors

Hi @rochmollero - You just need to add the extension to the gym app files.
similar to this: No module named 'omni.isaac.sensor' · Issue #93 · NVIDIA-Omniverse/OmniIsaacGymEnvs · GitHub

Hey, I’ve tried and now i can actually call the functions so that’s good. But now the problem is that print(self._imu_sensor_interface.get_sensor_readings(“/World/envs/env_0/Jvrc1/base_link/Imu_Sensor”)) is always the same value !

Is there a reason why ? I’m still using isaac_sim-2022.2.0, not the most recent by the way.