A modern, real-time telemetry dashboard for Unmanned Surface Vehicles (USV) built with Flask and WebSocket technology.
- Live position tracking with interactive map
- Real-time sensor data monitoring
- Battery, temperature, speed, and heading indicators
- Mission status and control mode display
- Responsive design for mobile and desktop
- Clean, intuitive user interface
- Real-time charts and data visualization
- Live camera feed from USV
- Live video streaming from USV camera
- Simulated camera feed for development
- Real-time frame transmission via WebSocket
- OpenStreetMap integration with Leaflet.js
- Real-time USV position tracking
- Path history visualization
- Custom USV marker with heading indicator
- Backend: Flask, Flask-SocketIO
- Frontend: Bootstrap 5, Chart.js, Leaflet.js
- Real-time Communication: WebSocket via Socket.IO
- Camera Processing: OpenCV, Base64 encoding
- Styling: Custom CSS with modern design principles
- Clone the repository:
git clone <repository-url>
cd usv- Create and activate virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\\Scripts\\activate- Install dependencies:
pip install -r requirements.txt- Start the application:
python run.py- Open your browser and navigate to:
http://localhost:5001
- The dashboard will display:
- Real-time USV telemetry data
- Interactive map with position tracking
- Live camera feed (simulated if no camera available)
- Sensor readings and mission status
GET /- Main dashboardGET /health- Health checkGET /api/usv/current- Current USV dataGET /api/usv/history- Historical dataGET /api/usv/path- Path coordinatesPOST /telemetry/data- Receive telemetry dataGET /telemetry/status- Telemetry service status
telemetry_update- Real-time telemetry dataposition_update- Position and heading updatescamera_frame- Live camera framesrequest_camera_stream- Start camera streamingstop_camera_stream- Stop camera streaming
usv/
├── app/
│ ├── __init__.py # Flask application factory
│ ├── controllers/ # Route handlers
│ │ ├── main_controller.py # Main dashboard routes
│ │ ├── telemetry_controller.py # Telemetry endpoints
│ │ └── api_controller.py # REST API endpoints
│ ├── models/ # Data models
│ │ └── usv_data.py # USV data structures
│ ├── services/ # Business logic
│ │ ├── telemetry_service.py # Telemetry processing
│ │ └── camera_service.py # Camera handling
│ ├── static/ # Static assets
│ │ ├── css/
│ │ ├── js/
│ │ └── images/
│ ├── templates/ # HTML templates
│ │ ├── base.html
│ │ └── dashboard.html
│ └── utils/ # Utility functions
├── config/ # Configuration files
├── logs/ # Application logs
├── tests/ # Test files
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore rules
└── run.py # Application entry point
The application uses environment variables for configuration:
FLASK_ENV- Environment (development/production)SECRET_KEY- Flask secret keyCAMERA_INDEX- Camera device index (default: 0)
This project follows clean architecture principles:
- KISS: Simple, focused components
- DRY: Reusable code modules
- SOLID: Proper separation of concerns
- Modular: Independent, testable components
- Responsive: Mobile-first design approach
- Controllers: Handle HTTP requests and responses
- Services: Business logic and data processing
- Models: Data structures and validation
- Templates: Presentation layer with Jinja2
- Static Assets: CSS, JavaScript, and images
Run tests with:
python -m pytest tests/- Follow the existing code style
- Write tests for new features
- Update documentation
- Ensure responsive design compatibility
This project is licensed under the MIT License.
For issues and questions, please create an issue in the project repository.
