Why is the class CameraConfig passed in wpilibpi python example?

This is an odd question I have. Why does this

class CameraConfig: pass

have anything to do with the python program. I don’t see how this would do anything. Is their something I’m missing that I don’t understand. How does creating an instance of this class result in having properties from the Json config file. Also, where is the

/boot/frc.json file located.

I’m kinda confused on what this does?

The readCameraConfig() and readSwitchedCameraConfig() functions are part of the process of reading the /boot/frc.json file (starting in readConfig()). They create an instance of the (empty) CameraConfig class and add attributes to it at runtime.

The /boot/frc.json file is a file on the Pi filesystem. It’s written by the web interface camera settings page, so is the mechanism by which the camera configuration is passed from the web interface to the vision program.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.