Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
imisaacwu committed Nov 5, 2024
1 parent a8fe4f5 commit e510bf8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/Constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ 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<robot::types::CameraID, frozen::string, 3> 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<robot::types::CameraID, frozen::string, 3>
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<frozen::string, robot::types::CameraID, 3> CAMERA_NAME_TO_ID = {
{"mast", MAST_CAMERA_ID}, {"wrist", WRIST_CAMERA_ID}, {"hand", HAND_CAMERA_ID}};
constexpr frozen::unordered_map<frozen::string, robot::types::CameraID, 3> CAMERA_NAME_TO_ID =
{{"mast", MAST_CAMERA_ID}, {"wrist", WRIST_CAMERA_ID}, {"hand", HAND_CAMERA_ID}};

/**
@deprecated No need for this constant once we fully switch over the Mission Control PlanViz
Expand Down
3 changes: 2 additions & 1 deletion src/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ extern const robot::types::CameraID HAND_CAMERA_ID;

extern const frozen::unordered_map<robot::types::CameraID, frozen::string, 3>
CAMERA_CONFIG_PATHS;
extern const frozen::unordered_map<frozen::string, robot::types::CameraID, 3> CAMERA_NAME_TO_ID;
extern const frozen::unordered_map<frozen::string, robot::types::CameraID, 3>
CAMERA_NAME_TO_ID;

extern const uint16_t WS_SERVER_PORT;

Expand Down
3 changes: 2 additions & 1 deletion src/camera/Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ void Camera::init() {
}

std::stringstream Camera::GStreamerFromFile(robot::types::CameraID camera_id) {
cv::FileStorage fs(Constants::CAMERA_CONFIG_PATHS.at(camera_id).data(), 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");
Expand Down

0 comments on commit e510bf8

Please sign in to comment.