Skip to content

Commit

Permalink
Merge branch 'master' into draft_img_encode_npy_npz
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Jan 14, 2024
2 parents d34d59c + d70f9cd commit f1602e9
Show file tree
Hide file tree
Showing 304 changed files with 18,315 additions and 5,171 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ modules/java/\.idea/
.scannerwork
build
*.blend1
**/results/**
175 changes: 96 additions & 79 deletions 3rdparty/catch2/catch.hpp

Large diffs are not rendered by default.

110 changes: 104 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,39 @@ if(NOT IOS)
include(cmake/VISPDetectPython.cmake)
endif()

if(CMAKE_VERSION VERSION_LESS "3.19.0")
set(CMAKE_NOT_OK_FOR_BINDINGS TRUE)
else()
set(CMAKE_NOT_OK_FOR_BINDINGS FALSE)
endif()

if(CMAKE_NOT_OK_FOR_BINDINGS)
status("${CMAKE_NOT_OK_FOR_BINDINGS}")
status("CMake version required for Python bindings is 3.19.0, but you have ${CMAKE_VERSION}. Python bindings generation will be deactivated")
endif()

# --- Python Bindings requirements ---

# this avoids non-active conda from getting picked anyway on Windows
#set(Python_FIND_REGISTRY LAST)
# Use environment variable PATH to decide preference for Python
#set(Python_FIND_VIRTUALENV FIRST)
#set(Python_FIND_STRATEGY LOCATION)

#find_package(Python 3.7 COMPONENTS Interpreter Development) # TODO: use visp function to find python?
#if(Python_FOUND)
# set(VISP_PYTHON_BINDINGS_EXECUTABLE "${Python_EXECUTABLE}")
#endif()
#find_package(pybind11)
VP_OPTION(USE_PYBIND11 pybind11 QUIET "Include pybind11 to create Python bindings" "" ON)

#if(pybind11_FOUND)
# set(VISP_PYBIND11_DIR "${pybind11_DIR}")
#endif()
#message("${pybind11_FOUND}")
# ---


include_directories(${VISP_INCLUDE_DIR})

#----------------------------------------------------------------------
Expand Down Expand Up @@ -413,6 +446,11 @@ VP_OPTION(BUILD_ANDROID_PROJECTS "" "" "Build Android projects providing .apk f
VP_OPTION(BUILD_ANDROID_EXAMPLES "" "" "Build examples for Android platform" "" ON IF ANDROID )
VP_OPTION(INSTALL_ANDROID_EXAMPLES "" "" "Install Android examples" "" OFF IF ANDROID )

# Build python bindings as an option
VP_OPTION(BUILD_PYTHON_BINDINGS "" "" "Build Python bindings" "" ON IF (PYTHON3INTERP_FOUND AND USE_PYBIND11 AND NOT CMAKE_NOT_OK_FOR_BINDINGS) )
VP_OPTION(BUILD_PYTHON_BINDINGS_DOC "" "" "Build the documentation for the Python bindings" "" ON IF BUILD_PYTHON_BINDINGS )


# Build demos as an option.
VP_OPTION(BUILD_DEMOS "" "" "Build ViSP demos" "" ON)
# Build tutorials as an option.
Expand Down Expand Up @@ -648,6 +686,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 @@ -730,10 +772,38 @@ if(DOXYGEN_FOUND)
set(DOXYGEN_USE_MATHJAX "NO")
endif()

# HTML version of the doc
set(DOXYGEN_GENERATE_HTML "YES")
set(DOXYGEN_GENERATE_XML "NO")
set(DOXYGEN_GENERATE_TEST_LIST "YES")
set(DOXYGEN_QUIET "NO")
set(DOXYGEN_INPUTS
"${VISP_SOURCE_DIR}/modules"
"${VISP_SOURCE_DIR}/example"
"${VISP_SOURCE_DIR}/tutorial"
"${VISP_SOURCE_DIR}/demo"
"${VISP_SOURCE_DIR}/doc"
"${VISP_BINARY_DIR}/doc"
"${VISP_CONTRIB_MODULES_PATH}"
)
string (REPLACE ";" " " DOXYGEN_INPUTS "${DOXYGEN_INPUTS}")
configure_file(${VISP_SOURCE_DIR}/doc/config-doxygen.in
${VISP_DOC_DIR}/config-doxygen
@ONLY )

# XML version of the doc
set(DOXYGEN_GENERATE_HTML "NO")
set(DOXYGEN_GENERATE_XML "YES")
set(DOXYGEN_GENERATE_TEST_LIST "NO")
set(DOXYGEN_QUIET "YES")
set(DOXYGEN_INPUTS
"${VISP_SOURCE_DIR}/modules"
)
string (REPLACE ";" " " DOXYGEN_INPUTS "${DOXYGEN_INPUTS}")
configure_file(${VISP_SOURCE_DIR}/doc/config-doxygen.in
${VISP_DOC_DIR}/config-doxygen-xml
@ONLY )

# set vars used in mainpage.dox.in
# - VISP_MAINPAGE_EXTENSION
set(VISP_MAINPAGE_EXTENSION "")
Expand Down Expand Up @@ -826,6 +896,8 @@ if(BUILD_JAVA)
endif()
endif()



if(ANDROID AND ANDROID_EXECUTABLE AND ANT_EXECUTABLE AND (ANT_VERSION VERSION_GREATER 1.7) AND (ANDROID_TOOLS_Pkg_Revision GREATER 13))
SET(CAN_BUILD_ANDROID_PROJECTS TRUE)
else()
Expand Down Expand Up @@ -941,6 +1013,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 @@ -1172,6 +1248,14 @@ if(BUILD_TUTORIALS)
add_subdirectory(tutorial)
vp_add_subdirectories(VISP_CONTRIB_MODULES_PATH tutorial)
endif()
if(BUILD_APPS)
vp_add_subdirectories(VISP_CONTRIB_MODULES_PATH apps)
endif()
if(BUILD_PYTHON_BINDINGS)
add_subdirectory(modules/python)
endif()



# ----------------------------------------------------------------------------
# Make some cmake vars advanced
Expand Down Expand Up @@ -1260,6 +1344,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 @@ -1442,7 +1527,8 @@ endif()

# ========================== java ==========================
status("")
status(" Python (for build):" PYTHON_DEFAULT_AVAILABLE THEN "${PYTHON_DEFAULT_EXECUTABLE}" ELSE "no")
status(" Python 3:")
status(" Interpreter:" PYTHON3INTERP_FOUND THEN "${PYTHON3_EXECUTABLE} (ver ${PYTHON3_VERSION_STRING})" ELSE "no")

if(BUILD_JAVA OR BUILD_visp_java)
status("")
Expand All @@ -1453,6 +1539,17 @@ if(BUILD_JAVA OR BUILD_visp_java)
endif()
endif()

# ======================= Python bindings ========================
status("")
status(" Python3 bindings:" BUILD_PYTHON_BINDINGS THEN "yes" ELSE "no")
if(BUILD_PYTHON_BINDINGS)
status(" Python3 interpreter:" PYTHON3INTERP_FOUND THEN "${PYTHON3_EXECUTABLE} (ver ${PYTHON3_VERSION_STRING})" ELSE "no")
status(" Pybind11:" USE_PYBIND11 THEN "${pybind11_DIR} (${pybind11_VERSION})" ELSE "no")
status(" Package version:" "${VISP_PYTHON_PACKAGE_VERSION}")
status(" Wrapped modules:" "${VISP_PYTHON_BOUND_MODULES}")
status(" Generated input config:" "${VISP_PYTHON_GENERATED_CONFIG_FILE}")
endif()

# ============================ Options ===========================
status("")
status(" Build options: ")
Expand Down Expand Up @@ -1502,8 +1599,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 @@ -1570,15 +1668,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 std::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
2 changes: 2 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ ViSP 3.x.x (Version in development)
. [#1273] Build error in visp_java without deprecated functionalities
. [#1274] Build issue no member named clamp in namespace std
. [#1279] Issue in vpPoseVector json serialization
. [#1296] Unable to parse camera parameters with vpXmlParserCamera::parse() when camera name is empty
. [#1307] Cannot set cxx standard when configuring for Visual Studio
----------------------------------------------
ViSP 3.6.0 (released September 22, 2023)
- Contributors:
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
Loading

0 comments on commit f1602e9

Please sign in to comment.