From 56d9ab6e2d59146ffe9a5b473a8ac2bdb5ce610b Mon Sep 17 00:00:00 2001 From: kalman Date: Mon, 14 Jan 2019 18:51:06 +0800 Subject: [PATCH 1/3] fix(rectify): delete useless log --- src/mynteye/api/processor/depth_processor.cc | 4 ++-- src/mynteye/api/processor/points_processor.cc | 2 +- src/mynteye/api/processor/rectify_processor.cc | 17 +++++++++++++++-- src/mynteye/api/processor/rectify_processor.h | 4 ---- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/mynteye/api/processor/depth_processor.cc b/src/mynteye/api/processor/depth_processor.cc index 4107065..ae8f5e5 100644 --- a/src/mynteye/api/processor/depth_processor.cc +++ b/src/mynteye/api/processor/depth_processor.cc @@ -29,7 +29,7 @@ DepthProcessor::DepthProcessor( std::int32_t proc_period) : Processor(std::move(proc_period)), calib_infos_(calib_infos) { - VLOG(2) << __func__ << ": proc_period=" << proc_period; + VLOG(2) << __func__; } DepthProcessor::~DepthProcessor() { @@ -51,7 +51,7 @@ bool DepthProcessor::OnProcess( ObjMat *output = Object::Cast(out); int rows = input->value.rows; int cols = input->value.cols; - // std::cout << calib_infos_->T_mul_f << std::endl; + std::cout << calib_infos_->T_mul_f << std::endl; // 0.0793434 cv::Mat depth_mat = cv::Mat::zeros(rows, cols, CV_16U); for (int i = 0; i < rows; i++) { diff --git a/src/mynteye/api/processor/points_processor.cc b/src/mynteye/api/processor/points_processor.cc index 162f7f7..fd8f204 100644 --- a/src/mynteye/api/processor/points_processor.cc +++ b/src/mynteye/api/processor/points_processor.cc @@ -57,7 +57,7 @@ PointsProcessor::PointsProcessor( std::int32_t proc_period) : Processor(std::move(proc_period)), calib_infos_(calib_infos) { - VLOG(2) << __func__ << ": proc_period=" << proc_period; + VLOG(2) << __func__; } PointsProcessor::~PointsProcessor() { diff --git a/src/mynteye/api/processor/rectify_processor.cc b/src/mynteye/api/processor/rectify_processor.cc index cf34e73..30a2442 100644 --- a/src/mynteye/api/processor/rectify_processor.cc +++ b/src/mynteye/api/processor/rectify_processor.cc @@ -339,13 +339,22 @@ void RectifyProcessor::InitParams( generateCameraFromIntrinsicsEquidistant(in_left); camodocal::CameraPtr camera_odo_ptr_right = generateCameraFromIntrinsicsEquidistant(in_right); - calib_infos = +<<<<<<< HEAD + auto calib_infos_temp = stereoRectify(camera_odo_ptr_left, camera_odo_ptr_right, in_left, in_right, ex_right_to_left); - + *calib_infos = *calib_infos_temp; +======= + auto calib_info_tmp = stereoRectify(camera_odo_ptr_left, + camera_odo_ptr_right, + in_left, + in_right, + ex_right_to_left); + *calib_infos = *calib_info_tmp; +>>>>>>> e56bf190f6df8a0af3b1c90b0e2008c8ae68309f cv::Mat rect_R_l = cv::Mat::eye(3, 3, CV_32F), rect_R_r = cv::Mat::eye(3, 3, CV_32F); for (size_t i = 0; i < 3; i++) { @@ -381,7 +390,11 @@ RectifyProcessor::RectifyProcessor( std::int32_t proc_period) : Processor(std::move(proc_period)), calib_model(CalibrationModel::UNKNOW) { +<<<<<<< HEAD +======= VLOG(2) << __func__ << ": proc_period=" << proc_period; +>>>>>>> e56bf190f6df8a0af3b1c90b0e2008c8ae68309f + calib_infos = std::make_shared(); InitParams( *std::dynamic_pointer_cast(intr_left), *std::dynamic_pointer_cast(intr_right), diff --git a/src/mynteye/api/processor/rectify_processor.h b/src/mynteye/api/processor/rectify_processor.h index 5929dfc..147bc1e 100644 --- a/src/mynteye/api/processor/rectify_processor.h +++ b/src/mynteye/api/processor/rectify_processor.h @@ -23,11 +23,7 @@ #include "mynteye/types.h" #include "mynteye/api/processor.h" #include "mynteye/device/device.h" -#include -#include #include -#include -#include #include #include #include From 13833ce2b0f852ca476c6bb21e8bab21e428c7ac Mon Sep 17 00:00:00 2001 From: kalman Date: Mon, 14 Jan 2019 18:55:53 +0800 Subject: [PATCH 2/3] fix(dataset): fix record bug --- tools/dataset/dataset.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/dataset/dataset.cc b/tools/dataset/dataset.cc index 7d2065d..eab794f 100644 --- a/tools/dataset/dataset.cc +++ b/tools/dataset/dataset.cc @@ -95,15 +95,13 @@ void Dataset::SaveMotionData(const device::MotionData &data) { auto &&writer = GetMotionWriter(); // auto seq = data.imu->serial_number; auto seq = motion_count_; - if (data.imu->flag == 1 || data.imu->flag == 2) { - writer->ofs << seq << ", " << static_cast(data.imu->flag) << ", " - << data.imu->timestamp << ", " << data.imu->accel[0] << ", " - << data.imu->accel[1] << ", " << data.imu->accel[2] << ", " - << data.imu->gyro[0] << ", " << data.imu->gyro[1] << ", " - << data.imu->gyro[2] << ", " << data.imu->temperature - << std::endl; - ++motion_count_; - } + writer->ofs << seq << ", " << static_cast(data.imu->flag) << ", " + << data.imu->timestamp << ", " << data.imu->accel[0] << ", " + << data.imu->accel[1] << ", " << data.imu->accel[2] << ", " + << data.imu->gyro[0] << ", " << data.imu->gyro[1] << ", " + << data.imu->gyro[2] << ", " << data.imu->temperature + << std::endl; + ++motion_count_; /* if(motion_count_ != seq) { LOG(INFO) << "motion_count_ != seq !" << " motion_count_: " << motion_count_ From feabcf294fd9c70edf35c3ac12786ce8334bd191 Mon Sep 17 00:00:00 2001 From: kalman Date: Mon, 14 Jan 2019 19:05:16 +0800 Subject: [PATCH 3/3] fix(ros): fix record -a bug --- .../src/mynt_eye_ros_wrapper/launch/mynteye.launch | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch b/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch index 17c38d5..dd1048b 100644 --- a/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch +++ b/wrappers/ros/src/mynt_eye_ros_wrapper/launch/mynteye.launch @@ -310,7 +310,7 @@ - 'image_transport/compressedDepth' - + - 'image_transport/compressedDepth' @@ -320,6 +320,16 @@ - 'image_transport/compressedDepth' + + + - 'image_transport/compressedDepth' + + + + + - 'image_transport/compressedDepth' + + - 'image_transport/compressedDepth'