Skip to content

Latest commit

 

History

History
180 lines (124 loc) · 4.54 KB

File metadata and controls

180 lines (124 loc) · 4.54 KB

SETUP — GUI-ROV Trial

Panduan copy-paste untuk setup cepat tiap trial. Baca dari atas ke bawah sesuai mode yang dipakai.


Prasyarat

  • Node.js ≥ 18 (server.js)
  • Python 3 (rov_agent.py di RPI)
  • Ethernet laptop ↔ RPI dalam satu subnet (contoh: laptop 192.168.2.1, RPI 192.168.2.2)

Dependency Python

pip install -r requirements.txt          # rov_agent.py + unit test di root
pip install -r autonomy/requirements.txt # opsional: stack autonomy/visi

Konfigurasi environment

Semua port, alamat, dan port serial punya default yang sudah benar untuk topologi tether standar. Kalau perlu mengubahnya, salin contohnya:

cp .env.example .env

.env tidak di-commit. Cara memuatnya:

# Laptop — start-gui.sh memuatnya otomatis kalau ada.
./start-gui.sh sim

# Manual, shell POSIX:
set -a; . ./.env; set +a

# RPI — lewat systemd:
#   [Service]
#   EnvironmentFile=/home/hydroships/GUI-ROV/.env

1. Sisi RPI (ROV)

# SSH ke RPI
ssh hydroships@192.168.2.2
# password: (spasi 1 kali)

# Pastikan rov-agent aktif
sudo systemctl start rov-agent
sudo systemctl status rov-agent

# Kalau ada perubahan di rov_agent.py, reload:
sudo systemctl restart rov-agent

# Lihat log real-time:
journalctl -u rov-agent -f

Jika status menunjukkan active (running), RPI siap.


2. Sisi Laptop (Server Node.js)

# Masuk ke repo
cd /home/rasya/GUI-ROV

# LIVE (default) — butuh RPI nyala & terhubung
./start-gui.sh

# ATAU simulasi — tanpa RPI
./start-gui.sh sim

Buka browser ke http://localhost:8080. Dashboard harus muncul.


3. Uji Koneksi UDP (Laptop → RPI) — LIVE mode saja

# Kirim test command ke RPI port 14550
echo '{"name":"light","value":true,"t":'$(date +%s)'}' | nc -u -w1 192.168.2.2 14550

Di RPI (journalctl -u rov-agent -f), harus muncul log command masuk.


4. Trial (Full End-to-End) — LIVE mode

# Terminal 1 — Start server (script otomatis cek dependency + buka browser)
cd /home/rasya/GUI-ROV
./start-gui.sh

# Terminal 2 — Cek log RPI via SSH (opsional)
ssh hydroships@192.168.2.2
journalctl -u rov-agent -f

Checklist Trial

  • Dashboard menunjukkan status ONLINE (link pill hijau)
  • Klik ARM di header → ROV armed
  • Gerakkan sumbu keyboard (W/S, A/D, Q/E, R/F) → ROV bergerak
  • Tekan STOP atau Spasi → failsafe, semua thruster netral

5. Simulasi (Tanpa Hardware)

cd /home/rasya/GUI-ROV
./start-gui.sh sim

Buka http://localhost:8080 — ROV 3D bergerak mengikuti telemetri palsu. Tidak ada UDP nyata ke RPI.

Pakai mode ini untuk semua sesi coding. Kalau laptop Anda tidak sesubnet dengan RPI (mis. laptop di 192.168.67.x sedangkan RPI di 192.168.2.2), mode LIVE hanya akan menghasilkan log "gagal kirim command" — bukan bug.

Yang bisa diuji di mode sim tanpa hardware sama sekali:

  • Tab Manual / Stabilize / Depth Hold / Acro — server SIM sekarang menerima pilot_mode dan memantulkannya sebagai field mode pada telemetri, persis seperti HEARTBEAT dari Pixhawk. Jadi sorotan tab, badge mode aktual, dialog konfirmasi ACRO, dan badge peringatan ACRO semuanya berperilaku nyata.
  • Arm/disarm, lampu, E-Stop, rekaman, halaman replay.

Yang tidak bisa diuji di sini: apa pun yang butuh MAVLink sungguhan (mode ditolak firmware, respons thruster). Untuk itu pakai mock MAVLink:

python autonomy/sitl_mock.py --mavlink udpout:127.0.0.1:14555
python autonomy/rov_link.py --server 127.0.0.1 --mavlink udpin:0.0.0.0:14555

Detailnya di autonomy/SITL_SETUP.md.


6. Troubleshooting

Gejala Solusi
Dashboard OFFLINE Cek kabel Ethernet, pastikan laptop & RPI di subnet yang sama (ip a di kedua sisi)
RPI active (failed) Cek log: journalctl -u rov-agent -e — biasanya konfigurasi atau library Python yang error
Port 14550 bentrok Pastikan hanya satu rov_agent.py yang berjalan (sudo systemctl restart rov-agent)
Thruster tidak respons Cek nilai x, y, r di dashboard — harus ada saat joystick digerakkan
Server crash EADDRINUSE Port 8080 dipakai proses lain — kill: lsof -ti:8080 | xargs kill -9

7. Urutan Cepat (Copy-Paste)

LIVE (dengan RPI)

# RPI (via SSH)
ssh hydroships@192.168.2.2
sudo systemctl restart rov-agent

# Laptop
cd /home/rasya/GUI-ROV && ./start-gui.sh
# Browser otomatis buka http://localhost:8080

SIM (tanpa RPI)

cd /home/rasya/GUI-ROV && ./start-gui.sh sim
# Browser otomatis buka http://localhost:8080