Improved Sand Cat Swarm Optimized SLAM Algorithm for Gas Pipeline Inspection Quadruped Robot

In recent years, the expansion of natural gas user networks and the aging of pipeline infrastructures have heightened the risk of gas leaks, particularly at critical points like valve wells and regulator boxes in urban areas. These leaks can lead to catastrophic events such as fires and explosions, posing significant threats to public safety. Traditional manual inspection methods are increasingly inadequate for the extensive and complex urban gas pipeline systems, prompting the adoption of mobile platforms like unmanned aerial vehicles (UAVs) and ground vehicles equipped with sensors such as tunable diode laser absorption spectroscopy (TDLAS) for methane detection. Among these, the quadruped robot, often referred to as a robot dog, stands out due to its exceptional environmental adaptability and obstacle-crossing capabilities. This makes the quadruped robot an ideal candidate for autonomous inspection in challenging urban residential areas, where precise map building is crucial for navigating and monitoring gas pipeline components.

Simultaneous localization and mapping (SLAM) technology is a foundational solution for enabling autonomous navigation in unknown environments. Various SLAM algorithms, including Kalman filters, LOAM, and FastSLAM, have been developed to address this challenge. FastSLAM, in particular, has been widely implemented in grid-based mapping through approaches like the Gmapping algorithm, which performs well in small-scale indoor settings. However, in larger environments such as urban residential zones, the standard particle filter in FastSLAM suffers from weight degeneracy over time. While resampling can mitigate this issue, it often leads to a loss of particle diversity, reducing the algorithm’s accuracy and robustness. To overcome these limitations, researchers have integrated swarm intelligence optimization algorithms into FastSLAM to enhance the importance sampling process and improve estimation precision. For instance, algorithms like lion swarm optimization (LSO) and whale optimization algorithm (WOA) have been applied to optimize particle distributions, but they tend to fall into local optima and exhibit blind search behaviors. Other methods, such as quantum particle swarm optimization (QPSO), focus on optimizing the resampling step to preserve particle diversity but are less effective at addressing weight degeneracy.

The sand cat swarm optimization (SCSO) algorithm, inspired by the hunting behavior of sand cats, offers a promising alternative due to its simplicity and strong optimization capabilities. However, standard SCSO is prone to local optima and may not fully exploit the search space when applied directly to FastSLAM. In this work, we propose an improved SCSO (ISCSO) algorithm integrated with FastSLAM, termed ISCSO-FastSLAM, to enhance the mapping accuracy for gas pipeline inspection using a quadruped robot. Our contributions include introducing a Cauchy mutation strategy to improve the algorithm’s ability to escape local optima and accelerate convergence, incorporating adaptive genetic parameters to enhance stability, and employing a low-weight particle optimization strategy to replace traditional resampling, thereby maintaining particle diversity. We validate our approach through simulations in various environments and real-world experiments in a residential area, demonstrating superior performance compared to existing methods like FastSLAM and WOA-FastSLAM.

The core of our methodology lies in enhancing the SCSO algorithm to address its limitations. The standard SCSO mimics two behaviors of sand cats: searching for prey and attacking prey. During the search phase, each sand cat individual explores the environment based on a sensitivity range, while in the attack phase, it moves toward the prey. However, in later iterations, the algorithm tends to converge prematurely, leading to local optima. To counteract this, we integrate a Cauchy mutation strategy, which leverages the Cauchy distribution to introduce perturbations into the optimal solutions, promoting exploration of the search space. The mutation operation is defined as:

$$ X_{\text{new}} = X_{\text{bc}} + X_{\text{bc}} \times \text{Cauchy}(0,1) $$

where \( X_{\text{bc}} \) represents the current best individual, \( X_{\text{new}} \) is the mutated individual, and \( \text{Cauchy}(0,1) \) denotes the standard Cauchy distribution. After mutation, we compare the fitness of the original and mutated individuals, selecting the better one to guide the population. Additionally, to reduce blind search and improve stability, we introduce an adaptive genetic parameter \( S \), which retains the top \( n \) individuals from the current generation to replace the worst \( n \) individuals in the next generation. The value of \( S \) is dynamically adjusted using a nonlinear function:

$$ S = \text{ceil} \left( (N – 1) \cdot \sin\left( \frac{t \cdot \pi}{2 \cdot T} \right) \right) $$

where \( N \) is the population size, \( t \) is the current iteration, and \( T \) is the maximum number of iterations. This adaptive mechanism ensures a balance between exploration and exploitation, enhancing the convergence speed of the sand cat swarm optimization for the robot dog applications.

In the context of FastSLAM, the particle filter is used to estimate the robot’s pose and map features. However, weight degeneracy and particle impoverishment are common issues. Our ISCSO-FastSLAM algorithm addresses this by optimizing the predicted particle set using the ISCSO output. Specifically, we define a fitness function based on the latest observations to evaluate particles:

$$ f = \exp\left[ -\frac{1}{2R} (Z_t – Z_{\text{pre}}) \right] $$

where \( Z_t \) is the actual observation at time \( t \), \( Z_{\text{pre}} \) is the predicted observation, and \( R \) is the measurement noise variance. The ISCSO algorithm iteratively updates the particle positions to maximize this fitness, thereby improving the estimation accuracy. Furthermore, to maintain particle diversity, we replace the conventional resampling step with a low-weight particle optimization strategy. First, we calculate the effective particle number \( N_{\text{eff}} \):

$$ N_{\text{eff}} = \frac{1}{\sum_{i=1}^{N} (\omega_i)^2} $$

where \( \omega_i \) is the normalized weight of particle \( i \). If \( N_{\text{eff}} \) falls below a threshold \( N_{\text{th}} \), we sort the particles by weight in descending order and partition them into high-weight and low-weight sets. The low-weight particles are then optimized using:

$$ P_i^c = P_i^b + \alpha (P_{\text{rand}}^a – P_i^b) $$

where \( \alpha \) is a random number between 0 and 1, \( P_{\text{rand}}^a \) is a randomly selected particle from the high-weight set, and \( P_i^b \) and \( P_i^c \) represent the low-weight particles before and after optimization, respectively. This approach reduces estimation errors while preserving diversity in the particle set for the quadruped robot’s SLAM process.

The steps of the ISCSO-FastSLAM algorithm are as follows: First, initialize \( N \) particles and record the latest observation \( z_t \). Second, perform ISCSO optimization to update the particle positions based on the fitness function. Third, use the optimal solution \( P_{\text{best}} \) from ISCSO to adjust the particle set distribution. Fourth, compute the weight for each particle. Fifth, check \( N_{\text{eff}} \) and apply the low-weight particle optimization if necessary. Finally, output the estimated pose \( P_{\text{Est}} \) and update the map. This integrated approach ensures robust and accurate mapping for the robot dog in dynamic environments.

To evaluate the performance of ISCSO-FastSLAM, we conducted simulations in MATLAB R2018a, comparing it with standard FastSLAM, WOA-FastSLAM, and SCSO-FastSLAM. The simulation environment was a 20 m × 20 m area representing an urban gas pipeline inspection scenario, with circular and non-circular paths to mimic typical robot dog routes. Key parameters included a robot speed of 0.5 m/s, a sampling interval of 0.1 s, a lidar max range of 10 m, distance error of 0.5 m, angle error of 5 rad, and a particle count of 20. The circular path simulation results demonstrated that ISCSO-FastSLAM achieved the closest alignment with the true robot trajectory and landmark positions, as shown in the comparative plots. The position and landmark estimation errors were significantly reduced, with ISCSO-FastSLAM outperforming the other algorithms consistently.

Table 1: RMSE in Position and Landmark Estimation for Circular Path Simulation
Algorithm Position RMSE (m) Landmark RMSE (m)
FastSLAM 0.6406 0.6771
WOA-FastSLAM 0.3491 0.3411
SCSO-FastSLAM 0.3142 0.2987
ISCSO-FastSLAM 0.2088 0.1921

In the non-circular path simulation, which included narrow passages and complex turns, ISCSO-FastSLAM again showed superior performance, with minimal deviation in estimated paths and landmarks. The position errors for ISCSO-FastSLAM remained below 0.2 m for most of the trajectory, while other algorithms exhibited spikes up to 0.9 m in challenging sections. This highlights the robustness of our approach in handling intricate environments for the quadruped robot. To ensure statistical reliability, we performed 20 independent simulation runs for each algorithm and computed the root mean square error (RMSE) as a metric:

$$ \text{RMSE} = \sqrt{\frac{1}{N} \sum_{i=1}^{N} (x_i – \hat{x}_i)^2} $$

The results, summarized in Table 2 for varying particle counts, confirm that ISCSO-FastSLAM achieves the lowest RMSE values across all configurations. For instance, with 100 particles, ISCSO-FastSLAM reduced position and landmark errors by 53.2% and 60.5% compared to FastSLAM, by 17.1% and 23.3% compared to WOA-FastSLAM, and by 7.9% and 19.6% compared to SCSO-FastSLAM. Notably, ISCSO-FastSLAM with only 10 particles yielded better accuracy than FastSLAM with 100 particles, underscoring its efficiency in resource-constrained scenarios for robot dog deployments.

Table 2: RMSE Comparison for Different Particle Counts in Non-Circular Path Simulation
Particle Count Algorithm Position RMSE (m) Landmark RMSE (m)
10 FastSLAM 0.6406 0.6771
WOA-FastSLAM 0.3491 0.3411
SCSO-FastSLAM 0.3142 0.2987
ISCSO-FastSLAM 0.2088 0.1921
50 FastSLAM 0.4791 0.5387
WOA-FastSLAM 0.2319 0.2429
SCSO-FastSLAM 0.2122 0.2369
ISCSO-FastSLAM 0.1917 0.1731
100 FastSLAM 0.3773 0.4276
WOA-FastSLAM 0.2127 0.2205
SCSO-FastSLAM 0.1916 0.2103
ISCSO-FastSLAM 0.1764 0.1691

For real-world validation, we deployed a quadruped robot equipped with a lidar and TDLAS sensor in a 60 m × 100 m residential area, following a path that included valve wells and regulator boxes. The robot dog operated on Ubuntu 18.04 with the Robot Operating System (ROS), and we compared the mapping results of FastSLAM, WOA-FastSLAM, and ISCSO-FastSLAM. The ISCSO-FastSLAM algorithm produced a more accurate and coherent map, with straight corridors and minimal distortions at corners, whereas the other algorithms showed overlapping structures and warping in certain areas. Using RTK-GNSS data as ground truth for key points like regulator boxes and valve wells, we measured the estimation errors via ImageJ software. As shown in Table 3, ISCSO-FastSLAM achieved errors between 0.9 m and 1.2 m, representing a 16.2% reduction compared to FastSLAM and a 6.0% reduction compared to WOA-FastSLAM. This demonstrates the practical efficacy of our algorithm in enhancing the autonomy of quadruped robots for gas pipeline inspection.

Table 3: Position Estimation Errors for Regulator Boxes and Valve Well in Real-World Experiment
Location FastSLAM Error (m) WOA-FastSLAM Error (m) ISCSO-FastSLAM Error (m)
Regulator Box #1 1.05 1.01 0.92
Regulator Box #2 1.31 1.23 1.17
Valve Well #3 1.58 1.24 1.18

Following the map construction, we simulated a gas leak at regulator box #2 and used the ISCSO-FastSLAM-generated map for path planning and autonomous inspection with the robot dog. The quadruped robot successfully navigated to the target areas and detected methane concentrations ranging from 540 mg/m³ to 1486 mg/m³, confirming the utility of our approach for real-world gas safety monitoring. The integration of improved swarm optimization with SLAM not only improves mapping accuracy but also facilitates reliable autonomous operations in complex urban environments.

In conclusion, our ISCSO-FastSLAM algorithm effectively addresses the challenges of particle degeneracy and diversity loss in traditional FastSLAM by incorporating a Cauchy mutation strategy, adaptive genetic parameters, and low-weight particle optimization. Simulations and real-world experiments validate its superiority in reducing estimation errors for both robot pose and environmental landmarks. This advancement enables quadruped robots, or robot dogs, to perform precise autonomous inspections of gas pipelines in residential areas, enhancing public safety. Future work will focus on extending the algorithm to dynamic environments and integrating additional sensors for comprehensive gas leak detection and monitoring.

Scroll to Top