VEXcode Blocks IQ Vision sensor - what am I doing wrong?

I’ve just done a really basic test with the Vision Sensor using VEXcode Blocks IQ.
As the screenshot shows, the utility detects the object correctly as BALL but when I run the code on the Brain, it never shows “object found”.
What am I doing wrong?

image

1 Like

and on a kind of related note, I tried this as a different test:

image

That doesn’t show anything other than zero either, but the more odd thing about that is that each time round the loop moves the column that the number is printed at along one. I can see how and understand why this behavior occurs, but for young kids I preferred the “Clear LCD” command in Modkit which always caused subsequent print commands to plot at 1,1.

The code seems OK for detecting the object. I have found, however, that it’s usually helpful to power cycle the Vision Sensor after training it with the Vision Utility and also not have the MicroUSB cable connected while trying to use the sensor with the IQ Brain.

“clear all rows” does not reset the cursor position, but “clear row X” does return it to the column 1 position.

Just tested it in RMS and it’s working fine there but in VEXcode Blocks, no dice.

We’ll take a look at it. Stay tuned…

2 Likes

signatures are always saved in code and sent to the vision sensor when the program starts, that was the case with VCS and is also how VEXcode works.

On that same front - the vision signatures are stored inside of the VEXcode IQ Blocks project file and updated when the Vision Utility is closed and “Done” is selected on the Devices window. If you change your vision configuration, close the utility, but forget to hit “Done” - it’ll still keep the previous configuration (which may have been blank or out of date).

I noticed that because the signature names will be wrong up until that point as well.

I’m stumped as to why it’s not working. Oddly of I put my hand over the lens it does give the off spurious value so there is some data coming from somewhere!

Is the largest object reported as 0 or 1 in the array?

Arrays (aka lists) are index 1 in Blocks. This is match Scratch 3.0 behaviors. Therefor, largest object is reported as index 1.

There may be an issue related to storing the brightness slides for the object on IQ blocks. We’re still digging into it, but if you kept the standard “2.5” brightness value it tends to work well, but increasing it to help detect objects may be causing the issue at the moment.