tjbot-ce - v3.0.0
    Preparing search index...

    Class CameraController

    Camera controller for TJBot Handles camera initialization and photo capture using rpi-cam-lib

    Index

    Constructors

    Methods

    • Capture a photo by invoking rpicam-still via child_process

      Parameters

      • OptionalatPath: string

        Optional path to save the photo. If not provided, a temporary file will be used.

      Returns Promise<string>

      Path to the saved photo

      TJBotError if the camera command fails

    • Capture a photo and return it as a Buffer

      Returns Promise<Buffer<ArrayBufferLike>>

      Promise that resolves to a Buffer containing the photo data

      TJBotError if the camera capture fails

    • Clean up resources (no-op for direct process invocation)

      Returns void

    • Initialize the camera with configuration

      Parameters

      • resolution: [number, number]

        Camera resolution as [width, height]

      • verticalFlip: boolean

        Whether to vertically flip the image

      • horizontalFlip: boolean

        Whether to horizontally flip the image

      • captureTimeout: number = 500

        Timeout in milliseconds before capturing (default: 500)

      • zeroShutterLag: boolean = false

        Enable zero shutter lag mode (default: false)

      Returns void