Removed pangolin deps from the main library. Now only executables depend on it.

This commit is contained in:
Vladyslav Usenko 2019-07-16 11:42:06 +02:00
parent c0403193ac
commit 3bb45510b5
5 changed files with 23 additions and 24 deletions

View File

@ -203,8 +203,6 @@ add_library(basalt SHARED
src/io/dataset_io.cpp src/io/dataset_io.cpp
src/io/marg_data_io.cpp src/io/marg_data_io.cpp
src/calibration/aprilgrid.cpp src/calibration/aprilgrid.cpp
src/calibration/cam_calib.cpp
src/calibration/cam_imu_calib.cpp
src/calibration/calibraiton_helper.cpp src/calibration/calibraiton_helper.cpp
src/calibration/vignette.cpp src/calibration/vignette.cpp
src/utils/vio_config.cpp src/utils/vio_config.cpp
@ -217,42 +215,42 @@ add_library(basalt SHARED
src/utils/keypoints.cpp) src/utils/keypoints.cpp)
target_link_libraries(basalt PUBLIC ${TBB_LIBRARIES} ${STD_CXX_FS} ${OpenCV_LIBS} pangolin PRIVATE rosbag apriltag opengv) target_link_libraries(basalt PUBLIC ${TBB_LIBRARIES} ${STD_CXX_FS} ${OpenCV_LIBS} PRIVATE rosbag apriltag opengv)
add_executable(basalt_calibrate src/calibrate.cpp) add_executable(basalt_calibrate src/calibrate.cpp src/calibration/cam_calib.cpp)
target_link_libraries(basalt_calibrate basalt) target_link_libraries(basalt_calibrate basalt pangolin)
add_executable(basalt_calibrate_imu src/calibrate_imu.cpp) add_executable(basalt_calibrate_imu src/calibrate_imu.cpp src/calibration/cam_imu_calib.cpp)
target_link_libraries(basalt_calibrate_imu basalt) target_link_libraries(basalt_calibrate_imu basalt pangolin)
add_executable(basalt_vio_sim src/vio_sim.cpp) add_executable(basalt_vio_sim src/vio_sim.cpp)
target_link_libraries(basalt_vio_sim basalt) target_link_libraries(basalt_vio_sim basalt pangolin)
add_executable(basalt_mapper_sim src/mapper_sim.cpp) add_executable(basalt_mapper_sim src/mapper_sim.cpp)
target_link_libraries(basalt_mapper_sim basalt) target_link_libraries(basalt_mapper_sim basalt pangolin)
add_executable(basalt_mapper_sim_naive src/mapper_sim_naive.cpp) add_executable(basalt_mapper_sim_naive src/mapper_sim_naive.cpp)
target_link_libraries(basalt_mapper_sim_naive basalt) target_link_libraries(basalt_mapper_sim_naive basalt pangolin)
add_executable(basalt_mapper src/mapper.cpp) add_executable(basalt_mapper src/mapper.cpp)
target_link_libraries(basalt_mapper basalt) target_link_libraries(basalt_mapper basalt pangolin)
add_executable(basalt_opt_flow src/opt_flow.cpp) add_executable(basalt_opt_flow src/opt_flow.cpp)
target_link_libraries(basalt_opt_flow basalt) target_link_libraries(basalt_opt_flow basalt pangolin)
add_executable(basalt_vio src/vio.cpp) add_executable(basalt_vio src/vio.cpp)
target_link_libraries(basalt_vio basalt) target_link_libraries(basalt_vio basalt pangolin)
find_package(realsense2 QUIET) find_package(realsense2 QUIET)
if(realsense2_FOUND) if(realsense2_FOUND)
add_executable(basalt_rs_t265_record src/rs_t265_record.cpp src/device/rs_t265.cpp) add_executable(basalt_rs_t265_record src/rs_t265_record.cpp src/device/rs_t265.cpp)
target_link_libraries(basalt_rs_t265_record basalt realsense2::realsense2 ${OpenCV_LIBS}) target_link_libraries(basalt_rs_t265_record basalt realsense2::realsense2 ${OpenCV_LIBS} pangolin)
add_executable(basalt_rs_t265_vio src/rs_t265_vio.cpp src/device/rs_t265.cpp) add_executable(basalt_rs_t265_vio src/rs_t265_vio.cpp src/device/rs_t265.cpp)
target_link_libraries(basalt_rs_t265_vio basalt realsense2::realsense2) target_link_libraries(basalt_rs_t265_vio basalt realsense2::realsense2 pangolin)
endif() endif()

View File

@ -39,8 +39,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/spline/rd_spline.h> #include <basalt/spline/rd_spline.h>
#include <pangolin/plot/datalog.h>
namespace basalt { namespace basalt {
class VignetteEstimator { class VignetteEstimator {
@ -65,7 +63,7 @@ class VignetteEstimator {
void optimize(); void optimize();
void compute_data_log(pangolin::DataLog &vign_data_log); void compute_data_log(std::vector<std::vector<float>> &vign_data_log);
void save_vign_png(const std::string &path); void save_vign_png(const std::string &path);

View File

@ -206,7 +206,11 @@ void CamCalib::computeVign() {
ve.optimize(); ve.optimize();
ve.compute_error(&reprojected_vignette_error); ve.compute_error(&reprojected_vignette_error);
ve.compute_data_log(vign_data_log);
std::vector<std::vector<float>> vign_data;
ve.compute_data_log(vign_data);
vign_data_log.Clear();
for (const auto &v : vign_data) vign_data_log.Log(v);
{ {
vign_plotter->ClearSeries(); vign_plotter->ClearSeries();

View File

@ -247,7 +247,8 @@ void VignetteEstimator::optimize() {
} }
} }
void VignetteEstimator::compute_data_log(pangolin::DataLog &vign_data_log) { void VignetteEstimator::compute_data_log(
std::vector<std::vector<float>> &vign_data_log) {
std::vector<std::vector<double>> num_proj_points( std::vector<std::vector<double>> num_proj_points(
2, std::vector<double>(vign_size, 0)); 2, std::vector<double>(vign_size, 0));
@ -268,7 +269,7 @@ void VignetteEstimator::compute_data_log(pangolin::DataLog &vign_data_log) {
} }
} }
vign_data_log.Clear(); vign_data_log.clear();
for (size_t i = 0; i < vign_size; i++) { for (size_t i = 0; i < vign_size; i++) {
std::vector<float> log_data; std::vector<float> log_data;
for (size_t j = 0; j < vio_dataset->get_num_cams(); j++) { for (size_t j = 0; j < vio_dataset->get_num_cams(); j++) {
@ -276,7 +277,7 @@ void VignetteEstimator::compute_data_log(pangolin::DataLog &vign_data_log) {
log_data.push_back(vign_param[j].evaluate(loc)[0]); log_data.push_back(vign_param[j].evaluate(loc)[0]);
log_data.push_back(num_proj_points[j][i]); log_data.push_back(num_proj_points[j][i]);
} }
vign_data_log.Log(log_data); vign_data_log.push_back(log_data);
} }
} }

View File

@ -35,8 +35,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <basalt/io/marg_data_io.h> #include <basalt/io/marg_data_io.h>
#include <pangolin/image/image_io.h>
#include <basalt/serialization/headers_serialization.h> #include <basalt/serialization/headers_serialization.h>
#include <experimental/filesystem> #include <experimental/filesystem>