simulo.IMU
Inertial Measurement Unit sensor.
Measures linear acceleration and angular velocity of a body. Commonly mounted on robot base for state estimation.
Attributes:
offset— Sensor offset relative to parent frame
Example:
import simulo
imu = simulo.IMU( offset=simulo.SensorOffset(pos=(0, 0, 0.1)),)scene.add(imu, at="/World/Robot/base/imu")
# Read dataaccel = imu.read_linear_acceleration() # (num_envs, 3)gyro = imu.read_angular_velocity() # (num_envs, 3)simulo.IMU( path: Optional[str] = None, offset: Optional[SensorOffset] = None, update_period: float = 0.0, enabled: bool = True, debug_vis: bool = False,)read_linear_acceleration()
Section titled “read_linear_acceleration()”IMU.read_linear_acceleration() -> torch.TensorGet linear acceleration in sensor frame.
Returns:
Acceleration tensor of shape (num_envs, 3). Values are float32 in m/s^2.
Raises:
RuntimeError— If sensor not initialized
read_angular_velocity()
Section titled “read_angular_velocity()”IMU.read_angular_velocity() -> torch.TensorGet angular velocity in sensor frame.
Returns:
Angular velocity tensor of shape (num_envs, 3). Values are float32 in rad/s.
Raises:
RuntimeError— If sensor not initialized
read_orientation()
Section titled “read_orientation()”IMU.read_orientation() -> torch.TensorGet orientation quaternion in world frame.
Returns:
Orientation tensor of shape (num_envs, 4). Quaternion in (w, x, y, z) format.
Raises:
RuntimeError— If sensor not initialized