A method for adaptive scheduling of mechanical scanning sonar measurements into visual-inertial slam
By performing time sorting, duplicate removal, window matching, and quality scoring on sonar measurements, the problems of out-of-order, duplicate, and quality instability introduced by sonar measurements in visual-inertial SLAM systems are solved, and adaptive scheduling of sonar measurements in visual-inertial SLAM systems is realized, improving the stability and accuracy of the system.
Patent Information
- Application Number
- CN202611430125.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-15
- Publication Date
- 2026-11-27
AI Technical Summary
In underwater environments, the temporal characteristics and quality instability of mechanical scanning sonar measurements may introduce problems such as out-of-order, repetitive, expired, or unstable quality when integrated into visual inertial SLAM systems, affecting system state estimation.
By implementing time sorting, duplicate removal, window matching, quality scoring, and adaptive scheduling before sonar measurements enter visual-inertial SLAM optimization, we ensure that sonar measurements participate in optimization in a controlled manner.
It effectively handles out-of-order, duplicate, and expired measurements, ensuring that sonar measurements only participate in optimization when they are consistent with the current state estimate in time, dynamically adjusting the access strength, reducing the impact of anomalies, and adapting to different underwater conditions and sonar quality.
Smart Images

Figure CN123175259A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater robot localization and mapping technology, and in particular to an adaptive scheduling method for mechanical scanning sonar measurements integrated with visual inertial SLAM. Background Technology
[0002] In underwater environments, visual sensors are susceptible to factors such as turbid water, changes in lighting, low contrast, motion blur, and suspended particles, leading to decreased stability in visual feature extraction and tracking. Visual-inertial SLAM can improve short-term motion estimation through the complementarity of cameras and IMUs, but when visual features are consistently insufficient or mismatches increase, system state estimation may still drift or tracking instability may occur.
[0003] Mechanically scanned sonar provides acoustic distance measurements that are insensitive to illumination and water turbidity, and is therefore often used for underwater robot localization, obstacle avoidance, and environmental perception. When sonar measurements are integrated into visual-inertial SLAM, the sonar measurements are typically used in backend optimization via acoustic distance constraints to provide supplementary constraints when visual information is insufficient or the observation quality is degraded.
[0004] However, the measurement outputs of mechanically scanned sonar exhibit distinct temporal characteristics. Sonar measurements may arrive at a lower frequency than those from the camera and IMU, and may also experience duplicate timestamps, out-of-order arrivals, delayed arrivals, or mismatches with the current sliding window due to communication, buffering, driver issues, or data playback processes. If such sonar measurements are directly entered into the visual-inertial SLAM optimization process without temporal verification, it may lead to expired or inconsistent measurements affecting the current state estimation.
[0005] Furthermore, sonar measurement quality is affected by factors such as range, echo intensity, scan angle variation, target reflection characteristics, and motion state. Even if sonar measurements are available in time, they may not be suitable for inclusion in the optimization process with fixed weights. Without a mechanism for adaptive scheduling based on visual tracking status, sonar measurement quality, and residual consistency, unnecessary sonar interference may be introduced when vision is stable, or the impact of erroneous measurements may be amplified when sonar anomalies occur. Summary of the Invention
[0006] To overcome the shortcomings of existing technologies, this invention provides an adaptive scheduling method for integrating mechanically scanned sonar measurements into visual-inertial SLAM. The scheduling refers to adjusting the way sonar participates in localization based on specific circumstances, i.e., the timing and degree of influence of sonar measurements entering SLAM. Before sonar measurements enter nonlinear optimization, this method performs time sorting, duplicate removal, window matching, quality scoring, access status determination, and anomaly backoff on them, ensuring that sonar measurements participate in visual-inertial SLAM in a controlled manner.
[0007] The technical solution adopted in this invention is as follows:
[0008] An adaptive scheduling method for integrating mechanically scanned sonar measurements with visual-inertial SLAM includes:
[0009] S1. Obtain the sonar measurement flow output by the mechanical scanning sonar, and obtain the current sliding window time range, key frame time, and visual tracking status of the visual inertial SLAM.
[0010] S2. Sonar measurement stream input time sorting buffer, and perform timestamp monotonicity check, repeat measurement check and buffer time limit check on sonar measurements;
[0011] S3. Based on the current sliding window time range, select candidate measurements from the sonar measurements that have passed the inspection;
[0012] S4. Calculate the sonar measurement quality score of the candidate measurement based on the sonar measurement's intrinsic and temporal attributes.
[0013] S5. Based on the sonar measurement quality score, visual tracking status, and prediction residual test results, determine the operating status of the sonar measurement access channel and the handling results of each candidate measurement.
[0014] When the processing result of the candidate measurement is normal access or deweighted access, the sonar measurement corresponding to the candidate measurement, the access weight of the sonar measurement, and the identifier representing the processing result are output to the sonar constraint access interface. When the processing result of the candidate measurement is isolation or rejection, or when the sonar measurement access channel is in standby, isolation, or rollback state, the corresponding sonar measurement is not output to the sonar constraint access interface, nor is it added as a constraint to the nonlinear optimization process of the visual inertial SLAM optimizer.
[0015] This method solves the problems of out-of-order, repetitive, expired, unstable quality, and fixed-weight access that existed in mechanical scanning sonar measurements before being integrated with visual-inertial SLAM optimization.
[0016] This solution does not aim to design a new visual-inertial SLAM framework, nor does it involve the specific construction method of acoustic distance constraints. The construction of acoustic distance constraints is completed by a sonar constraint access interface, which includes at least one of the following: a separately set sonar constraint construction interface, and a sonar constraint construction function module integrated into the visual-inertial SLAM nonlinear optimizer.
[0017] This solution is located between the mechanical scanning sonar output and the sonar constraint access point, providing a set of timing verification, quality evaluation, adaptive access scheduling and anomaly fallback mechanisms to determine when, with what weight, and with what processing result each sonar measurement participates in visual inertial SLAM.
[0018] The concept of this scheme is as follows: This method receives sonar measurement streams, acquires sliding window information and visual tracking status of visual inertial SLAM; a time-sorted buffer identifies and handles out-of-order, duplicate, and expired measurements using a safe output time limit mechanism; candidate measurements are filtered by sliding window, and quality scores are calculated based solely on the sonar's own attributes and time attributes; visual tracking status is used as an independent judgment condition, and prediction residual verification is used as an independent verification to determine the operating status of the sonar measurement access channel and the handling results of each candidate measurement; measurements that are normally accessed or deweighted are output along with access weights and handling result identifiers to the sonar constraint access interface, and each threshold is updated based on optimized residual statistics and access / rejection statistics.
[0019] Furthermore, the sonar measurement includes sonar sampling time and acoustic distance measurement, and also includes at least one of the following parameters: scanning angle, beam number, echo intensity, and sonar measurement source identifier.
[0020] Furthermore, the time sorting cache maintains the ordered output of sonar measurements according to the sonar sampling time; when multiple sonar measurements have the same timestamp, or multiple sonar measurements have the same source identifier, a time difference less than a preset time threshold, and the same beam number or a scanning angle difference less than a preset angle threshold, they are determined to be duplicate measurements; for the sonar measurements determined to be duplicates, one of them that meets the quality conditions is retained, and the rest are discarded and the reason for the discard is recorded.
[0021] Furthermore, sonar measurements that are outside the current sliding window and whose time difference with the nearest sliding window boundary exceeds a preset time threshold will not be included in the current optimization window as candidate measurements.
[0022] Furthermore, the sonar measurement quality score is determined by the sonar measurement's intrinsic and temporal attributes, including at least one of temporal validity, range validity, echo intensity or peak stability, scan angle or beam number continuity, and consistency of historical measurements.
[0023] Furthermore, the sonar measurement quality score is a weighted sum of normalized quality indicators, with each weight being non-negative and the sum of the weights being 1; when the quality score is not lower than the first scoring threshold, the corresponding measurement is marked as a high-quality candidate measurement; when the quality score is lower than the first scoring threshold but not lower than the second scoring threshold, the corresponding measurement is marked as a medium-quality candidate measurement; when the quality score is lower than the second scoring threshold, the processing result of the corresponding measurement is set to rejection; wherein the second scoring threshold is less than the first scoring threshold.
[0024] Furthermore, the visual tracking state is determined by at least one of the following: the current number of tracked features, the feature matching inlier ratio, the reprojection error, the keyframe creation state, and the inertial pre-integration consistency.
[0025] Furthermore, the operating states of the sonar measurement access channel include standby state, candidate access state, normal access state, deweighted access state, isolation state, and fallback state; the processing results of the candidate measurement include normal access, deweighted access, isolation, and rejection.
[0026] Furthermore, when the visual tracking state is stable, the sonar measurement access channel remains in standby mode, and this state does not change due to the increase in the sonar measurement quality score. When the sonar measurement access channel is in standby mode, the sonar measurement only participates in caching, quality scoring, prediction residual evaluation and log recording, and does not enter the nonlinear optimization process as a constraint.
[0027] When the visual tracking status declines and there are high-quality or medium-quality candidate measurements, the sonar measurement access channel enters the candidate access state. If the prediction residual in the candidate access state meets the preset consistency condition within multiple consecutive sliding windows, the sonar measurement access channel enters the normal access state.
[0028] Furthermore, when the prediction residual exceeds the first residual threshold but does not exceed the second residual threshold, the candidate measurement is processed as a downweighted access; when the prediction residual exceeds the second residual threshold, the candidate measurement is processed as a rejection; when the proportion of sonar measurements that are rejected within multiple consecutive sliding windows exceeds a preset proportion, the sonar measurement access channel enters an isolation state; wherein the first residual threshold is less than the second residual threshold.
[0029] Furthermore, when a candidate measurement does not yet meet the access conditions but has not yet met the rejection conditions, its handling result is set to isolation; the isolated sonar measurement is retained in the isolation buffer and time validity check, quality score or prediction residual test are re-executed within the preset isolation time limit; if the access conditions are still not met after the isolation time limit, its handling result is set to rejection and it is removed.
[0030] Furthermore, when the sonar measurement access channel is continuously abnormal within multiple consecutive sliding windows, the operation state of the sonar measurement access channel enters a rollback state, suspending the output of sonar measurements to the sonar constraint access interface, and the visual-inertial SLAM algorithm runs according to the original sensor configuration; the continuous abnormality is determined by at least one of the following conditions: the proportion of rejected measurements continuously exceeds a preset proportion, the prediction residual statistics continuously exceed the second residual threshold, the number of valid candidate measurements continuously falls below a preset number, and the proportion of time-series abnormal measurements continuously exceeds a preset proportion.
[0031] Furthermore, during the isolation state of the sonar measurement access channel, the prediction residual is continuously calculated for the sonar measurement; when the prediction residuals meet the preset consistency condition again within multiple consecutive sliding windows and the time sorting is normal, the sonar measurement access channel switches from the isolation state to the candidate access state.
[0032] Furthermore, the prediction residual is obtained by calling the prediction evaluation function of the sonar constraint access interface: based on the current state estimation of visual inertial SLAM, the predicted acoustic distance corresponding to the candidate measurement is obtained, and the difference between the acoustic distance measurement and the predicted acoustic distance is used as the prediction residual of the candidate measurement; the prediction evaluation process does not add constraints to the nonlinear optimization process, nor does it modify the state variables of visual inertial SLAM.
[0033] The access weights are determined based on sonar measurement quality scores, visual tracking status, and prediction residual test results.
[0034] The information output to the sonar constraint access interface includes at least the sonar sampling time, access weight, and processing result identifier.
[0035] Furthermore, for sonar measurements that are isolated or rejected, their timestamps, reasons for isolation or rejection, sonar measurement quality scores, and current visual tracking status are recorded for subsequent threshold adjustments or log auditing.
[0036] Furthermore, based on the optimized residual statistics of the visual inertial SLAM nonlinear optimization output, the number of accesses and rejections of sonar measurements, and changes in visual tracking status, at least one of the scoring threshold, residual threshold, and state transition conditions is updated; when tightening access conditions, the scoring threshold is increased and / or the residual threshold is decreased; when relaxing access conditions, the scoring threshold is decreased and / or the residual threshold is increased; the update magnitude of each threshold is limited to a preset upper and lower limit range, and the second scoring threshold is always kept less than the first scoring threshold, and the first residual threshold is always kept less than the second residual threshold.
[0037] Furthermore, the time-ordering buffer includes a queue to be sorted, duplicate measurement checking logic, a disordered reordering buffer, and a time-ordered output queue. It maintains the maximum timestamp of received measurements, the latest timestamp of output measurements, and a preset reordering waiting time. Sonar measurements with a sampling time no later than the latest timestamp of output measurements are determined to be late measurements that cannot be reordered, and are either removed or transferred to an isolation buffer with the reason recorded. Sonar measurements with a sampling time later than the latest timestamp of output measurements but earlier than the maximum timestamp of received measurements are entered into the... The out-of-order waiting buffer is sorted by timestamp and waits; sonar measurements whose sampling time is not earlier than the largest timestamp of the received measurements are entered into the waiting queue and duplicate measurement checks are performed; only when the sampling time of the sonar measurement is not later than the safe output time limit are they output in ascending order of time through the time-ordered output queue, where the safe output time limit is the largest timestamp of the received measurements minus the preset reordering waiting time; sonar measurements in the out-of-order waiting buffer that have not been output after the buffer retention period are marked as expired and removed.
[0038] The advantages of this invention compared to the prior art are:
[0039] 1. The time sorting cache handles out-of-order measurements with a safe output time limit mechanism. Slightly out-of-order measurements can be reordered and restored before being exceeded by the output. Late, duplicate, and expired measurements that cannot be reordered are removed and recorded, reducing the impact of abnormal timestamps on the visual inertial SLAM optimization process.
[0040] 2. Sliding window matching ensures that sonar measurements only participate in optimization when they are temporally consistent with the current state estimation window, thus avoiding the injection of historical sonar measurement errors into the current state estimation.
[0041] 3. The three-level judgment consists of sonar quality score, visual tracking status judgment and prediction residual test. The sonar access intensity is dynamically adjusted according to the degree of visual degradation and sonar reliability, rather than accessed with a fixed weight.
[0042] 4. The channel-level operating status and measurement-level handling results are designed in a hierarchical manner, and abnormal sonar measurements are promptly downweighted, isolated or rejected, reducing the risk of them continuously affecting visual inertial SLAM in the form of normal constraints.
[0043] 5. This invention connects to existing visual-inertial SLAM systems via a sonar constraint access interface, without involving the specific construction of acoustic distance constraints, and without changing the basic tracking and optimization framework of visual-inertial SLAM, making it easy to implement in existing systems. Attached Figure Description
[0044] Figure 1 This is a framework diagram of the adaptive scheduling method for mechanical scanning sonar measurement integrated with visual inertial SLAM in this invention.
[0045] Figure 2 This is a diagram showing the timing verification and sliding window matching of sonar measurements in this invention.
[0046] Figure 3 This is a schematic diagram of the sonar measurement access channel state machine in this invention;
[0047] Figure 4 This is a schematic diagram illustrating the principle of sonar measurement quality scoring and scoring threshold determination in this invention.
[0048] Figure 5 This is a schematic diagram illustrating the two-dimensional joint determination principle of visual tracking status and sonar measurement quality score in this invention. Detailed Implementation
[0049] The embodiments of the technical solutions of this application will now be described in detail with reference to the accompanying drawings. Unless otherwise stated, the technical or scientific terms used in this application have the ordinary meanings understood by those skilled in the art.
[0050] Example 1
[0051] Reference Figure 1 An adaptive scheduling method for mechanically scanned sonar measurements to access visual inertial SLAM includes the following steps: sonar measurement reception, visual inertial SLAM state acquisition, time sorting and deduplication, sliding window matching, quality scoring, prediction residual evaluation, access state determination, measurement output, anomaly isolation, log auditing and feedback update.
[0052] In this embodiment, the mechanically scanned sonar continuously outputs a sonar measurement stream. Each sonar measurement includes sampling time and acoustic distance measurement, and may include scan angle, beam number, echo intensity, and source identifier. The visual-inertial SLAM system simultaneously receives the camera image stream and the inertial measurement stream, maintaining a sliding window for nonlinear optimization. This method obtains the current sliding window time range, keyframe time, visual tracking status, and post-optimization residual statistics from the visual-inertial SLAM, but does not change its tracking, keyframe management, and optimization processes.
[0053] The instruction manual is required for: Figure 1 The sonar measurement stream, image stream, and inertial measurement stream mentioned in this application are the corresponding data streams.
[0054] Sonar measurements are first entered into a temporal sorting buffer, rather than immediately entering the optimization process. Measurements that pass the inspection are matched into a candidate set via a sliding window, and then sequentially undergo quality scoring, visual tracking status determination, and prediction residual verification to obtain their respective processing results. Measurements whose processing results are normal access or deweighted access, along with their access weights and processing result identifiers, are passed through the measurement output stage to the sonar constraint access interface. This interface is either a sonar constraint construction interface independently set up in the visual-inertial SLAM system, or a sonar constraint construction function integrated into the nonlinear optimizer, where the latter completes the specific construction of the acoustic distance constraints. This method does not limit or depend on any specific acoustic constraint geometry.
[0055] Working principle of this embodiment
[0056] The measurement frequency and arrival order of mechanically scanned sonar may differ from those of cameras and IMUs, and its measurement quality also varies with the environment. This embodiment establishes a sonar pre-access and scheduling layer between sonar measurements and the sonar constraint access interface. Timing verification ensures the temporal semantic consistency of measurements, and quality scoring, visual tracking status determination, and prediction residual verification determine the access method of measurements, enabling sonar measurements to participate in visual inertial SLAM in a controlled manner.
[0057] Example 2
[0058] Reference Figure 2 This embodiment further explains the time sorting cache and sliding window matching. The time sorting cache includes a queue to be sorted, duplicate measurement checking logic, a disordered reordering buffer area, and a time-ordered output queue, and maintains three time quantities: the maximum timestamp of received measurements, the latest timestamp of output measurements, and a preset reordering waiting time; the maximum timestamp of received measurements minus the preset reordering waiting time constitutes the safe output time limit.
[0059] The safe output time limit is calculated as "the latest received sampling time minus the reordering wait time":
[0060] (1)
[0061] in, To ensure safe output time limits, The maximum sampling timestamp of the received measurements. The preset reordering wait time is set. All three use the same time unit. For example, when the waiting time is 0.2 seconds, the maximum sampling timestamp of the received measurement is 10.0 seconds, and the safe output limit is 9.8 seconds. This limit is a waiting time reserved for slight out-of-order delivery and does not guarantee that earlier measurements will never be late.
[0062] Newly arrived sonar measurements are assigned based on their sampling time. Measurements with a sampling time no later than the latest timestamp of an already output measurement are considered non-reorderable late measurements. These measurements, regardless of the waiting time, cannot be output without disrupting the time order and are therefore discarded or moved to an isolation buffer, with the reason recorded. Measurements with a sampling time between the latest output timestamp and the largest received timestamp enter the out-of-order reordering buffer and wait in order of timestamp. Measurements with a sampling time no earlier than the largest received timestamp enter the waiting queue for normal processing. The time-ordered output queue only outputs measurements with sampling times no later than the safe output time limit, in ascending order. The preset reordering waiting time provides a window for slightly out-of-order measurements to be reordered, restoring their correct order before being overtaken by output. Measurements in the out-of-order reordering buffer that have exceeded the buffer retention period are marked as expired and discarded.
[0063] Measurements that have been deduplicated and are not expired can only be output from the ordered queue if the following time conditions are met:
[0064] (2)
[0065] in, It is the first Sampling time of sonar measurements This is the sampling time of the last measurement that has been output. The definition of equation (1) is followed. Measurements that meet the conditions are output from morning to night according to the sampling time, and are updated after each output. Therefore, the sampling time of the later measurement is always later than that of the earlier measurement. No comparison is performed before any measurement has been output. The comparison is as follows. Invalid timestamps must not be used for updates. .
[0066] Whether the buffer times out is determined by the actual dwell time. The current time and the moment the measurement first enters the corresponding buffer are recorded using the same local monotonic clock.
[0067] (3)
[0068] in, This refers to the duration of cache dwell time. This is the current local time. To measure the local time of the first entry into this cache, the units are the same. Compare with the corresponding reordering cache retention period or isolation period; if the corresponding condition is not met after the period expires, it will be handled according to the original expired or rejected rules. Re-checking during the isolation period does not reset the timer.
[0069] The criteria for determining duplicate measurements are: multiple measurements have the same timestamp; or the source identifier is the same, the time difference is less than a preset time threshold, and the beam number is the same or the scan angle difference is less than a preset angle threshold. Among the measurement groups that meet these criteria, one measurement is retained based on echo intensity, range validity, or source priority; the rest are discarded, and the reason is recorded. Jointly determining the source, time, and beam identity can prevent adjacent beam measurements from being mistakenly identified as duplicates when they are normally output by the same sonar.
[0070] The aforementioned "same timestamp" criterion for independent deduplication requires that the sampling timestamp of the input channel uniquely identify different valid measurements. When different sources or different valid beams may share the same timestamp, this uniqueness premise does not hold, and relying solely on identical timestamps may lead to misjudgment of duplicates. When the scanning angle is close to the perimeter, the angle difference is calculated based on the smallest included angle on the circumference.
[0071] The sliding window matching uses a two-level check: measurements within the current sliding window time range are directly included in the candidate set; measurements outside the window but whose time difference with the nearest sliding window boundary does not exceed a preset time threshold are also allowed to enter the candidate set; other measurements are not included in the current optimization window as candidate measurements.
[0072] To calculate the distance of the sliding window for measuring distance, we continue to use... Figure 2 Window mark The left side of the window is... The right end is There are three cases for measuring the time distance to the window:
[0073] (4)
[0074] in, Number the current sliding window. The end time of this window. The length of the window; For measurement number, Its sampling time, To measure the distance to the current time window. Equation (4) has the following relationships: the first row corresponds to a measurement earlier than the window, the second row corresponds to a measurement within the window, and the third row corresponds to a measurement later than the window; the result is always not less than zero.
[0075] by This indicates the allowable window boundary time tolerance, with the same unit as the sampling time. The time distance does not exceed... This can be used as a candidate measurement for the current window, with an equivalent sampling time range of:
[0076] (5)
[0077] During the derivation, the lower left limit is given when the measurement occurs before the window, and the upper right limit is given when the measurement occurs after the window; the measurement time distance within the window is zero, which naturally satisfies the requirements. At this time, only measurements located within the window (including both endpoints) are retained. This range only determines the eligibility of the time candidate, does not change the original sampling time, and does not mean that the measurement has been approved for optimization.
[0078] Working principle of this embodiment
[0079] The safe output time limit is a reserved waiting time for slightly out-of-order measurements; the checking of already output timestamps and ascending order output together maintain the temporal monotonicity of the output sequence. Measurements that arrive after exceeding the waiting range are still treated as late and cannot be inserted back into the already output sequence.
[0080] Example 3
[0081] Reference Figure 3 Based on Embodiment 1 or Embodiment 2, the system sets up a running state machine for the sonar measurement access channel. The state machine is a channel-level state, including six states: standby state, candidate access state, normal access state, degraded access state, isolation state, and fallback state. A single sonar measurement does not hold a state machine state, but only has a processing result, which includes four types: normal access, degraded access, isolation, and rejection.
[0082] When visual tracking is stable, the sonar measurement access channel remains in standby mode: sonar measurements only participate in caching, quality scoring, prediction residual evaluation, and logging, and are not used as constraints in optimization. This state does not change even if the sonar measurement quality score increases. When visual tracking deteriorates and high-quality or medium-quality candidate measurements are available, the channel enters candidate access mode. If the prediction residuals in candidate access mode meet preset consistency conditions within multiple consecutive sliding windows, the channel enters normal access mode.
[0083] In normal access mode, if the prediction residual of a candidate measurement exceeds the first residual threshold but does not exceed the second residual threshold, the channel enters a reduced-weight access state, and the corresponding measurement is output with a reduced access weight. If the prediction residual in the reduced-weight access state again meets the preset consistency condition, the channel returns to the candidate access state. When the channel experiences continuous anomalies: the proportion of rejected measurements continuously exceeds a preset proportion, the prediction residual statistics continuously exceed the second residual threshold, the number of valid candidate measurements continuously falls below a preset number, or the proportion of time-series abnormal measurements continuously exceeds a preset proportion, at least one of these occurs: the channel enters an isolation state. During isolation, the system continuously calculates the prediction residual for sonar measurements but does not output measurements. If the prediction residual again meets the preset consistency condition and the time sequence is normal within multiple consecutive sliding windows, the channel switches from the isolation state back to the candidate access state. If multiple consecutive sliding windows remain abnormal after isolation, the channel enters a fallback state, suspends sonar access, and the visual-inertial SLAM operates according to the original sensor configuration. When the preset reset condition is met or a reset command is received, the channel switches from the fallback state to the standby state.
[0084] At the individual measurement level, the difference between isolation and rejection is as follows: Measurements that do not yet meet the access conditions but have not yet met the rejection conditions are placed in isolation and retained in the isolation buffer. Within a preset isolation period, time validity checks, quality scoring, or prediction residual tests are re-executed. If the conditions are still not met after the isolation period, the measurement is rejected and removed. Rejection is the final step, and rejected measurements will no longer participate in subsequent decisions.
[0085] In this embodiment, "multiple consecutive sliding windows" refers to adjacent windows successively satisfying the same preset condition; if any window fails to meet the condition, the consecutive count is recalculated. The required number of windows, the anomaly ratio, and the minimum number of valid candidates are preset values.
[0086] Working principle of this embodiment
[0087] The channel-level status determines the overall access strategy, while the measurement-level processing results determine the destination of each measurement, with a clear division of labor between the two layers. Sonar access is thus no longer a fixed switch: when vision degrades, sonar is used to supplement information; when sonar malfunctions, its impact is gradually reduced through deweighting, isolation, and rollback; and after the malfunction is resolved, it can be gradually restored.
[0088] Example 4
[0089] Reference Figure 4 Based on the above embodiments, the system calculates a sonar measurement quality score for each candidate sonar measurement. The score consists only of the sonar measurement's intrinsic and temporal attributes, including temporal validity, range validity, echo intensity or peak stability, scan angle or beam number continuity, and consistency with historical measurements; visual tracking status and prediction residuals are not included in the score but are used as independent judgment dimensions and independent verification, respectively.
[0090] Figure 4 In This indicates the quality score of the current sonar measurement. Indicates the first Normalized indicators, This represents the weight of this indicator in the overall score. If using... For each indicator, first multiply it by its weight, then add them together:
[0091] (6)
[0092] in, This refers to the actual number of quality indicators used. Take from 1 ; Summation symbol This means adding up all the results. and A uniform dimensionless scoring scale is adopted. It is also a dimensionless quantity. Non-negative weights mean that the items will not cancel each other out with negative contributions, and a weight sum of 1 means that the total score is a weighted average of the items.
[0093] For example, if both are used Figure 4 The five categories of indicators are listed and numbered in order from top to bottom in the figure. Equation (6) can be directly expanded as follows:
[0094] (7)
[0095] Corresponding time validity Corresponding range validity Corresponding echo intensity or peak stability, Corresponding to the continuity of scanning angle or beam number, Consistency with historical measurements; to These are the scoring weights for the five items mentioned above. The specific normalization method and weight values for each item are preset according to the sonar model and application scenario, and can be adjusted by the feedback process, using the existing index definitions in this embodiment.
[0096] When all indicators are normalized to a range of 0 to 1, and larger values represent better quality, the overall score also falls within the range of 0 to 1. And non-negative weights, which can be obtained item by item. Adding these inequalities together gives:
[0097] (8)
[0098] This derivation only describes the scoring scale and range, and does not stipulate that indicators such as echo intensity and historical consistency must use a certain function. Missing fields should not be interpreted as indicating that the quality of that item has passed. The rules for determining the values of each indicator and the handling of missing values should be consistent under the same configuration.
[0099] by This indicates the first scoring threshold. This indicates the second scoring threshold, and... Figure 4 , Figure 5 Correspondingly, the second threshold is lower than the first threshold; within the above-mentioned scoring scale of 0 to 1, take... The specific judgment is as follows:
[0100] Quality rating When the time is right, mark it as a high-quality candidate; When the time is right, mark it as a medium-quality candidate; If the value is equal to the second threshold, the measurement is rejected, and the timestamp, reason for rejection, score, and current visual tracking status are recorded. A value equal to the second threshold is classified as a medium-quality candidate, and a value equal to the first threshold is classified as a high-quality candidate.
[0101] Measurements that are not rejected during the scoring phase yield candidate quality levels, not final access results. High-quality candidates must also pass visual state assessment, prediction residual verification, and channel state validation before they can be successfully accessed.
[0102] Working principle of this embodiment
[0103] The quality score uses only the intrinsic and temporal attributes of the sonar measurements. With fixed indicator configurations and scoring weights, visual tracking status and prediction residuals are not used as scoring inputs; they are used for independent subsequent evaluation. Cross-statistical window feedback can adjust scoring parameters, but it does not directly add the current visual status or current prediction residual to the current score.
[0104] Example 5
[0105] Reference Figure 5 Based on Examples 3 and 4, the visual tracking status and sonar measurement quality score together constitute the two-dimensional basis for sonar access judgment. When the visual tracking status is stable, the sonar measurement access channel remains in standby mode. Measurements are only cached, scored, and the prediction residuals are calculated without optimization. This result is not changed by the quality score. When the visual tracking status declines, the measurement is stratified according to the score range: measurements below the second score threshold are rejected, measurements between the two score thresholds are considered medium-quality candidate measurements, and measurements not below the first score threshold are considered high-quality candidate measurements.
[0106] The final processing of candidate measurements is determined by prediction residual verification and channel state validation. The prediction residual evaluation calls the prediction evaluation function of the sonar-constrained access interface: based on the current state estimation of visual-inertial SLAM, the interface returns the predicted acoustic distance corresponding to the candidate measurement; the prediction residual is the difference between the measured acoustic distance and the predicted acoustic distance. The prediction evaluation process does not add any constraints to the nonlinear optimization process, nor does it modify state variables; therefore, continuous evaluation in standby and isolation states does not affect system operation. Measurements whose prediction residuals exceed the first residual threshold but do not exceed the second residual threshold are de-weighted for access; measurements exceeding the second residual threshold are rejected. High-quality candidate measurements are only allowed normal access and output after continuous consistency verification of the channel candidate access state.
[0107] The prediction residual is calculated as "measured distance minus predicted distance":
[0108] (9)
[0109] in, For the first Acoustic distance measured by bar measurement, The sonar-constrained access interface estimates and returns the predicted acoustic distance based on the current state. This refers to the predicted residuals before data access. The hat-shaped symbol at the top indicates the "predicted value"; all three quantities use the same distance unit. This indicates that the measured distance is greater than the predicted distance. This indicates that the measured distance is less than the predicted distance. The prediction evaluation does not impose constraints on the visual-inertial SLAM optimizer, nor does it modify the current state estimate.
[0110] To simultaneously check for inconsistencies in both the positive and negative directions, this embodiment uses the absolute value of the residual. Compare with the threshold. The vertical line here indicates taking the absolute value. The first residual threshold is denoted as... The second residual threshold is denoted as Both and the distance use the same unit and satisfy the condition. .
[0111] when When the residual test satisfies the consistency requirement; when When residual testing requires weighting down; when When the value is equal to the second threshold, measurement is refused. This is the result of the residual check; whether it is ultimately output still depends on the visual state and channel state. It is still within the weighted range when the value equals the second threshold.
[0112] When the predicted distance is temporarily unavailable, the missing value is not treated as a zero residual; the measurement is handled according to the original isolation and timeout rules. The check here is whether the measurement is consistent with the current prediction; a large residual does not necessarily indicate an error in the sonar ranging itself.
[0113] De-weighted access means that, for the same measurement and under the same quality conditions, a lower positive weight is used than that for normal access. This relationship can be written as:
[0114] (10)
[0115] in, This indicates the weight of the measurement when it is normally connected. This indicates the weight used during de-weighted access; "Normal" and "De-weighted" are access method labels, not exponentiation. Both are related to... Figure 4 Synthetic quality score The meanings are different. The specific weights are still determined by the existing access rules combined with the quality score, visual status and residual check results. Equation (10) only explains the weighting relationship. Measurements that are disposed of as isolation or rejection are not output as optimization constraints.
[0116] Figure 5 The region division shown is a static criterion at a single moment; the rollback state is triggered by continuous anomalies in multiple consecutive sliding windows, which is a criterion in the time dimension, such as... Figure 3 As shown, not in Figure 5 The Chinese side indicated that...
[0117] Working principle of this embodiment
[0118] This embodiment forms a three-level judgment in the order of "time sequence validity check, sonar quality score, and joint judgment of visual tracking status and prediction residual", and finally gives the channel operation status and the handling result of individual measurement. This avoids sonar measurement directly entering the optimization with fixed weight, and enables the system to adjust the participation of sonar measurement under different underwater visibility conditions, different sonar echo quality and different motion states.
[0119] Example 6
[0120] This embodiment provides one implementation method for backend feedback and threshold update, refer to... Figure 1 and Figure 4 The system compiles the following information in each statistics window: the number of measurements with normal access, the number of measurements with reduced access weight, the number of measurements isolated or rejected, the statistics of the optimized residuals output by nonlinear optimization (such as the residual mean and dispersion), and the changes in visual tracking status.
[0121] The statistical object is the measurement whose handling results have been given in the statistics window. The rejection rate is calculated by dividing the number of rejections by the total number:
[0122] (11)
[0123] in, This represents the number of measurements rejected within this statistical window. The total number of measurements under the same statistical caliber The rejection rate ranges from 0 to 1. Isolation waiting is not counted as a rejection. When the same measurement is retried multiple times within a statistical window, the last retry within that window is counted once; the total number is subject to the same rules as the rejection number. This ratio is not calculated at this time. The number of normal, downgraded, and isolated cases is directly counted according to their respective handling methods.
[0124] The number of accesses is recorded separately for the measurements that actually participated in optimization. If the same measurement is optimized in this window and then isolated or rejected, its actual participation record is still retained and is not erased due to the last change. Subsequent residual statistics only use valid residuals that can be mapped to actual participation records and were successfully optimized.
[0125] The optimized residual is still calculated by subtracting the predicted distance from the measured distance, but the predicted value must come from the state after optimization.
[0126] (12)
[0127] in, Still using the original distance measurement method. The predicted distance obtained after optimization. This corresponds to the optimized residual. The superscript "after" indicates optimized, not exponential. This statistic uses the original distance residual and does not treat the scaling of the access weights as a reduction in the distance error itself.
[0128] When the mean and standard deviation of the optimized residual amplitudes are used as statistics, the calculation formula is:
[0129] (13)
[0130] in, This represents the number of effective optimized residuals actually used in this statistical analysis. From 1 to Each measurement is numbered; for each measurement, the residual corresponding to the last successful optimization is taken in this window. This represents the average value of the residual amplitudes; the horizontal line above indicates the average. This is the standard deviation of the residual amplitude, used to represent the degree of dispersion. The mean is "the sum of all amplitudes divided by the quantity", and the standard deviation is "the average of each amplitude minus the mean, squared, and then the square root". and All measurements are in distance units. Even if these two statistics are not calculated, they cannot be treated as zero error.
[0131] Based on the above statistics, the system adjusts at least one of the following parameters within preset upper and lower limits by a preset step size: the first and second scoring thresholds, the first and second residual thresholds, the weights of each indicator in the quality score, and the state transition conditions of the state machine. The adjustment direction is clearly defined as follows: when tightening access conditions, increase the scoring threshold and / or decrease the residual threshold; when relaxing access conditions, decrease the scoring threshold and / or increase the residual threshold. For example, tightening is applied when the optimized residual statistics continuously increase and the rejection rate rises; moderate relaxation is applied when the optimized residual statistics remain stable for a long period and the visual tracking status continuously declines, to enhance the sonar supplementary role. Under all circumstances, the second scoring threshold is kept lower than the first scoring threshold, the first residual threshold is kept lower than the second residual threshold, and each threshold does not exceed its preset upper and lower limits.
[0132] The addition and subtraction relationships in the above threshold adjustments can be directly written out. (Using...) or These represent the first and second thresholds, respectively. The step size for this update is the score threshold. This is the update step size for the residual threshold. When tightening access conditions:
[0133] (14)
[0134] When relaxing access conditions:
[0135] (15)
[0136] The superscript "old" indicates the value before the update, and "new" indicates the value after the update; neither is an exponentiation. and Use quality
[0137] Dimensionless scale for quantitative scoring; and Use distance units. The threshold that is not adjusted in this round has an update step size of zero. Equations (14) and (15) represent the calculations after the adjustment direction has been determined.
[0138] The update must also meet the preset upper and lower limits for each threshold:
[0139]
[0140] in, , The first The lower and upper limits of a rating threshold; , These represent the lower and upper limits of the corresponding residual thresholds. The subscript " "and" "" represents the minimum and maximum allowable values, respectively. When using a 0-1 rating scale, the upper and lower limits of the rating threshold are also between 0 and 1; the upper and lower limits of the residual threshold are positive values. The updated values must still meet the following conditions. , .
[0141] If a preset step size would cause exceeding the upper or lower limits or disrupt the order of the first and second thresholds, the actual adjustment range should be reduced; thresholds that cannot meet the requirements should remain unchanged. When tightening, the scoring threshold increases while the residual tolerance decreases; when loosening, the opposite occurs. The above relationships illustrate how the thresholds change, but do not necessarily indicate that the positioning error will improve. The quality scoring weights and state transition conditions can still be adjusted according to the original feedback configuration, and all adjusted scoring weights must still be non-negative and sum to 1.
[0142] In this embodiment, the predicted residual and the optimized residual are statistically analyzed and used separately: the former is used for access determination and isolation recovery determination, and the latter is used for feedback updates and log auditing.
[0143] Working principle of this embodiment
[0144] By statistically analyzing access, rejection, and post-optimization residuals, the system adjusts access parameters according to the original feedback conditions. Preset upper and lower limits and threshold order constraints limit the range of each adjustment, giving the feedback update a clear direction and magnitude.
[0145] Example 7
[0146] To implement the adaptive scheduling method of any of the above embodiments, this embodiment provides an adaptive scheduling system for mechanically scanned sonar measurements integrated with visual inertial SLAM; the scheduling system includes:
[0147] Mechanical scanning sonar is configured to provide sonar measurement data streams according to scanning orientation and form distance residuals through a sonar constraint construction interface. These residuals are then jointly optimized with the camera's visual reprojection constraints and the IMU's pre-integration motion constraints to enhance the robustness of localization and mapping in visual degradation scenarios.
[0148] Cameras are used to provide environmental observations and construct visual reprojection constraints;
[0149] IMU is used to provide high-frequency accelerometer and gyroscope measurements to construct inertial motion constraints;
[0150] The sonar front-end access and scheduling layer module is used to receive sonar measurement streams, ensure temporal semantic consistency of measurements through timing verification, and determine the access method of measurements through quality scoring, visual tracking status determination, and prediction residual verification, so that sonar measurements can participate in visual inertial SLAM in a controlled manner.
[0151] The visual-inertial SLAM optimizer receives image streams from the camera, inertial measurement streams from the IMU, and sonar constraint access interface admission information (such as sonar measurements, access weights, and status flags), and feeds back the optimization results (such as sliding window information, visual tracking status, and optimized residual statistics) to the sonar front-end access and scheduling layer module.
[0152] This application uses specific embodiments to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand this application and its core ideas. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An adaptive scheduling method for mechanical scanning sonar measurements integrated with visual-inertial SLAM, characterized in that, The method includes: S1. Obtain the sonar measurement flow output by the mechanical scanning sonar, and obtain the current sliding window time range, key frame time, and visual tracking status of the visual inertial SLAM. S2. Sonar measurement stream input time sorting and buffering, and perform timestamp monotonicity check, repeated measurement check and buffer time limit check on sonar measurements respectively; S3. Based on the current sliding window time range, select candidate measurements from the sonar measurements that have passed the inspection; S4. Calculate the sonar measurement quality score of the candidate measurement based on the sonar measurement's intrinsic and temporal attributes. S5. Based on the sonar measurement quality score, the visual tracking status, and the prediction residual test results, determine the operating status of the sonar measurement access channel and the processing results of each candidate measurement, wherein the prediction residual is the residual obtained by estimating the current state of the sonar measurement based on visual inertial SLAM without adding the sonar measurement to the optimization. When the processing result of the candidate measurement is normal access or deweighted access, the sonar measurement corresponding to the candidate measurement, the access weight, and the identifier representing the processing result are output to the sonar constrained access interface. When the result of the candidate measurement is isolation or rejection, or when the sonar measurement access channel is in standby, isolation or rollback state, the corresponding sonar measurement will not be output to the sonar constraint access interface, nor will the sonar measurement be added as a constraint to the nonlinear optimization process.
2. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 1, characterized in that, The sonar measurement includes sonar sampling time and acoustic distance measurement, and also includes at least one of the following parameters: scanning angle, beam number, echo intensity, and sonar measurement source identifier.
3. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 1, characterized in that, The time sorting cache maintains the ordered output of sonar measurements according to the sonar sampling time. When multiple sonar measurements have the same timestamp, or multiple sonar measurements have the same source identifier, a time difference less than a preset time threshold, and the same beam number or a scanning angle difference less than a preset angle threshold, they are determined to be duplicate measurements. For sonar measurements determined to be duplicates, one that meets the quality conditions is retained, and the rest are discarded and the reason for the discard is recorded.
4. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 1, characterized in that, Sonar measurements that are outside the current sliding window and whose time difference with the nearest sliding window boundary exceeds a preset time threshold will not be included in the current optimization window as candidate measurements.
5. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 1, characterized in that, The sonar measurement quality score is determined by the sonar measurement's intrinsic and temporal attributes, including at least one of the following: temporal validity, range validity, echo intensity or peak stability, scan angle or beam number continuity, and consistency of historical measurements.
6. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 5, characterized in that, The sonar measurement quality score is a weighted sum of normalized quality indicators, with each weight being non-negative and the sum of the weights being 1. When the quality score is not lower than the first scoring threshold, the corresponding measurement is marked as a high-quality candidate measurement. When the quality score is lower than the first scoring threshold but not lower than the second scoring threshold, the corresponding measurement is marked as a medium-quality candidate measurement. When the quality score is lower than the second scoring threshold, the corresponding measurement is set to rejection. The second scoring threshold is less than the first scoring threshold.
7. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 1, characterized in that, The visual tracking state is determined by at least one of the following: the current number of tracked features, the feature matching inlier ratio, the reprojection error, the keyframe creation state, and the inertial pre-integration consistency.
8. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 1, characterized in that, The operating states of the sonar measurement access channel include standby state, candidate access state, normal access state, degraded access state, isolation state, and fallback state; the processing results of the candidate measurement include normal access, degraded access, isolation, and rejection.
9. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 8, characterized in that, When the visual tracking state is stable, the sonar measurement access channel remains in standby mode, and this state does not change as the sonar measurement quality score increases. When the sonar measurement access channel is in standby mode, the sonar measurement only participates in caching, quality scoring, prediction residual evaluation and log recording, and does not enter the nonlinear optimization process as a constraint. When the visual tracking status declines and there are high-quality or medium-quality candidate measurements, the sonar measurement access channel enters the candidate access state. If the prediction residual in the candidate access state meets the preset consistency condition within multiple consecutive sliding windows, the sonar measurement access channel enters the normal access state.
10. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 8, characterized in that, When the prediction residual exceeds the first residual threshold but does not exceed the second residual threshold, the candidate measurement is processed by downweighting and access; when the prediction residual exceeds the second residual threshold, the candidate measurement is processed by rejection. When the proportion of sonar measurements that are rejected within multiple consecutive sliding windows exceeds a preset proportion, the sonar measurement access channel enters an isolation state; wherein the first residual threshold is less than the second residual threshold.
11. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 8, characterized in that, When a candidate measurement does not meet the access conditions but has not yet met the rejection conditions, its handling result is set to isolation; the isolated sonar measurement is retained in the isolation buffer and time validity check, quality score or prediction residual test are re-executed within the preset isolation time limit; If the access conditions are still not met after the isolation period expires, the result will be set to rejection and the application will be removed.
12. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 1, characterized in that, The prediction residual is obtained by calling the prediction evaluation function of the sonar constraint access interface: based on the current state estimation of visual inertial SLAM, the predicted acoustic distance corresponding to the candidate measurement is obtained, and the difference between the acoustic distance measurement and the predicted acoustic distance is used as the prediction residual of the candidate measurement; the prediction evaluation process does not add constraints to the nonlinear optimization process, nor does it modify the state variables of visual inertial SLAM.
13. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 1, characterized in that, For sonar measurements that are isolated or rejected, record their timestamp, reason for isolation or rejection, sonar measurement quality score, and current visual tracking status for subsequent threshold adjustment or log auditing.
14. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 8, characterized in that, When the sonar measurement access channel is continuously abnormal within multiple consecutive sliding windows, the operation state of the sonar measurement access channel enters a rollback state, suspending the output of sonar measurements to the sonar constraint access interface, and the visual inertial SLAM algorithm runs according to the original sensor configuration; the continuous abnormality is determined by at least one of the following conditions: the proportion of rejected measurements continuously exceeds a preset proportion, the prediction residual statistics continuously exceed the second residual threshold, the number of valid candidate measurements continuously falls below a preset number, and the proportion of time-series abnormal measurements continuously exceeds a preset proportion.
15. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 8, characterized in that, During the isolation state of the sonar measurement access channel, the prediction residual is continuously calculated for the sonar measurement. When the prediction residual meets the preset consistency condition again within multiple consecutive sliding windows and the time sorting is normal, the sonar measurement access channel switches from the isolation state to the candidate access state.
16. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 1, characterized in that, Based on the optimized residual statistics of the visual inertial SLAM nonlinear optimization output, the number of accesses and rejections of sonar measurements, and the changes in visual tracking status, at least one of the scoring threshold, residual threshold, and state transition conditions is updated; when tightening access conditions, the scoring threshold is increased and / or the residual threshold is decreased; when relaxing access conditions, the scoring threshold is decreased and / or the residual threshold is increased; the update magnitude of each threshold is limited to a preset upper and lower limit range, and the second scoring threshold is always kept less than the first scoring threshold, and the first residual threshold is always kept less than the second residual threshold.
17. The adaptive scheduling method for mechanical scanning sonar measurement integrated with visual-inertial SLAM according to claim 3, characterized in that, The time-ordering buffer includes a queue to be sorted, duplicate measurement checking logic, a disordered reordering buffer, and a time-ordered output queue. It maintains the maximum timestamp of received measurements, the latest timestamp of output measurements, and a preset reordering waiting time. Sonar measurements with a sampling time no later than the latest timestamp of output measurements are considered late measurements that cannot be reordered, and are either removed or transferred to an isolation buffer with the reason recorded. Sonar measurements with a sampling time later than the latest timestamp of output measurements but earlier than the maximum timestamp of received measurements enter the disordered reordering buffer and wait in time-ordered order. Sonar measurements with a sampling time no earlier than the maximum timestamp of received measurements enter the queue to be sorted and undergo duplicate measurement checking. Only when the sampling time of a sonar measurement is no later than a safe output time limit is it output in ascending time order through the time-ordered output queue. The safe output time limit is the maximum timestamp of received measurements minus the preset reordering waiting time. Sonar measurements that have not been output within the out-of-order buffer after the buffer retention period are marked as expired and removed.
