PhotonVision / photonvision

PhotonVision is the free, fast, and easy-to-use computer vision solution for the FIRST Robotics Competition.
https://photonvision.org
GNU General Public License v3.0
264 stars 183 forks source link

Use ReadQueue for PhotonCamera timestamps #1316

Closed mcm001 closed 2 months ago

mcm001 commented 5 months ago

This removes the extra GetLastChange call to keep everything properly atomic.

Closes #1303

srimanachanta commented 4 months ago

What's the overhead of enabling poll storage? If it's somewhat decent we should make this a configurable option when actually creating the camera.

mcm001 commented 4 months ago

It just makes the circular buffer of std vectors of bytes larger. Since the contents of the vector are dynamically allocated, the cost is zero, and then as you push more new packets in, you allocate new memory. So probably on the order of 20kb, at worst, of dynamically allocated memory, and 20*sizeof(vector) statically?