Skip to content

Commit

Permalink
Merge branch 'master' into feat_pololu
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle authored Oct 20, 2023
2 parents f5acefa + 8b0ad17 commit 6ea0448
Show file tree
Hide file tree
Showing 15 changed files with 324 additions and 294 deletions.
80 changes: 40 additions & 40 deletions cmake/FindBICLOPS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,85 +39,85 @@
#############################################################################


IF(NOT UNIX AND NOT WIN32)
# MESSAGE("FindBICLOPS.cmake: macro only for Unix and Windows for the moment.")
SET(BICLOPS_FOUND FALSE)
ELSE(NOT UNIX AND NOT WIN32)
if(NOT UNIX AND NOT WIN32)
# message("FindBICLOPS.cmake: macro only for Unix and Windows for the moment.")
set(BICLOPS_FOUND FALSE)
else(NOT UNIX AND NOT WIN32)

FIND_PATH(BICLOPS_INCLUDE_DIR Biclops.h
find_path(BICLOPS_INCLUDE_DIR Biclops.h
$ENV{BICLOPS_HOME}/include
/usr/include )

#MESSAGE("DBG BICLOPS_INCLUDE_DIR=${BICLOPS_INCLUDE_DIR}")
#message("DBG BICLOPS_INCLUDE_DIR=${BICLOPS_INCLUDE_DIR}")

FIND_PATH(PMD_INCLUDE_DIR PMD.h
find_path(PMD_INCLUDE_DIR PMD.h
$ENV{BICLOPS_HOME}/include
$ENV{BICLOPS_PMD_HOME}/include
/usr/include )

FIND_PATH(UTILS_INCLUDE_DIR utility.h
find_path(UTILS_INCLUDE_DIR utility.h
$ENV{BICLOPS_HOME}/include
$ENV{BICLOPS_UTILS_HOME}/include
/usr/include )

FIND_LIBRARY(BICLOPS_LIBRARY
find_library(BICLOPS_LIBRARY
NAMES Biclops libBiclops libBiclopsD
PATHS
$ENV{BICLOPS_HOME}/lib
/usr/lib
)

FIND_LIBRARY(PMD_LIBRARY
find_library(PMD_LIBRARY
NAMES PMD libPMD libPMDD
PATHS
$ENV{BICLOPS_HOME}/lib
$ENV{BICLOPS_PMD_HOME}/lib
/usr/lib
)

FIND_LIBRARY(UTILS_LIBRARY
find_library(UTILS_LIBRARY
NAMES Utils libUtils libUtilsD
PATHS
$ENV{BICLOPS_HOME}/lib
$ENV{BICLOPS_UTILS_HOME}/lib
/usr/lib
)
#MESSAGE("DBG BICLOPS_LIBRARY=${BICLOPS_LIBRARY}")
#message("DBG BICLOPS_LIBRARY=${BICLOPS_LIBRARY}")

## --------------------------------

IF(BICLOPS_LIBRARY AND PMD_LIBRARY AND UTILS_LIBRARY)
SET(BICLOPS_LIBRARIES ${BICLOPS_LIBRARY} ${PMD_LIBRARY} ${UTILS_LIBRARY})
ELSE(BICLOPS_LIBRARY AND PMD_LIBRARY AND UTILS_LIBRARY)
# MESSAGE(SEND_ERROR "Biclops library not found. Set USE_BICLOPS option OFF")
ENDIF(BICLOPS_LIBRARY AND PMD_LIBRARY AND UTILS_LIBRARY)
if(BICLOPS_LIBRARY AND PMD_LIBRARY AND UTILS_LIBRARY)
set(BICLOPS_LIBRARIES ${BICLOPS_LIBRARY} ${PMD_LIBRARY} ${UTILS_LIBRARY})
else(BICLOPS_LIBRARY AND PMD_LIBRARY AND UTILS_LIBRARY)
# message(SEND_ERROR "Biclops library not found. Set USE_BICLOPS option OFF")
endif(BICLOPS_LIBRARY AND PMD_LIBRARY AND UTILS_LIBRARY)

IF(NOT BICLOPS_INCLUDE_DIR)
# MESSAGE(SEND_ERROR "Biclops include dir not found. Set USE_BICLOPS option OFF")
ENDIF(NOT BICLOPS_INCLUDE_DIR)
if(NOT BICLOPS_INCLUDE_DIR)
# message(SEND_ERROR "Biclops include dir not found. Set USE_BICLOPS option OFF")
endif(NOT BICLOPS_INCLUDE_DIR)

IF(NOT PMD_INCLUDE_DIR)
# MESSAGE(SEND_ERROR "PMD include dir not found. Set USE_BICLOPS option OFF")
ENDIF(NOT PMD_INCLUDE_DIR)
if(NOT PMD_INCLUDE_DIR)
# message(SEND_ERROR "PMD include dir not found. Set USE_BICLOPS option OFF")
endif(NOT PMD_INCLUDE_DIR)

IF(NOT UTILS_INCLUDE_DIR)
# MESSAGE(SEND_ERROR "Utils include dir not found. Set USE_BICLOPS option OFF ")
ENDIF(NOT UTILS_INCLUDE_DIR)
if(NOT UTILS_INCLUDE_DIR)
# message(SEND_ERROR "Utils include dir not found. Set USE_BICLOPS option OFF ")
endif(NOT UTILS_INCLUDE_DIR)

IF(BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR)
SET(BICLOPS_INCLUDE_DIRS ${BICLOPS_INCLUDE_DIR} ${PMD_INCLUDE_DIR} ${UTILS_INCLUDE_DIR})
ENDIF(BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR)
if(BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR)
set(BICLOPS_INCLUDE_DIRS ${BICLOPS_INCLUDE_DIR} ${PMD_INCLUDE_DIR} ${UTILS_INCLUDE_DIR})
endif(BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR)

IF(BICLOPS_LIBRARIES AND BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR)
if(BICLOPS_LIBRARIES AND BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR)
#message("BICLOPS_LIBRARIES: ${BICLOPS_LIBRARIES}")
#message("BICLOPS_INCLUDE_DIRS: ${BICLOPS_INCLUDE_DIRS}")

# Try to compile a sample code using Biclops library to see if GetHomedState() is available
#SET(BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION FALSE)
#set(BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION FALSE)
include(CheckCXXSourceCompiles)

SET(CMAKE_REQUIRED_LIBRARIES ${BICLOPS_LIBRARIES})
SET(CMAKE_REQUIRED_INCLUDES ${BICLOPS_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${BICLOPS_LIBRARIES})
set(CMAKE_REQUIRED_INCLUDES ${BICLOPS_INCLUDE_DIRS})
CHECK_CXX_SOURCE_COMPILES("
#include <PMDUtils.h>
int main(){
Expand All @@ -127,14 +127,14 @@ ELSE(NOT UNIX AND NOT WIN32)
}
" BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION)

#MESSAGE("DBG1 BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION ${BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION}")
#message("DBG1 BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION ${BICLOPS_HAVE_GET_HOMED_STATE_FUNCTION}")

SET(BICLOPS_FOUND TRUE)
ELSE(BICLOPS_LIBRARIES AND BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR)
SET(BICLOPS_FOUND FALSE)
ENDIF(BICLOPS_LIBRARIES AND BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR)
set(BICLOPS_FOUND TRUE)
else(BICLOPS_LIBRARIES AND BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR)
set(BICLOPS_FOUND FALSE)
endif(BICLOPS_LIBRARIES AND BICLOPS_INCLUDE_DIR AND PMD_INCLUDE_DIR AND UTILS_INCLUDE_DIR)

MARK_AS_ADVANCED(
mark_as_advanced(
BICLOPS_INCLUDE_DIR
BICLOPS_LIBRARIES
BICLOPS_LIBRARY
Expand All @@ -143,4 +143,4 @@ ELSE(NOT UNIX AND NOT WIN32)
PMD_LIBRARY
UTILS_LIBRARY
)
ENDIF(NOT UNIX AND NOT WIN32)
endif(NOT UNIX AND NOT WIN32)
9 changes: 9 additions & 0 deletions doc/tutorial/unix/tutorial-install-fedora.dox
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ $ sudo dnf install libdmtx-devel
\verbatim
$ sudo dnf install gsl-devel
\endverbatim
- Gtk-2 for gui capabilities instead of X11
\verbatim
$ sudo dnf install gtk2-devel glib2-devel pango-devel atk-devel cairo-devel
\endverbatim
After installing the gtk packages, you need to explicitly enable gtk usage during ViSP cmake configuration step by:
\verbatim
$ cd $VISP_WS/visp-build
$ cmake ../visp -DUSE_GTK=ON
\endverbatim

\subsection install_fedora_get_source Get ViSP source code

Expand Down
15 changes: 15 additions & 0 deletions doc/tutorial/unix/tutorial-install-osx-homebrew.dox
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,21 @@ dyld[33644]: Library not loaded: /System/Library/Frameworks/Python.framework/Ver
To overcome this error, download and install the latest Python 2
for macOS from [offical site](https://www.python.org/downloads/macos/).

\subsubsection install_brew_3rdparty_other Other optional 3rd parties

We give also the way to install other 3rd party libraries to enable specific capabilities.

- Gtk-2 for gui capabilities instead of X11
\verbatim
$ brew install gtk
\endverbatim
After installing the gtk packages, you need to explicitly enable gtk usage during ViSP cmake configuration step by:
\verbatim
$ cd $VISP_WS/visp-build
$ cmake ../visp -DUSE_GTK=ON
\endverbatim


\subsection install_brew_get_source Get ViSP source code

There are different ways to get ViSP source code:
Expand Down
12 changes: 11 additions & 1 deletion doc/tutorial/unix/tutorial-install-ubuntu.dox
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ $ mkdir -p $VISP_WS

\section install_ubuntu_quick Quick ViSP installation

In this section, we give minimal instructions to build ViSP from source just to try ViSP without entering in \ref install_ubuntu_advanced.
In this section, we give minimal instructions to build ViSP from source just to try ViSP without entering in
\ref install_ubuntu_advanced.

- Install a small number of recommended 3rd parties

Expand Down Expand Up @@ -448,6 +449,15 @@ $ sudo apt-get install libgsl-dev
\verbatim
$ sudo apt-get install nlohmann-json3-dev
\endverbatim
- Gtk-2 for gui capabilities instead of X11
\verbatim
$ sudo apt-get install libgtk2.0-dev libglib2.0-dev libpango1.0-dev libatk1.0-dev libcairo2-dev
\endverbatim
After installing the gtk packages, you need to explicitly enable gtk usage during ViSP cmake configuration step by:
\verbatim
$ cd $VISP_WS/visp-build
$ cmake ../visp -DUSE_GTK=ON
\endverbatim

\subsection install_ubuntu_visp_get_source Get ViSP source code

Expand Down
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ visp_add_subdirectory(robot-simulator/camera REQUIRED_DEPS visp_core visp_vs v
visp_add_subdirectory(robot-simulator/viper850 REQUIRED_DEPS visp_core visp_vs visp_robot visp_io visp_gui)
visp_add_subdirectory(servo-afma4 REQUIRED_DEPS visp_core visp_blob visp_vs visp_robot visp_sensor visp_gui)
visp_add_subdirectory(servo-afma6 REQUIRED_DEPS visp_core visp_blob visp_vs visp_robot visp_sensor visp_vision visp_gui)
visp_add_subdirectory(servo-biclops REQUIRED_DEPS visp_core visp_blob visp_vs visp_robot visp_sensor visp_gui)
visp_add_subdirectory(servo-biclops REQUIRED_DEPS visp_core visp_detection visp_vs visp_robot visp_sensor visp_gui)
visp_add_subdirectory(servo-bebop2 REQUIRED_DEPS visp_core visp_vs visp_robot visp_gui visp_detection)
visp_add_subdirectory(servo-flir-ptu REQUIRED_DEPS visp_core visp_robot visp_vision visp_gui visp_vs visp_visual_features visp_detection visp_sensor)
visp_add_subdirectory(servo-franka REQUIRED_DEPS visp_core visp_robot visp_vision visp_io visp_gui visp_vs visp_visual_features visp_detection)
Expand Down
2 changes: 1 addition & 1 deletion example/servo-biclops/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cmake_minimum_required(VERSION 3.5)

project(example-servo-biclops)

find_package(VISP REQUIRED visp_core visp_blob visp_vs visp_robot visp_sensor visp_gui)
find_package(VISP REQUIRED visp_core visp_detection visp_vs visp_robot visp_sensor visp_gui)

set(example_cpp
moveBiclops.cpp
Expand Down
22 changes: 12 additions & 10 deletions modules/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,33 @@
# Add optional 3rd parties
set(opt_incs "")
set(opt_libs "")
set(opt_libs_private "")

# Display X11, GTK, GDI, D3D9. OpenCV already handled by core module
if(USE_X11)
list(APPEND opt_incs ${X11_INCLUDE_DIR})
list(APPEND opt_libs ${X11_LIBRARIES})
# X11 is private
include_directories(${X11_INCLUDE_DIR})
list(APPEND opt_libs_private ${X11_LIBRARIES})
mark_as_advanced(X11_xcb_icccm_INCLUDE_PATH)
mark_as_advanced(X11_xcb_icccm_LIB)
mark_as_advanced(X11_xcb_xkb_INCLUDE_PATH)
endif()

if(USE_GTK2)
list(APPEND opt_incs ${GTK2_INCLUDE_DIRS})
list(APPEND opt_libs ${GTK2_LIBRARIES})
# FS next lines removed until they proved to be useful
# if(UNIX)
# ## ignore gtk pedantic warnings by gcc specific -isystem :
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${GTK2_gtk_INCLUDE_PATH}")
# endif()
# gtk2 is private
include_directories(${GTK2_INCLUDE_DIRS})
list(APPEND opt_libs_private ${GTK2_LIBRARIES})
endif()

if(USE_GDI)
list(APPEND opt_libs ${GDI_LIBRARIES})
endif()

if(USE_DIRECT3D)
list(APPEND opt_incs ${DIRECT3D_INCLUDE_DIRS})
list(APPEND opt_libs ${DIRECT3D_LIBRARIES})
endif()

if(USE_PCL)
list(APPEND opt_incs ${PCL_INCLUDE_DIRS})

Expand All @@ -83,7 +85,7 @@ if(USE_PCL)
list(APPEND opt_libs ${PCL_DEPS_LIBRARIES})
endif()

vp_add_module(gui visp_core)
vp_add_module(gui visp_core PRIVATE_OPTIONAL ${opt_libs_private})
vp_glob_module_sources()
vp_module_include_directories(${opt_incs})
vp_create_module(${opt_libs})
Expand Down
Loading

0 comments on commit 6ea0448

Please sign in to comment.