Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| documentation:vision:aruco_marker_detection [2023-01-20 16:26] – Josefin Gustafsson | documentation:vision:aruco_marker_detection [2023-01-30 09:29] (current) – Marcus Nagy | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ======  | + | ======  | 
| - | ==== OpenCV ==== | + | //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:// | 
| - | https:// | + | |
| - | < | + | ==== Detection with OpenCV ==== | 
| - | Example code | + | |
| - | </code> | + | The repository in the following [[https:// | 
| + | |||
| + | ^ 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  | ||
| + | |||
| + | The //aruco// marker ids and their size should be specified in a text file of the following form: | ||
| <cli> | <cli> | ||
| - | box | + | id: size, length | 
| + | 10: 7, 10 | ||
| + | 23: 7, 20 | ||
| + | 34: 5, 12.2 | ||
| </ | </ | ||
| - | ==== SkiROS ==== | + | The first line is ignored so it should only contain the header "id: size, length" | 
| + | |||
| + | 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 | ||
| + | |||
| + | < | ||
| + | |||
| + | In which case one should check that the camera works and sends frames to the computer with realsense-viewer. | ||
| + | |||
| + | It is very important to check if the camera is recognized as a USB2 device or USB3 device since USB2 supports a smaller sets of resolution than USB3. If a resolution that is not possible is requested (for example if the camera is detected as a USB2 device and the expected resolution is too big) the pipeline throws the following error: | ||
| + | |||
| + | < | ||
| + | |||
| + | In which case one should check what resolution the frames from the camera have with realsense-viewer to verify that the expected resolution is correct. | ||
| + | |||
| + | First the //aruco// markers of some size are detected in the current frame with [[https:// | ||
| + | |||
| + | In order to make use of the translation of the //aruco// markers and the angle-axis one could use //openCV// [[https:// | ||
| + | to get a [[https:// | ||
| + | |||
| + | This script only draws the determined pose of each detected //aruco// marker in each frame and displays it but it can easily be modified to instead return the pose of each //aruco// marker and their associated id. | ||
| + | |||
| + | ==== Detection with SkiROS ==== | ||
| + | To detect //aruco// makers with a skill and implement a skill in [[https:// | ||
| + | |||
| + | There are a couple of steps to create a skill in **SkiROS**. | ||
| + |   - [[https:// | ||
| + | 		- Create a // | ||
| + | - addParam needed for the skill | ||
| + | 		- Create a // | ||
| + | - Handle the different situation like, [onPreempt, onInit, onStart, execute]. | ||
| + | 		- Create a // | ||
| + | 			- [[https:// | ||
| + |   - Add skill to simulation in e.g. [[https:// | ||
| + |   - Add skill code to into one of the skill repositories: | ||
| + | 		- [[https:// | ||
| + | 		- [[https:// | ||
| + |   - Add possible new ontologies to the [[https:// | ||
| - | text | ||