VEX v5 vision sensor not working

I’m trying to get my clawbot to move towards a yellow disk until its centered on the x and y axis. When that is done I want to to pick it up and place it into a goal.




What does the robot currently do when this code is run?

@EcstaticPilot
It justs keeps moving forwards

vision sensor is 315-211 pixels
even though its supposed to be 640-400 pixels

actually 316x212 (so max Y value would be 211).
It’s not supposed to be 640x400, not sure where that came from.

2 Likes

the vex site has it at 640-400

ok, I see, on the product page.
That’s mostly, but not entirely, wrong.
Internally the raw data we get from the sensor is about that (IIRC, it’s actually 640x480), but it’s in a format that’s not very useful for the color detecting algorithm. That image is converted and scaled down to 316x212 for processing, that’s also the coordinate system used for sending object information back to the V5.
see this kb article.

5 Likes

I’ve adjusted it some more and it will try a pick up the disk but it’s still being problematic

If you’re trying to do advanced stuff like this, I highly recommend switching to text and leaning about PID. Heres a good resource:
introduction_to_pid_controllers_ed2.pdf (400.2 KB)