Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera rework #337

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
11 changes: 11 additions & 0 deletions camera-config/HandCameraConfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
%YAML:1.0
---
name: "hand"
description: "Camera located on the hand of the rover."
# Make sure that this camera_id matches the one defined in the udev rules.
camera_id: 20

format: "jpeg"
width: 640
height: 480
framerate: 30
20 changes: 9 additions & 11 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ message("========================================")
# here to avoid the compiler spamming warnings at us for stuff in the Eigen headers.
find_package(Eigen3 REQUIRED NO_MODULE)
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
include_directories("/usr/local/include")

# Find the WebSocket++ library and Boost (provides the ASIO backend for Websocket++ and also
# provides the program_options argument parser). Only the `system` component of Boost is
Expand Down Expand Up @@ -132,8 +133,6 @@ endif()

add_library(camera SHARED
camera/Camera.cpp
camera/CameraParams.cpp
camera/CameraConfig.cpp
)
target_link_libraries(camera PUBLIC ${OpenCV_LIBS})

Expand Down Expand Up @@ -199,11 +198,11 @@ endif()
# hardware-agnostic utilities and common code for world interface
add_library(world_interface_core STATIC
world_interface/gps_common_interface.cpp
ar/Detector.cpp
ar/MarkerSet.cpp
ar/MarkerPattern.cpp
ar/Tag.cpp
ar/read_landmarks.cpp
#ar/Detector.cpp
#ar/MarkerSet.cpp
#ar/MarkerPattern.cpp
#ar/Tag.cpp
#ar/read_landmarks.cpp
world_interface/motor/base_motor.cpp
)
target_include_directories(world_interface_core SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
Expand Down Expand Up @@ -309,10 +308,10 @@ if(WITH_TESTS)
add_executable(tests
Tests.cpp
# AR Detection tests
ar/DetectorTests.cpp
ar/MarkerSetTests.cpp
# ar/DetectorTests.cpp
# ar/MarkerSetTests.cpp
# Camera tests
../tests/camera/CameraParamsTests.cpp
# ../tests/camera/CameraParamsTests.cpp
# GPS tests
../tests/gps/GPSDatumTest.cpp
../tests/gps/GPSConverterTest.cpp
Expand Down Expand Up @@ -368,7 +367,6 @@ add_compile_options(
-Werror
)

add_subdirectory(ar)
add_subdirectory(camera)
add_subdirectory(CAN)
add_subdirectory(network)
16 changes: 9 additions & 7 deletions src/Constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,17 @@ const double MAX_WHEEL_VEL = WHEEL_RADIUS * MAX_DRIVE_PWM / PWM_PER_RAD_PER_SEC;
const double MAX_DTHETA = kinematics::DiffDriveKinematics(EFF_WHEEL_BASE)
.wheelVelToRobotVel(-MAX_WHEEL_VEL, MAX_WHEEL_VEL)(2);

// TODO: We need to recalibrate the camera, since we replaced it with a different one.
const char* MAST_CAMERA_CONFIG_PATH = "../camera-config/MastCameraCalibration.yml";
const robot::types::CameraID MAST_CAMERA_ID = "mast";
const robot::types::CameraID MAST_CAMERA_ID = 40;
const robot::types::CameraID WRIST_CAMERA_ID = 30;
const robot::types::CameraID HAND_CAMERA_ID = 20;

const char* FOREARM_CAMERA_CONFIG_PATH = "../camera-config/WristCameraCalibration.yml";
const robot::types::CameraID FOREARM_CAMERA_ID = "wrist";
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"}};

const char* HAND_CAMERA_CONFIG_PATH = "../camera-config/HandCameraCalibration.yml";
const robot::types::CameraID HAND_CAMERA_ID = "hand";
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
12 changes: 6 additions & 6 deletions src/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ extern const double MAX_DTHETA;

// TODO: We need to recalibrate the camera, since we replaced it with a different one.
// TODO: rename cameras (in MC as well) as appropriate
extern const char* MAST_CAMERA_CONFIG_PATH;
extern const robot::types::CameraID MAST_CAMERA_ID;

extern const char* FOREARM_CAMERA_CONFIG_PATH;
extern const robot::types::CameraID FOREARM_CAMERA_ID;

extern const char* HAND_CAMERA_CONFIG_PATH;
extern const robot::types::CameraID WRIST_CAMERA_ID;
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 uint16_t WS_SERVER_PORT;

/**
Expand Down
281 changes: 0 additions & 281 deletions src/ar/ARTester.cpp

This file was deleted.

Loading