Add WITH_DEVICE_INFO_REQUIRED option
This commit is contained in:
parent
438ba6481d
commit
25f72dd74f
|
@ -22,6 +22,8 @@ include(${CMAKE_CURRENT_LIST_DIR}/Utils.cmake)
|
||||||
|
|
||||||
option(WITH_API "Build with API layer, need OpenCV" ON)
|
option(WITH_API "Build with API layer, need OpenCV" ON)
|
||||||
|
|
||||||
|
option(WITH_DEVICE_INFO_REQUIRED "Build with device info required" ON)
|
||||||
|
|
||||||
# 3rdparty components
|
# 3rdparty components
|
||||||
|
|
||||||
option(WITH_BOOST "Include Boost support" ON)
|
option(WITH_BOOST "Include Boost support" ON)
|
||||||
|
@ -33,6 +35,10 @@ if(WITH_API)
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/DetectOpenCV.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/DetectOpenCV.cmake)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_DEVICE_INFO_REQUIRED)
|
||||||
|
add_definitions(-DWITH_DEVICE_INFO_REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_BOOST)
|
if(WITH_BOOST)
|
||||||
find_package(Boost COMPONENTS filesystem)
|
find_package(Boost COMPONENTS filesystem)
|
||||||
if(Boost_FOUND)
|
if(Boost_FOUND)
|
||||||
|
@ -115,6 +121,8 @@ if(WITH_API)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
status(" WITH_DEVICE_INFO_REQUIRED: ${WITH_DEVICE_INFO_REQUIRED}")
|
||||||
|
|
||||||
status(" WITH_BOOST: ${WITH_BOOST}")
|
status(" WITH_BOOST: ${WITH_BOOST}")
|
||||||
if(WITH_BOOST)
|
if(WITH_BOOST)
|
||||||
if(Boost_FOUND)
|
if(Boost_FOUND)
|
||||||
|
|
|
@ -218,13 +218,18 @@ API::API(std::shared_ptr<Device> device) : device_(device) {
|
||||||
device_->GetIntrinsics(Stream::RIGHT, &in_r_ok);
|
device_->GetIntrinsics(Stream::RIGHT, &in_r_ok);
|
||||||
device_->GetExtrinsics(Stream::LEFT, Stream::RIGHT, &ex_l2r_ok);
|
device_->GetExtrinsics(Stream::LEFT, Stream::RIGHT, &ex_l2r_ok);
|
||||||
if (!in_l_ok || !in_r_ok || !ex_l2r_ok) {
|
if (!in_l_ok || !in_r_ok || !ex_l2r_ok) {
|
||||||
LOG(FATAL) << "Image params not found, but we need it to process the "
|
#if defined(WITH_DEVICE_INFO_REQUIRED)
|
||||||
"images. Please `make tools` and use `img_params_writer` "
|
LOG(FATAL)
|
||||||
"to write the image params. If you update the SDK from "
|
#else
|
||||||
"1.x, the `SN*.conf` is the file contains them. Besides, "
|
LOG(WARNING)
|
||||||
"you could also calibrate them by yourself. Read the guide "
|
#endif
|
||||||
"doc (https://github.com/slightech/MYNT-EYE-SDK-2-Guide) "
|
<< "Image params not found, but we need it to process the "
|
||||||
"to learn more.";
|
"images. Please `make tools` and use `img_params_writer` "
|
||||||
|
"to write the image params. If you update the SDK from "
|
||||||
|
"1.x, the `SN*.conf` is the file contains them. Besides, "
|
||||||
|
"you could also calibrate them by yourself. Read the guide "
|
||||||
|
"doc (https://github.com/slightech/MYNT-EYE-SDK-2-Guide) "
|
||||||
|
"to learn more.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
synthetic_.reset(new Synthetic(this));
|
synthetic_.reset(new Synthetic(this));
|
||||||
|
|
|
@ -541,8 +541,13 @@ void Device::ReadAllInfos() {
|
||||||
Channels::img_params_t img_params;
|
Channels::img_params_t img_params;
|
||||||
Channels::imu_params_t imu_params;
|
Channels::imu_params_t imu_params;
|
||||||
if (!channels_->GetFiles(device_info_.get(), &img_params, &imu_params)) {
|
if (!channels_->GetFiles(device_info_.get(), &img_params, &imu_params)) {
|
||||||
LOG(FATAL) << "Read device infos failed. Please upgrade your firmware to "
|
#if defined(WITH_DEVICE_INFO_REQUIRED)
|
||||||
"the latest version.";
|
LOG(FATAL)
|
||||||
|
#else
|
||||||
|
LOG(WARNING)
|
||||||
|
#endif
|
||||||
|
<< "Read device infos failed. Please upgrade your firmware to the "
|
||||||
|
"latest version.";
|
||||||
}
|
}
|
||||||
VLOG(2) << "Device info: {name: " << device_info_->name
|
VLOG(2) << "Device info: {name: " << device_info_->name
|
||||||
<< ", serial_number: " << device_info_->serial_number
|
<< ", serial_number: " << device_info_->serial_number
|
||||||
|
|
Loading…
Reference in New Issue
Block a user