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/22 22:04] – pontusr | documentation:vision:aruco_marker_detection [2023/01/30 08:29] (current) – marcusn | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== ArUco marker detection ====== | ====== ArUco marker detection ====== | ||
- | 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:// | + | //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:// |
==== Detection with OpenCV ==== | ==== Detection with OpenCV ==== | ||
- | The repository in the following [[https:// | + | The repository in the following [[https:// |
^ Argument Name ^ Description | ^ Argument Name ^ Description | ||
Line 12: | Line 12: | ||
| -pause | | -pause | ||
- | The aruco marker ids and their size should be specified in a text file of the following form: | + | The //aruco// marker ids and their size should be specified in a text file of the following form: |
<cli> | <cli> | ||
- | id: size | + | id: size, length |
- | 10: 10 | + | 10: |
- | 23: 20 | + | 23: |
- | 34: 12.2 | + | 34: |
</ | </ | ||
- | The first line is ignored so it should only contain the header "id: size" 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 size in millimeters which is the number to the right of the colon. | + | 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 |
+ | |||
+ | 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 ==== | ==== 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 | ||