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

Revision history [back]

click to hide/show revision 1
initial version

Hi

There can be a lot of ways to answer your question, and like @dornhege said, you just want to make it to ROS, or you want to make a ROS interface.

I prefer making a ROS only interface, so if someone wants to use the code on some other platform, it is easy to do so.

This is what we have:

  • A bunch of code which does Image Processing using OpenCV, and has no ROS in it. It gives a 2 point output (size of image, location of desired object)
  • A bunch of code which has a lot of logic in python to generate motion commands based on above output.

This is what we do:

  • A file vision_ros.cpp which contains subscribers and publishers and then calls the non-ROS opencv code like we call it from terminal, with one frame at a time. We earlier used sockets, so we had to change just one file.
  • Another file which uses the published data from vision_ros.cpp to pass on the information to python files by calling the respective functions.

So, the code stays in the format as it is, with little changes, is modular, and easy to port.