π Target Detection API#
Target Detector API#
To interact with the Target Detection module, you can refer to the following ROS 2 API:
The target_detector_server implements the main Target Detection functionalities.
To configure it you can refer to the following table containing the target_detector_serverβs parameters and their explanation:
Parameter |
Description |
---|---|
|
Frequency at which the detection algorithm is run. Higher frequencies increase responsiveness but require more computational resources. |
|
Timeout for action server results, ensuring that detection attempts do not run indefinitely. |
|
List of plugin names for target detectors to be loaded and used for detection tasks. |
|
The topic on which detected poses are published, allowing other components or systems to utilize the detection results. |
|
Tolerance for the time difference between the current time and the time a target was detected, ensuring relevance of detection data. |
|
Minimum required accuracy for a detection to be considered successful. Helps filter out false positives or uncertain detections. |
|
Distance used to adjust the target position by shortening the position in a straight line between the reference and the target. |
|
Homogeneuos transform to be applied on the transform between the reference and the target. |
|
Specifies whether the action server should operate with real-time priority, which can be essential for time-sensitive applications but requires appropriate system permissions. |
Note
To configure the target_detector_server, you can create your own parameter file and follow the guide in π Navigation Configuration Guide section:
mkdir -p ~/.pal/pal_navigation_cfg_params/params/pal_nav2_target_detector
touch ~/.pal/pal_navigation_cfg_params/params/pal_nav2_target_detector/my_params.yaml
vi ~/.pal/pal_navigation_cfg_params/params/pal_nav2_target_detector/my_params.yaml
Finally, here is a table with the available Target Detection plugins:
Provided Plugin |
Package |
Description |
---|---|---|
|
Name of the package to which the plugin belongs ( |
Name of the plugin to load ( |
|
Name of the package to which the plugin belongs ( |
Name of the plugin to load ( |
|
Name of the package to which the plugin belongs ( |
Name of the plugin to load ( |
In the following sections you can find more information about their confiugration and their own APIs.
Laser Detector API#
The pal_nav2_laser_target_detector::LaserTargetDetector
plugin provides the Laser Target Detection functionalities.
It implements the pal_nav2_core::TargetDetector
interface, but it also uses methods coming from the
PatternMarcher
class, to identify the presence and location of the target pattern within the generated image,
based on comparison with a predefined pattern image.
To configure the Laser Target Detection plugin you can refer to the following table containing the
LaserTargetDetector
βs parameters and their explanation:
Parameter |
Description |
---|---|
|
Directory containing image patterns and the pattern registry for identification purposes. |
|
Threshold for considering a detection successful, based on the accuracy of pattern matching. |
|
Maximum range considered for detection within the laser scan data. |
|
Resolution of the image generated from laser scan data, affecting the precision and performance of detection. |
Note
To configure the LaserTargetDetector
, you can create your
own parameter file and follow the guide in π Navigation Configuration Guide section:
mkdir -p ~/.pal/pal_navigation_cfg_params/params/pal_nav2_target_detector
touch ~/.pal/pal_navigation_cfg_params/params/pal_nav2_target_detector/my_laser_params.yaml
vi ~/.pal/pal_navigation_cfg_params/params/pal_nav2_target_detector/my_laser_params.yaml
And modify the relative section:
target_detector_server:
ros__parameters:
#Other target_detetor_server parameters
detector_plugins: ["laser_target_detector"]
laser_target_detector:
plugin: "pal_nav2_laser_target_detector::LaserTargetDetector"
base_frame_id: ${base_footprint_frame}
max_laser_range: 2.0
detection_threshold: 0.5
#Other laser_target_detector parameters
#Other detector plugins
ArUco Detector API#
The pal_nav2_aruco_target_detector::ArucoTargetDetector
plugin provides the ArUco Target Detection functionalities.
It implements the pal_nav2_core::TargetDetector
interface, but it also uses methods coming from the
ArucoDetector
class and the ImageFilter
class.
To configure the ArUco Target Detection plugin you can refer to the following table containing the
ArucoTargetDetector
βs parameters and their explanation:
Parameter |
Description |
Belonging Class |
---|---|---|
|
ArUco marker dictionary selection for detection, tailoring the detector to specific marker sets. |
|
|
ROS topic for image data reception, crucial for marker detection. |
|
|
ROS topic for camera calibration data, essential for accurate pose estimation. |
|
|
Enables/disables image preprocessing, potentially enhancing detection under various conditions. |
|
|
Binary thresholding value for image preprocessing, aiding in marker-background distinction. |
|
|
Region of interest size, focusing detection on specific image areas to improve efficiency. |
|
|
ArUco marker detection mode, balancing detection speed and robustness. |
|
|
Corner refinement method for marker detection, affecting pose estimation accuracy. |
|
|
Physical marker size, crucial for precise pose estimation. |
|
|
Maximum time between detections for consistent tracking, managing marker visibility and stability. |
|
|
Fisheye distortion correction flag, improving accuracy for fisheye lenses. |
|
|
Reprojection error sensitivity, tuning detection sensitivity and error tolerance. |
|
|
Flag for overlaying detected marker axes on the output image for visualization. |
|
Note
To configure the ArucoTargetDetector
, you can create your
own parameter file and follow the guide in π Navigation Configuration Guide section:
mkdir -p ~/.pal/pal_navigation_cfg_params/params/pal_nav2_target_detector
touch ~/.pal/pal_navigation_cfg_params/params/pal_nav2_target_detector/my_aruco_params.yaml
vi ~/.pal/pal_navigation_cfg_params/params/pal_nav2_target_detector/my_aruco_params.yaml
And modify the relative section:
target_detector_server:
ros__parameters:
#Other target_detetor_server parameters
detector_plugins: ["aruco_target_detector"]
aruco_target_detector:
plugin: "pal_nav2_aruco_target_detector::ArucoTargetDetector"
detector:
marker_size: 0.25
image_topic: "/roof_rgbd_camera/color/image_raw"
camera_info_topic: "/roof_rgbd_camera/color/camera_info"
#Other aruco_target_detector parameters
#Other detector plugins
Simple Detector API#
The pal_nav2_laser_target_detector::SimpleTargetDetector
plugin provides a bridge between
any kind of detector that you want to develop, or that you already have available, and the
target_detector_server node.