RobotWebTools / rclnodejs

Node.js version of ROS 2.0 client
https://docs.ros.org/en/humble/Concepts/Basic/About-Client-Libraries.html?highlight=rclnodejs#community-maintained
Apache License 2.0
311 stars 70 forks source link

Image Topic A web video server #975

Open kavikode opened 1 week ago

kavikode commented 1 week 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 1 week 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 1 week 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 1 week ago

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