//Aruco// markers are squares with bit patterns which can easily be detected and their orientation can always be determined due to their non-symmetric pattern. These markers can be generated [[https://chev.me/arucogen/ | here]].
The repository in the following [[https://git.cs.lth.se/robotlab/realsense_aruco_detection | link]] implements detection of //aruco// markers in opencv with a realsense camera, the authors are Pontus Rosqvist, Josefin Gustafsson, Marcus Nagy and Martin Lyrå. This script can take the following command line arguments:
^ Argument Name ^ Description ^
| -d | Specify if the depth image should be used. True or False. |
| -p | Specify where the camera parameters are saved, if left empty the camera parameters are loaded from the camera. |
| -pause | Specify where the aruco markers and their size is saved. |
The //aruco// marker ids and their size should be specified in a text file of the following form:
<cli>
id: size, length
10: 7, 10
23: 7, 20
34: 5, 12.2
</cli>
The first line is ignored so it should only contain the header "id: size, length" which tells you how the data is parsed. All lines after that are parsed where the number to the left of the colon is an //aruco// marker id which is associated with the length in millimeters which is the second number to the right of the colon. The first number to the right of the colon specifies the width of the //aruco// marker in pixels, the possible sizes are 4, 5, 6 and 7.
The code expects a realsense camera to be connected to the computer. If the pipeline does not receive a frame from the camera within 5 seconds the following error will be thrown
<code>RuntimeError: Frame didn't arrive within 5000</code>