Skip to content

Commit

Permalink
Merge pull request lagadic#1292 from fspindle/feat_with_3rdparties
Browse files Browse the repository at this point in the history
Feat with 3rdparties
  • Loading branch information
fspindle committed Dec 19, 2023
2 parents b68f53a + 9e63de2 commit 8ef760d
Show file tree
Hide file tree
Showing 125 changed files with 5,438 additions and 3,677 deletions.
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,10 @@ VP_OPTION(WITH_QBDEVICE "" "" "Build qbdevice-api as built-in lib
VP_OPTION(WITH_TAKKTILE2 "" "" "Build Right Hand takktile2 driver as built-in library" "" ON IF (VISP_CXX_STANDARD GREATER VISP_CXX_STANDARD_98) AND (NOT WIN32) AND (NOT WINRT) AND (NOT IOS) AND (NOT ANDROID))
VP_OPTION(WITH_CATCH2 "" "" "Use catch2" "" ON IF (VISP_CXX_STANDARD GREATER VISP_CXX_STANDARD_98))
VP_OPTION(WITH_POLOLU "" "" "Build rapa pololu as built-in library" "" ON IF (NOT WINRT) AND (NOT IOS) AND (NOT ANDROID))
VP_OPTION(WITH_PUGIXML "" "" "Use pugixml built-in third-party" "" ON)
VP_OPTION(WITH_SIMDLIB "" "" "Use simdlib built-in third-party" "" ON)
VP_OPTION(WITH_STBIMAGE "" "" "Use std_image built-in third-party" "" ON)
VP_OPTION(WITH_TINYEXR "" "" "Use tinyexr built-in third-party" "" ON)

# ----------------------------------------------------------------------------
# Check for specific functions. Should be after cxx standard detection in VISPDetectCXXStandard.cmake and potential modification depending on pcl, realsense2, libfranka
Expand Down Expand Up @@ -998,6 +1002,10 @@ VP_SET(VISP_HAVE_QBDEVICE TRUE IF (BUILD_MODULE_visp_robot AND WITH_QBDEVICE)
VP_SET(VISP_HAVE_TAKKTILE2 TRUE IF (BUILD_MODULE_visp_robot AND WITH_TAKKTILE2))
VP_SET(VISP_HAVE_POLOLU TRUE IF (BUILD_MODULE_visp_robot AND WITH_POLOLU))
VP_SET(VISP_HAVE_CATCH2 TRUE IF (BUILD_MODULE_visp_core AND WITH_CATCH2))
VP_SET(VISP_HAVE_SIMDLIB TRUE IF (BUILD_MODULE_visp_core AND WITH_SIMDLIB))
VP_SET(VISP_HAVE_STBIMAGE TRUE IF (BUILD_MODULE_visp_core AND WITH_STBIMAGE))
VP_SET(VISP_HAVE_TINYEXR TRUE IF (BUILD_MODULE_visp_core AND WITH_TINYEXR))
VP_SET(VISP_HAVE_PUGIXML TRUE IF (BUILD_MODULE_visp_core AND WITH_PUGIXML))

VP_SET(VISP_HAVE_QUALISYS TRUE IF (BUILD_MODULE_visp_sensor AND USE_QUALISYS))
VP_SET(VISP_HAVE_VICON TRUE IF (BUILD_MODULE_visp_sensor AND USE_VICON))
Expand Down Expand Up @@ -1325,6 +1333,7 @@ if(VISP_VCSVERSION)
status(" Version control:" ${VISP_VCSVERSION})
endif()

# ========================== contrib modules ==========================
if(VISP_CONTRIB_MODULES_PATH)
set(__dump_extra_header OFF)
foreach(p ${VISP_CONTRIB_MODULES_PATH})
Expand Down Expand Up @@ -1579,8 +1588,9 @@ status(" Use JPEG:" USE_JPEG THEN "yes (ver ${JPEG_LIB_
status(" Use PNG:" USE_PNG THEN "yes (ver ${PNG_VERSION_STRING})" ELSE "no")
status(" \\- Use ZLIB:" USE_ZLIB THEN "yes (ver ${ZLIB_VERSION_STRING})" ELSE "no")
status(" Use OpenCV:" USE_OPENCV THEN "yes (ver ${OpenCV_VERSION})" ELSE "no")
status(" Use stb_image (built-in):" "yes (ver ${STBIMAGE_VERSION})")
status(" Use TinyEXR (built-in):" "yes (ver ${TINYEXR_VERSION})")
status(" Use stb_image (built-in):" WITH_STBIMAGE THEN "yes (ver ${STBIMAGE_VERSION})" ELSE "no")
status(" Use TinyEXR (built-in):" WITH_TINYEXR THEN "yes (ver ${TINYEXR_VERSION})" ELSE "no")
status(" Use simdlib (built-in):" WITH_SIMDLIB THEN "yes" ELSE "no")
status("")
status(" Real robots: ")
status(" Use Afma4:" USE_AFMA4 THEN "yes" ELSE "no")
Expand Down Expand Up @@ -1647,15 +1657,15 @@ status(" \\- Use AprilTag big family:" WITH_APRILTAG_BIG_FAMILY THEN "yes" E
status("")
status(" Misc: ")
status(" Use Clipper (built-in):" WITH_CLIPPER THEN "yes (ver ${CLIPPER_VERSION})" ELSE "no")
status(" Use pugixml (built-in):" "yes (ver ${PUGIXML_VERSION})")
status(" Use pugixml (built-in):" WITH_PUGIXML THEN "yes (ver ${PUGIXML_VERSION})" ELSE "no")
status(" Use libxml2:" USE_XML2 THEN "yes (ver ${XML2_VERSION_STRING})" ELSE "no")
status(" Use json (nlohmann):" USE_NLOHMANN_JSON THEN "yes (ver ${nlohmann_json_VERSION})" ELSE "no")
status("")
status(" Optimization: ")
status(" Use OpenMP:" USE_OPENMP THEN "yes" ELSE "no")
status(" Use st::thread:" USE_THREADS THEN "yes" ELSE "no")
status(" Use pthread (built-in):" WITH_PTHREAD THEN "yes (ver ${PTHREADS_VERSION})" ELSE "no")
status(" Use Simd (built-in):" "yes (ver ${SIMD_VERSION})")
status(" Use simdlib (built-in):" WITH_SIMDLIB THEN "yes" ELSE "no")
status("")
status(" DNN: ")
status(" Use CUDA Toolkit:" USE_TENSORRT AND CUDA_FOUND THEN "yes (ver ${CUDA_VERSION})" ELSE "no")
Expand Down
8 changes: 6 additions & 2 deletions apps/calibration/visp-acquire-franka-calib-data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <visp3/sensor/vpRealSense2.h>

#if defined(VISP_HAVE_REALSENSE2) && \
(defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_FRANKA) && \
(defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_FRANKA) && defined(VISP_HAVE_PUGIXML) && \
defined(VISP_HAVE_MODULE_GUI) && defined(VISP_HAVE_MODULE_ROBOT) && defined(VISP_HAVE_MODULE_SENSOR) // optional

void usage(const char **argv, int error, const std::string &robot_ip)
Expand Down Expand Up @@ -103,8 +103,9 @@ int main(int argc, const char **argv)
std::cout << "Image size: " << width << " x " << height << std::endl;
// Save intrinsics
vpCameraParameters cam;
vpXmlParserCamera xml_camera;

cam = g.getCameraParameters(RS2_STREAM_COLOR, vpCameraParameters::perspectiveProjWithDistortion);
vpXmlParserCamera xml_camera;
xml_camera.save(cam, "franka_camera.xml", "Camera", width, height);

#if defined(VISP_HAVE_X11)
Expand Down Expand Up @@ -172,6 +173,9 @@ int main()
#if !defined(VISP_HAVE_FRANKA)
std::cout << "Install libfranka." << std::endl;
#endif
#if !defined(VISP_HAVE_PUGIXML)
std::cout << "Enable pugyxml built-in usage." << std::endl;
#endif

std::cout << "After installation of the missing 3rd parties, configure ViSP with cmake "
<< "and build ViSP again." << std::endl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <visp3/sensor/vpRealSense2.h>

#if defined(VISP_HAVE_REALSENSE2) && \
(defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_UR_RTDE) && \
(defined(VISP_HAVE_X11) || defined(VISP_HAVE_GDI)) && defined(VISP_HAVE_UR_RTDE) && defined(VISP_HAVE_PUGIXML) && \
defined(VISP_HAVE_MODULE_GUI) && defined(VISP_HAVE_MODULE_ROBOT) && defined(VISP_HAVE_MODULE_SENSOR) // optional

void usage(const char **argv, int error, const std::string &robot_ip)
Expand Down Expand Up @@ -175,6 +175,9 @@ int main()
std::cout << "ViSP is not build with libur_rtde 3rd party used to control a robot from Universal Robots..."
<< std::endl;
#endif
#if !defined(VISP_HAVE_PUGIXML)
std::cout << "Enable pugyxml built-in usage." << std::endl;
#endif

std::cout << "After installation of the missing 3rd parties, configure ViSP with cmake"
<< " and build ViSP again." << std::endl;
Expand Down
9 changes: 7 additions & 2 deletions apps/calibration/visp-compute-chessboard-poses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#include <visp3/core/vpConfig.h>

#if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_CALIB3D)
#if defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_CALIB3D) && defined(VISP_HAVE_PUGIXML)

#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/core/core.hpp>
Expand Down Expand Up @@ -345,7 +345,12 @@ int main(int argc, const char **argv)
#else
int main()
{
std::cerr << "OpenCV 2.3.0 or higher is requested to run the calibration." << std::endl;
#if !(defined(VISP_HAVE_OPENCV) && defined(HAVE_OPENCV_CALIB3D))
std::cerr << "OpenCV calib3d module is requested to run the calibration." << std::endl;
#endif
#if !defined(VISP_HAVE_PUGIXML)
std::cout << "pugixml built-in 3rdparty is requested to run the calibration." << std::endl;
#endif
return EXIT_SUCCESS;
}
#endif
46 changes: 25 additions & 21 deletions cmake/VISP3rdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,30 +57,34 @@ if(WITH_TAKKTILE2)
set(TAKKTILE2_VERSION ${TAKKTILE2_MAJOR_VERSION}.${TAKKTILE2_MINOR_VERSION}.${TAKKTILE2_PATCH_VERSION})
endif()

# pugixml is always enabled to provide default XML I/O capabilities
set(PUGIXML_LIBRARY visp_pugixml)
add_subdirectory("${VISP_SOURCE_DIR}/3rdparty/pugixml-1.9")
set(PUGIXML_INCLUDE_DIRS "${${PUGIXML_LIBRARY}_SOURCE_DIR}" "${${PUGIXML_LIBRARY}_BINARY_DIR}")
set(PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
set(PUGIXML_VERSION ${PUGIXML_MAJOR_VERSION}.${PUGIXML_MINOR_VERSION}.${PUGIXML_PATCH_VERSION})
if(WITH_PUGIXML)
set(PUGIXML_LIBRARY visp_pugixml)
add_subdirectory("${VISP_SOURCE_DIR}/3rdparty/pugixml-1.9")
set(PUGIXML_INCLUDE_DIRS "${${PUGIXML_LIBRARY}_SOURCE_DIR}" "${${PUGIXML_LIBRARY}_BINARY_DIR}")
set(PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
set(PUGIXML_VERSION ${PUGIXML_MAJOR_VERSION}.${PUGIXML_MINOR_VERSION}.${PUGIXML_PATCH_VERSION})
endif()

# simdlib is always enabled since it contains fallback code to plain C++ code
set(SIMD_LIBRARY visp_simdlib)
add_subdirectory("${VISP_SOURCE_DIR}/3rdparty/simdlib")
set(SIMDLIB_INCLUDE_DIRS "${VISP_SOURCE_DIR}/3rdparty/simdlib")
set(SIMDLIB_LIBRARIES ${SIMD_LIBRARY})
if(WITH_SIMDLIB)
set(SIMD_LIBRARY visp_simdlib)
add_subdirectory("${VISP_SOURCE_DIR}/3rdparty/simdlib")
set(SIMDLIB_INCLUDE_DIRS "${VISP_SOURCE_DIR}/3rdparty/simdlib")
set(SIMDLIB_LIBRARIES ${SIMD_LIBRARY})
endif()

# stb is always enabled
set(STBIMAGE_LIBRARY visp_stbimage)
add_subdirectory("${VISP_SOURCE_DIR}/3rdparty/stb_image")
set(STBIMAGE_INCLUDE_DIRS "${VISP_SOURCE_DIR}/3rdparty/stb_image")
set(STBIMAGE_VERSION ${STBIMAGE_MAJOR_VERSION}.${STBIMAGE_MINOR_VERSION}.${STBIMAGE_PATCH_VERSION})
if(WITH_STBIMAGE)
set(STBIMAGE_LIBRARY visp_stbimage)
add_subdirectory("${VISP_SOURCE_DIR}/3rdparty/stb_image")
set(STBIMAGE_INCLUDE_DIRS "${VISP_SOURCE_DIR}/3rdparty/stb_image")
set(STBIMAGE_VERSION ${STBIMAGE_MAJOR_VERSION}.${STBIMAGE_MINOR_VERSION}.${STBIMAGE_PATCH_VERSION})
endif()

# tinyexr is always enabled
set(TINYEXR_LIBRARY visp_tinyexr)
add_subdirectory("${VISP_SOURCE_DIR}/3rdparty/tinyexr")
set(TINYEXR_INCLUDE_DIRS "${VISP_SOURCE_DIR}/3rdparty/tinyexr")
set(TINYEXR_VERSION ${TINYEXR_MAJOR_VERSION}.${TINYEXR_MINOR_VERSION}.${TINYEXR_PATCH_VERSION})
if(WITH_TINYEXR)
set(TINYEXR_LIBRARY visp_tinyexr)
add_subdirectory("${VISP_SOURCE_DIR}/3rdparty/tinyexr")
set(TINYEXR_INCLUDE_DIRS "${VISP_SOURCE_DIR}/3rdparty/tinyexr")
set(TINYEXR_VERSION ${TINYEXR_MAJOR_VERSION}.${TINYEXR_MINOR_VERSION}.${TINYEXR_PATCH_VERSION})
endif()

if(WITH_CATCH2)
set(CATCH2_LIBRARY visp_catch2)
Expand Down
4 changes: 4 additions & 0 deletions cmake/VISPGenerateConfigScript.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ if(NOT DEFINED CMAKE_HELPER_SCRIPT)
VISP_HAVE_OPENMP

WITH_CATCH2
WITH_PUGIXML
WITH_SIMDLIB
WITH_STBIMAGE
WITH_TINYEXR

FILE_VISP_SCRIPT_CONFIG
FILE_VISP_SCRIPT_CONFIG_INSTALL
Expand Down
5 changes: 5 additions & 0 deletions cmake/templates/VISPConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -243,20 +243,25 @@ set(VISP_HAVE_PARPORT "@VISP_HAVE_PARPORT@")
set(VISP_HAVE_PCL "@VISP_HAVE_PCL@")
set(VISP_HAVE_PIONEER "@VISP_HAVE_PIONEER@")
set(VISP_HAVE_PNG "@VISP_HAVE_PNG@")
set(VISP_HAVE_POLOLU "@VISP_HAVE_POLOLU@")
set(VISP_HAVE_PTHREAD "@VISP_HAVE_PTHREAD@")
set(VISP_HAVE_PTU46 "@VISP_HAVE_PTU46@")
set(VISP_HAVE_PUGIXML "@VISP_HAVE_PUGIXML@")
set(VISP_HAVE_PYLON "@VISP_HAVE_PYLON@")
set(VISP_HAVE_QBDEVICE "@VISP_HAVE_QBDEVICE@")
set(VISP_HAVE_QT "@VISP_HAVE_QT@")
set(VISP_HAVE_QUALISYS "@VISP_HAVE_QUALISYS@")
set(VISP_HAVE_REALSENSE "@VISP_HAVE_REALSENSE@")
set(VISP_HAVE_REALSENSE2 "@VISP_HAVE_REALSENSE2@")
set(VISP_HAVE_SIMDLIB "@VISP_HAVE_SIMDLIB@")
set(VISP_HAVE_SOQT "@VISP_HAVE_SOQT@")
set(VISP_HAVE_SOWIN "@VISP_HAVE_SOWIN@")
set(VISP_HAVE_SOXT "@VISP_HAVE_SOXT@")
set(VISP_HAVE_STBIMAGE "@VISP_HAVE_STBIMAGE@")
set(VISP_HAVE_TAKKTILE2 "@VISP_HAVE_TAKKTILE2@")
set(VISP_HAVE_TENSORRT "@VISP_HAVE_TENSORRT@")
set(VISP_HAVE_THREADS "@VISP_HAVE_THREADS@")
set(VISP_HAVE_TINYEXR "@VISP_HAVE_TINYEXR@")
set(VISP_HAVE_UEYE "@VISP_HAVE_UEYE@")
set(VISP_HAVE_UR_RTDE "@VISP_HAVE_UR_RTDE@")
set(VISP_HAVE_V4L2 "@VISP_HAVE_V4L2@")
Expand Down
11 changes: 10 additions & 1 deletion cmake/templates/vpConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
#cmakedefine VISP_HAVE_X11

// Always define pugixml for compatibility.
#define VISP_HAVE_PUGIXML
#cmakedefine VISP_HAVE_PUGIXML

// Defined if XML2 library available.
#cmakedefine VISP_HAVE_XML2
Expand Down Expand Up @@ -192,6 +192,15 @@
// Defined if Catch2 library available
#cmakedefine VISP_HAVE_CATCH2

// Defined if simdlib library available
#cmakedefine VISP_HAVE_SIMDLIB

// Defined if stb_image library available
#cmakedefine VISP_HAVE_STBIMAGE

// Defined if tinyexr library available
#cmakedefine VISP_HAVE_TINYEXR

// Defined if Eigen3 library available
#cmakedefine VISP_HAVE_EIGEN3

Expand Down
4 changes: 4 additions & 0 deletions doc/config-doxygen.in
Original file line number Diff line number Diff line change
Expand Up @@ -2415,19 +2415,23 @@ PREDEFINED = @DOXYGEN_SHOULD_SKIP_THIS@ \
VISP_HAVE_POLOLU \
VISP_HAVE_PTHREAD \
VISP_HAVE_PTU46 \
VISP_HAVE_PUGIXML \
VISP_HAVE_PYLON \
VISP_HAVE_QBDEVICE \
VISP_HAVE_QT \
VISP_HAVE_QUALISYS \
VISP_HAVE_REALSENSE \
VISP_HAVE_REALSENSE_VERSION=0x020000 \
VISP_HAVE_REALSENSE2 \
VISP_HAVE_SIMDLIB \
VISP_HAVE_SOWIN \
VISP_HAVE_SOQT \
VISP_HAVE_SOXT \
VISP_HAVE_STBIMAGE \
VISP_HAVE_TAKKTILE2 \
VISP_HAVE_TENSORRT \
VISP_HAVE_THREADS \
VISP_HAVE_TINYEXR \
VISP_HAVE_UEYE \
VISP_HAVE_UR_RTDE \
VISP_HAVE_V4L2 \
Expand Down
Loading

0 comments on commit 8ef760d

Please sign in to comment.