diff --git a/docs/core/examples/guides/.vscode/settings.json b/docs/core/examples/guides/.vscode/settings.json new file mode 100644 index 000000000..70ab33523 --- /dev/null +++ b/docs/core/examples/guides/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "cSpell.words": ["AICA", "Freedrive", "Orbbec", "servoing", "URDF"] +} diff --git a/docs/core/examples/guides/assets/stag-detector-example.png b/docs/core/examples/guides/assets/stag-detector-example.png new file mode 100644 index 000000000..1a4f7f36d Binary files /dev/null and b/docs/core/examples/guides/assets/stag-detector-example.png differ diff --git a/docs/core/examples/guides/assets/stag-marker-detection.webm b/docs/core/examples/guides/assets/stag-marker-detection.webm new file mode 100644 index 000000000..332591ce4 Binary files /dev/null and b/docs/core/examples/guides/assets/stag-marker-detection.webm differ diff --git a/docs/core/examples/guides/assets/stagDetector-predicates_0.png b/docs/core/examples/guides/assets/stagDetector-predicates_0.png new file mode 100644 index 000000000..2cd136b92 Binary files /dev/null and b/docs/core/examples/guides/assets/stagDetector-predicates_0.png differ diff --git a/docs/core/examples/guides/assets/stagDetector-predicates_1.png b/docs/core/examples/guides/assets/stagDetector-predicates_1.png new file mode 100644 index 000000000..a07fefb48 Binary files /dev/null and b/docs/core/examples/guides/assets/stagDetector-predicates_1.png differ diff --git a/docs/core/examples/guides/fiducial-markers.md b/docs/core/examples/guides/fiducial-markers.md new file mode 100644 index 000000000..2028fb208 --- /dev/null +++ b/docs/core/examples/guides/fiducial-markers.md @@ -0,0 +1,240 @@ +--- +sidebar_position: 14 +title: Fiducial Markers +--- + +import stagDetectorExample from './assets/stag-detector-example.png' +import stagMarkerDetection from './assets/stag-marker-detection.webm' +import stagMarkerNumOne from './assets/stagDetector-predicates_1.png' +import stagMarkerNumZero from './assets/stagDetector-predicates_0.png' + +# Fiducial Markers + +Different types of fiducial markers are used in robotics to provide precise 3D pose estimation and identification for +cameras, enabling or improving robotic calibration and object manipulation. + +AICA's `core-vision` package gives you the choice between using two commonly used markers, the STag and ArUco. + +:::tip +Performing the [intrinsic calibration](./camera-calibration.md) of the camera improves the precision for fiducial +marker detection and tracking. +::: + +This guide provides an example of STag marker detection. Using the ArUco marker follows a very similar process. + +## Preparing fiducial markers + +A fiducial marker is an object placed in the field of view of an image for use as a point of reference or a measure. +STag and ArUco markers are two of the common types of fiducial marker systems used for real-time 6D pose estimation. +This section explains how to obtain, download and print these markers. + +### Obtaining markers + +- **ArUco marker**: ArUco markers can be generate online (e.g., from [here](https://chev.me/arucogen/)), which permits + choosing the dictionary, marker ID, and marker size. It can be then exported as PDF or SVG for printing. + +- **STag marker**: STag marker set can be either downloaded from + [public Google Drive](https://drive.google.com/drive/folders/0ByNTNYCAhWbIV1RqdU9vRnd2Vnc?resourcekey=0-9ipvecbezW8EWUva5GBQTQ) + or obtained from the [ROS2 STag project repository](https://github.com/usrl-uofsc/stag_ros/tree/ros2-devel) or the + generator/reference files linked by the project. In practice, you’ll want to obtain the marker PDF/SVG or generate the + markers from the project’s reference generator, then print them at true size. + +### Printing markers + +After choosing the marker family, selecting the library/dictionary, and the marker ID, download it as PDF or SVG. Use +the actual size of the marker (100% scale) for printing, so the black border and marker geometry are not resized. Also +it is recommended to print with high contrast and avoid compression artifacts. + +If possible, print on a rigid and flat sheet of paper to reduce warping, since fiducial detection is sensitive to +distortion. As another solution, you can fix the printed marker on a rigid surface, such as a piece of wood or +cardboard. + +After printing, measure the marker’s outer dimensions and compare them with the intended size from the generator. This +matters because calibration will be wrong if the marker size in the software does not match the physical print. + +## Using the STag detector + +Launch AICA Studio with a configuration that contains the `core-vision` package and create a new application. + +1. Remove the hardware interface that is included in new applications by default. +2. From the `Scene` menu, use the `Add Component` tab and look for the **Camera Streamer** and **STag Detector** + components, either by searching or by manually going under the `Core Vision Components` menu. Add both of them to the + graph. +3. Next, connect both components to the start block. Moreover, connect the outputs of the Camera Streamer to the + relevant inputs of the STag Detector. +4. Enable **auto-configure** and **auto-activate** on both components. +5. By selecting any of the components, you can find all the available component parameters in the right panel under + Settings. +6. If an intrinsic camera calibration is performed prior to this, add the file path of the camera configuration file as + a parameter to the **Camera Streamer** component. + +By this point, you should have something like the following: + +