1- from dataclasses import dataclass
21from typing import Sequence
32
43import numpy as np
5- import torch
64from pydantic import Field
75
86import genesis as gs
97
108from ..options import Options
11- from .raycaster import RaycastPattern , DepthCameraPattern
12-
9+ from .raycaster import DepthCameraPattern , RaycastPattern
1310
1411Tuple3FType = tuple [float , float , float ]
1512MaybeTuple3FType = float | Tuple3FType
@@ -190,7 +187,7 @@ class IMU(RigidSensorOptionsMixin, NoisySensorOptionsMixin, SensorOptions):
190187 acc_resolution : float, optional
191188 The measurement resolution of the accelerometer (smallest increment of change in the sensor reading).
192189 Default is 0.0, which means no quantization is applied.
193- acc_axes_skew : float | tuple[float, float, float] | Sequence[float]
190+ acc_cross_axis_coupling : float | tuple[float, float, float] | Sequence[float]
194191 Accelerometer axes alignment as a 3x3 rotation matrix, where diagonal elements represent alignment (0.0 to 1.0)
195192 for each axis, and off-diagonal elements account for cross-axis misalignment effects.
196193 - If a scalar is provided (float), all off-diagonal elements are set to the scalar value.
@@ -205,8 +202,8 @@ class IMU(RigidSensorOptionsMixin, NoisySensorOptionsMixin, SensorOptions):
205202 gyro_resolution : float, optional
206203 The measurement resolution of the gyroscope (smallest increment of change in the sensor reading).
207204 Default is 0.0, which means no quantization is applied.
208- gyro_axes_skew : float | tuple[float, float, float] | Sequence[float]
209- Gyroscope axes alignment as a 3x3 rotation matrix, similar to `acc_axes_skew `.
205+ gyro_cross_axis_coupling : float | tuple[float, float, float] | Sequence[float]
206+ Gyroscope axes alignment as a 3x3 rotation matrix, similar to `acc_cross_axis_coupling `.
210207 gyro_bias : tuple[float, float, float]
211208 The constant additive bias for each axis of the gyroscope.
212209 gyro_noise : tuple[float, float, float]
@@ -225,8 +222,8 @@ class IMU(RigidSensorOptionsMixin, NoisySensorOptionsMixin, SensorOptions):
225222
226223 acc_resolution : MaybeTuple3FType = 0.0
227224 gyro_resolution : MaybeTuple3FType = 0.0
228- acc_axes_skew : MaybeMatrix3x3Type = 0.0
229- gyro_axes_skew : MaybeMatrix3x3Type = 0.0
225+ acc_cross_axis_coupling : MaybeMatrix3x3Type = 0.0
226+ gyro_cross_axis_coupling : MaybeMatrix3x3Type = 0.0
230227 acc_noise : MaybeTuple3FType = 0.0
231228 gyro_noise : MaybeTuple3FType = 0.0
232229 acc_bias : MaybeTuple3FType = 0.0
@@ -240,15 +237,17 @@ class IMU(RigidSensorOptionsMixin, NoisySensorOptionsMixin, SensorOptions):
240237 debug_gyro_scale : float = 0.01
241238
242239 def model_post_init (self , _ ):
243- self ._validate_axes_skew (self .acc_axes_skew )
244- self ._validate_axes_skew (self .gyro_axes_skew )
245-
246- def _validate_axes_skew (self , axes_skew ):
247- axes_skew_np = np .array (axes_skew )
248- if axes_skew_np .shape not in ((), (3 ,), (3 , 3 )):
249- gs .raise_exception (f"axes_skew shape should be (), (3,), or (3, 3), got: { axes_skew_np .shape } " )
250- if np .any (axes_skew_np < 0.0 ) or np .any (axes_skew_np > 1.0 ):
251- gs .raise_exception (f"axes_skew values should be between 0.0 and 1.0, got: { axes_skew } " )
240+ self ._validate_cross_axis_coupling (self .acc_cross_axis_coupling )
241+ self ._validate_cross_axis_coupling (self .gyro_cross_axis_coupling )
242+
243+ def _validate_cross_axis_coupling (self , cross_axis_coupling ):
244+ cross_axis_coupling_np = np .array (cross_axis_coupling )
245+ if cross_axis_coupling_np .shape not in ((), (3 ,), (3 , 3 )):
246+ gs .raise_exception (
247+ f"cross_axis_coupling shape should be (), (3,), or (3, 3), got: { cross_axis_coupling_np .shape } "
248+ )
249+ if np .any (cross_axis_coupling_np < 0.0 ) or np .any (cross_axis_coupling_np > 1.0 ):
250+ gs .raise_exception (f"cross_axis_coupling values should be between 0.0 and 1.0, got: { cross_axis_coupling } " )
252251
253252
254253class Raycaster (RigidSensorOptionsMixin , SensorOptions ):
0 commit comments