This project contains the software to control a Remotely Operated Underwater Vehicle (ROV). It consists of two main components: a base station control program and a program that runs on the ROV's Raspberry Pi.
-
Base Station (
base_station/):- Runs on a laptop or desktop computer.
- Takes input from a keyboard or game controller (Xbox, PS).
- Calculates the necessary thruster forces for 6-DOF movement (surge, sway, heave, roll, pitch, yaw).
- Sends control commands to the ROV over the network (UDP).
- Receives and displays telemetry data and video from the ROV.
-
ROV/Pi (
pi/):- Runs on a Raspberry Pi mounted on the ROV.
- Receives control commands from the base station.
- Controls 8 thrusters via PWM signals using the
pigpiolibrary. - Reads data from an IMU (for roll, pitch, yaw) and a pressure sensor (for depth).
- Streams video from a RealSense camera and a standard Pi camera back to the base station.
- Input: The
base_stationcaptures user input for desired movement. - Control:
- Optional PID controllers can be enabled to automatically maintain a target depth, roll, pitch, or yaw.
- A Kalman filter is available to smooth the depth measurement.
- Kinematics: The desired movements are translated into individual forces required for each of the 8 thrusters.
- Communication:
- The base station sends thruster PWM commands to the Pi.
- The Pi sends sensor telemetry (IMU, pressure, temperature) back to the base station.
- The Pi streams video from its cameras to the base station.
-
On the ROV's Raspberry Pi:
- Ensure
pigpiodservice is running (sudo pigpiod). - Run the main Pi script:
python3 pi/main.py.
- Ensure
-
On the Base Station Computer:
- Run the main base station script:
python3 base_station/main.py.
- Run the main base station script:
- Network: IP addresses for the Pi and base station are set in
pi/main.pyandbase_station/config.py. - Controller: The input device (Keyboard, Xbox, PS) can be selected in
base_station/config.py. - Tuning: PID gains, sensor offsets, and thruster inversion/enable flags are located in
base_station/config.py. - Hardware Pins: GPIO pin assignments for the thrusters are defined in
pi/main.py.