-
Notifications
You must be signed in to change notification settings - Fork 202
Added IMU node and IMUData message docs #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b9abeda
Added IMU node and IMUData message docs
Erol444 1586799
Fixed PR issues
Erol444 8b4ff02
Merge branch 'main' into imu_docs
Erol444 25d7ff6
Fixed IMU sensors
Erol444 aeec778
Fixed typo
Erol444 4bc73b0
Update imu.rst
Erol444 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| IMUData | ||
| ======= | ||
|
|
||
| IMU data message is created by the :ref:`IMU` node. | ||
|
|
||
| Reference | ||
| ######### | ||
|
|
||
| .. tabs:: | ||
|
|
||
| .. tab:: Python | ||
|
|
||
| .. autoclass:: depthai.IMUData | ||
| :members: | ||
| :inherited-members: | ||
| :noindex: | ||
|
|
||
| .. tab:: C++ | ||
|
|
||
| .. doxygenclass:: dai::IMUData | ||
| :project: depthai-core | ||
| :members: | ||
| :private-members: | ||
| :undoc-members: | ||
|
|
||
| .. include:: ../../includes/footer-short.rst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| IMU | ||
| === | ||
|
|
||
| IMU (`intertial measurement unit <https://en.wikipedia.org/wiki/Inertial_measurement_unit>`__) node can be used to receive data from the IMU chip on the device. | ||
| Our DepthAI devices use `BNO085 <https://www.ceva-dsp.com/product/bno080-085/>`__ 9-axis sensor (`datasheet here <https://www.ceva-dsp.com/wp-content/uploads/2019/10/BNO080_085-Datasheet.pdf>`__) | ||
| that supports sensor fusion on the (IMU) chip itself. The IMU chip is connected to the Myriad X (VPU) over SPI (we have integrated | ||
| `this driver <https://github.com/hcrest/bno080-driver>`__ to the DepthAI). | ||
|
|
||
|
|
||
| How to place it | ||
| ############### | ||
|
|
||
| .. tabs:: | ||
|
|
||
| .. code-tab:: py | ||
|
|
||
| pipeline = dai.Pipeline() | ||
| imu = pipeline.create(dai.node.IMU) | ||
|
|
||
| .. code-tab:: c++ | ||
|
|
||
| dai::Pipeline pipeline; | ||
| auto imu = pipeline.create<dai::node::IMU>(); | ||
|
|
||
|
|
||
| Inputs and Outputs | ||
| ################## | ||
|
|
||
| .. code-block:: | ||
|
|
||
| ┌──────────────┐ | ||
| │ │ | ||
| │ │ out | ||
| │ IMU ├─────────► | ||
| │ │ | ||
| │ │ | ||
| └──────────────┘ | ||
|
|
||
| **Message types** | ||
|
|
||
| - :code:`out` - :ref:`IMUData` | ||
|
|
||
| Maximum frequencies | ||
| ################### | ||
|
|
||
| Maximum output frequencies are 500 Hz raw accelerometer, 1000 Hz raw gyroscope values individually, and 500 Hz combined (synced) output. | ||
| You can obtain the combined (synced) 500 Hz output with :code:`imu.enableIMUSensor([dai.IMUSensor.RAW_ACCELEROMETER, dai.IMUSensor.RAW_GYROSCOPE], 500)`. | ||
|
|
||
| Usage | ||
| ##### | ||
|
|
||
| .. tabs:: | ||
|
|
||
| .. code-tab:: py | ||
|
|
||
| pipeline = dai.Pipeline() | ||
| imu = pipeline.create(dai.node.IMU) | ||
|
|
||
| # enable RAW_ACCELEROMETER and RAW_GYROSCOPE at 100 hz rate | ||
| imu.enableIMUSensor([dai.IMUSensor.RAW_ACCELEROMETER, dai.IMUSensor.RAW_GYROSCOPE], 100) | ||
| # above this threshold packets will be sent in batch of X, if the host is not blocked and USB bandwidth is available | ||
| imu.setBatchReportThreshold(1) | ||
| # maximum number of IMU packets in a batch, if it's reached device will block sending until host can receive it | ||
| # if lower or equal to batchReportThreshold then the sending is always blocking on device | ||
| # useful to reduce device's CPU load and number of lost packets, if CPU load is high on device side due to multiple nodes | ||
| imu.setMaxBatchReports(10) | ||
|
|
||
| .. code-tab:: c++ | ||
|
|
||
| dai::Pipeline pipeline; | ||
| auto imu = pipeline.create<dai::node::IMU>(); | ||
|
|
||
| // enable RAW_ACCELEROMETER and RAW_GYROSCOPE at 100 hz rate | ||
| imu->enableIMUSensor({dai::IMUSensor::RAW_ACCELEROMETER, dai::IMUSensor::RAW_GYROSCOPE}, 100); | ||
| // above this threshold packets will be sent in batch of X, if the host is not blocked and USB bandwidth is available | ||
| imu->setBatchReportThreshold(1); | ||
| // maximum number of IMU packets in a batch, if it's reached device will block sending until host can receive it | ||
| // if lower or equal to batchReportThreshold then the sending is always blocking on device | ||
| // useful to reduce device's CPU load and number of lost packets, if CPU load is high on device side due to multiple nodes | ||
| imu->setMaxBatchReports(10); | ||
|
|
||
|
|
||
| IMU sensors | ||
| ########### | ||
|
|
||
| When enabling the IMU sensors (:code:`imu.enableIMUSensor()`), you can select between the following sensors: | ||
|
|
||
| - :code:`ACCELEROMETER_RAW` | ||
SzabolcsGergely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - :code:`ACCELEROMETER` | ||
| - :code:`LINEAR_ACCELERATION` | ||
| - :code:`GRAVITY` | ||
| - :code:`GYROSCOPE_RAW` | ||
| - :code:`GYROSCOPE_CALIBRATED` | ||
| - :code:`GYROSCOPE_UNCALIBRATED` | ||
| - :code:`MAGNETOMETER_RAW` | ||
| - :code:`MAGNETOMETER_CALIBRATED` | ||
| - :code:`MAGNETOMETER_UNCALIBRATED` | ||
| - :code:`ROTATION_VECTOR` | ||
| - :code:`GAME_ROTATION_VECTOR` | ||
| - :code:`GEOMAGNETIC_ROTATION_VECTOR` | ||
| - :code:`ARVR_STABILIZED_ROTATION_VECTOR` | ||
| - :code:`ARVR_STABILIZED_GAME_ROTATION_VECTOR` | ||
|
|
||
| Here are **descriptions of all sensors**: | ||
|
|
||
| .. autoclass:: depthai.IMUSensor | ||
| :noindex: | ||
|
|
||
| Examples of functionality | ||
| ######################### | ||
|
|
||
| - :ref:`IMU Accelerometer & Gyroscope` | ||
| - :ref:`IMU Rotation Vector` | ||
|
|
||
| Reference | ||
| ######### | ||
|
|
||
| .. tabs:: | ||
|
|
||
| .. tab:: Python | ||
|
|
||
| .. autoclass:: depthai.node.IMU | ||
| :members: | ||
| :inherited-members: | ||
| :noindex: | ||
|
|
||
| .. tab:: C++ | ||
|
|
||
| .. doxygenclass:: dai::node::IMU | ||
| :project: depthai-core | ||
| :members: | ||
| :private-members: | ||
| :undoc-members: | ||
|
|
||
| .. include:: ../../includes/footer-short.rst | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.