How fiu-mora-lab/searobotics_surveyor works
Project Type and Purpose
• This is a distributed, hardware‐centric Python library (“surveyor_lib”) that wraps client/server communications to operate an Autonomous Surface Vehicle (ASV) and its sensors (YSI EXO2 multiparameter sonde, LIDAR, camera).
• It is neither a traditional frontend/backend web app nor a compiler; it’s an open‐source robotics tool that abstracts sensor I/O behind networked servers and Python clients, and provides utility helpers for logging, message formatting, and data persistence.
Main Components
• Physical Hardware Nodes
• Surveyor ASV with onboard Raspberry Pi running camera_server.py & lidar_server.py
• External DAC (Windows PC) running exo2_server.py (Flask or raw socket)
• Sensors: EXO2 Sonde, LIDAR device, IP/USB camera
• Network Fabric
• Local Ethernet/Wi-Fi network interconnecting Pi, DAC, and control laptop
• Static IP assignments (e.g. Pi at 192.168.0.20, DAC at 192.168.0.68)
• Servers (surveyor_lib/servers)
• camera_server.py (streams image frames)
• lidar_server.py (streams scan data via rplidar .so bindings)
• exo2_flask_server.py / exo2_server.py (exposes Sonde data over HTTP or raw socket)
• Clients (surveyor_lib/clients)
• BaseClient: generic socket/HTTP connector
• CameraClient, LidarClient, Exo2Client: specialized parsers for each sensor stream
• Orchestration Layer
• Surveyor class (surveyor_lib/surveyor.py) initializes and manages sensor clients, provides unified API to application code
• Helper Utilities (surveyor_lib/helpers)
• hdf5_logger.py: logs timestamped sensor data to HDF5
• logger.py: configurable console/file logger
• read_save_helper.py: I/O utilities
• surveyor_messages_helper.py & waypoint_helper.py: message formatting and waypoint management
• External Application
• Your_application.py: imports Surveyor, kicks off sensor servers, processes data, issues waypoints
• Tests
• Unit tests under tests/ verifying clients, helpers, and Surveyor functionality
Relationships and Data Flow
• Sensor hardware → Server process on respective node (Pi or DAC)
• Server binds to IP:port → streams raw/binary data
• Client in Surveyor library connects over TCP/HTTP → receives, decodes, and buffers data
• Surveyor class polls or subscribes to client data → feeds to application logic
• Helpers log or persist data locally (HDF5, text logs)
• Application can command waypoints or camera snapshots via Surveyor API
Architectural Patterns & Design Principles
• Client–Server: loose coupling of sensor I/O (servers) from data consumption (clients) via network abstractions
• Modular Separation: each sensor has its own server/client pair; helpers are pluggable
• Single Responsibility: Surveyor orchestrates only clients; helpers manage logging, formatting, persistence
• Extensibility: to add a new sensor, create new server module + client subclass + docs
Key Technologies, Frameworks & Libraries
• Python 3.11, pyproject.toml for project metadata
• Flask (in exo2_flask_server) for HTTP-based sensor streaming
• Raw TCP sockets (base_client) for high‐throughput data
• rplidar C-extension modules (.so) for LIDAR on Raspberry Pi
• h5py for HDF5 logging
• pytest for automated testing
• isort/black/flake8 for code quality