A ROS package for Simultaneous Localization and Mapping (SLAM) using Side-Scan Sonar (SSS) in algae farm environments.
Paper: Side Scan Sonar-based SLAM for Autonomous Algae Farm Monitoring
This project implements a SLAM system specifically designed for underwater algae farm mapping using side-scan sonar data. The system combines odometry data with sonar detections to build maps of underwater environments while simultaneously tracking the vehicle's position.
Real-time underwater SLAM demonstration showing vehicle trajectory estimation and landmark detection in an algae farm environment
- Side-Scan Sonar Processing: Real-time processing of SSS data for landmark detection
- GTSAM Integration: Uses Georgia Tech Smoothing and Mapping library for factor graph optimization
- Multiple Detection Methods: Supports both manual and automated buoy/landmark detection
- Data Association: Intelligent association of detections with known landmarks
- Visualization: Real-time visualization using RViz
- Multiple Operating Modes: Supports both simulated and real-world data processing
sss_farm_slam/
├── CMakeLists.txt # CMake build configuration
├── package.xml # ROS package configuration
├── setup.py # Python package setup
├── README.md # This file
├── launch/ # ROS launch files
│ ├── run_sam_slam_real.launch
│ ├── pipeline_sim.launch
│ └── ...
├── scripts/ # Executable ROS nodes
│ ├── sam_listener_online_slam_node.py
│ ├── sam_listener_saver_node.py
│ └── ...
├── src/sam_slam_utils/ # Core Python modules
│ ├── sam_slam_mapping.py # Main mapping algorithms
│ ├── sam_slam_helpers.py # Utility functions
│ ├── sam_slam_proc_classes.py # Processing classes
│ └── sam_slam_ros_classes.py # ROS interface classes
├── processing scripts/ # Data analysis and visualization
│ ├── plot_*.py # Various plotting utilities
│ ├── process_*.py # Data processing scripts
│ └── data/ # Output data directory
├── testing scripts/ # Development and testing scripts
├── rviz/ # RViz configuration files
└── [data directories] # Raw data (should be excluded from repo)
roscpprospystd_msgscv_bridgegeometry_msgsnav_msgssensor_msgs
numpymatplotlibopencv-pythongtsam(Georgia Tech Smoothing and Mapping)scikit-imagemayavi(for 3D visualization)PIL(Pillow)
- ROS Melodic/Noetic
- Python 3.6+
- OpenCV 4.x
-
Clone the repository into your catkin workspace:
cd ~/catkin_ws/src git clone <repository-url> sss_farm_slam
-
Install Python dependencies:
pip install numpy matplotlib opencv-python scikit-image pillow pip install gtsam # or build from source for better performance -
Build the package:
cd ~/catkin_ws catkin_make source devel/setup.bash
To run SLAM with real sonar data:
roslaunch sam_slam run_sam_slam_real.launchThis launch file:
- Starts the SLAM node
- Plays back recorded ROS bag data
- Launches RViz for visualization
- Starts supporting nodes for GPS and detection
For testing with simulated data:
roslaunch sam_slam pipeline_sim.launchTo process and analyze data offline:
rosrun sam_slam sam_listener_saver_node.pyKey parameters can be configured in the launch files:
detect_update_time: Frequency of detection processing (Hz)da_distance_threshold: Distance threshold for data associationmanual_associations: Enable manual landmark associationsimulated_detections: Use simulated vs real detections
prior_ang_sig_deg: Prior angle uncertainty (degrees)prior_dist_sig: Prior position uncertainty (meters)odo_ang_sig_deg: Odometry angle noise (degrees)odo_dist_sig: Odometry distance noise (meters)detect_ang_sig_deg: Detection angle uncertainty (degrees)detect_dist_sig: Detection distance uncertainty (meters)
path_name: Directory for saving output dataverbose_*: Enable verbose output for different components
Main SLAM processing node that:
- Subscribes to odometry and detection topics
- Maintains factor graph using GTSAM
- Publishes estimated trajectory and landmarks
- Saves results to CSV files
Contains core algorithms for:
- Image registration and processing
- Sea-thru underwater image enhancement
- 3D point cloud processing
- Landmark detection and tracking
Defines data structures for:
- Pose management
- Detection handling
- Graph optimization
- Data association
Multiple scripts for analyzing and plotting results:
plot_ate_error_*.py: Absolute Trajectory Error analysisplot_online_*.py: Real-time performance metricsplot_pipeline_map.py: Map visualization
- Odometry:
nav_msgs/Odometrymessages - Detections: Custom detection messages with range/bearing
- Images:
sensor_msgs/Imagefor sonar data - Point Clouds:
sensor_msgs/PointCloud2for 3D data
- Trajectories: CSV files with pose estimates
- Landmarks: CSV files with landmark positions
- Performance Metrics: Analysis of accuracy and consistency
- Maps: Visualization images and 3D models
This work is part of a degree project focusing on underwater SLAM in structured environments like algae farms. The system addresses challenges specific to underwater robotics:
- Limited visibility: Using sonar instead of visual sensors
- Structured environments: Leveraging regular patterns in algae farms
- Data association: Robust matching of detections to landmarks
- Uncertainty quantification: Proper noise modeling for underwater sensors
Methods implemented are based on research presented at:
- ICRA 2024: Baseline methods and proposed improvements
- IROS: Multiple method comparisons and analysis
-
GTSAM Import Error:
- Ensure GTSAM is properly installed with Python bindings
- Try building GTSAM from source if pip installation fails
-
ROS Topic Issues:
- Check that all required topics are being published
- Verify topic names match between publishers and subscribers
-
Visualization Problems:
- Ensure RViz configuration file exists
- Check that all visualization messages are being published
-
Performance Issues:
- Reduce update frequencies in launch files
- Consider using optimized GTSAM build
- Monitor CPU/memory usage during operation
- Fork the repository
- Create a feature branch
- Make changes and test thoroughly
- Submit a pull request with clear description
This project is licensed under the BSD License - see the LICENSE file for details.
- Maintainer: Julian Valdez (jvaldez@kth.se)
- Institution: KTH Royal Institute of Technology
- Project: SSS Farm SLAM for Algae Farm Mapping
- Dr. John Folkesson - KTH Royal Institute of Technology (Supervisor)
- Dr. Ignacio Torroba - KTH Royal Institute of Technology (Advisor)
- Ocean Infinity - PhD student funding and industry partnership
- Georgia Tech for the GTSAM library
- ROS community for the robotics framework
