Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • LidarView/lidarview-core
  • nick.laurenson/lidarview-core
  • aerezarang/lidarview-core
3 results
Show changes
Commits on Source (38)
Showing
with 325 additions and 618 deletions
......@@ -121,8 +121,16 @@ target_link_libraries(lqApplicationComponents PUBLIC
ParaView::RemotingSettings
ParaView::RemotingViews
ParaView::RemotingViewsPython
VTK::CommonSystem
LidarCore # Only way to get the headers at compile time
LidarView::CommonCore
LidarView::Sources
LidarView::FiltersTemporal
LidarView::IOCore
LidarView::IOGeolocation
LidarView::IOGeneral
LidarView::IOLidar
LidarView::IONetwork
PythonQt::PythonQt # Required to Wrap additional functions
)
target_compile_definitions(lqApplicationComponents PUBLIC Q_OS_SYMBIAN)
......
#--------------------------------------
# Miscellaneous helper cmake macros
#--------------------------------------
include(LidarViewSupportMacros)
function(print_version name)
message(STATUS "Found ${name}: ${${name}_VERSION}")
endfunction()
function(check_depedency_target name target_name)
if (NOT TARGET ${target_name})
message(FATAL_ERROR "Missing ${name} dependency.")
endif ()
endfunction()
#--------------------------------------
# ParaView dependency - required
#--------------------------------------
find_package(ParaView 5.11 REQUIRED)
set(paraview_version "${ParaView_VERSION_MAJOR}.${ParaView_VERSION_MINOR}")
if (NOT PARAVIEW_USE_QT)
message(FATAL_ERROR "PARAVIEW_USE_QT is OFF, Paraview must be built with Qt")
endif ()
if (NOT PARAVIEW_USE_PYTHON)
message(FATAL_ERROR "PARAVIEW_USE_PYTHON is OFF, Paraview must be built with Python")
endif ()
print_version(ParaView)
#--------------------------------------
# VTK (from ParaView package) dependency - required
#--------------------------------------
if (NOT VTK_FOUND OR NOT VTK_VERSION)
message(FATAL_ERROR "VTK not found")
endif ()
if (NOT VTK_QT_VERSION VERSION_EQUAL "5")
message(FATAL_ERROR "Qt5 was not used to build VTK")
endif ()
print_version(VTK)
#--------------------------------------
# Qt5 dependency - required
#--------------------------------------
find_package(Qt5 REQUIRED COMPONENTS Core Gui Help PrintSupport UiTools Svg Widgets)
if (NOT Qt5_FOUND)
message(FATAL_ERROR "Qt5 not found")
endif ()
print_version(Qt5)
#--------------------------------------
# PythonQt dependency - required
#--------------------------------------
find_package(PythonQt REQUIRED)
check_depedency_target(PythonQt PythonQt::PythonQt)
message(STATUS "Found PythonQt")
#--------------------------------------
# PCAP dependency - required
#--------------------------------------
option(LIDARVIEW_USE_PCAP "PCAP is required for reading .pcap (from lidar)" ON)
mark_as_advanced(LIDARVIEW_USE_PCAP)
if (LIDARVIEW_USE_PCAP)
find_library(PCAP_LIBRARY pcap DOC "pcap library")
find_path(PCAP_INCLUDE_DIR pcap.h DOC "pcap include directory")
if (PCAP_LIBRARY AND PCAP_INCLUDE_DIR)
add_library(PCAP::pcap UNKNOWN IMPORTED)
set_target_properties(PCAP::pcap
PROPERTIES
IMPORTED_LOCATION "${PCAP_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${PCAP_INCLUDE_DIR}")
endif ()
check_depedency_target(pcap PCAP::pcap)
message(STATUS "Found PCAP library")
endif ()
#--------------------------------------
# Liblas dependency - required
#--------------------------------------
option(LIDARVIEW_USE_LIBLAS "Liblas is required for writing .las" ON)
mark_as_advanced(LIDARVIEW_USE_LIBLAS)
if (LIDARVIEW_USE_LIBLAS)
set(las_name las)
if(WIN32)
set(las_name liblas)
endif()
find_library(LIBLAS_LIBRARY ${las_name} DOC "las library")
find_path(LIBLAS_INCLUDE_DIR liblas/version.hpp DOC "las include directory")
if (LIBLAS_LIBRARY AND LIBLAS_INCLUDE_DIR)
add_library(LIBLAS::las UNKNOWN IMPORTED)
set_target_properties(LIBLAS::las
PROPERTIES
IMPORTED_LOCATION "${LIBLAS_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBLAS_INCLUDE_DIR}")
endif ()
check_depedency_target(liblas LIBLAS::las)
message(STATUS "Found LibLAS")
endif ()
#--------------------------------------
# Eigen dependency - required
#--------------------------------------
find_package(Eigen3 REQUIRED)
check_depedency_target(Eigen3 Eigen3::Eigen)
print_version(Eigen3)
#--------------------------------------
# Yaml dependency - required
#--------------------------------------
find_package(yaml-cpp REQUIRED)
add_library(YAML::yamlcpp ALIAS yaml-cpp)
check_depedency_target(yaml-cpp YAML::yamlcpp)
print_version(yaml-cpp)
#--------------------------------------
# Boost dependency - required (note: boost is also found by ParaView)
#--------------------------------------
find_package(Boost REQUIRED COMPONENTS atomic filesystem program_options system thread)
#--------------------------------------
# PCL dependency - optional
#--------------------------------------
lidarview_deprecated_setting(pcl_default LIDARVIEW_USE_PCL ENABLE_pcl OFF)
option(LIDARVIEW_USE_PCL "PCL is required for some filters (e.g SLAM, PCLRansacFilter)" "${pcl_default}")
if (LIDARVIEW_USE_PCL)
find_package(PCL REQUIRED COMPONENTS common kdtree features registration io sample_consensus)
# WIP not clean contains a NIP "-Dno-qhull"
add_definitions(${PCL_DEFINITIONS})
print_version(PCL)
endif ()
#--------------------------------------
# Ceres dependency - optional
#--------------------------------------
lidarview_deprecated_setting(ceres_default LIDARVIEW_USE_CERES ENABLE_ceres OFF)
option(LIDARVIEW_USE_CERES "Ceres is required for filters using non-linear least square optimization (e.g SLAM, autocalibration)" "${ceres_default}")
if (LIDARVIEW_USE_CERES)
find_package(Ceres REQUIRED)
endif ()
#--------------------------------------
# nanoflann dependency - optional
#--------------------------------------
lidarview_deprecated_setting(nanoflann_default LIDARVIEW_USE_NANOFLANN ENABLE_nanoflann OFF)
option(LIDARVIEW_USE_NANOFLANN "Nanoflann will be required for filters using some optimized kdtree (e.g SLAM, DBSCAN)" "${nanoflann_default}")
if (LIDARVIEW_USE_NANOFLANN)
find_package(nanoflann REQUIRED)
print_version(nanoflann)
endif ()
#--------------------------------------
# Opencv dependency - optional
#--------------------------------------
lidarview_deprecated_setting(opencv_default LIDARVIEW_USE_OPENCV ENABLE_opencv OFF)
option(LIDARVIEW_USE_OPENCV "OpenCV is required for handling lidar-camera multisensor systems" "${opencv_default}")
if (LIDARVIEW_USE_OPENCV)
find_package(OpenCV REQUIRED)
print_version(OpenCV)
endif ()
# From VTK/CMake/vtkSupportMacros.cmake
# Bridge an old, deprecated, setting to a new replacement setting.
#
# Use this function when a user-visible flag is being renamed or otherwise
# replaced. If the old value is set, it will be given as the default value,
# otherwise the given default value will be used. This returned value should
# then be used in the ``set(CACHE)`` or ``option()`` call for the new value.
#
# If the old value is set, it will warn that it is deprecated for the new name.
#
# If replacing the setting ``OLD_SETTING`` with ``NEW_SETTING``, its usage
# would look like:
#
# lidarview_deprecated_setting(default_setting NEW_SETTING OLD_SETTING "default value")
# set(NEW_SETTING "${default_setting}"
# CACHE STRING "Documentation for the setting.")
function (lidarview_deprecated_setting output_default new old intended_default)
set(default "${intended_default}")
if (DEFINED "${old}")
message(WARNING "The '${old}' variable is deprecated for '${new}'.")
set(default "${${old}}")
endif ()
set("${output_default}" "${default}" PARENT_SCOPE)
endfunction ()
# Remove an old / obsolete setting
#
# Use this function when a user-visible flag is being removed entirely. If the
# old value is set, it will be cause a warning message letting the user know
# that the setting has no effect.
function (lidarview_obsolete_setting old)
if (DEFINED "${old}")
message(WARNING "The '${old}' variable is obsolete and no longer has any effect.")
endif ()
endfunction ()
......@@ -61,49 +61,7 @@ file(STRINGS version.txt version_txt)
extract_version_components("${version_txt}" "LV")
determine_version(${CMAKE_SOURCE_DIR} ${GIT_EXECUTABLE} "LV")
# Paraview
#must be included after Python and Determine version
if(NOT ParaView_DIR)
message(WARNING "ParaView_DIR not found")
message(FATAL_ERROR "Building with external Paraview not yet implemented")
endif()
find_package(ParaView 5.11 REQUIRED)
message(STATUS "Paraview-${ParaView_VERSION}")
# WIP should check if EQUAL ${paraview_version}, in the event of from-source builds
# VTK from Paraview
if(NOT VTK_DIR)
message(WARNING "Is VTK provided by Paraview ?")
endif()
if(NOT VTK_FOUND )
message(FATAL_ERROR "VTK not found")
endif()
if(NOT VTK_VERSION )
message(FATAL_ERROR "VTK_VERSION not defined or empty, is VTK FOUND ?")
endif()
message(STATUS "VTK-${VTK_VERSION}")
# Qt5
if(NOT PARAVIEW_USE_QT)
message(FATAL_ERROR "PARAVIEW_BUILD_QT_GUI is OFF, Paraview must be built with Qt")
endif()
find_package(Qt5 REQUIRED COMPONENTS Core Gui Help PrintSupport UiTools Svg Widgets)
if(NOT Qt5_FOUND)
message(FATAL_ERROR "Qt5 not found")
endif()
message(STATUS "Qt: ${PARAVIEW_QT_VERSION}, actually ${Qt5Core_VERSION}")
#Fix SYSTEM Qt5 RPATH handling at install, WIP could base off "USE_SYSTEM_qt5"
if(NOT Qt5_DIR)
message(FATAL_ERROR "Qt5_DIR not set")
endif()
list(APPEND CMAKE_INSTALL_RPATH "${Qt5_DIR}/../../")
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/LVCore/CMake/")
find_package(PythonQt REQUIRED)
if(NOT PythonQt_FOUND OR NOT TARGET PythonQt::PythonQt)
message(FATAL_ERROR "PythonQt::PythonQt not FOUND")
endif()
include(FindLidarViewDependencies)
# Doc
option(BUILD_DOC "Build documentation" OFF)
......
......@@ -25,7 +25,10 @@ paraview_add_plugin(DatasetIOPlugin
SOURCES ${server_manager_sources} ${server_sources}
)
target_link_libraries(DatasetIOPlugin PUBLIC LidarCore)
target_link_libraries(DatasetIOPlugin PUBLIC
LidarView::IOLidar
VTK::FiltersGeneral
VTK::FiltersSources)
target_include_directories(DatasetIOPlugin
PUBLIC
Kitti/
......
# Create Plugin
paraview_add_plugin(LidarPlugin
VERSION "1.0"
MODULES LidarCore
MODULE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/LidarCore/vtk.module"
#--------------------------------------
# Scan and find all modules
#--------------------------------------
set(lidarplugin_source_directories "${CMAKE_CURRENT_SOURCE_DIR}/LidarCore")
vtk_module_find_modules(lidarplugin_module_files ${lidarplugin_source_directories})
vtk_module_scan(
MODULE_FILES ${lidarplugin_module_files}
PROVIDES_MODULES lidarplugin_modules
WANT_BY_DEFAULT ON)
#--------------------------------------
# Create plugin
#--------------------------------------
paraview_add_plugin(LidarPlugin
VERSION "2.0"
MODULES ${lidarplugin_modules}
MODULE_FILES ${lidarplugin_module_files}
MODULE_ARGS
LICENSE_DESTINATION "${LV_INSTALL_INCLUDE_DIR}" #wip Temporary fix
TEST_DIRECTORY_NAME "NONE" # Do not let vtk_module build the default 'Testing' subdir, it complexifies paths
TEST_DIRECTORY_NAME "None" # Deactivate testing - incompatible with LidarPlugin
TEST_INPUT_DATA_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/Testing/Data"
)
#-----------------------------------------------------------------------------
# Python wrapping
# Simply use "import LidarPlugin.LidarCore" and you have acces to the wrapped c++ code
# DO NOT FOR ANY REASON USE the method GetClientSideObject() to have acces to the vtkObject directly.
#-----------------------------------------------------------------------------
if(NOT LV_INSTALL_PYTHON_MODULES_DIR)
message(FATAL_ERROR "LV_INSTALL_PYTHON_MODULES_DIR not set")
endif()
set(lidarplugin_wrapped_modules
LidarView::CommonCore
LidarView::IOCore
LidarView::IOGeneral
LidarView::IOGeolocation
LidarView::IONetwork
LidarView::IOLidar
LidarView::Sources
)
vtk_module_wrap_python(
MODULES ${lidarplugin_wrapped_modules}
BUILD_STATIC OFF
INSTALL_HEADERS OFF
PYTHON_PACKAGE "lidarview.modules" # This is the name of the python module to import
MODULE_DESTINATION "${LV_INSTALL_PYTHON_MODULES_DIR}" #"." #does not really like #without CMAKE_INSTALL_PREFIX
LIBRARY_DESTINATION "${LV_INSTALL_LIBRARY_DIR}"
DEPENDS VTK::vtkpythonmodules
)
This diff is collapsed.
set(headers
CeresCameraCalibrationCostFunctions.h
CeresCostFunctions.h
CeresTools.h)
set(classes
vtkGeometricCalibration)
vtk_module_add_module(LidarView::CommonCeres
FORCE_STATIC
CLASSES ${classes}
HEADERS ${headers})
NAME
LidarView::CommonCeres
LIBRARY_NAME
lvCommonCeres
CONDITION
LIDARVIEW_USE_CERES
DEPENDS
Ceres::ceres
Eigen3::Eigen
PRIVATE_DEPENDS
LidarView::CommonCore
LidarView::IOCore # For vtkTemporalTransforms
VTK::CommonCore
VTK::CommonMath
VTK::CommonTransforms
......@@ -19,7 +19,7 @@
// LOCAL
#include "vtkGeometricCalibration.h"
#include "Common/vtkCustomTransformInterpolator.h"
#include "vtkCustomTransformInterpolator.h"
#include "vtkEigenTools.h"
#include "vtkConversions.h"
#include "vtkTemporalTransformsReader.h"
......
......@@ -70,7 +70,7 @@
// LOCAL
#include "vtkTemporalTransforms.h"
#include "LidarCoreModule.h"
#include "lvCommonCeresModule.h"
// STD
#include <vector>
......@@ -139,7 +139,7 @@ void EstimateEulerAngleConvention(const std::string& sourceSensorFilename,
* \@param timeStep time step between two consecutives acquisitions time
* to derived the "solid-system" equations
*/
std::pair<double, AnglePositionVector> LIDARCORE_EXPORT EstimateCalibrationFromPoses(
std::pair<double, AnglePositionVector> LVCOMMONCERES_EXPORT EstimateCalibrationFromPoses(
vtkSmartPointer<vtkTemporalTransforms> sourceSensor,
vtkSmartPointer<vtkTemporalTransforms> targetSensor,
const double timeScaleAnalysisBound = 5.0,
......
......@@ -18,7 +18,7 @@
//=========================================================================
// LOCAL
#include "Common/BoundingBox.h"
#include "BoundingBox.h"
//-----------------------------------------------------------------------------
template <unsigned int N>
......
set(sources
CameraModel.cxx
CameraProjection.cxx
LVTime.cxx
vtkTimeCalibration.cxx # Could not be Python wrapped
)
set(headers
# BoundingBox.h
CameraModel.h
CameraProjection.h
eigenFFTCorrelation.h
interpolator1D.h
LVTime.h
statistics.h)
set(classes
vtkConversions
vtkCustomTransformInterpolator
vtkEigenTools
vtkHelper
vtkPipelineTools
vtkTemporalTransforms)
# set(templates
# BoundingBox)
vtk_module_add_module(LidarView::CommonCore
FORCE_STATIC
SOURCES ${sources}
CLASSES ${classes}
# TEMPLATES ${templates}
HEADERS ${headers})
......@@ -27,7 +27,7 @@
// EIGEN
#include <Eigen/Dense>
#include "LidarCoreModule.h"
#include "lvCommonCoreModule.h"
enum ProjectionType
{
......@@ -43,7 +43,7 @@ enum ProjectionType
* 2- Intrinsic parameters, representing the focal and pixel grid
* 3- Optical parameters, representing the optical system distortions
*/
class LIDARCORE_EXPORT CameraModel
class LVCOMMONCORE_EXPORT CameraModel
{
public:
CameraModel() = default;
......