Hello, I have just started to get the auto for delivering a gear working. The problem I am having is that the pixy is detecting both strips at the same time, and I was wondering how to give me separate data for different detections
We are using the average x,y of the two boxes to get the center between the two strips, which is where the peg is.
The problem I’m having is that I only get one number back, and it goes between the two boxes very quickly. Idk how to make it so I receive the x value of the left box and the x value of the right box.
YOu have your code and pixy setup to only give you the information for the biggest detected object. Change the code so that you get information for the 2 biggest objects and then average those. It doesn’t matter which information is for the left and right, because the average will be the same.
Thanks, that’s great… just I’m not too good with coding, and I don’t know how to change it to grab the average. Do you think you can help ?
I don’t have any experience programming with the pixy, so I probably won’t be much help with your specific language. But I can tell you this, you don’t tell the pixy to grab the average. You have to get the data for both boxes and then calculate the average with code. For example, remember in the arduino example code, it tells you how many blocks are seen and the current x and y position of each block? You take those two values and calculate the average in your code (x1+x2/2)(y1+y2/2)
How are you interfacing with the PIXY?
We are plugging it straight into the roborio through i2c