diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 23bf7c5..16e1ad1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: - uses: pguyot/arm-runner-action@v2 with: - base_image: https://github.com/PhotonVision/photon-image-modifier/releases/download/Dev/photonvision_raspi_dev.img.xz + base_image: https://github.com/PhotonVision/photon-image-modifier/releases/download/v2027.0.0/photonvision_raspi_dev.img.xz cpu: cortex-a7 image_additional_mb: 1500 bind_mount_repository: true diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e92627..49238ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,11 @@ find_package(Threads REQUIRED) find_package(PkgConfig REQUIRED) find_package(OpenGL REQUIRED COMPONENTS OpenGL EGL) pkg_check_modules(LIBDRM REQUIRED libdrm) -pkg_check_modules(LIBCAMERA REQUIRED libcamera) + +# we now require libcamera 0.6 +set(LIBCAMERA_MIN_VERSION "0.6" CACHE STRING "Minimum libcamera version") +pkg_check_modules(LIBCAMERA REQUIRED "libcamera>=${LIBCAMERA_MIN_VERSION}") + pkg_check_modules(LIBGBM REQUIRED gbm) set(OPENCV_YEAR "frc2025") diff --git a/include/camera_model.h b/include/camera_model.h index 85b5170..f27a95b 100644 --- a/include/camera_model.h +++ b/include/camera_model.h @@ -18,6 +18,7 @@ #pragma once #include +#include #include enum CameraModel { @@ -30,5 +31,5 @@ enum CameraModel { OV7251, Unknown }; -CameraModel stringToModel(const std::string &model); +CameraModel stringToModel(std::string_view model); bool isGrayScale(CameraModel model); diff --git a/src/camera_model.cpp b/src/camera_model.cpp index febe29e..d79dff3 100644 --- a/src/camera_model.cpp +++ b/src/camera_model.cpp @@ -20,24 +20,24 @@ #include #include #include +#include -static const CameraModel grayScaleCameras[] = {OV9281}; +static const CameraModel grayScaleCameras[] = {OV9281, OV7251}; -CameraModel stringToModel(const std::string &model) { - const char *famname = model.c_str(); - if (!strcmp(famname, "ov5647")) +CameraModel stringToModel(std::string_view model) { + if (model == "ov5647") return OV5647; - else if (!strcmp(famname, "imx219")) + else if (model == "imx219") return IMX219; - else if (!strcmp(famname, "imx708")) + else if (model == "imx708") return IMX708; - else if (!strcmp(famname, "imx477")) + else if (model == "imx477") return IMX477; - else if (!strcmp(famname, "ov9281")) + else if (model == "ov9281") return OV9281; - else if (!strcmp(famname, "ov7251")) + else if (model == "ov7251") return OV7251; - else if (!strcmp(famname, "Disconnected")) + else if (model == "Disconnected") return Disconnected; else return Unknown;