novaphy.sensors.SensorIMU¶
Inertial measurement unit attached to one or more model Site instances. Reports linear acceleration (accelerometer) and angular velocity (gyroscope) in the sensor-local frame.
The accelerometer reports specific force (proper acceleration), so at rest
on a surface it reads +g upward and reads zero in free fall.
Methods¶
| Method | Description |
|---|---|
update(state, dt, gravity=None) |
Compute IMU readings from the current state. |
Attributes¶
| Attribute | Description |
|---|---|
accelerometer |
(N, 3) numpy array of accelerometer readings. |
gyroscope |
(N, 3) numpy array of gyroscope readings. |
num_sensors |
Number of attached sensors. |
Example¶
from novaphy import sensors
imu = sensors.SensorIMU(model, sites="imu_*")
imu.update(state, dt=1.0 / 120.0)
print(imu.accelerometer)