0

Rosanswers logo

Hi guys, i'm trying to make my robot rotating until he "see" a red object and then drive to this object. i tried to do it with point cloud library ,i understand i need to subscribe to a certain topic but i don't know which one? also after subscribing i don't know how to isolate the color of the frame from the message just received, can someone please help me? i'm using ros indigo with armadillo model. Thx.


Originally posted by iguma on ROS Answers with karma: 1 on 2016-12-23

Post score: 0

1 Answers1

0

Rosanswers logo

If you are using a depth camera then the PCL library would be appropriate, but if it is a regular color camera then you would want to use OpenCV, and could try out colored blob detection like in https://www.learnopencv.com/blob-detection-using-opencv-python-c/ (it mentions the blobcolor doesn't work as of that blog post, but I see in http://answers.opencv.org/question/26295/simpleblobdetection-set-blobcolor-python/ that it was fixed which may be available in your version). Or try out inRange to get a binary image of just the places in the image that are red ( http://stackoverflow.com/questions/26218280/thresholding-rgb-image-in-opencv ) and do some other operations to your object.

You should use http://answers.opencv.org for OpenCV specific questions.

If there is a single topic with a name that ends in image_raw or image_color then that might be the topic to subscribe to- use rqt_image_view to select from available image topics and find the right one if there are several options.


Originally posted by lucasw with karma: 8729 on 2016-12-24

This answer was ACCEPTED on the original site

Post score: 0

Lucas Walter
  • 3,337
  • 1
  • 14
  • 19