A real-time web dashboard using Python, Flask, Socket.io, OpenCV, and jQuery.
git clone https://github.com/ddelago/Simple-Rover-Dashboard.git
pip install -r requirements.txt
- Also pip install
opencv-python
andopencv-contrib-python
cd camera_server
- Make sure you have a
CameraCalibration.pckl
file. python webstreaming.py
- The camera server can now be viewed at http://localhost:6006.
- Ensure that a webcam is connected and that the correct camera is being sourced (line 20).
- Open up a new terminal
python server.py
- Navigate to http://localhost:1337 to view the dashboard.
- The map page is static and will be rendered using the saved map tiles.
- The tile data is located in
map_generation/map_server/tiles
. - The map icons are located in
map_generation/map_server/images
.
- To generate a new set of map tiles, first get a set of long/lat points that represents a bounding box. (2 pairs of points)
- Have Visual Studio installed.
- Open the
map_generation/GenerateTiles/GenerateTilesProject.sln
file in Visual Studio. - Update the coordinates you would like in the
Main
function ofGenerateTiles.cs
as well as the zoom levels you want. - Run the project in Visual Studio. This will create a folder called
tile-urls
with the urls that will be used to fetch map tiles from the osm server. - Run the
request_tiles.py
program from theGenerateTiles
directory. - This will fetch the map tiles using the urls and create the appropriate map tile folder structure in
map_generation/mapServer/tiles
- This process may take a very long time depending on your coordinates and the zoom levels that you requested.
- Once all tiles have been downloaded. You can open the
index.html
file in a browser and view your offline map!- You can also embed this static website into other websites such as a dashboard.
- To customize the usage of your map, such as feeding it coordinates to track, you can use the leaflet library included in
mapServer
to do so.
You first need to connect to the rover server in order to send commands.
- Enter the rover IP addess and port on the main dashboard and press submit.
- Check the server terminal to ensure there were no errors.
- Test the connection by pressing the
Activate LED
command button a few times.
Controller input using an Xbox 360 USB controller
Axis
- 0: Left stick horizontal
- 1: Left stick vertical
- 2: Left trigger (positive) and Right trigger (negative)
- 3: Right stick vertical
- 4: Right stick horizontal
Buttons:
- 0: A
- 1: B
- 2: X
- 3: Y
- 4: Left bumper
- 5: Right bumper
- 6: Back
- 7: Start
- 8: Left stick press
- 9: Right stick press
Hat (d-pad):
- Left press: (-1, 0)
- Right press: (1, 0)
- Down press: (0, -1)
- Up press: (0, 1)