diff --git a/src/Constants.cpp b/src/Constants.cpp index 0eea9edc..3edb963d 100644 --- a/src/Constants.cpp +++ b/src/Constants.cpp @@ -51,12 +51,12 @@ const robot::types::CameraID MAST_CAMERA_ID = 40; const robot::types::CameraID WRIST_CAMERA_ID = 30; const robot::types::CameraID HAND_CAMERA_ID = 20; -constexpr frozen::unordered_map CAMERA_CONFIG_PATHS = { +constexpr frozen::unordered_map CAMERA_CONFIG_PATHS = { {MAST_CAMERA_ID, "../camera-config/MastCameraCalibration.yml"}, {WRIST_CAMERA_ID, "../camera-config/WristCameraCalibration.yml"}, {HAND_CAMERA_ID, "../camera-config/HandCameraCalibration.yml"}}; -constexpr frozen::unordered_map CAMERA_NAME_TO_ID = { +constexpr frozen::unordered_map CAMERA_NAME_TO_ID = { {"mast", MAST_CAMERA_ID}, {"wrist", WRIST_CAMERA_ID}, {"hand", HAND_CAMERA_ID}}; /** diff --git a/src/Constants.h b/src/Constants.h index 0822c0ff..f2bf9dd7 100644 --- a/src/Constants.h +++ b/src/Constants.h @@ -57,9 +57,9 @@ extern const robot::types::CameraID MAST_CAMERA_ID; extern const robot::types::CameraID WRIST_CAMERA_ID; extern const robot::types::CameraID HAND_CAMERA_ID; -extern constexpr frozen::unordered_map +extern const frozen::unordered_map CAMERA_CONFIG_PATHS; -extern constexpr frozen::unordered_map CAMERA_NAME_TO_ID; +extern const frozen::unordered_map CAMERA_NAME_TO_ID; extern const uint16_t WS_SERVER_PORT; diff --git a/src/camera/Camera.cpp b/src/camera/Camera.cpp index 7a3dd5a7..54ddfb5e 100644 --- a/src/camera/Camera.cpp +++ b/src/camera/Camera.cpp @@ -62,7 +62,7 @@ void Camera::init() { } std::stringstream Camera::GStreamerFromFile(robot::types::CameraID camera_id) { - cv::FileStorage fs(Constants::CAMERA_CONFIG_PATHS.at(camera_id), cv::FileStorage::READ); + cv::FileStorage fs(Constants::CAMERA_CONFIG_PATHS.at(camera_id).data(), cv::FileStorage::READ); if (!fs.isOpened()) { throw std::invalid_argument("Configuration file of camera ID" + std::to_string(camera_id) + " does not exist");