ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

sensor_msgs/Image to jpg using roslibjs

asked 2020-12-01 14:52:03 -0500

rmango gravatar image

I'm trying to display a jpg image from the sensor_msgs/Image topic onto my webpage. I have been able to extract the images using image_view in the terminal, so I know that the images are being sent correctly, I just don't know how to decode them in javascript.

I've tried the solution in this answer (, but this does not work for me because I need to subscribe to a sensor_msgs/Image topic, not a sensor_msgs/CompressedImage topic.

I've found the tutorial for doing this in python ( but I can't figure out how this would be done in javascript.

Any suggestions on how to convert a sensor_msgs/Image message to a jpg?

edit retag flag offensive close merge delete


If you can view it in a browser and it doesn't have to be a jpg, the following QA would be helpful:

miura gravatar image miura  ( 2020-12-02 09:26:31 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2020-12-01 17:26:00 -0500

rmango gravatar image

I was able to get my webpage working using image_transport republish as shown here ( However, this doesn't seem like the ideal solution. If anyone knows how to process a sensor_msgs/Image without republishing please let me know!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-12-01 14:52:03 -0500

Seen: 435 times

Last updated: Dec 01 '20