Color Sorting

16 replies [Last post]
AmandaPanda
AmandaPanda's picture
Title: NooBot
Joined: 11/18/2013
Posts:
BotPoints: 144
User offline. Last seen 2 years 36 weeks ago.

I am sort of new to robotics, and I can't seem to find any where that clearly explains how to color sort, so if anyone can maybe give me a link or explain it to me?

Amanda
PDCMS

ruler501
ruler501's picture
Title: NooBot
Joined: 01/29/2012
Posts:
BotPoints: 367
User offline. Last seen 2 years 14 weeks ago.

What programming language do you have? I have a C++ program(that is kind of jumbled together) that does it, but it would have to be tweaked to work with any robot that wasn't mine so you'd have to figure out how it works.

Harrison Cassar
Title: NooBot
Joined: 10/16/2013
Posts:
BotPoints: 197
User offline. Last seen 2 years 26 weeks ago.

Well, at the 2014 Botball workshop on January 24th and 25th (for the Greater San Diego region), the present the color sorting/finding in a very detailed and easy-to-understand manner. Plus, they offer the PowerPoint to anyone that participates too. So, if you are planning to attend the workshop in January, and you do not find out how to learn it before that time, then you can learn it at the workshop.

If anyone can find a source for this too (for C and C++), that would be great because, just like you Amanda, I can't find one either.

Thanks! And good luck!

ruler501
ruler501's picture
Title: NooBot
Joined: 01/29/2012
Posts:
BotPoints: 367
User offline. Last seen 2 years 14 weeks ago.

There are a lot of methods for doing this(I directly used OpenCV and tried to do a PID like system). There is a botball library for vision that should have documentation somewhere that you could work from.

AmandaPanda
AmandaPanda's picture
Title: NooBot
Joined: 11/18/2013
Posts:
BotPoints: 144
User offline. Last seen 2 years 36 weeks ago.

I am not sure if I am going to the workshop, but I know you are, so when you learn more about color sorting, please explain it to me!

Amanda
PDCMS

AmandaPanda
AmandaPanda's picture
Title: NooBot
Joined: 11/18/2013
Posts:
BotPoints: 144
User offline. Last seen 2 years 36 weeks ago.

I am also using C programming, not C++, but I am going to learn the c++ language if I can.

Amanda
PDCMS

ruler501
ruler501's picture
Title: NooBot
Joined: 01/29/2012
Posts:
BotPoints: 367
User offline. Last seen 2 years 14 weeks ago.

If you want really tweakable code then I'd use openCV directly from C/++(I only know the C++ API). Though if you do this you will rpobably have to modify the compiler options to link openCV since last year at least that was not a default.

AmandaPanda
AmandaPanda's picture
Title: NooBot
Joined: 11/18/2013
Posts:
BotPoints: 144
User offline. Last seen 2 years 36 weeks ago.

That is okay, thank you though! If I don't figure
Out anything soon, I will take a look at that program.

Amanda
PDCMS

YuSheng.Chen
Title: NooBot
Joined: 10/28/2013
Posts:
BotPoints: 286
User offline. Last seen 3 years 27 weeks ago.

I am actually really surprised that nobody has been able to show her how to color sort. And, by the way, the workshop slides are available via team home base. To color sort, you have to first open your camera and then update the camera via a loop. To find the color, you have to insert the value of the color you are looking for via wavelengths. The wavelengths are specified on the slides and are also specified on the link. I know I am not making this very clear, but, if you need help, you can always ask me in class.

nbeps
Title: NooBot
Joined: 02/20/2014
Posts:
BotPoints: 2
User offline. Last seen 3 years 25 weeks ago.

I am having trouble learning how to make the bot go toward an orange cube. Can someone direct me in the right direction?
(nbeps stans for NewButExperiencedProgramers)

ruler501
ruler501's picture
Title: NooBot
Joined: 01/29/2012
Posts:
BotPoints: 367
User offline. Last seen 2 years 14 weeks ago.

There are multiple ways to sort and move towards objects of a certain color.
You can use the official libkovan programs(you'll need help from someone else as I've never worked with them).

Or you could directly write code with OpenCV(Here is how I did it https://github.com/ruler501/retgreen/tree/pid but that is pretty specialized and untested so you can't just copy it).