yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
ROSMASTER M1 PRO📖
0.Robot Configuration and Operation Guidelines
  • 0.Unboxing and Review
  • 1.Assembly Videos
  • 2.User Manual
  • 3.Enter Docker (For Raspberry Pi)
  • 4.FAQ
  • 5.RobotManager User Guide
1.Chassis Control Course
  • 1.Robot Information Publishing
  • 2.Robot Handle Control
  • 3.Robot Keyboard Control
  • 4.Linear Velocity Calibration
  • 5.Angular Velocity Calibration
  • 6.Robot URDF Model
  • 7.Robot EKF State Estimation
2.Lidar Course
  • 1.Lidar Introduction And Use
  • 2.Lidar Obstacle Avoidance
  • 3.Lidar Following
  • 4.Lidar Guard
  • 5.Lidar Patrol
  • 6.GMapping-SLAM Mapping
  • 7.Cartographer-SLAM Mapping
  • 8.Slam-Toolbox Mapping
  • 9.Lifelong Mode Mapping
  • 10.Navigation2 Single Point Navigation
  • 11.Navigation2 Multi Point Navigation
  • 12.Cartographer Relocalization Navigation
  • 13.Slam-Toolbox Localization Navigation
  • 14.Synchronous Mapping And Navigation
  • 15.Aruco Visual Relocalization Navigation
  • 16.Mobile App Mapping And Navigation
3.USB Camera-Depth Camera Course
  • 1.USB Camera Introduction
  • 2.USB Camera Intrinsic Calibration
  • 3.Nuwa-HP60C Camera Introduction (Depth Camera Only)
  • 4.Depth Pseudo Color Image (Depth Camera Only)
  • 5.Depth Camera Distance Measurement (Depth Camera Only)
  • 6.Block Volume Calculation (Depth Camera Only)
  • 7.Edge Detection (Depth Camera Only)
  • 8.RTAB-Map SLAM Mapping (Depth Camera Only)
  • 9.RTAB-Map Navigation (Depth Camera Only)
4.Robotic Arm and 3D Space Gripping Course
  • 1.Robotic Arm Basic Usage
  • 2.Robotic Arm Kinematics
  • 3.Robotic Arm Chassis Coordination Control
  • 4.AprilTag ID Sorting
  • 5.AprilTag Height Anomaly Sorting
  • 6.AprilTag Tracking and Grasping
  • 7.Color Block Sorting
  • 8.Color Block Height Anomaly Sorting
  • 9.Color Block Tracking and Grasping
  • 10.Wood Block Shape Sorting
  • 11.KCF Tracking and Grasping Objects
  • 12.Mediapipe Gesture ID Sorting AprilTag
  • 13.Mediapipe Gesture Height Sorting AprilTag
  • 14.Desktop Tracking and Grasping AprilTag
  • 15.3D Spatial Tracking AprilTag
  • 16.Transformer Model Tracking Algorithm
  • 17.Line Following Obstacle Clearing
5.Road network planning and navigation
  • 1.Introduction To Road Network Planning
  • 2.Road Network Annotation
  • 3.Planning And Navigation Between Waypoints
  • 4.Road Network Navigation In Any Pose
  • 5.Path Re-planning
6.OpenClaw Basic Course
  • 1.Introduction to OpenClaw
  • 2.OpenClaw Core Concepts
  • 3.OpenClaw API-KEY Configuration
  • 4.OpenClaw Switch Models
  • 5.OpenClaw System Prompt Words
  • 6.OpenClaw Common CLI Commands
7.OpenClaw Interaction Method
  • 1.OpenClaw Webchat Interaction
  • 2.OpenClaw Tui Interaction
  • 3.OpenClaw Voice Dialogue Interaction
  • 4.OpenClaw WhatsApp Interaction
8.OpenClaw Development
  • 1.OpenClaw Connecting to Robot MCP Service
  • 2.Robot CLI Command Tool
  • 3.robot-control Plugin Tool
  • 4.reply-bridge Plugin Tool
  • 5.OpenClaw Multimodal Vision
  • 6.OpenClaw Chassis Control
  • 7.OpenClaw Robotic Arm Control
  • 8.OpenClaw Skills Development
  • 9.OpenClaw Scheduled Tasks
  • 10.OpenClaw Multi-Agent Intelligent Agent
  • 11.OpenClaw Active Interaction
  • 12.OpenClaw Vector Memory
9.OpenClaw Embodied intelligent application
  • 1.OpenClaw Target Tracking
  • 2.OpenClaw Arm Tracking And Grasping
  • 3.OpenClaw Arm Fixed-point Placement
  • 4.OpenClaw Waste Sorting
  • 5.OpenClaw SLAM Mapping And Navigation
  • 6.OpenClaw Navigation Transport
  • 7.OpenClaw AprilTag Grasping
  • 8.OpenClaw Color Line Patrol
  • 9.OpenClaw Visual Distance Measurement
10.OpenClaw scenario sandbox
  • 1.Map Description and Props Placement
  • 2.Building the Sandbox Map
  • 3.Visual Relocalization Marker
  • 4.Map Mapping Marker
  • 5.Sandbox Scenario Comprehensive Case
11.AI Large Model Basics
  • 1.AI Large Model Types and Principles
  • 2.RAG Retrieval Enhancement and Model Training Samples
  • 3.Embodied Intelligent Robot System Architecture
  • 4.Embodied Intelligent Functions Core Source Code
12.AI large Model Development
  • 1.Register a Model Service Provider Account
  • 2.Configuring API-KEY
  • 3.Introduction to Dify
  • 4.Basic Dify Features
  • 5.AI Large Model Development - Chatbot
  • 6.Deploy the RAG Knowledge Base
  • 7.RAG Knowledge Base + Chatbot
  • 8.AI Agent Workflow
  • 9.Custom Wake-up Response
13.AI Model - Voice Version
  • 1.Semantic Understanding and Command Following
  • 2.Multimodal Visual Understanding
  • 3.Multimodal Visual Understanding and Robotic Arm Gripping
  • 4.Multimodal Visual Understanding and SLAM Navigation
  • 5.Robotic arm gripping+Multimodal visual understand+SLAM navigation
  • 6.Intention Understanding
14.AI Model - Text Version
  • 1.Semantic Understanding and Command Following
  • 2.Multimodal Visual Understanding
  • 3.Multimodal Visual Understanding and Robotic Arm Gripping
  • 4.Multimodal Visual Understanding and SLAM Navigation
  • 5.Robotic arm gripping+Multimodal visual understand+SLAM navigation
  • 6.Intention estimation
15.Mediapipe Visual Course
  • 1.Hand detection
  • 2.Posture detection
  • 3.Overall detection
  • 4.Facial Landmark Detection
  • 5.Face detection
  • 6.Face special effects
  • 7.3D object recognition
  • 8.Brush
  • 9.Finger control
  • 10.Palm target positioning
  • 11.Fingertip trajectory recognition
  • 12.Fingertip gesture control robotic arm
  • 13.Gesture grabbing and releasing objects
  • 14.Finger control robotic arm
  • 15.Medipipe gesture control robotic arm action group
16.MoveIt2 Simulation Course
  • 1.MovelT2 configuration
  • 2.MovelT2 simulation-reality linkage
  • 3.Random movement
  • 4.Forward kinematics design
  • 5.Inverse kinematics design
  • 6.Cartesian path
  • 7.Trajectory Planning
  • 8.Collision Detection
  • 9.Scene Design
  • 10.3D perception obstacle‑avoidance
17.Multi-vehicle Course
  • 1.Multi-vehicle Control
  • 2.Multi-vehicle Navigation
  • 3.Multi-vehicle Formation
18.YOLO26 Development
  • 1.CLI Use
  • 2.Object Detection
  • 3.Instance Segmentation
  • 4.Pose Estimation
  • 5.Image Classification
  • 6.Oriented Object Detection
  • 7.YOLOv26 + DeepSORT Tracking
  • 8.Monocular Depth Estimation
19.Control Board STM32 Driver Course
  • 0.Notes (Must Read)
  • 1.About Expansion Board
  • 2.STM32 Development Environment
  • 3.Button Control
  • 4.FreeRTOS Application
  • 5.Serial Communication
  • 6.SBUS Model Aircraft Remote Control
  • 7.CAN Bus Communication
  • 8.RGB Colorful Light Bar
  • 9.Timer Interrupt to Control PWM Servo
  • 10.Control Serial Port Servos
  • 11.Nine-axis Attitude Sensor to Obtain Data
  • 12.Control Motor
  • 13.Timer Captures the Encoder Data
  • 14.1 Kinematic Analysis of Mecanum Wheel
  • 14.2 Kinematic Analysis of Ackerman
  • 14.3 Kinematic Analysis of 4WD
  • 15.PID Control Robot Movement
20.Docker Course
  • 1.Docker Introduction and Installation
  • 2.Docker Basic Commands
  • 3.Docker Submission and Multi-Terminal Access
  • 4. Docker Startup Script
  • 5.Docker-Vscode Environment Construction
21.Image Processing Basics Course
  • 1. Introduction to Open Source CV
  • 2. Image reading and display
  • 3. Image writing
  • 4. Image quality
  • 5. Pixel Operation
  • 6. Image zoom
  • 7. Image cutting
  • 8. Image translation
  • 9. Image Mirroring
  • 10. Affine Transformation
  • 11. Image Rotation
  • 12. Perspective Transformation
  • 13. Grayscale processing
  • 14. Image Binarization
  • 15. Edge Detection
  • 16. Line drawing
  • 17. Rectangle and circle drawing
  • 18. Drawing text and pictures
22.Linux System Course
  • 1.Introduction to Linux system
  • 2.Ubuntu file system
  • 3.Ubuntu common commands
  • 4.Ubuntu common editors
  • 5.Ubuntu software operation commands
  • 6.Virtual machine installation
  • 7.SSH remote control
  • 8.VNC remote control
  • 9.Transfer files remotely
  • 10.Driver library and communication
  • 11.Static IP and hotspot mode
  • 12.Bind device ID
  • 13.Capacity expansion and resource allocation
  • 14.Update system software sources
  • 15.Set root user password
  • 16.sudo free password
  • 17.Connect to WiFi network
  • 18.View system version
  • 19.Customized service management
  • 20.Back up system image
23.ROS2 Basic Course
  • 1.Introduction to ROS2
  • 2.ROS2 install Humble
  • 3.ROS2 development environment
  • 4.ROS2 workspace
  • 5.ROS2 function package
  • 6.ROS2 node
  • 7.ROS2 topic communication
  • 8.ROS2 service communication
  • 9.ROS2 action communication
  • 10.ROS2 custom interface message
  • 11.ROS2 parameter service case
  • 12.ROS2 meta-function package
  • 13.ROS2 distributed communication
  • 14.ROS2 DDS
  • 15.ROS2 time related API
  • 16.ROS2 common command tools
  • 17.ROS2 rviz2 use
  • 18.ROS2 rqt toolbox
  • 19.ROS2 Launch startup file configuration
  • 20.ROS2 recording and playback tool
  • 21.ROS2 URDF model
  • 22.ROS2 Gazebo simulation platform
  • 23.ROS2 TF2 coordinate transformation
24.Main Control Course
Jetson Orin Nano_NX
  • 1.Jetson Orin board introduction
  • 2.Restore the factory image system
  • 3.Backup SSD system
  • 4.SSD expansion
  • 5.Network configuration
  • 6.SSH remote login
  • 7.VNC remote control
  • 8.Remote file transfer
  • 9.Jtop tool
  • 10.Exchange space expansion
Raspberry Pi
  • 1. Introduction to Raspberry PI 5
  • 2. Raspberry PI system installation and backup
  • 3. Powering the Raspberry PI 5
  • 4. Startup of Raspberry PI 5
  • 5. Update and upgrade operating system
  • 6. Introduction to raspi-config tool
  • 7. config.txt file description
  • 8. Network Configuration
  • 9. remote access
  • 10. Transfer files remotely
  • 11. Set display resolution and rotation
  • 12. Set screen to sleep
  • 13. Play audio and video
  • 14. Using USB camera
  • 15. Using MIPI camera
  • 16. Get real-time temperature of Raspberry Pi
RDKX5
  • 1.Introduction to RDK X5 board
  • 2.Write system file
  • 3.Hardware interface description
  • 4.Install case and other accessories
  • 5.Network configuration
  • 6.Remote login
  • 7.Update system
  • 8.srpi-config user guide
  • 9.config. txt configuration file
  • 10.Self-startup setting
  • 11.RDK exclusive command usage
  • 12.Linux command usage
  • 13.GPIO readwrite operation
  • 14.Image classification algorithm
  • 15.Use USB camera
  • 16.Use MIPI camera
  • 17.Binocular camera depth algorithm
  • 18. Controlling RGB Cooling Fans
Download
  • System File
  • Code
  • 3D Model File
  • Software Tools
  • Hardware_Info
  • Deb function package
  • Dify AI Agent
Download ZIP

Welcome to ROSMASTER M1 PRO repository

15.Aruco Visual Relocalization Navigation

Aruco Marker Visual Relocalization Navigation

Aruco Marker Visual Relocalization Navigation1. Course ContentLearning Objectives2. Preparation3. Recording the ArUco Tag Map Coordinates3.1 Preparing the ArUco Tags3.2 Deploying the ArUco Tags3.3 Starting the Tag Recording Node4. Starting the Visual Relocalization Navigation Mode4.1 Verifying the Relocalization Feature4.2 Controlling Tag Detection via Service5. Source Code Analysis5.1 Tag Recording Node Launch File5.2 Relocalization Mode Navigation Launch File5.3 aritag_relocation.yaml File Structure5.4 Visual Relocalization Working Principle5.5 Tag Configuration Parameters5.6 Inter-Node Communication Graph

1. Course Content

  • Use ArUco tags combined with the pose map's constraint solving function to implement the visual relocalization navigation feature.

  • By deploying ArUco tags as spatial anchors, when the robot's localization is lost or the accumulated error is too large, visual detection is used to automatically trigger relocalization, correct the robot's global pose in the map, and improve the robustness and reliability of the navigation system.

Note

The visual relocalization scheme here is used in subsequent OpenClaw courses and sandbox map courses to enhance global localization stability

Learning Objectives

  • Master the methods for preparing, deploying, and recording the positions of ArUco tags

  • Understand the working principles and applicable scenarios of visual relocalization

  • Learn to use the navigation mode that combines pose constraints with visual relocalization

2. Preparation

  • Referring to the prerequisite course 【Slam-Toolbox Mapping】, complete a grid map and a pose map in posegraph format; mapping and saving the map can be done either through the UI panel or CLI commands

Important

Pose points must be checked: when mapping with slam_toolbox, click the MarkerArray option in the Display panel in Rviz to view the pose map's pose points. Make sure there are enough pose points within the map area for localization during subsequent navigation.

image-20260506194426377

 

3. Recording the ArUco Tag Map Coordinates

3.1 Preparing the ArUco Tags

  • They can be obtained in the following ways:

    1. The tags from the sandbox map package

    2. Download and print the tags yourself from the attached materials

  • Determine the size of the tags

    • Measure the tags' actual side length with a measuring tool; the side length of the tags included in the sandbox map package is 0.048m

    • If the tags are printed by yourself, their actual size needs to be measured manually due to printer size scaling

image-20260506165106029

  • Modify the ArUco detection configuration file

~/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_bringup/param/common.yaml
  • Modify size to the actual size. If you are using the tags included with the sandbox map, the factory default size is 0.048 and does not need to be modified

xxxxxxxxxx
...
apriltag:                 # node name
  ros__parameters:
    image_transport: raw  # image format: "raw" or "compressed"
    family: 36h11         # tag family name: 16h5, 25h9, 36h11
    size: 0.048             # default tag edge size in meter
...

 

3.2 Deploying the ArUco Tags

  • Place the ArUco tags at the required positions in the map. They can be placed anywhere the camera can observe, such as on the floor or walls.

Important

Placement tips

  • It is recommended to place them near frequently navigated start or end points within the camera's field of view, triggering relocalization before the car departs or after it stops upon reaching the goal point

  • It is not recommended to place them along the driving path, because when the car is moving, the robotic arm produces mechanical swaying, causing the camera image to shake frequently and making the computed car position inaccurate

image-20260512145812324

 

3.3 Starting the Tag Recording Node

xxxxxxxxxx
ros2 launch yahboomcar_bringup record_tag.launch.py
  • Step 1: Move the car (by carrying it directly or controlling it to move) near the tag to be recorded, make the tag appear in the camera's field of view, and observe that the tag number in RVIZ looks like Tagx

     

  • Step 2: In the ArUco ID field of the aritag_recorder_panel panel, enter the ID of the tag to be recorded, then click Save to complete the recording (check whether the car's localization is accurate before recording)

image-20260512150842076

 

  • Before recording the tag position, if you find that the laser contour deviates significantly from the environmental edge features, as shown below, it proves that there is an error in the localization. In this case, you need to first use the 2D Pose Estimate tool for manual relocalization before recording the position

image-20260512165237920

  • The figure below proves that the localization is accurate, with a high degree of matching between the laser contour and the environmental edge features

image-20260512165738343

 

  • Repeat the above steps to complete the position recording of all tags. Record file path:

xxxxxxxxxx
~/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_bringup/param/aritag_relocation.yaml

image-20260828112032635

 

4. Starting the Visual Relocalization Navigation Mode

xxxxxxxxxx
ros2 launch yahboomcar_bringup aruco_relocation_nav.launch.py
  • The green circles Txx displayed on the map in the image are the positions of all the tags recorded in the previous steps. They may not be displayed immediately right after startup; the tag data is periodically published on the /apriltag_map_markers topic and displayed by RVIZ after subscription

image-20260828142226300

 

4.1 Verifying the Relocalization Feature

  • You can manually move the robot's position (to simulate a situation where the odometry has severe error and the global localization is chaotic, as shown in the figure above)

  • When a tag in the map is seen in the camera's field of view, relocalization is automatically triggered to correct the robot's global localization in the map

image-20260828144240824

  • The terminal will indicate the detected Aruco marker ID through logs

image-20260828142706366

4.2 Controlling Tag Detection via Service

  • Because the aritag tag detection node occupies the CPU at a high frequency, you can turn off the detection state when detection is not needed. The node provides a control_detection service to control whether tag detection is performed

  • Query status

xxxxxxxxxx
ros2 service call /control_detection apriltag_localization/srv/ControlDetection "{command: 0}"

image-20260512172021427

  • Enable detection

xxxxxxxxxx
ros2 service call /control_detection apriltag_localization/srv/ControlDetection "{command: 1}"

image-20260512172045344

  • Disable detection (reduces CPU usage)

xxxxxxxxxx
ros2 service call /control_detection apriltag_localization/srv/ControlDetection "{command: 2}"

image-20260512172102096

 

5. Source Code Analysis

5.1 Tag Recording Node Launch File

xxxxxxxxxx
~/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_bringup/launch/record_tag.launch.py

 

  • apriltag_detect: starts the apriltag_node tag detection node, loads the common.yaml configuration and enables detection, and remaps the camera image and camera_info topics

  • apriltag_recorder_node: starts the apriltag_recorder recording node, which listens to the detected tag poses and saves them to the YAML file specified by output_file_path, with the coordinate frame being target_frame (default map)

  • navigation_launch: includes nav2.launch.py, uses the slam_toolbox localization mode, does not start the chassis (start_carbase: false), and loads the dedicated record_tag Rviz configuration

  • call_detection_service: calls the /control_detection service after a 5-second delay to enable tag detection (command: 1), waiting for the system to fully start before enabling to avoid resource conflicts

  • car_base_launch: includes car_base.launch.py, enabling the IMU, LiDAR, and camera, and using the EKF odometry as the TF source

​x
    apriltag_detect = Node(
        package='apriltag_localization',
        executable='apriltag_node',
        name='apriltag',
        parameters=[os.path.join(get_package_share_directory('yahboomcar_bringup'),'param','common.yaml'),
                    {"detection_enabled": True}],
        remappings=[('/image_rect', GetCameraRgbTopic()),
                    ('/image_rect/camera_info', GetCameraInfo())],
        output='screen'
        )
    
    # AprilTag recorder node
    apriltag_recorder_node = Node(
        package='apriltag_localization',
        executable='apriltag_recorder',
        name='apriltag_recorder',
        output='screen',
        parameters=[{
            'output_file_path': LaunchConfiguration('output_file_path'),
            'target_frame': LaunchConfiguration('target_frame'),
        }]
    )
    #slam_toolbox_navigation
    navigation_launch = IncludeLaunchDescription(
            PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('yahboomcar_bringup'),'launch','nav2.launch.py')),
            launch_arguments={'log_level': 'warn',
                              'start_carbase': 'false',
                              'localization_mode':'slam_toolbox',
                              'rviz_config': 'record_tag'
                              }.items())

    # Enable aritag detection
    call_detection_service = TimerAction(
        period=5.0,  
        actions=[
            ExecuteProcess(
                cmd=['ros2', 'service', 'call', '/control_detection', 
                     'apriltag_localization/srv/ControlDetection', 
                     '{command: 1}'],
                output='screen'
            )
        ]
    )
    car_base_launch = IncludeLaunchDescription(
            PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('yahboomcar_bringup'),'launch','car_base.launch.py')),
            launch_arguments={
                              'use_imu': 'True',
                              'use_lidar': 'True',
                              'use_camera': 'True',
                              'odom_tf_source': 'ekf'
                              }.items())

 

5.2 Relocalization Mode Navigation Launch File

xxxxxxxxxx
~/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_bringup/launch/aruco_relocation_nav.launch.py
  • declared_arguments: declares the rviz launch parameter, default value True, controlling whether to automatically start Rviz2

  • apriltag_relocalization: includes apriltag_relocalization.launch.py, enabling tag detection (detection_enabled: true), which detects tags and triggers relocalization

  • car_base_launch: includes car_base.launch.py, enabling the IMU, LiDAR, and camera, and using the EKF odometry as the TF source

  • nav2: includes nav2.launch.py, uses the slam_toolbox localization mode, does not start the chassis (start_carbase: False), and loads the aruco_relocation_nav.rviz configuration

  • LaunchDescription: aggregates and returns the three modules of chassis launch, navigation, and tag relocalization

xxxxxxxxxx
def generate_launch_description():
    bringup_dir = get_package_share_directory('yahboomcar_bringup')
    
    declared_arguments = []
    declared_arguments.append(
        DeclareLaunchArgument(
            "rviz",
            default_value='True',
            description="if rviz is used, set to True. If False, rviz will not be launched.",
        )
    )
    apriltag_relocalization=IncludeLaunchDescription(
            PythonLaunchDescriptionSource(os.path.join(bringup_dir,'launch','apriltag_relocalization.launch.py')),
            launch_arguments={'detection_enabled': 'true',
                              'log_level': 'info'}.items())
    # Car base with camera and lidar
    car_base_launch = IncludeLaunchDescription(
            PythonLaunchDescriptionSource(os.path.join(bringup_dir,'launch','car_base.launch.py')),
            launch_arguments={
                              'use_imu': 'True',
                              'use_lidar': 'True',
                              'use_camera': 'True',
                              'odom_tf_source': 'ekf'
                              }.items())
    nav2=IncludeLaunchDescription(
        PythonLaunchDescriptionSource(os.path.join(bringup_dir,'launch','nav2.launch.py')),
        launch_arguments={'localization_mode':'slam_toolbox',
                            'start_carbase': 'False',
                            'log_level':'warn',
                            'rviz': LaunchConfiguration('rviz'),
                            'rviz_config': 'aruco_relocation_nav.rviz'
                            }.items())
    
    return LaunchDescription([
        *declared_arguments,
        car_base_launch,
        nav2,
        apriltag_relocalization,
    ])

 

5.3 aritag_relocation.yaml File Structure

The structure of the aritag_relocation.yaml file generated after recording is complete is as follows:

xxxxxxxxxx
tags:
  - id: 0                    # ArUco tag ID
    position:                # Position coordinates (relative to the map coordinate frame)
      x: 1.234               # X coordinate (meters)
      y: 0.567               # Y coordinate (meters)
      z: 0.0                 # Z coordinate (meters; usually 0, representing ground level)
    orientation:             # Orientation (quaternion)
      x: 0.0
      y: 0.0
      z: 0.123               
      w: 0.987
  - id: 1
    position:
      x: 2.345
      y: 1.234
      z: 0.0
    orientation:
      x: 0.0
      y: 0.0
      z: 0.456
      w: 0.890

Field description:

FieldTypeDescription
idintThe unique identifier ID of the ArUco tag
position.xfloatThe tag's X coordinate in the map coordinate frame (meters)
position.yfloatThe tag's Y coordinate in the map coordinate frame (meters)
position.zfloatThe tag's Z coordinate in the map coordinate frame (meters)
orientation.x/y/z/wfloatThe tag's orientation quaternion, representing the tag's facing direction

5.4 Visual Relocalization Working Principle

  1. Detect the ArUco tags: the camera continuously detects ArUco tags within its field of view

  2. Match global coordinates: if a tag is detected, read its global coordinates from aritag_relocation.yaml

  3. Calculate the deviation: compare the position estimated by the current odometry with the true position provided by the ArUco tag

  4. Correct the pose: use the ArUco tag's position to correct the robot's global pose

Relocalization advantages:

  • ✅ Eliminates accumulated error: the odometry accumulates error over time, while the ArUco tag provides an absolute position reference

  • ✅ Solves degraded scenarios: in areas with similar features such as long corridors, laser SLAM may produce chaotic localization, while the ArUco tag provides a reliable anchor

Notes: ⚠️ Before recording the tag position, you must ensure that the laser localization is accurate (the laser contour matches the environmental edges) ⚠️ If a tag's position changes, its global coordinates need to be recorded again

 

5.5 Tag Configuration Parameters

  • Configuration parameter file path for the tag node

xxxxxxxxxx
~/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_bringup/param/common.yaml

Parameter description:

ParameterDescriptionDefault Value
image_transportImage transport format; raw is raw image, compressed is compressed imageraw
familyArUco tag family type; different families use different encoding methods36h11
sizeThe tag's physical side length (unit: meters); must match the actual size0.048
profileWhether to output performance profiling informationfalse
max_hammingMaximum allowed Hamming distance (number of correctable bits); 0 means no error correction0
detector.threadsNumber of detection threads1
detector.decimatePyramid downsampling factor; a larger value makes detection faster but reduces accuracy2.0
detector.blurGaussian blur sigma value, used for quad detection0.0
detector.refineWhether to enable edge sharpening for precise localizationtrue
detector.sharpeningSharpening strength of the decoded image0.25
detector.debugWhether to output debug images to the current working directoryfalse
pose_estimation_methodPose estimation method; pnp means using the PnP algorithmpnp
tag.idsList of tag IDs to detect; only tags appearing in the list are detected[1-20]
tag.framesList of TF coordinate frame names corresponding to the IDs[tag1-tag20]

Important parameter tuning suggestions:

  • size: must be measured accurately and set; errors will cause incorrect pose computation

  • family: must match the tag family used, otherwise detection will fail

  • tag.ids: only list the tag IDs actually used, to reduce unnecessary TF publishing

xxxxxxxxxx
...
apriltag:                 # node name
  ros__parameters:
    image_transport: raw  # image format: "raw" or "compressed"
    family: 36h11         # tag family name: 16h5, 25h9, 36h11
    size: 0.048             # default tag edge size in meter
    profile: false        # print profiling information to stdout
    # tuning of detection (defaults)
    max_hamming: 0        # maximum allowed hamming distance (corrected bits)
    detector:
      threads: 1          # number of threads
      decimate: 2.0       # decimate resolution for quad detection
      blur: 0.0           # sigma of Gaussian blur for quad detection
      refine: true        # snap to strong gradients
      sharpening: 0.25    # sharpening of decoded images
      debug: false            # write additional debugging images to current working directory
    pose_estimation_method: "pnp" # method for estimating the tag pose
    tag:
      ids:    [1, 2, 3, 4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]         # tag IDs for which to publish transform
      frames: [tag1, tag2, tag3, tag4, tag5, tag6, tag7, tag8, tag9, tag10, tag11, tag12, tag13, tag14, tag15, tag16, tag17, tag18, tag19, tag20] 
...

 

5.6 Inter-Node Communication Graph

  • Start it while the relocalization navigation is running:

xxxxxxxxxx
ros2 run rqt_graph rqt_graph
  • The apriltag node subscribes to the camera topic to detect tags and publishes the /detections topic; the relocalization node apriltag_relocation subscribes to /detections. When a tag is detected, based on the tag's recorded map anchor coordinates, it computes the position of the car's base_link in the map coordinate frame and publishes it to /initialpose, triggering the localization function of the slam_toolbox node to compute the precise coordinate position of the car in the map from the pose constraint graph

image-20260512163350766

Synchronous Mapping And Navigation
Mobile App Mapping And Navigation

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文