This is part of the LiDAR Data Streaming Project developed at TiHAN, IIT-H
This is an alternative to using Firebase; when both of the devices are not behind Symmetric NAT (AKA Full-Cone NAT). The type of NAT can be checked here. Permissive NAT is a requirement for Peer-to-Peer (WebRTC) communication.
To learn more about NAT, go here.
NOTE: A TURN Server is often cheaper than the Firebase method, however, it only allows single subscriber of the data stream. In contrast, the Firebase method allows multiple subscribers.
ROS (preferably melodic version for Ubuntu 18.04) is required to be setup on both the sender (encoder) and the receiver (decoder).
ROS-Bridge server needs to be installed for roslibjs which was part of the project that this repository was intended for.
Installation: (Change melodic
to the required version)
sudo apt-get install ros-melodic-rosbridge-server
Starting Server:
roslaunch rosbridge_server rosbridge_websocket.launch
Node Package Manager (NPM) and Node.js are required to be installed ([email protected]+
, [email protected]+
).
The source code is available here.
Run the following commands:
cd ~ #directory where the project is to be located
git clone https://github.com/bhaskar-anand-iith/lidar-p2p
cd lidar-fb/ #root of project
npm i #installing dependencies
- Version Error: ensure
[email protected]+
, and[email protected]+
npm -v
node -v
For testing locally:
npm run dev #runs the "dev" srcipt defined in package.json
The sender and the receiver each have a UUID (randomly generated uniquely identifying ID). For the peer-to-peer connection to be established, the sender must connect to the receiver using the receiver's UUID. Once the connection is established, the connection will be open until the webpage is reloaded or the sender connects to another receiver.
Sender/Sensor side: Once the webpage has loaded, the webpage automatically subscribes to /n2b_data
rostopic, and immediately tries publishing to the peer. Data is only sent after connection is established with peer.
Receiver/Visualizer side: Once the webpage has loaded and the sender peer has established connection, the data starts being published to /b2n_data
rostopic.
Subscribes to /n2b_data
topic (from native c++ code)
Publishes to /b2n_data
topic (from browser)
The app has been deployed on Heroku. It is connected with GitHub (through a webhook) and automatically deploys any changes that are made to the main
branch (by default) in the connected GitHub repository.
Requires a Heroku account
- Go to Heroku Dashboard
- Click on
New
-> Create new app - Enter App name, choose a region, and click
Create app
- In the
Deploy
tab, set the deployment method toGitHub
- Search for the repository name (
lidar-fb
) (you must be owner of repository on GitHub. Explore GitHub Teams for more features) Enable Automatic Deploys
andDeploy Branch
(main)
The webapp will take some time to be built and deployed. The webapp can be accessed at App-name
.herokuapp.com
For additional build information, access the Activity
tab and click on the build of choice.
- Not connecting to peer/No messages being sent or received: check NAT type.
- Receiving data but no visualization in RViz: check if roscore, ros-bridge server, and decoder are running.
- No data is being sent: check if roscore, ros-bridge server, and encoder are running, check bandwidth.
- Latency is continuously increasing over time: bandwidth is insufficient, find a better network.