Detecting cone orientation with PhotonVision?

Is there a built-in way to get data from PhotonVision that would indicate which direction a cone is laying on the field? We were wondering if we could have a camera pointed straight down at the field and determine the direction the cone is laying in order to rotate a grabber to the proper position to pick it up.

We tried this a little bit at the end of the night tonight, but we’ll be playing with it some more tomorrow with better lighting. It didn’t look like there was any obvious way to get something like pitch or skew that would indicate the cone’s orientation.

1 Like

There is no obvious or built in way to do this. All PhotonVision sees is a blob of pixels of a certain color and then puts a box around them. It can’t actually get the details of the cone and it would be hard to tell orientation because of all the edge cases. Ex. you could check if the length of the blob is longer than it is wide to indicate knocked over, but what if you are viewing it from the base?

I do reccomend playing around with it and seeing if you can figure it out, but its tough.

I just found this as well. Can we implement custom OpenCV pipelines in PhotonVision?

The colored shape pipeline is the designed for detecting some gamepieces. If you can get a consistent identification of the shape then PhotonVision can return its estimated orientation (which is based on the aspect ratio of the bounding box.)

1 Like