Skip to content

Commit 990b110

Browse files
trickeydanAdimote
andcommitted
Add orientation documentation
Co-authored-by: Andrew Barrett-Sprot <abarrettsprot@gmail.com>
1 parent 07e3034 commit 990b110

File tree

10 files changed

+63
-0
lines changed

10 files changed

+63
-0
lines changed
18.9 KB
Loading
27 KB
Loading
25 KB
Loading
18.7 KB
Loading
25.9 KB
Loading
27.5 KB
Loading
19.3 KB
Loading
29.2 KB
Loading

docs/source/api/vision/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ You can access the position using ``m.bearing`` and ``m.distance``.
8484
print(m.bearing) # Bearing to the marker from the origin, in radians
8585
print(m.distance) # Bearing to the marker from the origin, in radians
8686
87+
* ``m.bearing`` is equivalent to ``m.position.cylindrical.phi``.
88+
* ``m.distance`` is equivalent to ``m.position.cylindrical.p``.
89+
8790
For further information on position, including how to use ``m.position`` and the coordinate systems,
8891
see `Position <position.html>`__.
8992

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,63 @@
11
Orientation
22
===========
33

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

Comments
 (0)