-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signaling #103
Open
hello-binit
wants to merge
29
commits into
feature/login
Choose a base branch
from
feature/signaling
base: feature/login
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Signaling #103
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hello-binit
force-pushed
the
feature/signaling
branch
from
September 26, 2024 01:33
b4e8295
to
3a915d0
Compare
The logic behind joining, leaving, and sending messages via the signaling server is now refactored into standalone classes. The WebRTC negotiation instantiates a LocalSignaling object, and uses an API defined by BaseSignaling to communicate with the signaling server, without worrying about the details.
Calling a robot at https://<url>/operator/stretch-re1-xxxx will be converted into a room UID by looking up the name <-> UID mapping in Firebase.
The call allows one operator to connect to a robot at a time. A second browser tab can identify if the room is already occupied by looking at the "active" attribute of its role within the room.
hello-binit
force-pushed
the
feature/signaling
branch
from
November 8, 2024 18:41
69a8203
to
ac6127c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR is the second of two PRs (the first is #115) that will make web teleop deployable on the internet. It introduces "signalers", which manage sending signals to establish a WebRTC connection between a robot and an operator anywhere in the world. Web teleop already had local signaling embedded in
webrtcconnections.tsx
+ a signaling server inserver.js
, which means that if you could do signaling if you could access the robot (often through ngrok tunneling or tailscale). However, since it's not common to expose tunnels/tailscale to the internet, a new way of signaling was needed. In this PR, theBaseSignaling
interface is introduced and two implementations are added:LocalSignaling
andFirebaseSignaling
. Whereas the former still usesserver.js
, the latter uses Firebase's Realtime Database to transfer signals. This PR builds on the previous PR's authentication to ensure security. Lastly, we can support alternate signaling servers in the future by adding new implementations ofBaseSignaling
to theshared.signaling
module.Testing procedure
We will be testing this PR and the Login & Homepage PR together. Check out the "feature/signaling" branch. Go through the testing instructions for the other PR first, then go through these:
Running the interface locally
Launch the interface
https://localhost/operator
in a browser and you should see the web interface.Running the interface online
You will need to send me your email address and robot's serial number before you can test this section. Additionally, you will need to ask me for an
.env
file to put in the root of your repo, change "localstorage" to "firebase" in line 4 of start_web_server_and_robot_browser.sh, and then launch the interface normally.https://web.hello-robot.com/operator
and the interface will not load. In the console, you'll see that the interface was unable to determine which robot to call because the URL was missing therobot
parameter.https://web.hello-robot.com/operator/?robot=stretch-se3-3005
to try calling a robot that doesn't belong to you. The interface will not load.window.onbeforeunload
enough time to complete entirely. In the future, we'll use heartbeats to fix this and make connectivity more robust in general.Before opening a pull request
From the top-level of this repository, run:
pre-commit run --all-files
To merge
Squash & Merge