1
votes

I'm new to ROS. My app was developed in Qt + OpenCV, it is cross-platform. It connectes to a camera and display both images and CAN signals from vehicle bus. Now I want to transfer the image and the CAN signal to a ROS system in real time. After googled for few hours, looks like there are few options:

  1. Use ros_bridge: http://wiki.ros.org/rosbridge_suite This approach need a websocket and transfer data using JSON format. Requires ROS side run the bridge server. Then my qpp need to run a webbroswer and open the HTML page that uses websocket with roslibjs JavaScript library. I haven't figure out how to tranfer iamge object and how to receive on the ROS side. any help is appreciated.

  2. I found this: http://wiki.ros.org/web_video_server but it is streaming images from ROS to a website via HTTP. It's the otherway around.

My question is which way is the best and fastest to implement support for transfer images to ROS?

I cannot use ROS-Qt-Plugin to re-compile my app since it is a way too big project that doesn't suit my situation.

Thanks for any help.

1

1 Answers

1
votes

I had a similar project, we ended up using OpenCV to read images, then just using cv_bridge to convert it to a ROS message and publish it to a topic. It was really simple, but we had to be careful with images sizes/data rates to avoid overflowing our network capacity.

It is straightforward to start a ros node in a Qt application, even without ROS-Qt. Maybe something like in this example? And obviously once you have the node, just create the appropriate publisher and getting it to ROS is simple. Using the cv_bridge package is easy, just follow the tutorials for either C++ or Python.

Let me know if that helps.