Skip to content

Commit 5226862

Browse files
Merge pull request #510 from luxonis/imu_device_ts
Add device monotonic timestamp to IMU reports
2 parents b793fdc + a661e86 commit 5226862

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

examples/IMU/imu_gyroscope_accelerometer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@
1414

1515
xlinkOut.setStreamName("imu")
1616

17-
# enable ACCELEROMETER_RAW and GYROSCOPE_RAW at 500 hz rate
18-
imu.enableIMUSensor([dai.IMUSensor.ACCELEROMETER_RAW, dai.IMUSensor.GYROSCOPE_RAW], 500)
17+
# enable ACCELEROMETER_RAW at 500 hz rate
18+
imu.enableIMUSensor(dai.IMUSensor.ACCELEROMETER_RAW, 500)
19+
# enable GYROSCOPE_RAW at 400 hz rate
20+
imu.enableIMUSensor(dai.IMUSensor.GYROSCOPE_RAW, 400)
21+
# it's recommended to set both setBatchReportThreshold and setMaxBatchReports to 20 when integrating in a pipeline with a lot of input/output connections
1922
# above this threshold packets will be sent in batch of X, if the host is not blocked and USB bandwidth is available
2023
imu.setBatchReportThreshold(1)
2124
# maximum number of IMU packets in a batch, if it's reached device will block sending until host can receive it

src/DatatypeBindings.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ void DatatypeBindings::bind(pybind11::module& m, void* pCallstack){
503503
.def_readwrite("sequence", &IMUReport::sequence)
504504
.def_readwrite("accuracy", &IMUReport::accuracy)
505505
.def_readwrite("timestamp", &IMUReport::timestamp)
506+
.def_readwrite("tsDevice", &IMUReport::tsDevice)
506507
;
507508

508509

0 commit comments

Comments
 (0)