This ROS2 package is designed to detect and estimate the pose of ArUco fractal markers.
- Detects ArUco fractal markers in images.
- Estimates the pose of detected markers with respect to a camera frame.
- Publishes the marker pose as a
geometry_msgs::msg::PoseStamped
. - Broadcasts the transform from the camera frame to the marker frame using TF.
- ROS2: Make sure you have ROS2 installed on your system. This package has been tested with ROS2 Foxy, but it should work with other ROS2 distributions as well.
- OpenCV: For image processing.
- ArUco Library: Required for marker detection.
-
Clone this repository into your ROS2 workspace:
cd <your_workspace>/src git clone https://github.com/dimianx/aruco_fractal_tracker.git
-
Navigate to the workspace root and build the package:
cd <your_workspace> colcon build
-
Source your workspace:
source <your_workspace>/install/setup.bash
To run the ArUco Fractal Tracker node, use the following command:
ros2 run aruco_fractal_tracker aruco_fractal_tracker_node --ros-args -p marker_configuration:=<path_to_marker_config> -p marker_size:=<marker_size> -p cam_params_file:=<path_to_cam_params> --remap image_input_topic:=<your_camera_image_topic> --remap image_output_topic:=<where_to_output_processed_image> --remap poses_output_topic:=<where_to_publish_marker_pose>
marker_configuration
(string): The configuration file for the ArUco fractal markers.marker_size
(double): The size of the marker in meters.cam_params_file
(string): The camera parameters file (in YAML format).
The node uses the following topics:
image_input_topic
(input): The topic from which the node subscribes to images for processing.image_output_topic
(output): The topic on which the node publishes images with detected markers and pose information.poses_output_topic
(output): The topic on which the node publishes the pose of the detected marker as ageometry_msgs::msg::PoseStamped
.
An example ArUco fractal marker configuration is provided in the example_marker
folder. This folder contains both the marker image and configuration file necessary for testing the node. To use this example marker:
- Navigate to the
example_marker
folder. - Print out the marker image (
marker.png
) and place it in the camera's field of view. - Use the provided configuration file (
marker_configuration.yaml
) to run the node.