Project files
readme.md
Machine-translated by Robotheca from the original in Chinese (opens in a new tab). License: MIT (opens in a new tab) and GPL-3.0-only (opens in a new tab).
Environment Setup
-
Required third-party libraries: pyserial, pygame, opencv
-
It is recommended to manage the virtual environment with Anaconda:
2.1 Open Anaconda Prompt
2.2 Create a new virtual environment (Python 3.10):
conda create -n FinsROV python=3.102.3 Activate the environment:
conda activate FinsROV2.4 Install the required libraries:
pip install pyserial pygame pip install opencv-python
Hardware Connection
-
Connect the USB plug of the ROV tether cable to the computer.
-
Ensure the joystick is connected to the computer (wired / wireless dongle / bluetooth). You may verify detection via: Win + R β type
joy.cplβ check whether the controller appears in the list. -
Ensure the ROV is connected to the power supply.
Code Configuration
-
Before running the program, update the serial communication port in the code to match the COM port assigned to the tetherβs USB interface (check via Device Manager β Ports (COM & LPT), e.g., COM11). After confirming the COM port, locate the following line in the code:
serial.open("COM28") # replace with the actual COM port on your deviceFor example, if the detected port is COM11, modify it as follows:
serial.open("COM11") -
Run the
usbCameraFullControlfile. The control mapping is as follows:Start: enable/disable hover control
D-pad: planar motion (forward/backward/left/right)
X / Y: planar rotation direction
A / B: ascend / descend
Note: the speed is currently hard-coded.
Note
- If the propellers whine or make obvious abnormal noises on startup, stop the robot immediately (set to OFF) and restart it (set to ON). Power off is generally unnecessary. Repeat the above steps until the propellers operate with normal noises.
- If the robot fails to respond to button presses, power it off and restart it directly.
- When controlling via the joystick, ensure that any serial debugging tool is closed to prevent the UART port from being occupied, which may cause joystick control to fail.
Files by @IWIN-FINS, at commit 1bc38e8, read from GitHub in your browser. Hardware license: MIT; software license: GPL-3.0-only. Robotheca doesn't review code: read it before running it.