RobotWebTools / rclnodejs

Node.js version of ROS 2.0 client
https://docs.ros.org/en/jazzy/Concepts/Basic/About-Client-Libraries.html#community-maintained
Apache License 2.0
332 stars 72 forks source link

Image Topic A web video server #975

Open kavikode opened 5 months ago

kavikode commented 5 months ago

Is it possible to stream a image topic on a webpage using rclnodejs? Any examples please to get the camera view from a robot displayed on the webpage?

minggangw commented 5 months ago

You cannot run rclnodejs in a browser because nodejs is not supported, instead, you could:

  1. Leverage Electron which support nodejs to develop desktop apps.
  2. Leverage something like web video server, but I'm not sure if it can work for ROS2.
  3. Leverage roslibjs that can run in a browser to receive ROS2 topics.
chfritz commented 5 months ago

Hi @kavikode, I strongly recommend learning about webrtc. I recently wrote a blog post on the various approaches people have used for streaming video to the web and why webrtc is the way to go: https://transitiverobotics.com/blog/streaming-video-from-robots.

PS: and yes, you can use rclnodejs on the robot to get the image stream. That's what we do in our solution.

kavikode commented 5 months ago

thank you so much @minggangw and @chfritz! I will try the provided solutions. I appreciate your time to help me.