A full-stack application for optimizing and visualizing drone flight paths for power grid inspection. Built for NextEra Energy to efficiently plan multi-mission drone routes covering photo waypoints and asset inspections.
GridWatch consists of two main components:
- Backend: Python-based route optimizer using Google OR-Tools
- Frontend: React-based interactive visualization dashboard
The system optimizes flight paths across 11 drone missions, covering approximately 2,817 waypoints and over 300k+ feet while respecting battery constraints and flight boundaries.
- Python 3.11 or higher
- pip package manager
- Node.js 16.x or higher
- npm 8.x or higher
- Git (for version control)
git clone <repository-url>
cd GridEyeOr extract the project folder if downloaded as a ZIP file.
cd backend\drone-optimizerpython -m venv .venv.\.venv\Scripts\Activate.ps1Note: If you encounter an execution policy error, run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserpip install -r requirements.txtpython terminal.pyThis will process the waypoint data and generate optimized mission paths in the output/ directory.
Open a new terminal window and run:
cd frontendnpm installThe .env file should already be configured with:
REACT_APP_MAPBOX_TOKEN=<your-mapbox-token>
REACT_APP_API_URL=http://localhost:5000
If you need to update the Mapbox token, edit the .env file in the frontend directory.
You will need to run both the backend and frontend servers simultaneously.
cd backend
python server.pyThe Flask API server will start on http://localhost:5000
cd frontend
npm startThe React application will start on http://localhost:3000 and should automatically open in your browser.
GridEye/
├── backend/
│ ├── server.py # Flask API server
│ └── drone-optimizer/
│ ├── terminal.py # Route optimization script
│ ├── requirements.txt # Python dependencies
│ ├── *.npy # Pre-calculated data matrices
│ ├── polygon_lon_lat.wkt # Flight boundary definition
│ └── output/ # Generated JSON files
│ ├── mission_paths.json
│ ├── asset_points.json
│ ├── photo_points.json
│ └── polygon_boundary.json
│
└── frontend/
├── package.json # Node dependencies
├── .env # Environment configuration
├── public/
│ └── index.html
└── src/
├── Visualization.js # Main application component
├── components/ # React components
├── services/
│ └── api.js # API communication
└── utils/ # Helper functions
- Google OR-Tools based route optimization
- Multi-mission planning with battery constraints
- Asset and photo waypoint coverage
- JSON API endpoints for mission data
- Interactive Mapbox-based mission visualization
- Real-time mission path animation
- Battery usage monitoring per mission
- Mission filtering and selection controls
- Detailed mission statistics and tables
- Distance distribution charts
- Export functionality
The backend server provides the following endpoints:
GET /- API status and available endpointsGET /mission-paths- Optimized mission routesGET /asset-points- Asset inspection locationsGET /photo-points- Photo waypoint locationsGET /polygon-boundary- Flight zone boundaryGET /mission-data- Combined data endpoint
- View Mission Routes: The map displays all 11 optimized mission paths with color-coded routes
- Filter Missions: Toggle individual missions on/off using the mission buttons
- Animate Routes: Select a mission from the dropdown and click "Animate" to visualize the flight path
- View Waypoints: Enable "Show All Waypoints" to see asset poles and photo points
- Monitor Battery: Check the battery usage section for per-mission battery consumption
- Analyze Data: Review mission details table and distance distribution chart
Virtual environment activation fails
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserPackage installation fails
- Ensure Python 3.11+ is installed:
python --version - Upgrade pip:
python -m pip install --upgrade pip
Missing data files
- Ensure all
.npyand.wktfiles are present inbackend/drone-optimizer/ - Re-run
python terminal.pyto regenerate output files
npm start fails
- Clear node_modules:
Remove-Item -Recurse -Force node_modules - Reinstall:
npm install
Map not displaying
- Verify Mapbox token in
.envfile - Check browser console for errors
API connection errors
- Ensure backend server is running on port 5000
- Verify
REACT_APP_API_URLin.envmatches backend URL
- Modify
terminal.pyfor optimization algorithm changes - Update
server.pyto add new API endpoints - Data files in
drone-optimizer/output/are generated by the optimizer
- Components are in
src/components/ - API calls are centralized in
src/services/api.js - Map visualization logic is in
src/utils/mapDataGen.js - Tailwind CSS is used for styling
- The application caches mission data to minimize API calls
- Map rendering uses WebGL for efficient visualization
- Animations use requestAnimationFrame for smooth playback
- Mission filtering is memoized to prevent unnecessary re-renders
This project tackles the NextEra Energy Drone Challenge