0
$\begingroup$

Rosanswers logo

Hello, I try to deal with a topic which type is sensor_msgs/Image. I want to display those messages in a webpage using rosbridge. As it's written here the json obejct contain an uri field. I created a canva and then drawed an image object containing this "uri field value" as source. I succeeded to connect to the topic because my handler is activated but i cant display the picture. Somebody already did something similar?

Benoit


Originally posted by BeuBeu on ROS Answers with karma: 56 on 2012-05-21

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Have you considered trying to use mjpeg_sever to stream images to your web page? This package takes advantage of browser optimizations by streaming ROS images in binary form. Take a look at the following wiki page which explains how to get it up and running:

http://ros.org/wiki/mjpeg_server


Originally posted by rtoris288 with karma: 1173 on 2012-05-21

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by tjay on 2012-05-21:
I second this recommendation for general in-page image use. Treating images special has been deprecated (and thanks to you removed from the documentation). If you really want to still handle images "purely" with JS and rosbridge, you should look at wsview.js in the scripts directory.

Comment by BeuBeu on 2012-05-21:
Hello, Tjay, I looked your script. Just to clear my mind, your img argument in the display function is the json_object received by a rosbridge handler? I found a code handling the mono8 encoding; /trunk/experimental/ROSDojo

Comment by tjay on 2012-05-22:
The object the display method expects is indeed the "raw" JSON object. Also, make sure to take a look at the rgb8 version. It's in the scripts directory of rosbridge itself.

Comment by BeuBeu on 2012-05-22:
OK It works !!!! I will try the mpeg_server because this solution is quite power consuming. (50-60% of the CPU if i ask for a topic at 200Hz).

Comment by tjay on 2012-05-23:
Oh yeah. It's pretty terrible. Again, I recommend mjpeg_server unless you can get away with a tiny low framerate stream. I've had good luck with a 160x120 stream at 8HZ that I use the wsview.js script to upsize. It'll still hog your CPU more than a bit though.

Comment by BeuBeu on 2012-05-23:
My picture are 7752*480 published at 30 Hz. Both strategy works and own quite high CPU consuming.(50 %) Thanks you for your advices :)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.