How to publish webcam image from Html webpage with roslibjs
Hi, I am trying to make a simple webpage that, on the click of a button, takes a picture of yourself, using the built-in webcam on the device connected to the webpage. I want to then publish that image over ros. I have found tutorials showing how to take pictures, and they work, but I can't figure out how to publish it over ros. I did find one tutorial: http://wiki.ros.org/roslibjs/Tutorial... but when I run it, it appears to work fine, but I can't see the images when I try to look at them in rviz. So does anyone know how I would go about sending a webcam image over roslibjs? I am a noob at web stuff so thanks for your help!
Well, it depends on which object are you recieving the image, but in order to send it trough ROS, the default transport message is Sensor_msgs::Image (http://docs.ros.org/en/melodic/api/se...)
So, you should convert it to that.
here there is an example of how to do it, for example,with cv::mat:
https://answers.ros.org/question/9765...
Nevertheless, this is on ROS side. you shouls find a solution for JS (i don't think it should be hard).