Skip to content
Snippets Groups Projects
Commit d1cb8f15 authored by RUI-ETRILLARD Pacôme's avatar RUI-ETRILLARD Pacôme
Browse files

translate changes done between 42f69a52 and 252b1967 on the FR version

parent 991ca962
No related branches found
No related tags found
1 merge request!1translate changes about rotations and python use of esieabot-ai
......@@ -69,6 +69,29 @@ You can use the esieabot-ai library directly in a C program like this :
This simple program loops esieabot-ai to retrieve the list of markers as an array and iterate through it. To compile it, add ``-lesieabot-ai`` to the compile command.
Use in Python
-------------
You can also use the esieabot-ai library in python. However, you will have to make a request yourself.
To do this, you must first import the `requests` library.
.. code-block:: python
import requests
import math
response = requests.get('http://127.0.0.1:5001/get_markers').json()
for marker in response["markers"]:
distance = math.sqrt(marker["x"] ** 2 + marker["y"] ** 2 + marker["z"] ** 2)
print("Marker found: number {} at {}cm distance. x={} y={} z={}".format(marker["id"], distance, marker["x"], marker["y"], marker["z"]))
This program will, as in the C example, retrieve the list of markers, but in the form of a dictionary. The program will thus iterate in it for each element.
Structures
``````````
......@@ -81,10 +104,14 @@ Structures
- ``int roll`` is its rotation (roll axis) in degrees
- ``int yaw`` is its rotation (yaw axis) in degrees
Angles are returned in degrees, between -180 and 180.
.. note:: A marker facing up and aligned perpendicular to the camera will have a roll of 180° but a pitch and yaw of 0°
Orientation
-----------
.. image:: yaw-pitch-roll.jpg
.. image:: yaw-pitch-roll.png
:width: 400
:align: center
\ No newline at end of file
docs/source/program/yaw-pitch-roll.jpg

36.6 KiB

docs/source/program/yaw-pitch-roll.png

63.5 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment