Multi-camera vision mark based mobile robot absolute positioning method and system

By employing an absolute positioning method based on multi-camera visual markers, outliers are eliminated, weighted averaging and symbol alignment are performed, and timestamps and caching mechanisms are combined to solve the problems of single-camera visual markers being susceptible to occlusion and inconsistencies in multi-camera system fusion, thus achieving stable positioning under complex conditions.

CN123160657APending Publication Date: 2026-11-24HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611253196.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In existing mobile robot localization solutions, single-camera visual marker localization methods are susceptible to lighting, occlusion, and motion blur, while multi-camera systems are prone to pose jumps and inconsistent fusion results, leading to unstable localization.

Method used

An absolute positioning method using multi-camera visual markers is employed. By calculating the pose of the cameras in the world coordinate system of the site, outliers are eliminated, and weighted averaging and sign alignment are performed. Combined with timestamps and caching mechanisms, exponential moving averages are used for smoothing to improve positioning stability.

Benefits of technology

Under conditions of occlusion, changing viewpoint, and asynchronous frame input, the positioning stability of the mobile robot is improved, ensuring the continuity and reliability of absolute positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160657A_ABST
    Figure CN123160657A_ABST
Patent Text Reader

Abstract

This invention relates to a method and system for absolute localization of mobile robots based on multi-camera visual markers. The method calculates the pose of the cameras in the world coordinate system based on the pose matrix and relative pose, and also calculates the pose of the mobile robot body in the world coordinate system. A weighted average of the position and attitude quaternions of the candidate poses of the robot body is performed to obtain the effective pose under the same camera. If the most recent effective pose of a camera is within an effective time window, the attitude quaternions of the effective poses of multiple cameras within the effective time window are sign-aligned. A normalized weighted average of the positions of the effective poses of multiple cameras within the effective time window is performed to obtain the position of the effective absolute pose. The position and attitude quaternions of the effective absolute pose are smoothed, and the robot body pose in the world coordinate system is output. This improves the localization stability of the mobile robot under conditions of occlusion, viewpoint changes, single-marker false detection, and asynchronous frame input from dual cameras.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of robot visual positioning technology, and in particular to a method and system for absolute positioning of mobile robots based on multi-camera visual markers. Background Technology

[0002] In mobile robots, intelligent vehicles, racing robots, automated handling platforms, and indoor navigation systems, real-time, stable, and repeatable absolute positioning is fundamental for path planning, closed-loop control, and task execution. Existing mobile robot localization solutions typically include odometry, IMU, LiDAR SLAM, visual SLAM, UWB, and visual tag-based localization using QR codes or AprilTags. Among these, visual tag-based localization solutions are characterized by low cost, simple deployment, clear absolute coordinates, and ease of debugging, making them suitable for use in structured environments, experimental platforms, and competition scenarios.

[0003] Traditional single-camera visual marker localization methods typically utilize a camera to identify markers of known size and location in the field, solve the camera's pose relative to the markers using perspective geometry, and further calculate the robot's pose. However, in actual operation, the robot's perspective changes rapidly, markers may be occluded, and the detection of individual marker corners is easily affected by lighting, motion blur, and lens distortion, leading to unstable localization. Furthermore, while multi-camera systems can expand the field of view, the arrival times of image frames from different cameras differ. Without effective caching and fusion strategies, pose jumps or inconsistent fusion results can easily occur. Summary of the Invention

[0004] This invention provides a method and system for absolute positioning of mobile robots based on multi-camera visual marking, aiming to solve at least one of the technical problems existing in the prior art.

[0005] The technical solution of this invention is a mobile robot absolute localization method based on multi-camera visual marking, comprising the following steps: S100. Calculate the pose of the camera in the world coordinate system based on the pose matrix of the visual marker in the world coordinate system and the relative pose from the marker coordinate system to the camera coordinate system. Calculate the pose of the mobile robot body in the world coordinate system based on the extrinsic parameter matrix and the pose of the camera in the world coordinate system, and obtain the candidate pose of the vehicle body based on the corresponding visual marker. S200. If the number of candidate vehicle poses after removing outliers reaches a preset number, then according to the comprehensive weight of the candidate vehicle poses, the candidate vehicle positions of the candidate vehicle poses are weighted and averaged, and the pose quaternions of the candidate vehicle poses after symbol alignment are weighted and averaged to obtain the effective poses under the same camera. S300. Store the most recent valid pose of each camera in a cache, and determine whether the most recent valid pose of the camera is within the valid time window based on the timestamp. If the most recent valid pose of the camera is within the valid time window, then perform sign alignment on the pose quaternions of the valid poses of multiple cameras within the valid time window, and perform normalized weighted average on the positions of the valid poses of multiple cameras within the valid time window to obtain the position of the valid absolute pose. S400: The position and attitude quaternion of the effective absolute pose are smoothed by exponential moving average, and the vehicle pose in the field world coordinate system is output.

[0006] According to some embodiments of the present invention, before step S100, the mobile robot absolute localization method based on multi-camera visual markers further includes the following steps: A1. Establish a world coordinate system for the site, and pre-measure and store the pose matrix of the visual marker in the world coordinate system for the site; A2. Set the mobile robot body to include at least two of the aforementioned cameras, and calibrate the intrinsic parameter matrix, distortion parameters, and extrinsic parameter matrix of each camera relative to the coordinate system of the mobile robot body; A3. Control the camera to acquire images, convert the images into grayscale images, detect visual markers in the grayscale images, and obtain the ID of the visual markers and the image coordinates of the four corner points; A4. For each visual marker with a known ID, construct four three-dimensional corner points in the marker coordinate system based on the center of the visual marker as the origin and the actual side length of the visual marker, and use the multi-point perspective problem to solve the relative pose from the marker coordinate system to the camera coordinate system.

[0007] According to some embodiments of the present invention, before step S200, the mobile robot absolute localization method based on multi-camera visual markers further includes the following steps: B1. Calculate the reprojection error for the candidate vehicle poses. If the reprojection error is greater than the error threshold, discard the candidate vehicle poses whose reprojection error is greater than the error threshold. B2. For the candidate vehicle pose, construct the comprehensive weight based on the area of ​​the visual marker in the image, the Euclidean distance between the camera and the visual marker, and the reprojection error. B3. For multiple candidate vehicle poses under the same camera, calculate the median of the x-coordinate, y-coordinate, and z-coordinate of the candidate vehicle position in the multiple candidate vehicle poses to obtain the median position; B4. Calculate the median distance based on the candidate vehicle position and the median position. If the median distance exceeds a preset translation threshold, then the candidate vehicle pose with the median distance exceeding the preset translation threshold is considered an outlier and the outlier is removed.

[0008] According to some embodiments of the present invention, in step S100, The pose of the camera in the site world coordinate system is calculated based on the pose matrix and the relative pose, as shown below: world_T_cam = world_T_tag × inv(cam_T_tag), In the formula, world_T_cam is the pose of the camera in the world coordinate system of the site, world_T_tag is the pose matrix of the visual tag in the world coordinate system of the site, cam_T_tag is the relative pose of the tag coordinate system to the camera coordinate system, and inv represents the inverse matrix. The pose of the mobile robot in the world coordinate system is calculated based on the extrinsic parameter matrix and the pose of the camera in the site world coordinate system, as shown below: world_T_base = world_T_cam × inv(base_T_camera), In the formula, world_T_base is the pose of the mobile robot body in the world coordinate system of the site, that is, the candidate pose of the body based on the corresponding visual marker, and base_T_camera is the extrinsic parameter matrix.

[0009] According to some embodiments of the present invention, the calculation of reprojection error for candidate vehicle poses includes: For each of the vehicle body candidate poses, calculate the theoretical projection corner points based on three-dimensional corner points; The pixel error between the theoretically projected corner point and the actual detected corner point is calculated, and the average value of multiple pixel errors is calculated to obtain the reprojection error.

[0010] According to some embodiments of the present invention, in step B2, With the four corner points arranged clockwise, the area of ​​the visual marker in the image is represented as follows: A = 1 / 2 • |Σ(i=1…4)(u_iv_(i+1)-u_(i+1)v_i)|, In the formula, A is the area of ​​the visual mark in the image, (u_i,v_i) represents the image coordinates of the i-th corner point arranged clockwise, (u_(i+1), v_(i+1)) represents the image coordinates of the (i+1)-th corner point, i=1,…,4 and the corner point number cycles modulo 4, that is, (u_5,v_5)=(u_1,v_1); The Euclidean distance between the camera and the visual marker is expressed as follows: , In the formula, d is the Euclidean distance between the camera and the visual marker, t_ct is the translation vector in the relative pose from the marker coordinate system to the camera coordinate system, that is, the position vector of the origin of the marker coordinate system in the camera coordinate system, and t_x, t_y, and t_z are the three components of t_ct. The overall weight is expressed as follows: w_A = clip(√(A / A_ref), 0.10, 1.00), w_E = exp[-(e_reproj / σ_E)²], w_D = 1 / [1+(d / σ_D)²], w_j = w_A • w_E • w_D, In the formula, A_ref=1600 pixel² is the reference area, σ_E=2.0 pixel is the reprojection error scale parameter, σ_D=2.5 m is the distance scale parameter, w_A, w_E, and w_D are the area weight, error weight, and distance weight, respectively, clip represents the clipping function that restricts the function value to a given upper and lower limit, A is the area of ​​the visual marker in the image, exp represents the natural exponential function, e_reproj is the reprojection error, d is the Euclidean distance between the camera and the visual marker, and w_j is the comprehensive weight of the j-th candidate pose of the vehicle body.

[0011] According to some embodiments of the present invention, the median distance is calculated based on the candidate vehicle position and the median position, as shown below: , In the formula, δ_j is the median distance, p_j is the coordinate of the candidate vehicle position, and p_med is the coordinate of the median position.

[0012] According to some embodiments of the present invention, in step S200, the effective pose includes the position of the effective pose and the pose quaternion of the effective pose. Based on the comprehensive weights of the candidate vehicle poses, a weighted average is calculated for the candidate vehicle positions, and a weighted average is calculated for the pose quaternions of the symbol-aligned candidate vehicle poses to obtain the effective poses under the same camera, including: The position of the effective pose is obtained by weighted averaging the candidate positions of the candidate vehicle body poses, as shown below: λ_j = w_j / Σw_j, p_camera0 = Σλ_jp_j, In the formula, λ_j represents the normalized weight of the j-th vehicle candidate pose, which is equal to the ratio of w_j to the sum of the comprehensive weights of all vehicle candidate poses under the same camera, p_j is the coordinate of the vehicle candidate position, that is, the position vector of the j-th vehicle candidate pose, w_j is the comprehensive weight of the j-th vehicle candidate pose, and p_camera0 represents the position of the effective pose under the same camera; like Then let q_j←-q_j to align the sign of the corresponding vehicle body candidate pose quaternion with the reference quaternion, where q_j is the j-th vehicle body candidate pose quaternion, q_ref represents the vehicle body candidate pose with the largest comprehensive weight, and T represents transpose. The pose quaternions of the candidate vehicle poses after symbol alignment are weighted and averaged to obtain the pose quaternions of the effective poses, as shown below: q_sum=Σλ_jq_j, q_camera0 = q_sum / ||q_sum|| In the formula, q_sum represents the weighted sum of the attitude quaternions of each candidate vehicle pose after sign alignment, ||q_sum|| represents the Euclidean norm of q_sum, and q_camera0 represents the attitude quaternion of the effective pose obtained after normalizing q_sum.

[0013] According to some embodiments of the present invention, the vehicle pose in the field world coordinate system includes the position of the vehicle pose in the field world coordinate system and the pose quaternion of the vehicle pose in the field world coordinate system; step S400 includes: The effective absolute pose is smoothed using the exponential moving average, and the vehicle pose in the field world coordinate system is output as follows: p_t = αp_f + (1-α)p_(t-1), In the formula, p_t is the position of the vehicle body in the world coordinate system of the site at the current time, α is the smoothing coefficient and 0<α≤1, p_f is the position of the effective absolute pose at the current time, and p_(t-1) represents the position of the vehicle body in the world coordinate system of the site at the previous time. like Then let q_f←-q_f to align the sign of the attitude quaternion of the effective absolute pose with the attitude quaternion of the previous moment, where q_f is the attitude quaternion of the effective absolute pose at the current moment, T represents transpose, and q_(t-1) represents the attitude quaternion of the vehicle body pose in the field world coordinate system at the previous moment. The attitude quaternion of the effective absolute pose is smoothed using the exponential moving average method, and the attitude quaternion of the vehicle body pose in the field world coordinate system is output as follows: q'_t = αq_f + (1-α)q_(t-1), q_t=q'_t / ||q'_t||, In the formula, q'_t represents the unnormalized quaternion obtained by exponential moving average of q_f and q_(t-1), ||q'_t|| represents the Euclidean norm of q'_t, and q_t is the attitude quaternion of the vehicle body pose in the world coordinate system of the site at the current moment obtained by normalizing q'_t.

[0014] The technical solution of the present invention also relates to a mobile robot absolute positioning system based on multi-camera visual markers, used to execute the mobile robot absolute positioning method based on multi-camera visual markers as described above, wherein the mobile robot absolute positioning system based on multi-camera visual markers includes: The single-camera multi-label fusion module is used to calculate the weighted average of the vehicle candidate positions based on the comprehensive weight of the vehicle candidate poses if the number of vehicle candidate poses after removing outliers reaches a preset number, and to calculate the weighted average of the pose quaternions of the vehicle candidate poses after symbol alignment, so as to obtain the effective poses under the same camera. A multi-camera cache fusion module is used to store the most recent valid pose of each camera in a cache, and determine whether the most recent valid pose of the camera is within a valid time window based on the timestamp. If the most recent valid pose of the camera is within the valid time window, the pose quaternions of the valid poses of multiple cameras within the valid time window are sign-aligned, and the positions of the valid poses of multiple cameras within the valid time window are normalized and weighted to obtain the position of the valid absolute pose. The single-camera multi-marker fusion module is connected to the multi-camera cache fusion module. The smoothing and publishing module is used to smooth the position and attitude quaternions of the effective absolute pose using an exponential moving average, output the vehicle pose in the site world coordinate system, and publish the vehicle pose in the site world coordinate system to the robot control system; the multi-camera cache fusion module is connected to the smoothing and publishing module.

[0015] The present invention also relates to a computer device, including a memory and a processor, wherein the processor executes the method described above when executing a computer program stored in the memory.

[0016] The present invention also relates to a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the method described above.

[0017] The beneficial effects of this invention include: calculating the camera's pose in the field world coordinate system based on the pose matrix of the visual markers in the field world coordinate system and the relative pose from the marker coordinate system to the camera coordinate system; calculating the pose of the mobile robot's body in the field world coordinate system based on the extrinsic parameter matrix and the camera's pose in the field world coordinate system; obtaining candidate body poses based on the corresponding visual markers; if the number of candidate body poses after removing outliers reaches a preset number, then a weighted average of the candidate body positions of the candidate body poses is performed based on the comprehensive weight of the candidate body poses; a weighted average of the pose quaternions of the candidate body poses after symbol alignment is performed to obtain the effective poses under the same camera; and the most recent poses of each camera are then calculated. The effective poses are stored in the cache, and the timestamp is used to determine whether the most recent effective pose of the camera is within the effective time window. If the most recent effective pose of the camera is within the effective time window, the pose quaternions of the effective poses of multiple cameras within the effective time window are sign-aligned, and the positions of the effective poses of multiple cameras within the effective time window are normalized and weighted to obtain the position of the effective absolute pose. An exponential moving average is used to smooth the position of the effective absolute pose and the pose quaternion of the effective absolute pose, and the vehicle pose in the world coordinate system of the site is output, which improves the positioning stability of the mobile robot under the conditions of occlusion, viewpoint change, single marker false detection and asynchronous frame input of dual cameras.

[0018] Furthermore, additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0019] Figure 1 This is an optional flowchart of a mobile robot absolute positioning method based on multi-camera visual markers in an embodiment of the present invention.

[0020] Figure 2This is a schematic diagram of a mobile robot absolute positioning system based on multi-camera visual marking in an embodiment of the present invention. Detailed Implementation

[0021] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with the embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.

[0022] It should be noted that, unless otherwise specified, when a feature is referred to as "fixed" or "connected" to another feature, it can be directly fixed or connected to the other feature, or indirectly fixed or connected to the other feature. Furthermore, the descriptions of "upper," "lower," "left," "right," "top," and "bottom" used in this invention are only relative to the relative positional relationships of the various components of the invention in the accompanying drawings.

[0023] Furthermore, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and not for limiting the invention. The term "and / or" as used herein includes any combination of one or more of the associated listed items.

[0024] It should be understood that although the terms first, second, third, etc., may be used to describe various elements in this invention, these elements should not be limited to these terms. These terms are only used to distinguish elements of the same type from each other. For example, a first element may also be referred to as a second element without departing from the scope of this invention, and similarly, a second element may also be referred to as a first element.

[0025] To facilitate understanding of the technical solutions provided in the embodiments of the present invention, some key terms used in the embodiments of the present invention will be explained here first: AprilTag: A two-dimensional visual tag that can be recognized by computer vision algorithms, providing a unique ID and corner location.

[0026] PnP: Perspective-n-Point, a method for solving camera pose using several 3D points and their 2D projection points.

[0027] ROS2: Robot Operating System 2, a framework for robot software communication and operation.

[0028] TF: A mechanism in robotic systems used to publish and maintain transformation relationships between different coordinate systems.

[0029] Reprojection error: The pixel error between the solved 3D pose and the actual detected corner point after reprojecting it onto the image plane.

[0030] EMA: Exponential Moving Average, used to reduce output jitter.

[0031] PoseStamped: A standard message type in ROS (Robot Operating System) that includes a timestamp, coordinate system ID, and pose data.

[0032] Reference Figure 1 In some embodiments, the mobile robot absolute positioning method based on multi-camera visual markers of the present invention includes at least the following steps: S100. Calculate the pose of the camera in the world coordinate system based on the pose matrix of the visual marker in the world coordinate system and the relative pose from the marker coordinate system to the camera coordinate system. Calculate the pose of the mobile robot body in the world coordinate system based on the extrinsic parameter matrix and the pose of the camera in the world coordinate system, and obtain the candidate pose of the vehicle body based on the corresponding visual marker. S200. If the number of candidate vehicle poses after removing outliers reaches a preset number, then the candidate vehicle positions of the candidate vehicle poses are weighted and averaged according to the comprehensive weight of the candidate vehicle poses, and the pose quaternions of the candidate vehicle poses after symbol alignment are weighted and averaged to obtain the effective poses under the same camera. S300: Store the most recent valid pose of each camera in the cache, and determine whether the most recent valid pose of the camera is within the valid time window based on the timestamp. If the most recent valid pose of the camera is within the valid time window, then perform sign alignment on the pose quaternions of the valid poses of multiple cameras within the valid time window, and perform normalized weighted average on the positions of the valid poses of multiple cameras within the valid time window to obtain the position of the valid absolute pose. S400 uses an exponential moving average to smooth the position and attitude quaternions of the effective absolute pose, and outputs the vehicle pose in the field world coordinate system.

[0033] Specifically, an exponential moving average is used to smooth the position and attitude quaternion of the effective absolute pose, and the vehicle pose in the field world coordinate system is output. The vehicle pose in the field world coordinate system is used as the absolute positioning input for path planning, motion control, map display and task execution.

[0034] Specifically, caching and fusing the recent effective poses of multiple cameras within a time window helps to solve the problem of inconsistent arrival times of images from different cameras.

[0035] In some embodiments, prior to step S100, the mobile robot absolute localization method based on multi-camera visual markers further includes the following steps: A1. Establish a world coordinate system for the site, and pre-measure and store the pose matrix of the visual markers in the world coordinate system for the site. A2. Set the mobile robot body to include at least two cameras, and calibrate the intrinsic parameter matrix, distortion parameters and extrinsic parameter matrix of each camera relative to the coordinate system of the mobile robot body; A3. Control the camera to capture images, convert the images to grayscale images, detect visual markers in the grayscale images, and obtain the IDs of the visual markers and the image coordinates of the four corner points; A4. For each visual marker with a known ID, construct four 3D corner points in the marker coordinate system based on the actual side length of the visual marker, with the center of the visual marker as the origin, and use the multi-point perspective problem to solve the relative pose from the marker coordinate system to the camera coordinate system.

[0036] In a specific embodiment, the visual tag is AprilTag, a QR code tag, or other planar visual tag with a unique ID.

[0037] In a specific embodiment, the relative pose from the marker coordinate system to the camera coordinate system is solved using a multi-point perspective problem, including: The rotation vector and translation vector are calculated using the multi-point perspective problem, and the rotation vector is converted into a rotation matrix using the Rodriguez formula. Based on the rotation matrix and translation vector, the relative pose from the marker coordinate system to the camera coordinate system is obtained, as shown below: cam_T_tag = [ R_ct t_ct ; 0 0 0 1 ], In the formula, cam_T_tag is the relative pose from the marker coordinate system to the camera coordinate system, R_ct is the rotation matrix from the marker coordinate system to the camera coordinate system, and t_ct is the translation vector in the relative pose from the marker coordinate system to the camera coordinate system, that is, the position vector of the origin of the marker coordinate system in the camera coordinate system.

[0038] In some embodiments, prior to step S200, the mobile robot absolute localization method based on multi-camera visual markers further includes the following steps: B1. Calculate the reprojection error for the candidate vehicle poses. If the reprojection error is greater than the error threshold, discard the candidate vehicle poses whose reprojection error is greater than the error threshold. B2. For candidate vehicle poses, construct a comprehensive weight based on the area of ​​the visual marker in the image, the Euclidean distance between the camera and the visual marker, and the reprojection error. B3. For multiple candidate vehicle poses under the same camera, calculate the median of the x, y, and z coordinates of the candidate vehicle positions in the multiple candidate vehicle poses to obtain the median position; B4. Calculate the median distance based on the candidate vehicle position and the median position. If the median distance exceeds the preset translation threshold, the candidate vehicle position with the median distance exceeding the preset translation threshold is regarded as an outlier and removed.

[0039] Specifically, when a single camera has multiple candidate vehicle poses, outlier poses can be eliminated by using the median position and a preset translation threshold, which can reduce positioning jumps caused by misidentification or abnormal corners.

[0040] As can be seen, this invention proposes a method and system for absolute localization of mobile robots based on multi-camera visual markers. The core of this method is as follows: the poses of multiple visual markers are pre-calibrated in the world coordinate system of the site; images are acquired synchronously or asynchronously by multiple onboard cameras; visual markers such as AprilTag are identified; and the relative poses between the cameras and markers are obtained by PnP pose solving. Then, the absolute pose of the robot body in the world coordinate system of the site is calculated by combining the pose matrix and camera extrinsic parameters. At the same time, reprojection error filtering, area / distance / error comprehensive weighting, multi-marker outlier removal, multi-camera recent cache fusion, and exponential sliding smoothing are introduced to improve the localization stability of the mobile robot under conditions of occlusion, viewpoint change, single-marker false detection, and asynchronous frame input from dual cameras.

[0041] In some embodiments, in step S100, The pose of the camera in the world coordinate system of the site is calculated based on the pose matrix and the relative pose, as shown below: world_T_cam = world_T_tag × inv(cam_T_tag), In the formula, world_T_cam is the pose of the camera in the world coordinate system of the site, world_T_tag is the pose matrix of the visual tag in the world coordinate system of the site, cam_T_tag is the relative pose from the tag coordinate system to the camera coordinate system, and inv means to find the inverse matrix. The pose of the mobile robot in the world coordinate system of the site is calculated based on the extrinsic parameter matrix and the pose of the camera in the site's world coordinate system, and is expressed as follows: world_T_base = world_T_cam × inv(base_T_camera), In the formula, world_T_base is the pose of the mobile robot body in the world coordinate system of the site, that is, the candidate pose of the body based on the corresponding visual marker, and base_T_camera is the extrinsic parameter matrix.

[0042] In some embodiments, calculating the reprojection error for the candidate vehicle pose includes: For each candidate vehicle pose, theoretically projected corner points are calculated based on 3D corner points; The pixel error between the theoretically projected corner point and the actual detected corner point is calculated, and the average value of multiple pixel errors is calculated to obtain the reprojection error.

[0043] In a specific embodiment, for each candidate vehicle pose, theoretically projected corner points are calculated based on three-dimensional corner points, including: For each candidate vehicle body pose, the 3D corner points of the visual markers are set as follows: The 3D corner points are transformed to the camera coordinate system using rotation matrices and translation vectors, as shown below: , In the formula, P_i is the column vector of coordinates of the i-th 3D corner point in the marker coordinate system, the superscript T indicates transpose, (X_i,Y_i,Z_i) represents the coordinates of the 3D corner point in the marker coordinate system, (X_ci, Y_ci, Z_ci) represents the coordinates of the 3D corner point in the camera coordinate system, R_ct is the rotation matrix from the marker coordinate system to the camera coordinate system, and t_ct is the translation vector in the relative pose from the marker coordinate system to the camera coordinate system, that is, the position vector of the origin of the marker coordinate system in the camera coordinate system; The theoretical projection corner points are calculated as follows: x_i = X_ci / Z_ci, y_i = Y_ci / Z_ci, r_i² = x_i² + y_i², , , , , In the formula, (x_i, y_i) represents the coordinates of the three-dimensional corner point mapped onto the normalized imaging plane with Z=1 in front of the camera, r_i represents the radial distance from the normalized point to the optical axis, r_i² represents the square of the radial distance, and L_i represents the radial distortion factor. , , The radial distortion coefficients are obtained from the camera intrinsic parameter calibration; x_di and y_di represent the normalized coordinates after radial and tangential distortion. , Indicates the tangential distortion coefficient; f_x and f_y represent the pixel coordinates of the theoretical projection corner point; f_x and f_y represent the equivalent focal length in pixels; c_x and c_y represent the principal point, i.e., the pixel coordinates of the intersection of the optical axis and the image plane.

[0044] In a specific embodiment, the pixel error between the theoretically projected corner point and the actual detected corner point is calculated, and the average value of multiple pixel errors is calculated to obtain the reprojection error, as shown below: , e_reproj = (1 / 4) • Σ(i=1…4)e_i, In the formula, e_i represents the pixel error, and (u_i, v_i) represents the pixel coordinates of the actual detected corner point. Represents the pixel coordinates of the theoretically projected corner point, and e_reproj is the reprojection error.

[0045] In some embodiments, in step B2, With the four corner points arranged clockwise, the area of ​​the visual marker in the image is represented as follows: A = 1 / 2 • |Σ(i=1…4)(u_iv_(i+1)-u_(i+1)v_i)|, In the formula, A is the area of ​​the visual marker in the image, (u_i,v_i) represents the image coordinates of the i-th corner point arranged clockwise, (u_(i+1), v_(i+1)) represents the image coordinates of the (i+1)-th corner point, i=1,…,4 and the corner point number cycles modulo 4, that is, (u_5,v_5)=(u_1,v_1); The Euclidean distance between the camera and the visual marker is expressed as follows: , In the formula, d is the Euclidean distance between the camera and the visual marker, t_ct is the translation vector in the relative pose from the marker coordinate system to the camera coordinate system, that is, the position vector of the origin of the marker coordinate system in the camera coordinate system, and t_x, t_y, and t_z are the three components of t_ct. The overall weighting is expressed as follows: w_A = clip(√(A / A_ref), 0.10, 1.00), w_E = exp[-(e_reproj / σ_E)²], w_D = 1 / [1+(d / σ_D)²], w_j = w_A • w_E • w_D, In the formula, A_ref=1600 pixel² is the reference area, σ_E=2.0 pixel is the reprojection error scale parameter, σ_D=2.5 m is the distance scale parameter, w_A, w_E, and w_D are the area weight, error weight, and distance weight, respectively, clip represents the clipping function that restricts the function value to a given upper and lower limit, A is the area of ​​the visual marker in the image, exp represents the natural exponential function, e_reproj is the reprojection error, d is the Euclidean distance between the camera and the visual marker, and w_j is the comprehensive weight of the j-th vehicle candidate pose.

[0046] In some embodiments, the median distance is calculated based on the candidate vehicle location and the median location, as follows: , In the formula, δ_j is the median distance, p_j is the coordinate of the candidate vehicle position, and p_med is the coordinate of the median position.

[0047] In some embodiments, in step S200, the effective pose includes the position of the effective pose and the pose quaternion of the effective pose. Based on the comprehensive weights of the candidate vehicle poses, a weighted average is calculated for the candidate vehicle positions, and a weighted average is calculated for the pose quaternions of the symbol-aligned candidate vehicle poses to obtain the effective poses under the same camera, including: The effective pose position is obtained by weighted averaging of the candidate vehicle body positions for the candidate poses, as shown below: λ_j = w_j / Σw_j, p_camera0 = Σλ_jp_j, In the formula, λ_j represents the normalized weight of the j-th vehicle candidate pose, which is equal to the ratio of w_j to the sum of the comprehensive weights of all vehicle candidate poses under the same camera, p_j is the coordinate of the vehicle candidate position, that is, the position vector of the j-th vehicle candidate pose, w_j is the comprehensive weight of the j-th vehicle candidate pose, and p_camera0 represents the position of the effective pose under the same camera. like Then let q_j←-q_j to align the sign of the corresponding vehicle body candidate pose quaternion with the reference quaternion, where q_j is the pose quaternion of the j-th vehicle body candidate pose, q_ref represents the pose quaternion of the vehicle body candidate pose with the largest comprehensive weight, and T represents transpose. The pose quaternions of the candidate vehicle poses after symbol alignment are weighted and averaged to obtain the pose quaternions of the effective poses, as shown below: q_sum=Σλ_jq_j, q_camera0 = q_sum / ||q_sum|| In the formula, q_sum represents the weighted sum of the attitude quaternions of each candidate vehicle pose after sign alignment, ||q_sum|| represents the Euclidean norm of q_sum, and q_camera0 represents the attitude quaternion of the effective pose obtained after normalizing q_sum.

[0048] In a specific embodiment, in step S300, when the mobile robot body includes a first camera and a second camera, the positions of the effective poses of multiple cameras within the effective time window are normalized and weighted to obtain the position of the effective absolute pose, as shown below: W'_c = W_c • exp[-(t_now-t_c) / τ], p_f = (W'_0p_0+W'_1p_1) / (W'_0+W'_1), In the formula, τ is the time decay time constant, τ=0.15s, c is the camera index; W_c represents the total weight of the c-th cached camera, W'_c represents the weight obtained after introducing time decay into W_c, exp represents the natural exponential function, t_now is the current time, t_c is the cache timestamp corresponding to the effective pose of the c-th camera, W'_0 represents the total weight of the first camera after introducing time decay, p_0 is the position of the effective pose corresponding to the first cached camera, W'_1 represents the total weight of the second camera after introducing time decay, p_1 is the position of the effective pose corresponding to the second cached camera, and p_f is the position of the effective absolute pose obtained by normalizing and weighting the positions of the effective poses of the two cameras.

[0049] In some embodiments, the vehicle pose in the site world coordinate system includes the vehicle position in the site world coordinate system and the pose quaternion of the vehicle pose in the site world coordinate system; step S400 includes: An exponential moving average is used to smooth the effective absolute pose, and the vehicle pose in the world coordinate system is output as follows: p_t = αp_f + (1-α)p_(t-1), In the formula, p_t is the position of the vehicle body in the world coordinate system at the current moment, α is the smoothing coefficient and 0<α≤1, p_f is the position of the effective absolute pose at the current moment, and p_(t-1) represents the position of the vehicle body in the world coordinate system at the previous moment. like Then let q_f←-q_f to align the sign of the attitude quaternion of the effective absolute pose with the attitude quaternion of the previous moment, where q_f is the attitude quaternion of the effective absolute pose at the current moment, T represents transpose, and q_(t-1) represents the attitude quaternion of the vehicle body pose in the field world coordinate system at the previous moment. An exponential moving average is used to smooth the attitude quaternion of the effective absolute pose, and the attitude quaternion of the vehicle body pose in the field world coordinate system is output as follows: q'_t = αq_f + (1-α)q_(t-1), q_t=q'_t / ||q'_t||, In the formula, q'_t represents the unnormalized quaternion obtained by exponential moving average of q_f and q_(t-1), ||q'_t|| represents the Euclidean norm of q'_t, and q_t is the attitude quaternion of the vehicle pose in the world coordinate system at the current moment obtained by normalizing q'_t.

[0050] It is understandable that by constructing multi-level screening, weighted fusion, outlier removal, time caching, and pose smoothing mechanisms, mobile robots can obtain stable, continuous, and controllable absolute poses in the world coordinate system within structured environments.

[0051] Specifically, the mobile robot absolute localization method based on multi-camera visual markers includes the following steps: Establish a site world coordinate system, pre-measure and store the pose matrices of multiple visual markers in the site world coordinate system. The visual markers can be AprilTag, QR code markers or other planar visual markers with unique IDs. Install at least two cameras on the mobile robot body, and calibrate the intrinsic parameter matrix, distortion parameters, and extrinsic parameter matrix of each camera relative to the robot body coordinate system. After each camera captures an image, the image is converted into a grayscale image, and visual markers in the image are detected to obtain the ID of each visual marker and the image coordinates of its four corner points; For each visual tag with a known ID, construct the 3D corner point in the tag's local coordinate system based on the tag's actual side length, and use the PnP method to solve the relative pose from the tag coordinate system to the camera coordinate system. The pose of the camera in the world coordinate system of the site is calculated based on the pose matrix and the relative pose. Then, the pose of the robot body in the world coordinate system of the site is calculated based on the extrinsic parameter matrix of the camera relative to the robot body coordinate system. Calculate the reprojection error for each vehicle body candidate pose, and discard the vehicle body candidate pose when the reprojection error is greater than the error threshold. For the retained candidate vehicle poses, a comprehensive weight is constructed based on the area of ​​the marker in the image, the distance from the camera to the marker, and the reprojection error. When the same camera acquires multiple candidate vehicle poses, outlier detection is performed based on the median of the translation of the candidate poses, and the position and pose are weighted and fused after outlier removal. The most recent valid pose of each camera is stored in the cache, and its timestamp is used to determine whether it is within the valid time window; the poses of multiple cameras within the valid time window are then further weighted and fused. The final fused pose (i.e. the aforementioned effective absolute pose) is subjected to exponential sliding smoothing, where the translation vector is linearly smoothed and the pose quaternion is normalized and smoothed after sign alignment. The smoothed robot pose (i.e., the vehicle pose in the aforementioned site world coordinate system) is published to the robot software system as the absolute positioning input for path planning, motion control, map display, and task execution.

[0052] In one specific embodiment, the site dimensions are set to 4.0 m × 2.0 m. The origin of the site's world coordinate system is set at the lower right corner of the site, with the X-axis pointing forward along the longer side, the Y-axis pointing to the left along the shorter side, and the Z-axis pointing vertically upward. Multiple tag36h11 family AprilTags are placed in the site, each visual tag having a side length of 0.075 m, and the pose matrix of each visual tag in the site's world coordinate system is pre-stored in the program.

[0053] A first and second camera are installed on the mobile robot, each subscribing to a corresponding image topic. Each camera has an independent image topic, frame_id, intrinsic parameter matrix, distortion coefficients, and extrinsic parameter matrix. After system startup, a ROS2 node is established, and the AprilTag detector, image bridging module, pose publisher, and TF broadcaster are initialized.

[0054] Whenever a camera image arrives, the system converts the image to grayscale and performs AprilTag detection. For detected visual tags already registered in the pose table, the system constructs local 3D points of the tag according to a preset corner point order, and calls the PnP pose solving algorithm to obtain rvec (i.e., the aforementioned rotation vector) and tvec (i.e., the aforementioned translation vector), and then generates the cam_T_tag homogeneous transformation matrix. The system then calculates the pose of the camera in the site world coordinate system and the pose of the mobile robot body in the site world coordinate system to obtain the candidate pose of the vehicle body based on the visual tag.

[0055] The system reprojects the 3D corner points back onto the image plane and calculates the average pixel error between the theoretically projected corner points and the actual detected corner points. When the reprojection error exceeds the error threshold, it indicates that the marker detection or pose solution may be abnormal, and the system discards the candidate vehicle pose. For valid candidate vehicle poses, the system calculates area weight, error weight, and distance weight, and multiplies these three factors to obtain the comprehensive weight of the candidate vehicle pose. The larger the area of ​​the marked image, the smaller the reprojection error, and the closer the marker distance, the higher the weight of the candidate pose.

[0056] For multiple candidate vehicle poses under the same camera, the system first calculates the median of the translation positions and considers vehicle candidate poses whose distance from the median exceeds a preset translation threshold as outliers. If a sufficient number of vehicle candidate poses are still retained after outlier removal, the positions of the retained vehicle candidate poses are weighted and averaged, and the pose quaternions are sign-aligned and then weighted and averaged to obtain the effective pose of the camera.

[0057] The system stores the most recent valid pose, its weight, and timestamp of each camera in a cache. During the fusion phase, only camera poses with an age less than a preset timeout are used; when at least one valid camera pose exists, multi-camera weighted fusion continues. Finally, the system uses an exponential moving average to smooth the position and quaternions, outputting the vehicle pose in the site's world coordinate system.

[0058] It should be understood that expanding the visual coverage area through multiple cameras allows for continued localization even when a single camera is occluded, drops frames, or has insufficient field of view. Reprojection error filtering removes outlier labels, improving the reliability of single-label pose calculation. A comprehensive weighting of area, distance, and error ensures that clearer, closer, and geometrically more consistent labels contribute more to the fused pose. Median outlier removal reduces pose jumps caused by misidentification or single outlier labels. A multi-camera recent caching mechanism adapts to asynchronous image input, enabling effective pose fusion without mandatory hardware synchronization. Translation and quaternion smoothing reduce localization jitter, making the output more suitable for mobile robot control loops. The system can directly connect to ROS2, outputting PoseStamped and TF coordinate transformations for easy integration into robot navigation, visualization, and control modules.

[0059] In one specific embodiment, the robot is used to handle bulk goods. The three crates in the picking area contain 1.8 kg ± 50 g of white kidney beans, 2.1 kg ± 50 g of soybeans, and 2.5 kg ± 50 g of mung beans, respectively. The placement area has five crates, each labeled with a number from 1 to 5 on its two long sides. The target crates for soybeans, mung beans, and white kidney beans are numbers 1, 2, and 3, respectively; crates 4 and 5 are empty. The order of the goods in the picking area and the arrangement of the five numbered crates in positions 4 through 8 are determined by drawing lots.

[0060] The inner bottom right corner of the site is taken as the origin of the site world coordinate system; the +X axis extends along the 4.0 m long side from the placement area to the pickup area, the +Y axis extends along the 2.0 m short side from the lower side to the upper side, and the +Z axis points vertically upward. Thus, the center line is x=2.00 m, where 0≤x<2.00 m is the side of the placement area and 2.00 m<x≤4.00 m is the side of the pickup area. The center of the 400 mm×400 mm starting area is (2.00 m, 1.00 m, 0).

[0061] The positions of two cylindrical obstacles are entered into the path planner according to the official site drawings and on-site re-measurement values; the positioning module does not treat obstacles as fixed markers, but continuously outputs the absolute pose of the vehicle body in the site world coordinate system to the planner. When the robot handles bulk materials, the planner makes the bulk material movement path bypass the obstacles, and limits the maximum handling height of the grabbing / conveying mechanism to below 0.45 m, so that it is lower than the upper surface of the 0.50 m high obstacles.

[0062] As shown in Table 1, each visual marker has a side length of 0.075 m, the center of the marker is 0.050 m from the ground, and can be completely accommodated inside the fence with a height of 0.100 m. The markers do not cover the center line and the starting area, and do not extend into the 4.0 m×2.0 m ground operation area.

[0063] Table 1 Visual Marker Information Tag ID World coordinates (m) Installation location Mark the front normal 0 (0.05, 0.40, 0.05) Inside the right fence +X 1 (0.05, 1.60, 0.05) Inside the right fence +X 2 (1.00, 1.95, 0.05) Inside of the upper fence -Y 3 (3.00, 1.95, 0.05) Inside of the upper fence -Y 4 (3.95, 1.00, 0.05) Inside the left fence -X 5 (3.95, 0.40, 0.05) Inside the left fence -X 6 (3.00, 0.05, 0.05) Inside of the lower fence +Y 7 (1.00, 0.05, 0.05) Inside of the lower fence +Y The pose matrix of each visual marker is directly generated through the fixed template position, and can also be written into the configuration file after being rechecked with a tape measure. The marker coordinate system takes the marker center as the origin, the Z axis is perpendicular to the marker plane and points to the inside of the site, the X axis and Y axis are located in the marker plane, and the three axes satisfy the right-hand rule.

[0064] As shown in Table 2, the mobile robot uses a 24 V power supply, and the example of the whole robot mass is 18.5 kg. The origin of the vehicle body coordinate system base_link is located at the projection of the geometric center of the driving wheel on the ground, the +x axis points to the front of the robot, the +y axis points to the left side of the robot, and the +z axis points upward. The robot initially faces the pickup area, so base_link is consistent with the direction of the site world coordinate axes.

[0065] Table 2 Camera Information parameter First camera (camera0) Second camera (camera1) Image resolution / frame rate 1280×720, 30 fps 1280×720, 30 fps Installation direction Forward of the vehicle body Rear of the vehicle body Relative vehicle position (+0.25, 0, +0.35) m (-0.20, 0, +0.35) m fx, fy 812.4, 810.8 pixels 806.1, 804.5 pixels cx, cy 639.5, 359.7 pixels 640.7, 360.2 pixels Distortion parameters (k1,k2,p1,p2,k3) (-0.041,0.017,0.0004,-0.0003,0) (-0.038,0.013,-0.0002,0.0005,0) The optical coordinate system of the first camera adopts the OpenCV convention: +z is in front of the lens, +x is to the right of the image, and +y is to the bottom of the image. An example of the extrinsic parameter matrix of the first camera relative to the robot body coordinate system is: base_T_camera0 = [ 0 0 1 0.25 ] [ -1 0 0 0 ] [ 0 -1 0 0.35 ] [ 0 0 0 1 ] Before the official start, the center of the vehicle body is located at (1.55 m, 1.00 m, 0), and the drive wheels and movable vehicle body are located on one side of the placement area and do not press the center line; the center of the lifting device is located at (2.00 m, 1.00 m, 0), and its ground projection is in the center of the starting area and touches the ground.

[0066] Specifically, the complete positioning steps are as follows: after the rising edge of the vehicle's physical start switch, the ROS2 control node sets sensor_enable to true, and starts image acquisition from two cameras, AprilTag detection, and positioning release. Each camera subscribes to an independent image topic and records the camera_id, frame_id, and capture timestamp for each image. The images are then distorted and converted to grayscale. The tag36h11 detector outputs the tag ID and the pixel coordinates of the four corner points. If the tag ID is not registered in the pose matrix table, it is not used for localization. Using the center of the marker as the origin, four local three-dimensional corner points are constructed based on a side length of 0.075 m: (-0.0375,-0.0375,0), (0.0375,-0.0375,0), (0.0375,0.0375,0), and (-0.0375,0.0375,0). The order of the corner points is consistent with the output order of the detector. The `solvePnPGeneric` function is called, and `SOLVEPNP_IPPE_SQUARE` is used to solve for the planar square marker pose. For multiple PnP solutions, solutions with `tvec_z ≤ 0` are first discarded, and then the solution with the smallest reprojection error is selected to generate the relative pose from the marker coordinate system to the camera coordinate system. `solvePnPGeneric` is a general-purpose PnP solution function in OpenCV that supports various algorithms and can return multiple possible solutions. `SOLVEPNP_IPPE_SQUARE` specifies that the IPPE (Infinitesimal PlanePose Estimation) algorithm is used, and that the input is a square marker.

[0067] Based on world_T_cam=world_T_tag•inv(cam_T_tag) and world_T_base=world_T_cam•inv(base_T_camera), calculate the vehicle candidate pose corresponding to each visual tag; Calculate the average reprojection error of the four corner points, the area of ​​the marked image, and the distance from the camera to the marker. The example validity conditions are: reprojection error no greater than 3.0 pixels, image area no less than 180 pixel², and distance no greater than 4.5 m. Median outlier removal is performed on all valid vehicle body candidate poses in a frame from the same camera, and position and quaternion fusion is performed according to the comprehensive weights of area, error and distance to obtain the valid pose of the camera. Store the most recent valid pose, weight, and timestamp of each camera in a cache; only cached data with an age not exceeding 0.25 seconds is used. Perform temporal decay weighted fusion on different cameras; Perform EMA smoothing on the fused translation vector and pose quaternion, with an example smoothing coefficient α=0.35; publish PoseStamped and TF with world (i.e., the aforementioned site world coordinate system) as the parent coordinate system and base_link (i.e., the aforementioned mobile robot body coordinate system) as the child coordinate system; The path planning node uses absolute pose to bypass two cylindrical obstacles and reach pickup locations 1-3 and the corresponding digital cargo boxes after drawing lots. The digit recognition, bean recognition, and grasping modules can operate independently; the positioning module does not rely on manual remote control. After the transport is completed, the planner controls the movable part to return completely to the placement area where x < 2.00 m based on the positioning results, and then outputs the completion status.

[0068] Specifically, the rotation matrix R_ct and translation vector t_ct output by PnP satisfy P_cam = R_ct • P_tag + t_ct, therefore cam_T_tag represents the transformation from the marker coordinate system to the camera coordinate system: cam_T_tag = [ R_ct t_ct ; 0 0 0 1 ], , world_T_cam = world_T_tag • inv(cam_T_tag), world_T_base = world_T_cam • inv(base_T_camera), Numerical Example: After the robot starts, it is located near the initial area. The first camera detects a marker with ID=4 inside the left-hand fence. The center of this marker is (3.95 m, 1.00 m, 0.05 m), and the Z-axis normal is -X. Its world pose is: world_T_tag4 = [ 0 0 -1 3.95 ] [ -1 0 0 1.00 ] [ 0 1 0 0.05 ] [ 0 0 0 1 ] The PnP method (i.e., the aforementioned multi-point perspective problem) yields rvec=(π,0,0) and tvec=(0,0.30,2.15) m. From the Rodrigues formula (i.e., the aforementioned Rodrigues formula), we obtain R_ct=diag(1,-1,-1), thus: cam_T_tag4 = [ 1 0 0 0 ] [ 0 -1 0 0.30 ] [ 0 0 -1 2.15 ] [ 0 0 0 1 ] Substituting world_T_cam=world_T_tag4•inv(cam_T_tag4), we get: world_T_camera0 = [ 0 0 1 1.80 ] [ -1 0 0 1.00 ] [ 0 -1 0 0.35 ] [ 0 0 0 1 ] Combining this with the above base_T_camera0, we calculate world_T_base = world_T_camera0 • inv(base_T_camera0): world_T_base = [ 1 0 0 1.55 ] [ 0 1 0 1.00 ] [ 0 0 1 0 ] [ 0 0 0 1 ] Therefore, the vehicle center was identified as x=1.55 m, y=1.00 m, z=0, and the heading angle was 0°. This location is on one side of the placement area with a centerline of x=2.00 m.

[0069] Specifically, the i-th three-dimensional corner point of the visual marker is set as Transform R_ct and t_ct obtained using PnP into the camera coordinate system: , x_i = X_ci / Z_ci, y_i = Y_ci / Z_ci, r_i² = x_i² + y_i², , , , , , e_reproj = (1 / 4) • Σ(i=1…4)e_i, The OpenCV projectPoints function can be directly called in the program to complete the above projection. Taking the camera0 parameters and PnP results as an example, the four theoretical projection corner points and the actual detected corner points are shown in Table 3: Table 3. Four theoretical projection corner points and actual detection corner points corner point Theoretical projection (pixel) Actual measurement (pixel) Error (pixel) 1 (625.337, 486.873) (625.637, 486.623) 0.391 2 (653.651, 486.871) (653.451, 487.221) 0.403 3 (653.659, 458.645) (654.059, 458.345) 0.500 4 (625.334, 458.647) (625.084, 458.847) 0.320 e_reproj=(0.391+0.403+0.500+0.320) / 4=0.403 pixel Since 0.403 pixels is less than the 3.0 pixel threshold, the candidate vehicle pose passes the geometric consistency check. If the reprojection error exceeds the error threshold, it indicates that the corner detection, tag ID matching, or PnP solution may be abnormal, and the candidate vehicle pose is discarded directly.

[0070] Specifically, the four corner points are arranged clockwise as (u_i, v_i), and the area of ​​the visual marker in the image is: A = 1 / 2 • |Σ(i=1…4)(u_iv_(i+1)-u_(i+1)v_i)|, where point 5 is equivalent to point 1. The corner detection yielded A = 804.30 pixel². A larger area indicates a higher proportion of the marker in the image and a relatively smaller corner quantization error.

[0071] The Euclidean distance between the camera and the visual marker is expressed as follows: , In this example, d = √(0² + 0.30² + 2.15²) = 2.171 m.

[0072] To avoid the area term being overly dominated by the square of the distance, the area term is normalized using the square root; the error term uses Gaussian decay; and the distance term uses a bounded inverse proportional function. w_A = clip(√(A / A_ref), 0.10, 1.00),A_ref=1600 pixel², w_E = exp[-(e_reproj / σ_E)²], σ_E=2.0 pixel, w_D = 1 / [1+(d / σ_D)²], σ_D=2.5 m, w_j = w_A • w_E • w_D, Substituting A = 804.30 pixel², e_reproj = 0.403 pixel, and d = 2.171 m: w_A = √(804.30 / 1600) = 0.709 w_E=exp[-(0.403 / 2.0)²]=0.960 w_D=1 / [1+(2.171 / 2.5)²]=0.570 w = 0.709 × 0.960 × 0.570 = 0.388 Therefore, larger, closer markers with smaller reprojection errors receive higher weights. Other embodiments can employ piecewise linear, power function, or lookup table methods, as long as the weights do not decrease as the area increases, and the weights do not increase as the error and distance increase.

[0073] Specifically, assuming camera0 identifies three visual markers in the same frame, Table 4 is obtained after PnP and coordinate transformation: Table 4 Information obtained from candidate vehicle poses via PnP and coordinate transformation Candidate Position p_j(m) Overall weight w_j 1 (1.550, 1.000, 0.000) 0.388 2 (1.566, 0.992, 0.004) 0.332 3 (2.210, 0.350, 0.010) 0.280 Calculate the median for x, y, and z coordinates respectively, and we get p_med = (1.566, 0.992, 0.004) m. Calculate... We obtained δ_1=0.018 m, δ_2=0, and δ_3≈0.916 m. In this embodiment, the translation outlier threshold (i.e., the aforementioned preset translation threshold) is set to 0.15 m, so candidate 3 is eliminated.

[0074] λ_j = w_j / Σw_j p_camera0 = Σλ_jp_j = (1.557, 0.996, 0.002) m The pose is referenced to the quaternion q_ref with the largest weight. If Then let q_j = -q_j to eliminate the sign jump caused by q and -q representing the same attitude; then calculate q_sum = Σλ_jq_j and normalize q_camera0 = q_sum / ||q_sum||.

[0075] Specifically, referring to Table 5, each camera cache item is set to C_c=(p_c,q_c,W_c,t_c), representing the position, quaternion, total weight of a single camera, and timestamp, respectively. The current time is t_now=12.050 s, and the effective cache window is T_max=0.25 s.

[0076] Table 5. Relevant information about the camera Camera Cache location p_c(m) Original weight W_c Timestamp (s) Age (s) camera0 (1.557,0.996,0.002) 0.720 12.000 0.050 camera1 (1.548,1.005,0.002) 0.540 11.910 0.140 Both caches have an age of no more than 0.25 s. To reduce the impact of older frames, a time decay is introduced, τ = 0.15 s: W'_c = W_c • exp[-(t_now-t_c) / τ], W'_0=0.720•exp(-0.050 / 0.15)=0.516, W'_1=0.540•exp(-0.140 / 0.15)=0.212, p_f = (W'_0p_0+W'_1p_1) / (W'_0+W'_1) = (1.555,0.999,0.002) m, The pose of multiple cameras uses the same quaternion sign alignment and normalized weighted average as that of a single camera. If only one camera cache is valid, the pose of that camera is used directly; if all caches time out, no new valid absolute pose is published, and a positioning failure status is published to the upper-level controller, which then performs deceleration or stops the camera.

[0077] Specifically, let the previously published position be p_(t-1) = (1.548, 1.000, 0.001) m, the current fusion position be p_f = (1.555, 0.999, 0.002) m, and the smoothing coefficient be α = 0.35. p_t = αp_f + (1-α)p_(t-1) = (1.550,1.000,0.001) m, like Then first let q_f = -q_f, q'_t = αq_f + (1-α)q_(t-1), q_t=q'_t / ||q'_t||, The smoothed PoseStamped and TF are used for autonomous navigation, pickup positioning, digital recognition of placed containers, and final return to the placement area. EMA only suppresses minor jitter; when the difference between the candidate pose and the previous moment exceeds the jump threshold, outlier detection can be performed first, and then a decision can be made on whether to enter EMA, to avoid abnormal measurements being slowly brought into the control system after smoothing.

[0078] Specifically, in one embodiment for a bulk cargo handling robot, the site dimensions are 4.0 m × 2.0 m, with a perimeter fence 0.10 m high and 0.035 m wide. The origin of the site's world coordinate system is located at the lower right corner of the inner side of the site. The X-axis points from the placement area to the retrieval area along the long side, the Y-axis points from the bottom to the top along the short side, and the Z-axis points vertically upwards, with the center line at x = 2.00 m. Multiple AprilTags with sides of 0.075 m are easily peeled off and leave no residue, and their pose matrices in the site's world coordinate system are pre-stored.

[0079] The mobile robot is equipped with two cameras, one forward and one backward, each with independent image parameters, intrinsic parameters, distortion parameters, and extrinsic parameter matrices relative to the robot's coordinate system. Upon the start signal, the system initiates image acquisition and AprilTag detection. The robot's movable parts are positioned to one side of the placement area, with the center projection of the lifting device located in the 400 mm × 400 mm initial area and touching the ground.

[0080] Whenever an image arrives, the system detects the marker ID and four corner points, constructs the local 3D corner points of the marker, and calculates the relative pose from the marker coordinate system to the camera coordinate system using PnP. It then calculates the camera pose in the site's world coordinate system and the vehicle's candidate pose.

[0081] The system calculates the average reprojection error, the area of ​​the marked pixels, and the distance from the camera to the marked pixels, and filters them according to preset thresholds; it constructs a comprehensive weight for the effective vehicle body candidate poses based on area, error, and distance.

[0082] For multiple candidate vehicle poses from the same camera, the system performs outlier removal centered on the median of the translation components, and then performs weighted fusion of position and quaternions. The most recent valid pose from each camera is written to the cache by timestamp, and only results within the valid time window are fused, with added time decay weights. Finally, the position and quaternions are smoothed using EMA, and the world is output to the base_link's PoseStamped and TF. This pose allows the fully automated path planner to control the robot to navigate around a cylindrical obstacle with a diameter of 0.102 m and a height of 0.50 m, transporting bulk materials from the picking area to a randomly selected digital cargo box, and controlling the movable parts to return to the placement area after the task is completed.

[0083] Reference Figure 2 This invention also provides a mobile robot absolute positioning system based on multi-camera visual markers, used to execute the above-described mobile robot absolute positioning method based on multi-camera visual markers. The mobile robot absolute positioning system based on multi-camera visual markers includes: The single-camera multi-label fusion module is used to calculate the weighted average of the vehicle candidate positions based on the comprehensive weight of the vehicle candidate poses if the number of vehicle candidate poses after removing outliers reaches a preset number, and to calculate the weighted average of the pose quaternions of the vehicle candidate poses after symbol alignment, so as to obtain the effective poses under the same camera. The multi-camera cache fusion module stores the most recent valid pose of each camera in the cache and determines whether the most recent valid pose of the camera is within the valid time window based on the timestamp. If the most recent valid pose of the camera is within the valid time window, the pose quaternions of the valid poses of multiple cameras within the valid time window are sign-aligned, and the positions of the valid poses of multiple cameras within the valid time window are normalized and weighted averaged to obtain the position of the valid absolute pose. The single-camera multi-marker fusion module is connected to the multi-camera cache fusion module. The smoothing and publishing module is used to smooth the position and pose quaternions of the effective absolute pose using an exponential moving average, output the vehicle pose in the site world coordinate system, and publish the vehicle pose in the site world coordinate system to the robot control system; the multi-camera cache fusion module is connected to the smoothing and publishing module.

[0084] In a specific embodiment, the mobile robot absolute positioning system based on multi-camera visual markers further includes: The visual marker deployment module is used to pre-measure and store the pose matrix of the visual markers in the world coordinate system of the site; A multi-camera acquisition module is used to control the cameras to acquire images; a visual marker deployment module is connected to the multi-camera acquisition module. The marker detection module is used to detect visual markers in the grayscale image and obtain the ID of the visual marker and the image coordinates of its four corner points; the multi-camera acquisition module is connected to the marker detection module. The single-marker pose solving module is used to solve the relative pose from the marker coordinate system to the camera coordinate system using a multi-point perspective problem; the marker detection module is connected to the single-marker pose solving module. The single-camera multi-label fusion module is also used to construct a comprehensive weight for vehicle candidate poses based on the area of ​​the visual label in the image, the Euclidean distance between the camera and the visual label, and the reprojection error. For multiple vehicle candidate poses under the same camera, the median of the x, y, and z coordinates of the vehicle candidate positions in the multiple vehicle candidate poses is calculated to obtain the median position. The median distance is calculated based on the vehicle candidate positions and the median position. If the median distance exceeds a preset translation threshold, the vehicle candidate poses with a median distance exceeding the preset translation threshold are regarded as outliers and removed. The single-label pose solving module is connected to the single-camera multi-label fusion module.

[0085] Specifically, the system consists of: Visual marker deployment module: Used to deploy and record the world pose of multiple visual markers within the site.

[0086] Multi-camera acquisition module: used to acquire image frames in real time from at least two vehicle-mounted cameras.

[0087] Marker detection module: used to identify marker IDs and corner coordinates in an image.

[0088] Single-marker pose solving module: used to solve the relative pose from the marker coordinate system to the camera coordinate system through PnP, and to perform reprojection error verification.

[0089] Single-camera multi-label fusion module: used to output the vehicle pose under a single camera according to weights and outlier removal rules.

[0090] Multi-camera cache fusion module: used to fuse the effective poses of multiple cameras within a time window.

[0091] Smoothing and Publishing Module: Used to smooth the final pose and publish it to the robot control system.

[0092] This invention also provides a computer device including a memory and a processor, wherein the processor performs the above-described method when executing a computer program stored in the memory.

[0093] This invention also provides a computer-readable storage medium storing program instructions thereon, which, when executed by a processor, implement the method described above.

[0094] It should be understood that the method steps in the embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium. The method can use standard programming techniques. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if necessary, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit (ASIC).

[0095] Furthermore, the procedures described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by the context. The procedures described herein (or variations and / or combinations thereof) may be executed under the control of one or more computer systems configured with executable instructions, and may be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. The computer program comprises a plurality of instructions executable by one or more processors.

[0096] Furthermore, the method can be implemented in any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices, etc. Aspects of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. When programmed according to the methods and techniques described in the invention, the invention may also include the computer itself.

[0097] A computer program can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects generated on the display.

[0098] The above description is merely a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention, as long as they achieve the technical effects of the present invention by the same means, should be included within the scope of protection of the present invention. Within the scope of protection of the present invention, the technical solutions and / or implementation methods can have various modifications and variations.

Claims

1. A method for absolute localization of a mobile robot based on multi-camera visual markers, characterized in that, Includes the following steps: S100. Calculate the pose of the camera in the world coordinate system based on the pose matrix of the visual marker in the world coordinate system and the relative pose from the marker coordinate system to the camera coordinate system. Calculate the pose of the mobile robot body in the world coordinate system based on the extrinsic parameter matrix and the pose of the camera in the world coordinate system, and obtain the candidate pose of the vehicle body based on the corresponding visual marker. S200. If the number of candidate vehicle poses after removing outliers reaches a preset number, then according to the comprehensive weight of the candidate vehicle poses, the candidate vehicle positions of the candidate vehicle poses are weighted and averaged, and the pose quaternions of the candidate vehicle poses after symbol alignment are weighted and averaged to obtain the effective poses under the same camera. S300. Store the most recent valid pose of each camera in a cache, and determine whether the most recent valid pose of the camera is within the valid time window based on the timestamp. If the most recent valid pose of the camera is within the valid time window, then perform sign alignment on the pose quaternions of the valid poses of multiple cameras within the valid time window, and perform normalized weighted average on the positions of the valid poses of multiple cameras within the valid time window to obtain the position of the valid absolute pose. S400: The position and attitude quaternion of the effective absolute pose are smoothed by exponential moving average, and the vehicle pose in the field world coordinate system is output.

2. The mobile robot absolute positioning method based on multi-camera visual markers according to claim 1, characterized in that, Before step S100, the mobile robot absolute localization method based on multi-camera visual markers further includes the following steps: A1. Establish a world coordinate system for the site, and pre-measure and store the pose matrix of the visual marker in the world coordinate system for the site; A2. Set the mobile robot body to include at least two of the aforementioned cameras, and calibrate the intrinsic parameter matrix, distortion parameters, and extrinsic parameter matrix of each camera relative to the coordinate system of the mobile robot body; A3. Control the camera to acquire images, convert the images into grayscale images, detect visual markers in the grayscale images, and obtain the ID of the visual markers and the image coordinates of the four corner points; A4. For each visual marker with a known ID, construct four three-dimensional corner points in the marker coordinate system based on the center of the visual marker as the origin and the actual side length of the visual marker, and use the multi-point perspective problem to solve the relative pose from the marker coordinate system to the camera coordinate system.

3. The mobile robot absolute positioning method based on multi-camera visual markers according to claim 1, characterized in that, Before step S200, the mobile robot absolute localization method based on multi-camera visual markers further includes the following steps: B1. Calculate the reprojection error for the candidate vehicle poses. If the reprojection error is greater than the error threshold, discard the candidate vehicle poses whose reprojection error is greater than the error threshold. B2. For the candidate vehicle pose, construct the comprehensive weight based on the area of ​​the visual marker in the image, the Euclidean distance between the camera and the visual marker, and the reprojection error. B3. For multiple candidate vehicle poses under the same camera, calculate the median of the x-coordinate, y-coordinate, and z-coordinate of the candidate vehicle position in the multiple candidate vehicle poses to obtain the median position; B4. Calculate the median distance based on the candidate vehicle position and the median position. If the median distance exceeds a preset translation threshold, then the candidate vehicle pose with the median distance exceeding the preset translation threshold is considered an outlier and the outlier is removed.

4. The mobile robot absolute positioning method based on multi-camera visual markers according to claim 1, characterized in that, In step S100, The pose of the camera in the site world coordinate system is calculated based on the pose matrix and the relative pose, as shown below: world_T_cam = world_T_tag × inv(cam_T_tag), In the formula, world_T_cam is the pose of the camera in the world coordinate system of the site, world_T_tag is the pose matrix of the visual tag in the world coordinate system of the site, cam_T_tag is the relative pose of the tag coordinate system to the camera coordinate system, and inv represents the inverse matrix. The pose of the mobile robot in the world coordinate system is calculated based on the extrinsic parameter matrix and the pose of the camera in the site world coordinate system, as shown below: world_T_base = world_T_cam × inv(base_T_camera), In the formula, world_T_base is the pose of the mobile robot body in the world coordinate system of the site, that is, the candidate pose of the body based on the corresponding visual marker, and base_T_camera is the extrinsic parameter matrix.

5. The mobile robot absolute positioning method based on multi-camera visual markers according to claim 3, characterized in that, The reprojection error for the candidate vehicle pose is calculated, including: For each of the vehicle body candidate poses, calculate the theoretical projection corner points based on three-dimensional corner points; The pixel error between the theoretically projected corner point and the actual detected corner point is calculated, and the average value of multiple pixel errors is calculated to obtain the reprojection error.

6. The mobile robot absolute positioning method based on multi-camera visual markers according to claim 3, characterized in that, In step B2 With the four corner points arranged clockwise, the area of ​​the visual marker in the image is represented as follows: A = 1 / 2 • |Σ(i=1…4)(u_iv_(i+1)-u_(i+1)v_i)|, In the formula, A is the area of ​​the visual mark in the image, (u_i,v_i) represents the image coordinates of the i-th corner point arranged clockwise, (u_(i+1), v_(i+1)) represents the image coordinates of the (i+1)-th corner point, i=1,…,4 and the corner point number cycles modulo 4, that is, (u_5,v_5)=(u_1,v_1); The Euclidean distance between the camera and the visual marker is expressed as follows: , In the formula, d is the Euclidean distance between the camera and the visual marker, t_ct is the translation vector in the relative pose from the marker coordinate system to the camera coordinate system, that is, the position vector of the origin of the marker coordinate system in the camera coordinate system, and t_x, t_y, and t_z are the three components of t_ct. The overall weight is expressed as follows: w_A = clip(√(A / A_ref), 0.10, 1.00), w_E = exp[-(e_reproj / σ_E)²], w_D = 1 / [1+(d / σ_D)²], w_j = w_A • w_E • w_D, In the formula, A_ref=1600 pixel² is the reference area, σ_E=2.0 pixel is the reprojection error scale parameter, σ_D=2.5 m is the distance scale parameter, w_A, w_E, and w_D are the area weight, error weight, and distance weight, respectively, clip represents the clipping function that restricts the function value to a given upper and lower limit, A is the area of ​​the visual marker in the image, exp represents the natural exponential function, e_reproj is the reprojection error, d is the Euclidean distance between the camera and the visual marker, and w_j is the comprehensive weight of the j-th candidate pose of the vehicle body.

7. The mobile robot absolute positioning method based on multi-camera visual markers according to claim 3, characterized in that, The median distance is calculated based on the candidate vehicle positions and the median position, as shown below: , In the formula, δ_j is the median distance, p_j is the coordinate of the candidate vehicle position, and p_med is the coordinate of the median position.

8. The mobile robot absolute positioning method based on multi-camera visual markers according to claim 1, characterized in that, In step S200, the effective pose includes the position of the effective pose and the pose quaternion of the effective pose. Based on the comprehensive weights of the candidate vehicle poses, a weighted average is calculated for the candidate vehicle positions, and a weighted average is calculated for the pose quaternions of the symbol-aligned candidate vehicle poses to obtain the effective poses under the same camera, including: The position of the effective pose is obtained by weighted averaging the candidate positions of the candidate vehicle body poses, as shown below: λ_j = w_j / Σw_j, p_camera0 = Σλ_jp_j, In the formula, λ_j represents the normalized weight of the j-th vehicle candidate pose, which is equal to the ratio of w_j to the sum of the comprehensive weights of all vehicle candidate poses under the same camera, p_j is the coordinate of the vehicle candidate position, that is, the position vector of the j-th vehicle candidate pose, w_j is the comprehensive weight of the j-th vehicle candidate pose, and p_camera0 represents the position of the effective pose under the same camera; like Then let q_j←-q_j to align the sign of the corresponding vehicle body candidate pose quaternion with the reference quaternion, where q_j is the j-th vehicle body candidate pose quaternion, q_ref represents the vehicle body candidate pose with the largest comprehensive weight, and T represents transpose. The pose quaternions of the candidate vehicle poses after symbol alignment are weighted and averaged to obtain the pose quaternions of the effective poses, as shown below: q_sum=Σλ_jq_j, q_camera0 = q_sum / ||q_sum|| In the formula, q_sum represents the weighted sum of the attitude quaternions of each candidate vehicle pose after sign alignment, ||q_sum|| represents the Euclidean norm of q_sum, and q_camera0 represents the attitude quaternion of the effective pose obtained after normalizing q_sum.

9. The mobile robot absolute positioning method based on multi-camera visual markers according to claim 1, characterized in that, The vehicle pose in the field world coordinate system includes the vehicle position and the pose quaternion in the field world coordinate system; step S400 includes: The effective absolute pose is smoothed using the exponential moving average, and the vehicle pose in the field world coordinate system is output as follows: p_t = αp_f + (1-α)p_(t-1), In the formula, p_t is the position of the vehicle body in the world coordinate system of the site at the current time, α is the smoothing coefficient and 0<α≤1, p_f is the position of the effective absolute pose at the current time, and p_(t-1) represents the position of the vehicle body in the world coordinate system of the site at the previous time. like Then let q_f←-q_f to align the sign of the attitude quaternion of the effective absolute pose with the attitude quaternion of the previous moment, where q_f is the attitude quaternion of the effective absolute pose at the current moment, T represents transpose, and q_(t-1) represents the attitude quaternion of the vehicle body pose in the field world coordinate system at the previous moment. The attitude quaternion of the effective absolute pose is smoothed using the exponential moving average method, and the attitude quaternion of the vehicle body pose in the field world coordinate system is output as follows: q'_t = αq_f + (1-α)q_(t-1), q_t=q'_t / ||q'_t||, In the formula, q'_t represents the unnormalized quaternion obtained by exponential moving average of q_f and q_(t-1), ||q'_t|| represents the Euclidean norm of q'_t, and q_t is the attitude quaternion of the vehicle body pose in the world coordinate system of the site at the current moment obtained by normalizing q'_t.

10. A mobile robot absolute positioning system based on multi-camera visual markers, used to execute the mobile robot absolute positioning method based on multi-camera visual markers as described in any one of claims 1 to 9, characterized in that, The mobile robot absolute positioning system based on multi-camera visual markers includes: The single-camera multi-label fusion module is used to calculate the weighted average of the vehicle candidate positions based on the comprehensive weight of the vehicle candidate poses if the number of vehicle candidate poses after removing outliers reaches a preset number, and to calculate the weighted average of the pose quaternions of the vehicle candidate poses after symbol alignment, so as to obtain the effective poses under the same camera. A multi-camera cache fusion module is used to store the most recent valid pose of each camera in a cache, and determine whether the most recent valid pose of the camera is within a valid time window based on the timestamp. If the most recent valid pose of the camera is within the valid time window, the pose quaternions of the valid poses of multiple cameras within the valid time window are sign-aligned, and the positions of the valid poses of multiple cameras within the valid time window are normalized and weighted to obtain the position of the valid absolute pose. The single-camera multi-marker fusion module is connected to the multi-camera cache fusion module. The smoothing and publishing module is used to smooth the position and attitude quaternions of the effective absolute pose using an exponential moving average, output the vehicle pose in the site world coordinate system, and publish the vehicle pose in the site world coordinate system to the robot control system; the multi-camera cache fusion module is connected to the smoothing and publishing module.