Using Vision Sensor for Rollers


We do not have optical encoders to use for our roller mechanism, so we are currently attempting to use the vision sensor instead. Has anyone done this in V5 blocks and would you be willing to share the code with us? Thank you!

I’ve tried it, and I can tell you it doesn’t work nearly as well as an optical encoder or optical sensor. I don’t have my old code right now, but I have a few tips. The hard part is getting it to recognize when the roller is half-half (from the front), but this can be avoided by putting the vision sensor on the top or bottom. Lighting is also an issue; different light conditions affect the vision sensor a lot. That said, I really don’t recommend a vision sensor. The built-in motor encoders are mediocre, but still work better than a vision sensor, so I think you could try that for your roller mech.


We use the built-in encoders currently, but our main issue is that the rollers have varied from event to event (some are harder to spin, some are easier). So more often than not, the amount of spin we use at our own fields don’t work for fields at events.

Do you have any code you would be willing to share? Thank you!

1 Like