mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Fixed ZED sdk build on Linux (added c++11)
This commit is contained in:
+17
-17
@@ -236,22 +236,6 @@ IF(WITH_GTSAM)
|
|||||||
FIND_PACKAGE(GTSAM QUIET)
|
FIND_PACKAGE(GTSAM QUIET)
|
||||||
ENDIF(WITH_GTSAM)
|
ENDIF(WITH_GTSAM)
|
||||||
|
|
||||||
IF(G2O_FOUND OR GTSAM_FOUND)
|
|
||||||
#Newest versions require std11
|
|
||||||
IF(NOT MSVC)
|
|
||||||
include(CheckCXXCompilerFlag)
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
|
||||||
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
|
||||||
IF(COMPILER_SUPPORTS_CXX11)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
||||||
ELSEIF(COMPILER_SUPPORTS_CXX0X)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
|
||||||
ELSE()
|
|
||||||
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler if you want to use g2o or gtsam (set \"-DWITH_G2O=OFF -DWITH_GTSAM=OFF\" to build without g2o and gtsam).")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
ENDIF(G2O_FOUND OR GTSAM_FOUND)
|
|
||||||
|
|
||||||
IF(WITH_FLYCAPTURE2)
|
IF(WITH_FLYCAPTURE2)
|
||||||
FIND_PACKAGE(FlyCapture2 QUIET)
|
FIND_PACKAGE(FlyCapture2 QUIET)
|
||||||
IF(FlyCapture2_FOUND)
|
IF(FlyCapture2_FOUND)
|
||||||
@@ -280,7 +264,7 @@ IF(WITH_ZED)
|
|||||||
LINK_DIRECTORIES( ${LINK_DIRECTORIES} ${ZED_LIBRARY_DIR})
|
LINK_DIRECTORIES( ${LINK_DIRECTORIES} ${ZED_LIBRARY_DIR})
|
||||||
ENDIF(ZED_LIBRARIES AND ZED_INCLUDE_DIRS)
|
ENDIF(ZED_LIBRARIES AND ZED_INCLUDE_DIRS)
|
||||||
ELSE() # Linux
|
ELSE() # Linux
|
||||||
find_package(ZED 0.9)
|
find_package(ZED 0.9 QUIET)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
|
|
||||||
IF(ZED_FOUND)
|
IF(ZED_FOUND)
|
||||||
@@ -295,6 +279,22 @@ IF(WITH_ZED)
|
|||||||
ENDIF(ZED_FOUND)
|
ENDIF(ZED_FOUND)
|
||||||
ENDIF(WITH_ZED)
|
ENDIF(WITH_ZED)
|
||||||
|
|
||||||
|
IF(G2O_FOUND OR GTSAM_FOUND OR ZED_FOUND)
|
||||||
|
#Newest versions require std11
|
||||||
|
IF(NOT MSVC)
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
|
||||||
|
IF(COMPILER_SUPPORTS_CXX11)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
|
ELSEIF(COMPILER_SUPPORTS_CXX0X)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||||
|
ELSE()
|
||||||
|
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler if you want to use g2o or gtsam (set \"-DWITH_G2O=OFF -DWITH_GTSAM=OFF\" to build without g2o and gtsam).")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
ENDIF(G2O_FOUND OR GTSAM_FOUND OR ZED_FOUND)
|
||||||
|
|
||||||
####### OSX BUNDLE CMAKE_INSTALL_PREFIX #######
|
####### OSX BUNDLE CMAKE_INSTALL_PREFIX #######
|
||||||
IF(APPLE AND BUILD_AS_BUNDLE)
|
IF(APPLE AND BUILD_AS_BUNDLE)
|
||||||
IF(Qt5_FOUND OR (QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND))
|
IF(Qt5_FOUND OR (QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND))
|
||||||
|
|||||||
@@ -778,16 +778,13 @@ bool CameraStereoZed::init(const std::string & calibrationFolder, const std::str
|
|||||||
zed_ = new sl::zed::Camera(sl::zed::HD720); // Use in Live Mode
|
zed_ = new sl::zed::Camera(sl::zed::HD720); // Use in Live Mode
|
||||||
//zed_ = new sl::zed::Camera(argv[1]); // Use in SVO playback mode
|
//zed_ = new sl::zed::Camera(argv[1]); // Use in SVO playback mode
|
||||||
|
|
||||||
int width = zed_->getImageSize().width;
|
|
||||||
int height = zed_->getImageSize().height;
|
|
||||||
|
|
||||||
//init WITH self-calibration (- last parameter to false -)
|
//init WITH self-calibration (- last parameter to false -)
|
||||||
sl::zed::ERRCODE err = zed_->init(sl::zed::MODE::PERFORMANCE, 0, true, false, false);
|
sl::zed::ERRCODE err = zed_->init(sl::zed::MODE::PERFORMANCE, 0, true, false, false);
|
||||||
|
|
||||||
// Quit if an error occurred
|
// Quit if an error occurred
|
||||||
if (err != sl::zed::SUCCESS)
|
if (err != sl::zed::SUCCESS)
|
||||||
{
|
{
|
||||||
UERROR("ZED camera initialization failed: %s", sl::zed::errcode2str(err));
|
UERROR("ZED camera initialization failed: %s", sl::zed::errcode2str(err).c_str());
|
||||||
delete zed_;
|
delete zed_;
|
||||||
zed_ = 0;
|
zed_ = 0;
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user