You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+65-35Lines changed: 65 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,53 @@
1
-
# Purpose
2
-
The purpose of RoverGUI is to provide a live camera view to anyone operating the rover via a web browser! While RoverGUI is meant to be used by anyone, it is important to keep in mind that non-autonomous members will likely
3
-
be using the GUI as a live camera view like this would not be allowed for Autonomous operation during URC.
1
+
# RoverGUI
4
2
5
-
# Dependencies
6
-
The following dependencies are under the assertion that both the frontend and backend are running on an **x86-64 linux operation system**. Each bullet is a link to the corresponding dependency's download/install page.
3
+
RoverGUI provides a live camera view to anyone operating the rover via a web browser! Non-Autonomous members will likely be using the GUI, so it's easy to use.
First, open two `ssh` windows to the Rover. Run both the backend and frontend, starting **with the backend first**:
8
+
9
+
In window 1:
10
+
11
+
```console
12
+
~ $ cd RoverGUI/backend
13
+
~/RoverGUI/backend $ cargo run
14
+
```
15
+
16
+
In window 2:
17
+
18
+
```console
19
+
~ $ cd RoverGUI/react-app
20
+
~/RoverGUI/backend $ npm run start --host
21
+
```
22
+
23
+
From your laptop, **open the GUI in a web browser with its URL**: (i.e., open this link in Firefox/Chrome: [http://192.168.1.68:3000](http://192.168.1.68:3000), where `192.168.1.68` is the Rover's IP address, and ). You should then be presented with a page with a dropdown list of available cameras. Select a camera -- then, a live stream should be visible!
24
+
25
+
## Dependencies
26
+
27
+
The following dependencies are under the assertion that both the frontend and backend are running on an **x86-64 Linux operating system**. Each bullet is a link to the corresponding dependency's download/install page.
> It is recommended to install NodeJS using the **nvm** package manager on linux. This simplifies the process of both installing and upgrading NodeJS versions. This also automatically installs NPM for you! The NodeJS download page should provide instructions given that **Linux**, **nvm**, and **npm** are selected.
14
36
15
-
## Backend Dependencies
16
-
*[Rust](https://rust-lang.org/tools/install/)
17
-
* Video4Linux (v4l)
37
+
### Backend
38
+
39
+
-[Rust](https://rust-lang.org/tools/install/)
40
+
- Video4Linux (v4l)
18
41
19
42
> [!IMPORTANT]
20
-
> Video4Linux is a kernel-level driver dependency. Usually it is included with almost all linux distros. If it isn't, please consult your distro's documentation!
43
+
> Video4Linux is a kernel-level driver dependency. It is usually included with most Linux distros. If it isn't, please consult your distro's documentation for installation instructions!
44
+
45
+
## Instructions
46
+
47
+
### Frontend
48
+
49
+
#### Installing Frontend's Package Dependencies
21
50
22
-
# Frontend (`/react-app`)
23
-
## Installing Frontend's Package Dependencies
24
51
Before running the frontend, you will need to install the package's dependencies using your favorite terminal!
25
52
26
53
```bash
@@ -54,25 +81,18 @@ npm notice
54
81
# Done!
55
82
```
56
83
57
-
## Running the frontend
84
+
#### Running the frontend
85
+
58
86
```bash
59
87
# To start the frontend, simply run the following command in the frontend's folder.
60
-
npm run start
88
+
npm run start --host
61
89
62
90
# Your output should look like this:
63
-
Compiled successfully!
64
-
65
-
You can now view react-app in the browser.
66
-
67
-
Local: http://localhost:3000
68
-
On Your Network: http://192.168.2.62:3000
91
+
VITE v7.3.1 ready in 96 ms
69
92
70
-
Note that the development build is not optimized.
71
-
To create a production build, use npm run build.
72
-
73
-
webpack compiled successfully
74
-
75
-
# Done!
93
+
➜ Local: http://localhost:5173/
94
+
➜ Network: http://192.168.1.68:5173/
95
+
➜ press h + enter to show help
76
96
```
77
97
78
98
The URLs that are outputted by this command (i.e. http://localhost:3000) are the same URLs that you use to see the GUI from your web browser. You may hold ctrl and then click on the links to view them or simply copy & paste them into your browser.
@@ -88,11 +108,14 @@ The URLs that are outputted by this command (i.e. http://localhost:3000) are the
88
108
Would you like to run the app on another port instead? › (Y/n)
89
109
```
90
110
91
-
## Stopping the frontend
92
-
In the same terminal in which you are running the frontend, simply do `Ctrl+C` to send a SIGINT signal to interrupt the frontend (this stops it)!
111
+
#### Stopping the frontend
112
+
113
+
In the same terminal in which you are running the frontend, press `Ctrl+C` to send a SIGINT signal to interrupt the frontend (this stops it)!
114
+
115
+
### Backend (`/backend`)
116
+
117
+
#### Building the backend crate and its Cargo dependencies
93
118
94
-
# Backend (`/backend`)
95
-
## Building the backend crate and its Cargo dependencies
96
119
Before running the backend, you will need to build the frontend along with all of its dependencies.
97
120
98
121
```bash
@@ -135,6 +158,7 @@ cargo build
135
158
```
136
159
137
160
## Running the backend
161
+
138
162
```bash
139
163
# Simply run:
140
164
cargo run
@@ -176,8 +200,14 @@ arget(s) in 0.24s
176
200
177
201
The output of this command tells important information about the backend like its address, port, and its available routes. In this case, the frontend would need to access the backend from the URL `http://127.0.0.1:3600`.
178
202
179
-
## Stopping the backend
203
+
### Stopping the backend
204
+
180
205
In the same terminal in which you are running the backend, simply do `Ctrl+C` to send a SIGINT signal to interrupt the backend (this stops it)!
181
206
182
-
# Using RoverGUI
183
-
Simply open the GUI in a web browser with its URL (i.e. http://localhost:3000). You should then be presented with a page that has a dropdown for the different camera paths that are available on the system. Simply select a path and then the corresponding live camera stream should be visible!
207
+
### The "fake" backend
208
+
209
+
There's a `fake_backend` binary you can use to test the frontend on a non-Linux computer (i.e., macOS or Windows). To use it, just type: `NUM_CAMERAS=1 cargo run --bin fake_backend $NUM_CAMERAS`. You can set `NUM_CAMERAS` to any value you'd like.
210
+
211
+
Then, open up the frontend as described above. It'll connect successfully!
212
+
213
+
You can press `Ctrl+C` to stop the fake backend from running.
0 commit comments