|
1 | 1 | Orientation |
2 | 2 | =========== |
3 | 3 |
|
| 4 | +.. figure:: /_static/api/vision/yawpitchroll.png |
| 5 | + :alt: Yaw Pitch and Roll |
| 6 | + :scale: 80% |
| 7 | + |
| 8 | + Yaw Pitch and Roll (Image source: Peking University) |
| 9 | + |
| 10 | +Orientation represents the rotation of a marker around the x, y, and z axes. These can be accessed as follows: |
| 11 | + |
| 12 | +* ``rot_x`` / ``pitch`` - the angle of rotation in radians counter-clockwise about the Cartesian x axis. |
| 13 | +* ``rot_y`` / ``yaw`` - the angle of rotation in radians counter-clockwise about the Cartesian y axis. |
| 14 | +* ``rot_z`` / ``roll`` - the angle of rotation in radians counter-clockwise about the Cartesian z axis. |
| 15 | + |
| 16 | +Rotations are applied in order of z, y, x. |
| 17 | + |
| 18 | +.. code:: python |
| 19 | +
|
| 20 | + markers = r.camera.see() |
| 21 | +
|
| 22 | + for m in markers: |
| 23 | + print(m.orientation.rot_x) # Angle of rotation about x axis. |
| 24 | + print(m.orientation.rot_y) # Angle of rotation about y axis. |
| 25 | + print(m.orientation.rot_z) # Angle of rotation about z axis. |
| 26 | +
|
| 27 | +.. Note:: In our use case the z axis always faces the camera, and thus will appear as a clockwise rotation |
| 28 | + |
| 29 | +Examples |
| 30 | +-------- |
| 31 | + |
| 32 | +The following table visually explains what positive and negative rotations represent. |
| 33 | + |
| 34 | ++----------------------------+-----------------------------+ |
| 35 | +| 0 in all axes | |m0x0y0z| | |
| 36 | ++--------------+-------------+---------------+-------------+ |
| 37 | +| π/4 in rot_x | |m-45x0y0z| | -π/4 in rot_x | |m-45x0y0z| | |
| 38 | ++--------------+-------------+---------------+-------------+ |
| 39 | +| π/4 in rot_y | |m0x45y0z| | -π/4 in rot_y | |m0x-45y0z| | |
| 40 | ++--------------+-------------+---------------+-------------+ |
| 41 | +| π/4 in rot_z | |m0x0y45z| | -π/4 in rot_z | |m0x0y-45z| | |
| 42 | ++--------------+-------------+---------------+-------------+ |
| 43 | + |
| 44 | +.. |m0x0y0z| image:: /_static/api/vision/m0x0y0z.png |
| 45 | + :scale: 30% |
| 46 | + |
| 47 | +.. |m0x0y45z| image:: /_static/api/vision/m0x0y45z.png |
| 48 | + :scale: 30% |
| 49 | + |
| 50 | +.. |m0x0y-45z| image:: /_static/api/vision/m0x0y-45z.png |
| 51 | + :scale: 30% |
| 52 | + |
| 53 | +.. |m0x45y0z| image:: /_static/api/vision/m0x45y0z.png |
| 54 | + :scale: 30% |
| 55 | + |
| 56 | +.. |m0x-45y0z| image:: /_static/api/vision/m0x-45y0z.png |
| 57 | + :scale: 30% |
| 58 | + |
| 59 | +.. |m45x0y0z| image:: /_static/api/vision/m45x0y0z.png |
| 60 | + :scale: 30% |
| 61 | + |
| 62 | +.. |m-45x0y0z| image:: /_static/api/vision/m-45x0y0z.png |
| 63 | + :scale: 30% |
0 commit comments