What would be better for the wheel of fortune: using a camera or a color sensor?
I think it depends on your capabilities and which control you are spinning the wheel for.
If your team has never done machine vision programming. A color sensor is quick and easy. However if even that sensor is outside the scope of your teams capabilities then just the use of a camera to manually operare the control panel would be your best bet.
Also in theory if you can get decent enough traction on the control panel you could even use an encoder and go by how many rotations your mechanism made. This would work easily for the rotational control, but not so well for the positional control.
A color sensor sounds like the easiest solution to me. The less extraneous data you collect, the easier it is to do something useful with that data.
For the position, you know what color you need to be at and you know the order of the colors. So you can pretty easily figure out “if I need to spin it to green, the color closest to the robot being read by the color sensor is ____” and so forth. Then it’s just a matter of spinning the wheel until you see the right color and then stopping.
For roatation control, you can use the color sensor almost like an encoder for the wheel. Mark the color that you’re reading when you start spinning. Every time the sensor reads that color and didn’t read it in the last iteration, increment a counter. When that counter hits 6 (or 7 to be safe), stop spinning.
This is what we’re planning on, and we have good recent color vision experience. I can’t come up with a good reason not to use the color sensor if able (and it being in the KOP with example code should make it possible for a lot of teams)
Our plan is to use the color sensor for the following reasons:
- Coding is much simpler than for vision processing
- REV already has sample code available that will tell you the color
- Vision processing takes more CPU resources, sensor is very low
- Purpose built sensors are simpler, cheaper and tend to perform better
- Sensor position/distance to target is critical for accuracy - range is narrow at 1 to 10 cm
- Running and protecting wiring from sensor to RoboRIO