HKUST, Mechanical Engineering, Final year design project
Opensource ROV with Interchangable Modules.
Jun Hur - junjustinhur
Richard Lauwrence - rlauwrence
Alvin Chan - anfchan
Gaurav Vijai Jeandani
Refer to assembly instructions and bill of materials provided in Hardware folder
1. python 2 IDE
2. VNC viewer
3. IP scanner
4. Arduino IDE
Communication between Arduino controllers are mediated by Ethernet connection between two computers (Raspberry Pi and a Window machine). Protocol used for Ethernet connection is TCP/IP, and Python scripts are used on both machines/computers in order to establish socket connection that relays information from Arduino controllers.
------------------ ------------------- ---------------- ----------------------- --------------
| Remote Control | -----> | Windows Machine | <----> | Raspberry Pi | -----> | On-board Controller | <----> | Components |
------------------ ------------------- ---------------- ----------------------- --------------
Arduinos are controllers of choice in this project - they are used as transmitter (in the form a remote control on-shore) and receiver (controller used on-board of the ROV). trasmitter.ino is uploaded in the oh-shore controller and receiver.ino is uploaded in the on-board controller. The arduino file and the required libraries are put in the same directory -- by default, I've put them in /home/document/FYP/arduino/transmitter folder and /home/pi/fydprov2019/reciever folder.
Raspberry Pi is used as buffer for data from on-board Arduino controller and also camera (in the future), which selected data will then be relayed to the Windows machine through Ethernet to be viewed by the user. There are several things that need to be setup first on Raspberry Pi for socket communication between RasPi and Windows to work properly
-
Put launcher.sh and Python script in same directory -- by default, I've put it in /home/pi/fydprov2019 folder
-
Enter in terminal while in /home:
sudo +x <directory>/launcher.sh sudo +x <directory>/enableStaticIP.sh sudo +x <directory>/disableStaticIP.sh sudo mkdir logs
-
Setup the static IP
- enter in terminal
sudo nano /etc/network/interfaces
- enter the following at the bottom of the file to setup the static IP:
auto eth0 iface eth0 inet static address 169.254.32.218 netmask 255.255.255.0 gateway 169.254.32.1
- save and exit (ctrl+x, y, enter)
- enter in terminal:
sudo systemctl disable dhcpcd sudo systemctl enable networking
- enter in terminal
Note that only after doing step no.2 that enableStaticIP.sh and disableStaticIP.sh can be used, though make sure that only use enableStaticIP.sh when static IP is disabled, and disableStaticIP.sh otherwise. Turn off static IP if you wish to access (shared) internet via Ethernet
-
Setup the bootup script
- open crontab; enter this into the terminal:
sudo crontab -e
- if this is the first time you open crontab, you should be prompted with which text editor you want crontab to be opened with
- Add the following lines on the bottom, this will initialize pigpiod and run the launcher.sh (hence the Python script):
@reboot sudo pigpiod @reboot sh <directory>/launcher.sh > /home/pi/logs/cronlog 2>&1
- save and exit (ctrl+x, y, enter)
- open crontab; enter this into the terminal:
-
Make sure before reboot, launcher.sh and the Python script is correct
- Boot the RaspberryPi.
- Open 'sendSerial.py' on a Python IDE and run.
- Open terminal and launch 'readSerial.py'
ssh pi@169.254.32.218
vncserver :1 (if you want to access desktop via VNC)
cd fydprov2019 (or wtv the folder is)
python readserial.py
Push Joystic up, down, right, and left to surge and sway.
Push upper and lower button to heave.
Tilte and rotate the controller to control attitude.