Skip to content

Commit c293b3e

Browse files
authored
Implement WebRTC (#114)
* [WIP] Robot streaming works * Finalized WebRTC implementation * Added playwright * Got it working on lovelace and with Amal's phone * Update README * Re-add PORT given the .env variable must be REACT_APP_PORT * Removed unnecessary logging
1 parent ec73b0e commit c293b3e

19 files changed

+897
-122
lines changed

feedingwebapp/.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# from screens that would otherwise wait for ROS messages).
33
REACT_APP_DEBUG=false
44

5+
# The port to launch the app on
6+
REACT_APP_PORT=3000
7+
# The port for the WebRTC signalling server
8+
REACT_APP_SIGNALLING_SERVER_PORT=5000
59
# The port of the rosbridge server (default: 9090)
610
REACT_APP_ROSBRIDGE_PORT="9090"
711
# The port of the web video server (default: 8080)

feedingwebapp/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The overall user flow for this robot can be seen below.
2222
4. Source the directory: `source install/setup.bash`
2323
5. Navigate to the web app folder: `cd feeding_web_interface/feedingwebapp`
2424
6. Install web app dependencies: `npm install --legacy-peer-deps`
25+
1. You may also have to run `npx playwright install`; you might be prompted to run that after `node --env-file=.env start_robot_browser.js`
2526
* Consider checking out the Troubleshooting section if there are errors in this process.
2627
If your workspace has already been built, you should run `source install/setup.bash`. If this is your first time building your workspace, you should `source /opt/ros/humble/setup.bash` and then run `colcon build` followed by `source install/setup.bash`. For both of the above cases, you must be in the main directory of your workspace (e.g., `src` should be a subfolder).
2728

@@ -31,7 +32,9 @@ If your workspace has already been built, you should run `source install/setup.b
3132
- If you're not running the robot code alongside the app, set `REACT_APP_DEBUG=true` in `.env` to be able to move past screens where the app is waiting on the robot. The default is `REACT_APP_DEBUG=false`.
3233
- If users will be accessing the app on a device other than the device running ROS, change `REACT_APP_ROS_SERVER_HOSTNAME` in `.env` to be the hostname of the device running ROS. Ensure that device is configured so that ports 8080 (web_video_server default) and 9090 (rosbridge default) can be accessed.
3334
3. Start the app: `npm start`
34-
4. Use a web browser to navigate to `localhost:3000` to see the application.
35+
4. Start the WebRTC signalling server: `node --env-file=.env server.js`
36+
5. Start the headless robot browser: `node --env-file=.env start_robot_browser.js`
37+
6. Use a web browser to navigate to `localhost:3000` to see the application.
3538

3639
#### Launching Dummy Nodes
3740
This repository includes several dummy nodes that match the interface that the robot nodes will use. By running the dummy nodes alongside the app, we can test the app's communication with the robot even without actual robot code running.
@@ -108,3 +111,4 @@ Note that we use `npm`, not `yarn`, to manage dependencies for this project.
108111

109112
## Troubleshooting
110113
* While installing, if you run into an error about `PUPPETEER`, the fix is to just follow the instructions provided in console and to actually disable it.
114+
* If you get an error says `--env-file` is a bad option, you have to update your `node` verion.

0 commit comments

Comments
 (0)