A modular system for guiding a Blueye underwater drone to an autonomous docking station using USBL (Ultra Short Baseline) positioning data with the Blueye SDK.
This system enables a Blueye underwater drone to navigate to a docking station at a specific depth by:
- Reading relative position data from a USBL system
- Converting relative coordinates to absolute GPS coordinates
- Creating a multi-stage mission plan
- Executing the mission safely with proper monitoring and logging
blueye-docking-system/
├── src/ # Source code
│ ├── config.py # Configuration parameters
│ ├── drone.py # Drone connection and control
│ ├── mission.py # Mission building and execution
│ ├── navigation.py # Navigation strategies
│ ├── utils.py # Utility functions
│ ├── gui.py # Graphical user interface
│ ├── dvl_visualizer.py # 3D DVL data visualization
│ ├── dvl_2d_visualizer.py # 2D DVL data visualization
│ ├── usbl_data.py # Mock USBL server for testing
│ └── main.py # Application entry point
├── mission_logs/ # Mission log storage
├── tests/ # Unit and integration tests
├── docs/ # Documentation
│ ├── images/ # Diagrams and screenshots
│ └── api/ # API documentation
├── LICENSE # License file
└── README.md # This file
- config.py: Central configuration parameters for the entire system
- utils.py: Utility functions for logging, coordinate conversion, and USBL data handling
- navigation.py: Navigation strategy implementations (three-stage and direct approaches)
- mission.py: Mission building, execution, and telemetry logging
- drone.py: Drone connection management and mission execution
- gui.py: Graphical user interface for system control and visualization
- dvl_visualizer.py: 3D visualization of DVL (Doppler Velocity Log) position data
- dvl_2d_visualizer.py: 2D visualization of DVL position data
- usbl_data.py: Mock USBL server for testing without physical hardware
- main.py: Main application entry point with command-line interface
-
Three-Stage Navigation:
- Navigate to a point directly above the docking station
- Descend to the target depth
- Move horizontally to the exact docking position
-
Direct Navigation: Alternative strategy for a more direct approach (when position is well-known)
-
USBL Integration: Reads and averages position data from USBL system
-
Coordinate Conversion: Transforms relative USBL coordinates to absolute GPS coordinates
-
Comprehensive Logging: Detailed mission logs with telemetry data
-
Configurable Parameters: Easily adjustable settings for speeds, depths, etc.
-
GUI Interface: User-friendly interface for mission control and visualization
-
Position Visualization: Real-time display of drone position using DVL data
- Python 3.6+
- Blueye SDK (
blueye.sdk
) - NumPy
- PyQt5 for GUI
- Matplotlib for 2D visualization
- PyQtGraph and OpenGL for 3D visualization
- OpenCV (optional, for camera integration)
-
Clone the repository:
git clone https://github.com/yourusername/blueye-docking-system.git cd blueye-docking-system
-
Install the required packages:
pip install -r requirements.txt
-
Install the Blueye SDK according to the official instructions.
Basic usage with default parameters:
python src/main.py
With custom parameters:
python src/main.py --docking-depth 80.0 --approach-speed 0.25 --drone-ip 192.168.1.101
--drone-ip
: IP address of the Blueye drone (default: 192.168.1.101)--drone-timeout
: Connection timeout in seconds (default: 30)
--usbl-ip
: IP address of the USBL system (default: 192.168.1.189)--usbl-port
: Port number of the USBL system (default: 9200)--usbl-samples
: Number of USBL samples to average (default: 5)--no-usbl
: Skip USBL reading and use docking station coordinates directly
--docking-lat
: Docking station latitude (default: 66.442387)--docking-lon
: Docking station longitude (default: 10.369335)--docking-depth
: Docking station depth in meters (default: 80.0)
--timeout
: Maximum mission duration in seconds (default: 1800)--approach-speed
: Horizontal movement speed in m/s (default: 0.3)--descent-speed
: Vertical movement speed in m/s (default: 0.2)--direct-approach
: Use direct approach instead of three-stage approach
To launch the GUI:
python src/gui.py
The GUI provides:
- Configuration panels for all mission parameters
- USBL connection testing
- Position calculation testing
- Mission execution and monitoring
- Real-time telemetry display
- DVL position visualization
- Camera feed (if available)
The system converts USBL relative coordinates (x, y) to absolute GPS coordinates (latitude, longitude) using the following process:
- Calculate distance from origin:
distance = √(x² + y²)
- Calculate bearing angle:
bearing = atan2(x, y)
- Apply haversine formula to calculate new coordinates given the docking station position, distance, and bearing
The default strategy approaches the docking station in three stages:
- Horizontal Approach: Navigate to a point directly above the docking station at a safe depth
- Vertical Descent: Descend to the docking station depth
- Final Approach: Move horizontally to the exact docking station coordinates
An alternative strategy that takes a more direct path to the docking station:
- Simultaneously sets target depth and position
- More efficient for shorter distances
- Enable with the
--direct-approach
flag
Mission logs are saved to the mission_logs/
directory in JSON format, with detailed telemetry and status information. Each log includes:
- Mission start and end timestamps
- Drone position and telemetry data
- Mission status at each log point
- Success/failure information
- Create a new class in
navigation.py
that extendsNavigationStrategy
- Implement the
create_mission()
method - Add the new strategy option to
main.py
The GUI is built with PyQt5 and can be customized by modifying gui.py
.
- Ensure the drone is powered on and connected to the network
- Verify the IP address is correct (default: 192.168.1.101)
- Check that the USBL system is operational and connected
- Verify the USBL system connection settings
- Ensure the transceiver and transducer are functioning properly
- Try increasing the number of samples with
--usbl-samples
- Check the mission logs for detailed error information
- Verify the drone has sufficient battery power
- Ensure the docking station coordinates are accurate