CameraManager class handles all camera operations including initialization, configuration, and image capture.
CameraManager Class
The camera system is implemented inarm_system/perception/vision/camera/main.py:5.
Camera Configuration
The camera is configured with the following default settings:- Resolution: 1280x720 pixels
- Camera Index: 0 (default system camera)
- Backend: OpenCV VideoCapture
Resolution Settings
The camera resolution is set using OpenCV properties (arm_system/perception/vision/camera/main.py:8):
Image Capture Process
Thecapture_image() method handles the complete image capture workflow (arm_system/perception/vision/camera/main.py:11):
Buffer Flushing
The camera flushes 5 frames before capturing to ensure the most recent frame is captured (arm_system/perception/vision/camera/main.py:12):
Storage Location
Captured images are stored in theobjects_images/ directory relative to the camera module:
- Directory:
arm_system/perception/vision/camera/objects_images/ - Filename Format:
YYYYMMDD-HHMMSS.png - Example:
20260307-143022.png
arm_system/perception/vision/camera/main.py:23).
Integration with System
The camera is initialized in theCommunicationManager class (arm_system/communication/serial_manager.py:49):
arm_system/communication/serial_manager.py:178):
Cleanup
The camera is automatically released when theCameraManager object is destroyed (arm_system/perception/vision/camera/main.py:28):