I am working on a color tracking program but i am having some difficulties. It might be something really obvious, but i just can't seem to find it. When i run the program i don't get anything on the screen.
I would like to know what is wrong.
Attachment | Size |
---|---|
ColorTracking.c | 1.31 KB |
First you have way too many blank lines separating things. It makes your code quite hard to read.
You also seem to have very strange indentation where some lines are randomly indented or less indented than those around them
You need to have #include at the top of your file if you want to use printf
You should use if{} else if{} else{} not if{} if{} else{} The way you currently have it when the blob is to the right it print out that it is to the right and that it is not in the frame.
You do not handle the case of x=80 and instead assume the object is out of the frame.
There is your code with my suggested fixes. I do not have a robot so cannot test if it works.
Thank you. I will see if it works.
Noah Zinn
After i made the changes and compiled it, i ran the program. But it says VIDIOC_QUERYMENU: Invalid argument.
it still runs but it says that for several lines.
Noah Zinn
I remember last year when I worked with the robots they did that when you initialized the camera(I couldn't find a way around it, but I didn't look to hard). As long as your program runs fine after it you're good.
We are seeing the same error message (printed many times), but things are otherwise working.
Yeah the error doesn't affect anything with the botball color tracking library.
The program still says "No object in sight" even when i put the object right in front of the camera and move it around to various positions.
Noah Zinn
Have you checked that you calibrated the color correctly on the robot?
I have the latest botball software for everything. My configurations are correct in that they correctly show the object in question. Also the configuration that I am using is default. I think my coding is right but I still get this problem of "No such object 0" If you could tell me what the possible problems are that would be really helpful.
Call camera_update() before assigning x and y.
-Marty Rand
{
Senior programmer at Norman Advanced Robotics
Former senior programmer at Whittier Middle School
Youth Advisory Council
All around nerd
}