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

First, thank you for your answers. Let me describe what I try to do so maybe someone has solved this already:

I want to write a node which is performing the following steps:

  1. read a first image from usb_cam and store it as an image which can be processed using openCV
  2. switch on a line laser to draw a line within the field of view of the usb_cam
  3. read a second image from the usb_cam and store it
  4. subtract both images using openCV so only the laser line is visible in the resulting image.

If I can perform this operation using messages only, it's fine to me but I thought in this case a service call to get the first and the second image is the better approach.

Since I'm a ROS beginner, sample code would be great...

Thank you in advance, HXP2

First, thank you for your answers. Let me describe what I try to do so maybe someone has solved this already:

I want to write a node which is performing the following steps:

  1. read a first image from usb_cam and store it as an image which can be processed using openCV
  2. switch on a line laser to draw a line within the field of view of the usb_cam
  3. read a second image from the usb_cam and store it
  4. subtract both images using openCV so only the laser line is visible in the resulting image.

If I can perform this operation using messages only, it's fine to me but I thought in this case a service call to get the first and the second image is the better approach.

Since I'm a ROS beginner, sample code would be great...

Thank you in advance, HXP2

Solution:

Thank you demmeln, I followed your suggestion and erverything works well now !