diff --git a/CMakeLists.txt b/CMakeLists.txt index ac1c33a..23eaead 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ add_executable(calibrate_handeye calibration/calibrate_handeye.cpp) add_executable(calibrate_robotworld_handeye calibration/calibrate_robotworld_handeye.cpp) add_executable(split_video calibration/split_video.cpp) -target_link_libraries(capture ${OpenCV_LIBS} fmt::fmt component device) +target_link_libraries(capture ${OpenCV_LIBS} fmt::fmt yaml-cpp component device) target_link_libraries(calibrate_camera ${OpenCV_LIBS} fmt::fmt yaml-cpp component) target_link_libraries(calibrate_handeye ${OpenCV_LIBS} fmt::fmt yaml-cpp component) target_link_libraries(calibrate_robotworld_handeye ${OpenCV_LIBS} fmt::fmt yaml-cpp component) @@ -117,4 +117,3 @@ target_link_libraries(balance_infantry ${OpenCV_LIBS} fmt::fmt yaml-cpp nlohmann add_executable(balance_infantry_mpc src/task/balance_infantry_mpc.cpp) target_link_libraries(balance_infantry_mpc ${OpenCV_LIBS} fmt::fmt yaml-cpp nlohmann_json::nlohmann_json auto_aim auto_buff component device) - diff --git a/configs/ascento.yaml b/configs/ascento.yaml index 1af1349..07d6c29 100644 --- a/configs/ascento.yaml +++ b/configs/ascento.yaml @@ -76,7 +76,7 @@ can_interface: "can0" #####-----gimbal参数-----##### com_port: "/dev/gimbal" - +baudrate: 115200 #####-----buff_detector参数-----##### model: "assets/yolo11_buff_int8.xml" diff --git a/configs/calibration.yaml b/configs/calibration.yaml index fa6f79d..7cb9f73 100644 --- a/configs/calibration.yaml +++ b/configs/calibration.yaml @@ -1,7 +1,7 @@ -pattern_cols: 10 -pattern_rows: 7 -center_distance_mm: 40 -pattern_type: circles_grid # circles_grid | chessboard +pattern_cols: 11 +pattern_rows: 8 +center_distance_mm: 30 +pattern_type: chessboard # circles_grid | chessboard R_gimbal2imubody: [1, 0, 0, 0, 1, 0, 0, 0, 1] @@ -15,3 +15,6 @@ quaternion_canid: 0x01 bullet_speed_canid: 0x110 send_canid: 0xff can_interface: "can0" +#####-----gimbal参数-----##### +com_port: "/dev/ttyUSB0" +baudrate: 115200 diff --git a/configs/camera.yaml b/configs/camera.yaml index e1c9cdd..cddfc59 100644 --- a/configs/camera.yaml +++ b/configs/camera.yaml @@ -1,9 +1,9 @@ -camera_name: "mindvision" -exposure_ms: 2 -gamma: 0.5 -vid_pid: "f622:d13a" +# camera_name: "mindvision" +# exposure_ms: 2 +# gamma: 0.5 +# vid_pid: "f622:d13a" -# camera_name: "hikrobot" -# exposure_ms: 3 -# gain: 10.0 -# vid_pid: "2bdf:0001" \ No newline at end of file +camera_name: "hikrobot" +exposure_ms: 3 +gain: 10.0 +vid_pid: "2bdf:0001" \ No newline at end of file diff --git a/configs/demo.yaml b/configs/demo.yaml index ec93654..af8ce21 100644 --- a/configs/demo.yaml +++ b/configs/demo.yaml @@ -78,7 +78,7 @@ can_interface: "can0" #####-----gimbal参数-----##### com_port: "/dev/gimbal" - +baudrate: 115200 #####-----planner-----##### fire_thresh: 0.003 diff --git a/configs/standard3.yaml b/configs/standard3.yaml index 96e38a8..9b2afed 100644 --- a/configs/standard3.yaml +++ b/configs/standard3.yaml @@ -79,6 +79,7 @@ can_interface: "can0" #####-----gimbal参数-----##### com_port: "/dev/ttyUSB0" +baudrate: 115200 yaw_kp: 0 yaw_kd: 0 pitch_kp: 0 diff --git a/configs/standard4.yaml b/configs/standard4.yaml index 88a6d50..bc6565a 100644 --- a/configs/standard4.yaml +++ b/configs/standard4.yaml @@ -79,7 +79,7 @@ can_interface: "can0" #####-----gimbal参数-----##### com_port: "/dev/gimbal" - +baudrate: 115200 #####-----planner-----##### fire_thresh: 0.003 diff --git a/src/device/gimbal/gimbal.cpp b/src/device/gimbal/gimbal.cpp index 930228a..7735b83 100644 --- a/src/device/gimbal/gimbal.cpp +++ b/src/device/gimbal/gimbal.cpp @@ -11,13 +11,14 @@ Gimbal::Gimbal(const std::string & config_path) { auto yaml = component::load(config_path); auto com_port = component::read(yaml, "com_port"); + auto baudrate = component::read(yaml, "baudrate"); try { serial_.setPort(com_port); - serial_.setBaudrate(115200); + serial_.setBaudrate(baudrate); serial_.setTimeout(serial::Timeout::max(), 100, 0, 100, 0); serial_.open(); - component::logger()->info("[Gimbal] Serial port {} opened at 115200 baud", com_port); + component::logger()->info("[Gimbal] Serial port {} opened at {} baud", com_port, baudrate); } catch (const std::exception & e) { component::logger()->error("[Gimbal] Failed to open serial: {}", e.what()); exit(1);