My class is currently working with RobotC and the color sensor. We were able to successfully use the color sensor to “stop on red, go on green” with the color sensor facing forward. We then tried to use the greyscale to line track. Although we could get the values for the greyscale from the device info screen on the brain, the robot would not track (it kept turning away) Now we are trying to have the color sensor read when we are on black or red and it is not picking up either color. Can anyone share any experiences they have had with the color sensor that might shed some light on what we are missing here? Thank you in advance.
Nathan
In my opinion, it is quite hard to track a line using the VexIQ color sensor. Line tracking robots are typically using 3 sensors with a plenty of room for proper course correction, while VexIQ is only using a single grayscale value, trying to follow an edge of the line, not the line itself. For that to work well, you need several things:
[LIST=1]
When we tried line tracking in grayscale mode, we had to use value of 600. Lighting made a difference.
Here is one where someone tried line following just to give you some ideas. https://www.youtube.com/watch?v=BvChC6J6bNE
Are you using graphical or text programming? I have had pretty good success line tracking with a single sensor on a Clawbot chassis but writing a program in text coding so it can be a little more complex.
By using lots of different thresholds and turn rates (say 3 different levels of black and 3 different levels of white as well as an “ideal” straight ahead upper and lower threshold) you can make it quite accurate. The robot needs to move reasonably slowly though as not to lose the line.