ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

sensor_msgs/Image to jpg using roslibjs

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

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 (https://answers.ros.org/question/2525...), 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 (https://wiki.ros.org/cv_bridge/Tutori...) 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

Comments

If you can view it in a browser and it doesn't have to be a jpg, the following QA would be helpful: https://stackoverflow.com/questions/5...

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

1 Answer

Sort by ยป oldest newest most voted
0

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

rmango gravatar image

I was able to get my webpage working using image_transport republish as shown here (https://answers.ros.org/question/3201...). 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

Question Tools

1 follower

Stats

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

Seen: 828 times

Last updated: Dec 01 '20