├── core
├── include
│ └── pcl2
│ │ ├── core.h
│ │ ├── conversions.h
│ │ ├── stats.h
│ │ ├── impl
│ │ ├── row.hpp
│ │ ├── eigen_matrix.hpp
│ │ └── stats.hpp
│ │ ├── spatial_index.h
│ │ ├── math.h
│ │ ├── exception.h
│ │ ├── row.h
│ │ ├── create.h
│ │ ├── eigen_matrix.h
│ │ ├── matrix_impl.h
│ │ ├── matrix_row_impl.h
│ │ ├── typed_matrix_impl.h
│ │ ├── matrix_view_impl.h
│ │ ├── matrix.h
│ │ └── eigen_matrix_impl.h
├── src
│ ├── row.cpp
│ ├── eigen_matrix.cpp
│ ├── stats.cpp
│ ├── matrix.cpp
│ ├── math.cpp
│ └── cloud.cpp
└── CMakeLists.txt
├── PCLConfigVersion.cmake.in
├── cmake
├── pkgconfig.cmake.in
├── pcl_options.cmake
├── pcl_examples.cmake
├── Modules
│ ├── FindSphinx.cmake
│ ├── FindEigen.cmake
│ ├── FindOpenNI.cmake
│ ├── FindFlann.cmake
│ ├── FindGLEW.cmake
│ └── FindQhull.cmake
├── pcl_openmp.cmake
├── pcl_tests.cmake
├── pcl_find_boost.cmake
├── merge_cmake_install.py
├── dep_graph.cmake
├── CudaComputeTargetFlags.cmake
├── cpack_options.cmake.in
├── pcl_pclconfig.cmake
├── pcl_find_python.cmake
├── uninstall_target.cmake.in
├── pcl_find_sse.cmake
├── pcl_all_in_one_installer.cmake
├── pcl_cpack.cmake
└── CMakeParseArguments.cmake
├── pcl2_config.h.in
├── tools
├── CMakeLists.txt
├── cloud_intro.cpp
├── rst_test.cpp
├── pcl2_test.cpp
└── mat_intro.cpp
├── io
├── CMakeLists.txt
├── include
│ └── pcl2
│ │ └── io
│ │ └── io.h
└── src
│ └── io.cpp
├── search
├── CMakeLists.txt
├── include
│ └── pcl2
│ │ └── search
│ │ ├── neighbors.h
│ │ └── kdtree.h
└── src
│ └── neighbors.cpp
├── registration
├── CMakeLists.txt
├── src
│ ├── transform.cpp
│ ├── fit.cpp
│ └── icp.cpp
└── include
│ └── pcl2
│ └── registration
│ ├── transform.h
│ ├── impl
│ └── fit.hpp
│ ├── fit.h
│ ├── correspondence_identification.h
│ └── icp.h
├── doc
└── Mainpage.dox
├── LICENSE.txt
└── features
└── include
└── pcl2
└── features
└── normals.h
/core/include/pcl2/core.h:
--------------------------------------------------------------------------------
1 | #include "pcl2/matrix.h"
2 | #include "pcl2/typed_matrix.h"
3 | #include "pcl2/row.h"
4 | #include "pcl2/cloud.h"
5 |
--------------------------------------------------------------------------------
/PCLConfigVersion.cmake.in:
--------------------------------------------------------------------------------
1 | # Check whether the requested PACKAGE_FIND_VERSION is compatible
2 |
3 | set(PACKAGE_VERSION @PCL_VERSION@)
4 |
5 | # Check whether the requested PACKAGE_FIND_VERSION is compatible
6 | if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
7 | set(PACKAGE_VERSION_COMPATIBLE FALSE)
8 | else()
9 | set(PACKAGE_VERSION_COMPATIBLE TRUE)
10 | if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
11 | set(PACKAGE_VERSION_EXACT TRUE)
12 | endif()
13 | endif()
--------------------------------------------------------------------------------
/cmake/pkgconfig.cmake.in:
--------------------------------------------------------------------------------
1 | # This file was generated by CMake for @PROJECT_NAME@ library @PKG_NAME@
2 | prefix=@CMAKE_INSTALL_PREFIX@
3 | exec_prefix=${prefix}
4 | libdir=${prefix}/@LIB_INSTALL_DIR@
5 | #includedir=${prefix}/@INCLUDE_INSTALL_DIR@
6 | includedir=${prefix}/include/@PROJECT_NAME_LOWER@-@PCL_MAJOR_VERSION@.@PCL_MINOR_VERSION@
7 | Name: @PKG_NAME@
8 | Description: @PKG_DESC@
9 | Version: @PCL_VERSION@
10 | Requires: @PKG_EXTERNAL_DEPS@
11 | Libs: -L${libdir} -l@PKG_NAME@ @PKG_LIBFLAGS@ @PKG_INTERNAL_DEPS@
12 | Cflags: -I${includedir} @PKG_CFLAGS@
13 |
14 |
--------------------------------------------------------------------------------
/cmake/pcl_options.cmake:
--------------------------------------------------------------------------------
1 | # Options for building PCL.
2 |
3 | # Build shared libraries by default.
4 | cmake_dependent_option(PCL_SHARED_LIBS
5 | "Build shared libraries." ON "NOT ANDROID_NDK" OFF)
6 |
7 | if(PCL_SHARED_LIBS)
8 | set(PCL_LIB_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
9 | set(PCL_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
10 | set(PCL_LIB_TYPE "SHARED")
11 | else(PCL_SHARED_LIBS)
12 | set(PCL_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
13 | set(PCL_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})
14 | set(PCL_LIB_TYPE "STATIC")
15 | endif(PCL_SHARED_LIBS)
16 | mark_as_advanced(PCL_SHARED_LIBS)
17 |
--------------------------------------------------------------------------------
/cmake/pcl_examples.cmake:
--------------------------------------------------------------------------------
1 | # Example management
2 |
3 | # Add an option so the user can turn tests off
4 | option(BUILD_EXAMPLES "Build the library examples" ${DEFAULT})
5 |
6 | # Print a suitable status message
7 | if(NOT ${DEFAULT} AND NOT ${BUILD_EXAMPLES})
8 | if(REASON)
9 | message(STATUS "Examples will not be built: ${REASON}")
10 | else(REASON)
11 | message(STATUS "Examples will not be built: Disabled manually")
12 | endif(REASON)
13 | elseif(NOT ${BUILD_EXAMPLES})
14 | message(STATUS "Examples will not be built: Disabled manually")
15 | else(NOT ${DEFAULT} AND NOT ${BUILD_EXAMPLES})
16 | message(STATUS "Examples will be built")
17 | endif(NOT ${DEFAULT} AND NOT ${BUILD_EXAMPLES})
18 |
--------------------------------------------------------------------------------
/pcl2_config.h.in:
--------------------------------------------------------------------------------
1 | /* pcl_config.h. Generated by CMake for @PROJECT_NAME@. */
2 |
3 | /* PCL version information */
4 | #cmakedefine PCL2_MAJOR_VERSION ${PCL2_MAJOR_VERSION}
5 | #cmakedefine PCL2_MINOR_VERSION ${PCL2_MINOR_VERSION}
6 | #cmakedefine PCL2_REVISION_VERSION ${PCL2_REVISION_VERSION}
7 | #cmakedefine PCL2_VERSION_PRETTY "${PCL_VERSION}"
8 | #define PCL2_VERSION_CALC(MAJ, MIN, PATCH) (MAJ*100000+MIN*100+PATCH)
9 | #cmakedefine PCL2_VERSION \
10 | PCL_VERSION_CALC(PCL2_MAJOR_VERSION,PCL2_MINOR_VERSION,PCL2_REVISION_VERSION)
11 | #define PCL2_VERSION_COMPARE(OP,MAJ,MIN,PATCH) \
12 | (PCL2_VERSION OP PCL2_VERSION_CALC(MAJ,MIN,PATCH))
13 |
14 | #cmakedefine HAVE_OPENNI 1
15 | #cmakedefine HAVE_CUDA 1
16 |
17 | #cmakedefine HAVE_SSE3_EXTENSIONS
18 | #cmakedefine HAVE_SSE2_EXTENSIONS
19 | #cmakedefine HAVE_SSE_EXTENSIONS
20 |
21 | #ifdef DISABLE_OPENNI
22 | #undef HAVE_OPENNI
23 | #endif
24 |
--------------------------------------------------------------------------------
/cmake/Modules/FindSphinx.cmake:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Find Sphinx
3 | #
4 | # This sets the following variables:
5 | # SPHINX_FOUND - True if Sphinx was found.
6 | # SPHINX_EXECUTABLE - Sphinx-build executable
7 |
8 | find_package(PkgConfig)
9 | pkg_check_modules(PC_SPHINX sphinx-build)
10 |
11 | find_package(PythonInterp)
12 |
13 | if(PYTHONINTERP_FOUND)
14 | get_filename_component(PYTHON_DIR "${PYTHON_EXECUTABLE}" PATH)
15 | endif(PYTHONINTERP_FOUND)
16 |
17 | find_program(SPHINX_EXECUTABLE NAMES sphinx-build
18 | HINTS ${PC_SPHINX_EXECUTABLE} $ENV{SPHINX_DIR} ${PYTHON_DIR}/Scripts
19 | PATH_SUFFIXES bin
20 | DOC "Sphinx documentation generator"
21 | )
22 |
23 | include(FindPackageHandleStandardArgs)
24 | find_package_handle_standard_args(Sphinx DEFAULT_MSG SPHINX_EXECUTABLE)
25 |
26 | mark_as_advanced(SPHINX_EXECUTABLE)
27 |
--------------------------------------------------------------------------------
/tools/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set (SUBSYS_NAME tools)
2 | set (SUBSYS_DESC "Useful PCL-based command line tools")
3 | set (SUBSYS_DEPS core io registration search)
4 | set (DEFAULT ON)
5 | set (REASON "")
6 |
7 | PCL_SUBSYS_OPTION (build ${SUBSYS_NAME} ${SUBSYS_DESC} ${DEFAULT} ${REASON})
8 | PCL_SUBSYS_DEPEND (build ${SUBSYS_NAME} DEPS ${SUBSYS_DEPS})
9 |
10 | if (build)
11 | PCL_ADD_EXECUTABLE (mat_intro ${SUBSYS_NAME} mat_intro.cpp)
12 | target_link_libraries (mat_intro pcl2_core pcl2_io pcl2_search pcl2_registration ${PCL_LIBRARIES})
13 |
14 | PCL_ADD_EXECUTABLE (cloud_intro ${SUBSYS_NAME} cloud_intro.cpp)
15 | target_link_libraries (cloud_intro pcl2_core pcl2_io pcl2_search pcl2_registration ${PCL_LIBRARIES})
16 |
17 | PCL_ADD_EXECUTABLE (rst_test ${SUBSYS_NAME} rst_test.cpp)
18 | target_link_libraries (rst_test pcl2_core ${PCL_LIBRARIES})
19 |
20 | PCL_ADD_EXECUTABLE (pcl2_test ${SUBSYS_NAME} pcl2_test.cpp)
21 | target_link_libraries (pcl2_test pcl2_core pcl2_io pcl2_search pcl2_registration ${PCL_LIBRARIES})
22 |
23 | endif ()
24 |
--------------------------------------------------------------------------------
/cmake/pcl_openmp.cmake:
--------------------------------------------------------------------------------
1 | # Find the correct flags to use for OpenMP.
2 | # Taken from rosbuild and edited a little.
3 |
4 | include(${PROJECT_SOURCE_DIR}/cmake/pcl_targets.cmake)
5 |
6 | find_package(OpenMP)
7 |
8 | ###############################################################################
9 | # Add the OpenMP flags to a target.
10 | # _name The name of the target to add the flags to.
11 | macro(PCL_ADD_OPENMP_FLAGS _name)
12 | if(OPENMP_FOUND)
13 | PCL_ADD_CFLAGS(${_name} ${OpenMP_CXX_FLAGS})
14 | endif(OPENMP_FOUND)
15 | endmacro(PCL_ADD_OPENMP_FLAGS)
16 |
17 | ###############################################################################
18 | # Link to the appropriate OpenMP implementation for the compiler.
19 | # _name The name of the target to link OpenMP into.
20 | macro(PCL_LINK_OPENMP _name)
21 | if(OPENMP_FOUND AND CMAKE_COMPILER_IS_GNUCC)
22 | # For GCC, link to libgomp
23 | target_link_libraries(${_name} gomp)
24 | endif(OPENMP_FOUND AND CMAKE_COMPILER_IS_GNUCC)
25 | endmacro(PCL_LINK_OPENMP)
26 |
27 |
--------------------------------------------------------------------------------
/cmake/pcl_tests.cmake:
--------------------------------------------------------------------------------
1 | # Test management
2 |
3 | # Need GTest to build the tests
4 | find_package(GTest)
5 | if(GTEST_FOUND)
6 | set(REASON)
7 | set(DEFAULT ON)
8 | else(GTEST_FOUND)
9 | set(REASON "GTest was not found.")
10 | set(DEFAULT OFF)
11 | endif(GTEST_FOUND)
12 |
13 | # Add an option so the user can turn tests off
14 | option(BUILD_TESTS "Build the library tests" ${DEFAULT})
15 |
16 | # Print a suitable status message
17 | if(NOT ${DEFAULT} AND NOT ${BUILD_TESTS})
18 | if(REASON)
19 | message(STATUS "Tests will not be built: ${REASON}")
20 | else(REASON)
21 | message(STATUS "Tests will not be built: Disabled manually")
22 | endif(REASON)
23 | elseif(NOT ${BUILD_TESTS})
24 | message(STATUS "Tests will not be built: Disabled manually")
25 | else(NOT ${DEFAULT} AND NOT ${BUILD_TESTS})
26 | message(STATUS "Tests will be built")
27 | endif(NOT ${DEFAULT} AND NOT ${BUILD_TESTS})
28 |
29 | # Set up for testing if tests are enabled
30 | if(BUILD_TESTS)
31 | enable_testing()
32 | include_directories(${GTEST_INCLUDE_DIRS})
33 | endif(BUILD_TESTS)
34 |
35 |
--------------------------------------------------------------------------------
/cmake/Modules/FindEigen.cmake:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Find Eigen3
3 | #
4 | # This sets the following variables:
5 | # EIGEN_FOUND - True if Eigen was found.
6 | # EIGEN_INCLUDE_DIRS - Directories containing the Eigen include files.
7 | # EIGEN_DEFINITIONS - Compiler flags for Eigen.
8 |
9 | find_package(PkgConfig)
10 | pkg_check_modules(PC_EIGEN eigen3)
11 | set(EIGEN_DEFINITIONS ${PC_EIGEN_CFLAGS_OTHER})
12 |
13 | find_path(EIGEN_INCLUDE_DIR Eigen/Core
14 | HINTS ${PC_EIGEN_INCLUDEDIR} ${PC_EIGEN_INCLUDE_DIRS} "${EIGEN_ROOT}" "$ENV{EIGEN_ROOT}"
15 | PATHS "$ENV{PROGRAMFILES}/Eigen" "$ENV{PROGRAMW6432}/Eigen"
16 | "$ENV{PROGRAMFILES}/Eigen 3.0.0" "$ENV{PROGRAMW6432}/Eigen 3.0.0"
17 | PATH_SUFFIXES eigen3 include/eigen3 include)
18 |
19 | set(EIGEN_INCLUDE_DIRS ${EIGEN_INCLUDE_DIR})
20 |
21 | include(FindPackageHandleStandardArgs)
22 | find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR)
23 |
24 | mark_as_advanced(EIGEN_INCLUDE_DIR)
25 |
26 | if(EIGEN_FOUND)
27 | message(STATUS "Eigen found (include: ${EIGEN_INCLUDE_DIRS})")
28 | endif(EIGEN_FOUND)
29 |
30 |
--------------------------------------------------------------------------------
/io/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(SUBSYS_NAME io)
2 | set(SUBSYS_DESC "libpcl2_io: I/O operations")
3 | set(SUBSYS_DEPS core)
4 |
5 | set(build TRUE)
6 | PCL_SUBSYS_OPTION(build ${SUBSYS_NAME} ${SUBSYS_DESC} ON)
7 | PCL_SUBSYS_DEPEND(build ${SUBSYS_NAME} DEPS ${SUBSYS_DEPS})
8 |
9 | #PCL_ADD_DOC(${SUBSYS_NAME})
10 |
11 | if(build)
12 | set(srcs
13 | src/io.cpp
14 | )
15 |
16 | set(incs
17 | include/pcl2/io/io.h
18 | )
19 |
20 | set(impl_incs
21 | )
22 |
23 | set(LIB_NAME pcl2_${SUBSYS_NAME})
24 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
25 | PCL_ADD_LIBRARY(${LIB_NAME} ${SUBSYS_NAME} ${srcs} ${incs} ${impl_incs})
26 | PCL_ADD_SSE_FLAGS(${LIB_NAME})
27 | PCL_MAKE_PKGCONFIG(${LIB_NAME} ${SUBSYS_NAME} "${SUBSYS_DESC}" "" "" "" "" "")
28 |
29 | # Install include files
30 | PCL_ADD_INCLUDES(${SUBSYS_NAME} "" ${incs})
31 | PCL_ADD_INCLUDES(${SUBSYS_NAME} impl ${impl_incs})
32 |
33 | #if(BUILD_TESTS)
34 | # add_subdirectory(test)
35 | #endif(BUILD_TESTS)
36 |
37 | #if(BUILD_EXAMPLES)
38 | # add_subdirectory(examples)
39 | #endif(BUILD_EXAMPLES)
40 | endif(build)
41 |
--------------------------------------------------------------------------------
/cmake/pcl_find_boost.cmake:
--------------------------------------------------------------------------------
1 | # Find and set Boost flags
2 |
3 | if(NOT PCL_SHARED_LIBS OR WIN32)
4 | set(Boost_USE_STATIC_LIBS ON)
5 | set(Boost_USE_STATIC ON)
6 | endif(NOT PCL_SHARED_LIBS OR WIN32)
7 |
8 | if(${CMAKE_VERSION} VERSION_LESS 2.8.5)
9 | SET(Boost_ADDITIONAL_VERSIONS "1.43" "1.43.0" "1.44" "1.44.0" "1.45" "1.45.0" "1.46.1" "1.46.0" "1.46" "1.47" "1.47.0")
10 | else(${CMAKE_VERSION} VERSION_LESS 2.8.5)
11 | SET(Boost_ADDITIONAL_VERSIONS "1.47" "1.47.0")
12 | endif(${CMAKE_VERSION} VERSION_LESS 2.8.5)
13 |
14 | # Disable the config mode of find_package(Boost)
15 | set(Boost_NO_BOOST_CMAKE ON)
16 |
17 | # Optional boost modules
18 | find_package(Boost 1.40.0 COMPONENTS mpi serialization)
19 |
20 | # Required boost modules
21 | find_package(Boost 1.40.0 REQUIRED COMPONENTS system filesystem thread date_time iostreams)
22 |
23 | if(Boost_FOUND)
24 | set(BOOST_FOUND TRUE)
25 | # Obtain diagnostic information about Boost's automatic linking outputted
26 | # during compilation time.
27 | add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
28 |
29 | include_directories(${Boost_INCLUDE_DIRS})
30 | link_directories(${Boost_LIBRARY_DIRS})
31 | endif(Boost_FOUND)
32 |
--------------------------------------------------------------------------------
/cmake/merge_cmake_install.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # file: merge_cmake_install.py
3 |
4 | import sys, math
5 | import fnmatch
6 | import os
7 | import shutil
8 |
9 | if len(sys.argv) != 2:
10 | # stop the program and print an error message
11 | sys.exit("Must provide a cmake binary folder")
12 |
13 | base_folder = sys.argv[1]
14 |
15 | string_to_remove_debug = "IF(\"${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Dd][Ee][Bb][Uu][Gg])$\")"
16 | string_to_remove_release = "IF(\"${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Rr][Ee][Ll][Ee][Aa][Ss][Ee])$\")"
17 |
18 | matches = []
19 | for root, dirnames, filenames in os.walk(base_folder):
20 | for filename in fnmatch.filter(filenames, 'cmake_install.cmake'):
21 | matches.append(os.path.join(root, filename))
22 |
23 | for one_match in matches:
24 | #print one_match, "\n"
25 | shutil.move( one_match, one_match+"~" )
26 | destination= open( one_match, "w" )
27 | source= open( one_match+"~", "r" )
28 | for line in source:
29 | if string_to_remove_debug in line:
30 | destination.write( "\n" )
31 | elif string_to_remove_release in line:
32 | destination.write( "\n" )
33 | else:
34 | destination.write( line )
35 | source.close()
36 | destination.close()
--------------------------------------------------------------------------------
/search/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(SUBSYS_NAME search)
2 | set(SUBSYS_DESC "libpcl2_search: Nearest neighbor and radius search")
3 | set(SUBSYS_DEPS core)
4 |
5 | set(build TRUE)
6 | PCL_SUBSYS_OPTION(build ${SUBSYS_NAME} ${SUBSYS_DESC} ON)
7 | PCL_SUBSYS_DEPEND(build ${SUBSYS_NAME} DEPS ${SUBSYS_DEPS})
8 |
9 | #PCL_ADD_DOC(${SUBSYS_NAME})
10 |
11 | if(build)
12 | set(srcs
13 | src/neighbors.cpp
14 | )
15 |
16 | set(incs
17 | include/pcl2/search/neighbors.h
18 | include/pcl2/search/kdtree.h
19 | )
20 |
21 | set(impl_incs
22 | )
23 |
24 | set(LIB_NAME pcl2_${SUBSYS_NAME})
25 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
26 | PCL_ADD_LIBRARY(${LIB_NAME} ${SUBSYS_NAME} ${srcs} ${incs} ${impl_incs})
27 | PCL_ADD_SSE_FLAGS(${LIB_NAME})
28 | PCL_MAKE_PKGCONFIG(${LIB_NAME} ${SUBSYS_NAME} "${SUBSYS_DESC}" "" "" "" "" "")
29 |
30 | # Install include files
31 | PCL_ADD_INCLUDES(${SUBSYS_NAME} "" ${incs})
32 | PCL_ADD_INCLUDES(${SUBSYS_NAME} impl ${impl_incs})
33 |
34 | #if(BUILD_TESTS)
35 | # add_subdirectory(test)
36 | #endif(BUILD_TESTS)
37 |
38 | #if(BUILD_EXAMPLES)
39 | # add_subdirectory(examples)
40 | #endif(BUILD_EXAMPLES)
41 | endif(build)
42 |
--------------------------------------------------------------------------------
/cmake/dep_graph.cmake:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Make a dependency graph dot file
3 | function(MAKE_DEP_GRAPH)
4 | set(_dot_file "${PROJECT_BINARY_DIR}/pcl.dot")
5 | file(WRITE ${_dot_file} "digraph pcl {\n")
6 | foreach(_ss ${PCL_SUBSYSTEMS})
7 | if(NOT _ss STREQUAL "global_tests" AND
8 | NOT _ss STREQUAL "apps" AND
9 | NOT _ss STREQUAL "tools" AND
10 | NOT _ss STREQUAL "test" AND
11 | NOT _ss STREQUAL "python" AND
12 | NOT _ss STREQUAL "documentation")
13 | PCL_GET_SUBSYS_STATUS(_status ${_ss})
14 | if(_status)
15 | file(APPEND ${_dot_file}
16 | " \"${_ss}\" [style=\"filled\" fillcolor=\"#008000\" shape=\"box\"];\n ")
17 | else(_status)
18 | file(APPEND ${_dot_file}
19 | " \"${_ss}\" [style=\"filled\" fillcolor=\"#D40000\" shape=\"box\"];\n ")
20 | endif(_status)
21 | GET_IN_MAP(_deps PCL_SUBSYS_DEPS ${_ss})
22 | foreach(_dep ${_deps})
23 | file(APPEND ${_dot_file} " \"${_ss}\" -> \"${_dep}\";\n")
24 | endforeach(_dep)
25 | endif()
26 | endforeach(_ss)
27 |
28 | #file(APPEND ${_dot_file}
29 | # " \"test\" [style=\"filled\" fillcolor=\"#A3A27C\" shape=\"box\"];\n ")
30 | file(APPEND ${_dot_file} "}\n")
31 | endfunction(MAKE_DEP_GRAPH)
32 |
33 |
--------------------------------------------------------------------------------
/registration/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(SUBSYS_NAME registration)
2 | set(SUBSYS_DESC "libpcl2_registration: Iterative Closest Point (ICP) registration")
3 | set(SUBSYS_DEPS core)
4 |
5 | set(build TRUE)
6 | PCL_SUBSYS_OPTION(build ${SUBSYS_NAME} ${SUBSYS_DESC} ON)
7 | PCL_SUBSYS_DEPEND(build ${SUBSYS_NAME} DEPS ${SUBSYS_DEPS})
8 |
9 | #PCL_ADD_DOC(${SUBSYS_NAME})
10 |
11 | if(build)
12 | set(srcs
13 | src/fit.cpp
14 | src/icp.cpp
15 | src/transform.cpp
16 | )
17 |
18 | set(incs
19 | include/pcl2/registration/correspondence_identification.h
20 | include/pcl2/registration/fit.h
21 | include/pcl2/registration/icp.h
22 | include/pcl2/registration/transform.h
23 | )
24 |
25 | set(impl_incs
26 | )
27 |
28 | set(LIB_NAME pcl2_${SUBSYS_NAME})
29 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
30 | PCL_ADD_LIBRARY(${LIB_NAME} ${SUBSYS_NAME} ${srcs} ${incs} ${impl_incs})
31 | PCL_ADD_SSE_FLAGS(${LIB_NAME})
32 | PCL_MAKE_PKGCONFIG(${LIB_NAME} ${SUBSYS_NAME} "${SUBSYS_DESC}" "" "" "" "" "")
33 |
34 | # Install include files
35 | PCL_ADD_INCLUDES(${SUBSYS_NAME} "" ${incs})
36 | PCL_ADD_INCLUDES(${SUBSYS_NAME} impl ${impl_incs})
37 |
38 | #if(BUILD_TESTS)
39 | # add_subdirectory(test)
40 | #endif(BUILD_TESTS)
41 |
42 | #if(BUILD_EXAMPLES)
43 | # add_subdirectory(examples)
44 | #endif(BUILD_EXAMPLES)
45 | endif(build)
46 |
--------------------------------------------------------------------------------
/doc/Mainpage.dox:
--------------------------------------------------------------------------------
1 | namespace pcl2
2 | {
3 |
4 | /**
5 |
6 | \mainpage Point %Cloud Library 2.0
7 |
8 | The Point %Cloud Libary is an awesome open source lirbary for 3-D point
9 | cloud processing. This paragraph says some introductory things about the
10 | library and what it can be used for.
11 |
12 | \section getting_started Getting started
13 |
14 | One of the first steps in get started with the PCL 2.0 is to get familiar with
15 | the basic data structures. The first is the Cloud class. This is one of the
16 | most central data structures in PCL. It is used to represent all of the
17 | various geometric, color, and feature data related to point cloud processing
18 | Most of the high-level algorithms in PCL are designed to expect a Cloud as
19 | input and to return a Cloud as output. [There is WAY more to say, but I'll
20 | get to that later. This is just a placeholder...]
21 |
22 | To provide a concrete example...
23 | \code
24 | // Think of lots of code examples...
25 | using namespace pcl2;
26 | Cloud cloud = loadCloud ("example.pcd");
27 | FloatMatrix points = cloud["xyz"];
28 | \endcode
29 |
30 | Also, the Matrix class. [Say a bunch of stuff about Matrix and its
31 | subclasses.]
32 |
33 | \section faq Frequently Asked Questions
34 |
35 | \li Q: Why isn't this page finished?
36 | \li A: Because.
37 |
38 | \li Q: How do I do something awesome with PCL?
39 | \li A: Take a look at the following example:
40 |
41 | \code
42 | using namespace pcl2;
43 | Cloud cloud = loadCloud ("example.pcd");
44 | cloud += doSomethingAwesome (cloud);
45 | saveCloud ("awesome_result.pcd", cloud);
46 | \endcode
47 |
48 | */
49 |
50 | }
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Software License Agreement (BSD License)
2 |
3 | Point Cloud Library (PCL) - www.pointclouds.org
4 | Copyright (c) 2009-2011, Willow Garage, Inc.
5 | Copyright (c) XXX, respective authors.
6 |
7 | All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions
11 | are met:
12 |
13 | * Redistributions of source code must retain the above copyright
14 | notice, this list of conditions and the following disclaimer.
15 | * Redistributions in binary form must reproduce the above
16 | copyright notice, this list of conditions and the following
17 | disclaimer in the documentation and/or other materials provided
18 | with the distribution.
19 | * Neither the name of Willow Garage, Inc. nor the names of its
20 | contributors may be used to endorse or promote products derived
21 | from this software without specific prior written permission.
22 |
23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | POSSIBILITY OF SUCH DAMAGE.
35 |
--------------------------------------------------------------------------------
/core/src/row.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | #include "pcl2/impl/row.hpp"
39 |
40 | template class pcl2::Row;
41 | template class pcl2::Row;
42 | template class pcl2::Row;
43 |
--------------------------------------------------------------------------------
/cmake/CudaComputeTargetFlags.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Compute target flags macros by Anatoly Baksheev
3 | #
4 | # Usage in CmakeLists.txt:
5 | # include(CudaComputeTargetFlags.cmake)
6 | # APPEND_TARGET_ARCH_FLAGS()
7 |
8 | #compute flags macros
9 | MACRO(CUDA_COMPUTE_TARGET_FLAGS arch_bin arch_ptx cuda_nvcc_target_flags)
10 | string(REGEX REPLACE "\\." "" ARCH_BIN_WITHOUT_DOTS "${${arch_bin}}")
11 | string(REGEX REPLACE "\\." "" ARCH_PTX_WITHOUT_DOTS "${${arch_ptx}}")
12 |
13 | set(cuda_computer_target_flags_temp "")
14 |
15 | # Tell NVCC to add binaries for the specified GPUs
16 | string(REGEX MATCHALL "[0-9()]+" ARCH_LIST "${ARCH_BIN_WITHOUT_DOTS}")
17 | foreach(ARCH IN LISTS ARCH_LIST)
18 | if (ARCH MATCHES "([0-9]+)\\(([0-9]+)\\)")
19 | # User explicitly specified PTX for the concrete BIN
20 | set(cuda_computer_target_flags_temp ${cuda_computer_target_flags_temp} -gencode arch=compute_${CMAKE_MATCH_2},code=sm_${CMAKE_MATCH_1})
21 | else()
22 | # User didn't explicitly specify PTX for the concrete BIN, we assume PTX=BIN
23 | set(cuda_computer_target_flags_temp ${cuda_computer_target_flags_temp} -gencode arch=compute_${ARCH},code=sm_${ARCH})
24 | endif()
25 | endforeach()
26 |
27 | # Tell NVCC to add PTX intermediate code for the specified architectures
28 | string(REGEX MATCHALL "[0-9]+" ARCH_LIST "${ARCH_PTX_WITHOUT_DOTS}")
29 | foreach(ARCH IN LISTS ARCH_LIST)
30 | set(cuda_computer_target_flags_temp ${cuda_computer_target_flags_temp} -gencode arch=compute_${ARCH},code=compute_${ARCH})
31 | endforeach()
32 |
33 | set(${cuda_nvcc_target_flags} ${cuda_computer_target_flags_temp})
34 | ENDMACRO()
35 |
36 | MACRO(APPEND_TARGET_ARCH_FLAGS)
37 | set(cuda_nvcc_target_flags "")
38 | CUDA_COMPUTE_TARGET_FLAGS(CUDA_ARCH_BIN CUDA_ARCH_PTX cuda_nvcc_target_flags)
39 | if (cuda_nvcc_target_flags)
40 | message(STATUS "CUDA NVCC target flags: ${cuda_nvcc_target_flags}")
41 | list(APPEND CUDA_NVCC_FLAGS ${cuda_nvcc_target_flags})
42 | endif()
43 | ENDMACRO()
--------------------------------------------------------------------------------
/cmake/Modules/FindOpenNI.cmake:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Find OpenNI
3 | #
4 | # This sets the following variables:
5 | # OPENNI_FOUND - True if OPENNI was found.
6 | # OPENNI_INCLUDE_DIRS - Directories containing the OPENNI include files.
7 | # OPENNI_LIBRARIES - Libraries needed to use OPENNI.
8 | # OPENNI_DEFINITIONS - Compiler flags for OPENNI.
9 |
10 | find_package(PkgConfig)
11 | if(${CMAKE_VERSION} VERSION_LESS 2.8.2)
12 | pkg_check_modules(PC_OPENNI openni-dev)
13 | else()
14 | pkg_check_modules(PC_OPENNI QUIET openni-dev)
15 | endif()
16 |
17 | set(OPENNI_DEFINITIONS ${PC_OPENNI_CFLAGS_OTHER})
18 |
19 | #add a hint so that it can find it without the pkg-config
20 | find_path(OPENNI_INCLUDE_DIR XnStatus.h
21 | HINTS ${PC_OPENNI_INCLUDEDIR} ${PC_OPENNI_INCLUDE_DIRS} /usr/include/openni /usr/include/ni "${OPENNI_ROOT}" "$ENV{OPENNI_ROOT}"
22 | PATHS "$ENV{PROGRAMFILES}/OpenNI/Include" "$ENV{PROGRAMW6432}/OpenNI/Include"
23 | PATH_SUFFIXES openni include Include)
24 | #add a hint so that it can find it without the pkg-config
25 | find_library(OPENNI_LIBRARY
26 | NAMES OpenNI64 OpenNI
27 | HINTS ${PC_OPENNI_LIBDIR} ${PC_OPENNI_LIBRARY_DIRS} /usr/lib "${OPENNI_ROOT}" "$ENV{OPENNI_ROOT}"
28 | PATHS "$ENV{PROGRAMFILES}/OpenNI/Lib" "$ENV{PROGRAMW6432}/OpenNI/Lib64"
29 | PATH_SUFFIXES lib Lib Lib64)
30 |
31 | set(OPENNI_INCLUDE_DIRS ${OPENNI_INCLUDE_DIR})
32 | if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
33 | set(OPENNI_LIBRARIES ${OPENNI_LIBRARY} usb-1.0)
34 | else()
35 | set(OPENNI_LIBRARIES ${OPENNI_LIBRARY})
36 | endif()
37 |
38 | include(FindPackageHandleStandardArgs)
39 | find_package_handle_standard_args(OpenNI DEFAULT_MSG
40 | OPENNI_LIBRARY OPENNI_INCLUDE_DIR)
41 |
42 | mark_as_advanced(OPENNI_LIBRARY OPENNI_INCLUDE_DIR)
43 | if(OPENNI_FOUND)
44 | set(HAVE_OPENNI ON)
45 | include_directories(${OPENNI_INCLUDE_DIRS})
46 | message(STATUS "OpenNI found (include: ${OPENNI_INCLUDE_DIR}, lib: ${OPENNI_LIBRARY})")
47 | endif(OPENNI_FOUND)
48 |
49 |
--------------------------------------------------------------------------------
/registration/src/transform.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file transform.cpp
39 | * \brief Defines functions declared in transform.h
40 | */
41 |
42 | #include "pcl2/registration/transform.h"
43 |
44 | pcl2::Cloud
45 | pcl2::transform (Cloud cloud, const MatF & tform)
46 | {
47 | /// \todo Implement me!
48 | return (cloud);
49 | }
50 |
--------------------------------------------------------------------------------
/registration/include/pcl2/registration/transform.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file transform.h
39 | * \brief Declares functions for transforming point clouds
40 | */
41 |
42 | #ifndef PCL2_TRANSFORM_H
43 | #define PCL2_TRANSFORM_H
44 |
45 | #include "pcl2/cloud.h"
46 | #include "pcl2/typed_matrix.h"
47 |
48 | namespace pcl2
49 | {
50 |
51 | Cloud transform (Cloud cloud, const MatF & tform);
52 |
53 | }
54 |
55 | #endif // PCL2_TRANSFORM_H
56 |
--------------------------------------------------------------------------------
/core/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(SUBSYS_NAME core)
2 | set(SUBSYS_DESC "libpcl2_core: core structures")
3 | set(SUBSYS_DEPS)
4 |
5 | set(build TRUE)
6 | PCL_SUBSYS_OPTION(build ${SUBSYS_NAME} ${SUBSYS_DESC} ON)
7 | PCL_SUBSYS_DEPEND(build ${SUBSYS_NAME} DEPS ${SUBSYS_DEPS} EXT_DEPS eigen boost)
8 |
9 | #PCL_ADD_DOC(${SUBSYS_NAME})
10 |
11 | if(build)
12 | set(srcs
13 | src/cloud.cpp
14 | src/matrix.cpp
15 | src/row.cpp
16 | src/eigen_matrix.cpp
17 | # src/conversions.cpp
18 | src/math.cpp
19 | src/stats.cpp
20 | #src/create.cpp
21 | )
22 |
23 | set(incs
24 | include/pcl2/cloud.h
25 | # include/pcl2/conversions.h
26 | include/pcl2/core.h
27 | include/pcl2/create.h
28 | include/pcl2/eigen_matrix.h
29 | include/pcl2/eigen_matrix_impl.h
30 | include/pcl2/exception.h
31 | include/pcl2/kernels.h
32 | include/pcl2/math.h
33 | include/pcl2/matrix.h
34 | include/pcl2/matrix_impl.h
35 | include/pcl2/matrix_row_impl.h
36 | include/pcl2/matrix_view_impl.h
37 | include/pcl2/row.h
38 | include/pcl2/spatial_index.h
39 | include/pcl2/stats.h
40 | include/pcl2/typed_matrix.h
41 | include/pcl2/typed_matrix_impl.h
42 | )
43 |
44 | set(impl_incs
45 | include/pcl2/impl/eigen_matrix.hpp
46 | include/pcl2/impl/eigen_matrix_impl.hpp
47 | include/pcl2/impl/math.hpp
48 | include/pcl2/impl/matrix_row_impl.hpp
49 | include/pcl2/impl/matrix_view_impl.hpp
50 | include/pcl2/impl/row.hpp
51 | include/pcl2/impl/stats.hpp
52 | include/pcl2/impl/typed_matrix.hpp
53 | #include/pcl2/impl/create.hpp
54 | )
55 |
56 | set(LIB_NAME pcl2_${SUBSYS_NAME})
57 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
58 | PCL_ADD_LIBRARY(${LIB_NAME} ${SUBSYS_NAME} ${srcs} ${incs} ${impl_incs})
59 | PCL_ADD_SSE_FLAGS(${LIB_NAME})
60 | PCL_MAKE_PKGCONFIG(${LIB_NAME} ${SUBSYS_NAME} "${SUBSYS_DESC}" "" "" "" "" "")
61 |
62 | # Install include files
63 | PCL_ADD_INCLUDES(${SUBSYS_NAME} "" ${incs})
64 | PCL_ADD_INCLUDES(${SUBSYS_NAME} impl ${impl_incs})
65 |
66 | #if(BUILD_TESTS)
67 | # add_subdirectory(test)
68 | #endif(BUILD_TESTS)
69 |
70 | #if(BUILD_EXAMPLES)
71 | # add_subdirectory(examples)
72 | #endif(BUILD_EXAMPLES)
73 | endif(build)
74 |
--------------------------------------------------------------------------------
/registration/src/fit.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file fit.cpp
39 | * \brief Defines functions declared in fit.h
40 | */
41 |
42 | #include "pcl2/registration/fit.h"
43 | #include "pcl2/registration/impl/fit.hpp"
44 |
45 | pcl2::MatF
46 | pcl2::fitPlaneLLS (const Cloud & cloud)
47 | {
48 | MatF points = cloud["xyz"];
49 | return (fitPlaneLLS (points));
50 | }
51 |
52 | pcl2::MatF
53 | pcl2::fitPlaneRANSAC (const Cloud & cloud, float inlier_threshold)
54 | {
55 | MatF points = cloud["xyz"];
56 | return (fitPlaneRANSAC (points, inlier_threshold));
57 | }
58 |
--------------------------------------------------------------------------------
/io/include/pcl2/io/io.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file io.h
39 | * \brief Declares functions for loading and saving .PCD files
40 | */
41 |
42 | #include "pcl2/cloud.h"
43 |
44 | namespace pcl2
45 | {
46 |
47 | /** \brief Load a PCD file
48 | * \param filename The name of the PCD file to load
49 | * \return A Cloud containing the file's data
50 | */
51 | Cloud loadCloud (const std::string & filename);
52 |
53 |
54 | /** \brief Save a PCD file
55 | * \param filename The name of the PCD file to create
56 | * \param cloud The Cloud to save
57 | */
58 | void saveCloud (const std::string & filename, const Cloud & cloud);
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/core/src/eigen_matrix.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | #include "pcl2/impl/eigen_matrix.hpp"
39 |
40 | template class pcl2::TypedMat;
41 | template class pcl2::TypedMat;
42 | template class pcl2::TypedMat;
43 |
44 | template class pcl2::EigenMat;
45 | template class pcl2::EigenMat;
46 | template class pcl2::EigenMat;
47 |
48 | /// \todo Move this!
49 | template std::ostream& pcl2::operator << (std::ostream&, const pcl2::TypedMat &);
50 | template std::ostream& pcl2::operator << (std::ostream&, const pcl2::TypedMat &);
51 | template std::ostream& pcl2::operator << (std::ostream&, const pcl2::TypedMat &);
52 |
--------------------------------------------------------------------------------
/io/src/io.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file io.cpp
39 | * \brief Defines functions declared in io.h
40 | */
41 |
42 | #include "pcl2/io/io.h"
43 | #include "pcl2/conversions.h"
44 |
45 | #include
46 |
47 | pcl2::Cloud pcl2::loadCloud (const std::string & filename)
48 | {
49 | sensor_msgs::PointCloud2 pc2;
50 | pcl::io::loadPCDFile (filename, pc2);
51 | return (pcl2::convertPointCloud2ToCloud (pc2));
52 | }
53 |
54 | void pcl2::saveCloud (const std::string & filename, const pcl2::Cloud & cloud)
55 | {
56 | boost::shared_ptr pc2 = convertCloudToPointCloud2 (cloud);
57 | pcl::io::savePCDFile (filename, *pc2);
58 | }
59 |
--------------------------------------------------------------------------------
/core/include/pcl2/conversions.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file conversions.h
39 | * \brief Declares several functions for converting between pcl and pcl2 data structures
40 | */
41 |
42 | #ifndef PCL2_CONVERSIONS_H
43 | #define PCL2_CONVERSIONS_H
44 |
45 | #include
46 | #include
47 | #include
48 |
49 | #include "pcl2/cloud.h"
50 | #include "pcl2/typed_matrix.h"
51 |
52 | namespace pcl2
53 | {
54 |
55 | pcl::PointCloud::Ptr
56 | convertToPointCloudXYZ (const MatF & xyz);
57 |
58 | boost::shared_ptr
59 | convertCloudToPointCloud2 (const Cloud & input);
60 |
61 | Cloud
62 | convertPointCloud2ToCloud (const sensor_msgs::PointCloud2 & input);
63 |
64 | }
65 | #endif
66 |
--------------------------------------------------------------------------------
/core/include/pcl2/stats.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file stats.h
39 | * \brief Declares functions for computing statistical properties of a matrix
40 | */
41 |
42 | #ifndef PCL2_STATS_H
43 | #define PCL2_STATS_H
44 |
45 | #include "pcl2/typed_matrix.h"
46 |
47 | namespace pcl2
48 | {
49 |
50 | template
51 | TypedMat
52 | computeMean (const TypedMat & input);
53 |
54 | template
55 | TypedMat
56 | computeCovariance (const TypedMat & input);
57 |
58 | template
59 | TypedMat
60 | computeCovariance (const TypedMat & input, const TypedMat & mean);
61 |
62 | template
63 | void
64 | computeMeanAndCovariance (const TypedMat & input, TypedMat & mean, TypedMat & covariance);
65 |
66 |
67 | }
68 | #endif
69 |
--------------------------------------------------------------------------------
/cmake/cpack_options.cmake.in:
--------------------------------------------------------------------------------
1 | set(CPACK_PACKAGE_NAME "@PROJECT_NAME@")
2 | set(CPACK_PACKAGE_VENDOR "PointClouds.org")
3 | set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Point Cloud Library (PCL)")
4 | set(CPACK_PACKAGE_INSTALL_DIRECTORY "@PROJECT_NAME@ @PCL_VERSION@")
5 | set(CPACK_RESOURCE_FILE_LICENSE "@PROJECT_SOURCE_DIR@/LICENSE.txt")
6 | set(CPACK_RESOURCE_FILE_README "@PROJECT_SOURCE_DIR@/AUTHORS.txt")
7 |
8 | @PCL_CPACK_COMPONENTS@
9 |
10 | IF ((WIN32 OR UNIX) AND (CPACK_GENERATOR STREQUAL "NSIS"))
11 | set(CPACK_NSIS_DISPLAY_NAME "@PROJECT_NAME@-@PCL_VERSION@")
12 | set(CPACK_NSIS_MUI_ICON "@PROJECT_SOURCE_DIR@/cmake/images/pcl.ico")
13 | set(CPACK_NSIS_MUI_UNIICON "@PROJECT_SOURCE_DIR@/cmake/images/pcl.ico")
14 | set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.pointclouds.org")
15 | set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.pointclouds.org")
16 | set(CPACK_NSIS_MODIFY_PATH ON)
17 | set(CPACK_PACKAGE_EXECUTABLES @PCL_EXECUTABLES@)
18 | set(CPACK_NSIS_MENU_LINKS
19 | "share/doc/pcl/tutorials/html/index.html" "Tutorials"
20 | "share/doc/pcl/tutorials/html/sources" "Tutorials sources"
21 | "share/doc/pcl/html/pcl-@PCL_MAJOR_VERSION@.@PCL_MINOR_VERSION@.chm" "Documentation"
22 | "http://www.pointclouds.org" "PCL Website")
23 | #set(CPACK_NSIS_MENU_LINKS "share/doc/@PROJECT_NAME@/user_guide.pdf" "User's guide")
24 | #set(CPACK_NSIS_MENU_LINKS "share/doc/@PROJECT_NAME@/developer_guide.pdf" "Developer's guide")
25 | if(WIN32 AND NOT UNIX)
26 | # There is a bug in NSI that does not handle full unix paths properly. Make
27 | # sure there is at least one set of four (4) backlasshes.
28 | set(CPACK_PACKAGE_ICON "@PROJECT_SOURCE_DIR@/cmake/images\\\\pcl_horz_large_pos.bmp")
29 | else(WIN32 AND NOT UNIX)
30 | set(CPACK_PACKAGE_ICON "@PROJECT_SOURCE_DIR@/cmake/images/pcl_horz_large_pos.bmp")
31 | endif(WIN32 AND NOT UNIX)
32 | ENDIF ()
33 |
34 | IF (UNIX AND ((CPACK_GENERATOR STREQUAL "DEB") OR (CPACK_GENERATOR STREQUAL "RPM")))
35 | # define stuff for the DEB/RPM packages
36 | set(CPACK_PACKAGE_CONTACT "pcl-developers@pointclouds.org")
37 | ENDIF ()
38 |
39 | IF (UNIX AND (CPACK_GENERATOR STREQUAL "DEB"))
40 | SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
41 | ENDIF ()
42 |
43 | IF (APPLE AND (CPACK_GENERATOR STREQUAL "PackageMaker"))
44 | # define stuff for the PackageMaker packages
45 | set(CPACK_OSX_PACKAGE_VERSION 10.5)
46 | set(CPACK_PACKAGE_CONTACT "pcl-developers@pointclouds.org")
47 | set(CPACK_SET_DESTDIR ON)
48 | set(CPACK_PACKAGING_INSTALL_PREFIX /usr/local)
49 | ENDIF ()
50 |
--------------------------------------------------------------------------------
/search/include/pcl2/search/neighbors.h:
--------------------------------------------------------------------------------
1 | /** \file neighbors.h
2 | * \brief Declares functions for finding nearest neighbors
3 | */
4 |
5 | #ifndef PCL2_NEIGHBORS_H
6 | #define PCL2_NEIGHBORS_H
7 |
8 | #include "pcl2/cloud.h"
9 | #include "pcl2/typed_matrix.h"
10 |
11 |
12 | namespace pcl2
13 | {
14 |
15 | /** \todo Document this class */
16 | class Neighborhood : public Cloud
17 | {
18 | public:
19 | Neighborhood (Cloud & cloud, const TypedMat & indices) : Cloud (cloud (indices)), indices_ (indices)
20 | {
21 |
22 | }
23 | protected:
24 | MatI indices_;
25 | };
26 |
27 | /** \brief Find the nearest neighbor to a query point in a given cloud
28 | * \param cloud An input cloud containing a 3D "xyz" channel
29 | * \param query A 3D query point
30 | * \return The index of the nearest neighbor.
31 | * \see http://en.wikipedia.org/wiki/Nearest_neighbor_search#k-nearest_neighbor
32 | */
33 | int findNearestNeighbor (const Cloud & cloud, const MatF & query);
34 |
35 | /** \brief Find the k nearest neighbors that surround a query point in a given cloud
36 | * \param cloud An input cloud containing a 3D "xyz" channel
37 | * \param query A 3D query point
38 | * \param k the number of nearest neighbors to return
39 | * \return A MatI containing the indices of the k nearest neighbors.
40 | * \see http://en.wikipedia.org/wiki/Nearest_neighbor_search#k-nearest_neighbor
41 | */
42 | MatI findKNearestNeighbors (const Cloud & cloud, const MatF & query, size_t k);
43 |
44 | /** \brief Find all points within a specified radius surrounding a query point in a given cloud
45 | * \param cloud An input cloud containing a 3D "xyz" channel
46 | * \param query A 3D query point
47 | * \param r the radius of the neighborhood
48 | * \return A MatI containing the indices of all points that fell within the given radius
49 | * \see http://en.wikipedia.org/wiki/Fixed-radius_near_neighbors
50 | * \see computeFixedRadiusNeighborhood
51 | */
52 | MatI findFixedRadiusNeighbors (Cloud & cloud, const MatF & query, float r);
53 |
54 | /** \brief Compute the subset points that fall within a specified radius surrounding a query point in a given cloud
55 | * \param cloud An input cloud containing a 3D "xyz" channel
56 | * \param query A 3D query point
57 | * \param r the radius of the neighborhood
58 | * \return A neighborhood of points that lie within the given radius around the query point
59 | * \see http://en.wikipedia.org/wiki/Fixed-radius_near_neighbors
60 | * \see findFixedRadiusNeighbors
61 | */
62 | Neighborhood computeFixedRadiusNeighborhood (Cloud & cloud, const MatF & query, float r);
63 |
64 | }
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/cmake/pcl_pclconfig.cmake:
--------------------------------------------------------------------------------
1 |
2 | set(PCL_SUBSYSTEMS_MODULES ${PCL_SUBSYSTEMS})
3 | list(REMOVE_ITEM PCL_SUBSYSTEMS_MODULES tools cuda_apps global_tests proctor gpu_kinfu)
4 |
5 | set(PCLCONFIG_AVAILABLE_COMPONENTS)
6 | set(PCLCONFIG_AVAILABLE_COMPONENTS_LIST)
7 | set(PCLCONFIG_INTERNAL_DEPENDENCIES)
8 | set(PCLCONFIG_EXTERNAL_DEPENDENCIES)
9 | set(PCLCONFIG_OPTIONAL_DEPENDENCIES)
10 | foreach(_ss ${PCL_SUBSYSTEMS_MODULES})
11 | PCL_GET_SUBSYS_STATUS(_status ${_ss})
12 | if(_status)
13 | set(PCLCONFIG_AVAILABLE_COMPONENTS "${PCLCONFIG_AVAILABLE_COMPONENTS} ${_ss}")
14 | set(PCLCONFIG_AVAILABLE_COMPONENTS_LIST "${PCLCONFIG_AVAILABLE_COMPONENTS_LIST}\n# - ${_ss}")
15 | GET_IN_MAP(_deps PCL_SUBSYS_DEPS ${_ss})
16 | if(_deps)
17 | set(PCLCONFIG_INTERNAL_DEPENDENCIES "${PCLCONFIG_INTERNAL_DEPENDENCIES}set(pcl_${_ss}_int_dep ")
18 | foreach(_dep ${_deps})
19 | set(PCLCONFIG_INTERNAL_DEPENDENCIES "${PCLCONFIG_INTERNAL_DEPENDENCIES}${_dep} ")
20 | endforeach(_dep)
21 | set(PCLCONFIG_INTERNAL_DEPENDENCIES "${PCLCONFIG_INTERNAL_DEPENDENCIES})\n")
22 | endif(_deps)
23 | GET_IN_MAP(_ext_deps PCL_SUBSYS_EXT_DEPS ${_ss})
24 | if(_ext_deps)
25 | set(PCLCONFIG_EXTERNAL_DEPENDENCIES "${PCLCONFIG_EXTERNAL_DEPENDENCIES}set(pcl_${_ss}_ext_dep ")
26 | foreach(_ext_dep ${_ext_deps})
27 | set(PCLCONFIG_EXTERNAL_DEPENDENCIES "${PCLCONFIG_EXTERNAL_DEPENDENCIES}${_ext_dep} ")
28 | endforeach(_ext_dep)
29 | set(PCLCONFIG_EXTERNAL_DEPENDENCIES "${PCLCONFIG_EXTERNAL_DEPENDENCIES})\n")
30 | endif(_ext_deps)
31 | GET_IN_MAP(_opt_deps PCL_SUBSYS_OPT_DEPS ${_ss})
32 | if(_opt_deps)
33 | set(PCLCONFIG_OPTIONAL_DEPENDENCIES "${PCLCONFIG_OPTIONAL_DEPENDENCIES}set(pcl_${_ss}_opt_dep ")
34 | foreach(_opt_dep ${_opt_deps})
35 | set(PCLCONFIG_OPTIONAL_DEPENDENCIES "${PCLCONFIG_OPTIONAL_DEPENDENCIES}${_opt_dep} ")
36 | endforeach(_opt_dep)
37 | set(PCLCONFIG_OPTIONAL_DEPENDENCIES "${PCLCONFIG_OPTIONAL_DEPENDENCIES})\n")
38 | endif(_opt_deps)
39 | endif(_status)
40 | endforeach(_ss)
41 |
42 | configure_file("${PCL_SOURCE_DIR}/PCLConfig.cmake.in"
43 | "${PCL_BINARY_DIR}/PCLConfig.cmake" @ONLY)
44 | configure_file("${PCL_SOURCE_DIR}/PCLConfigVersion.cmake.in"
45 | "${PCL_BINARY_DIR}/PCLConfigVersion.cmake" @ONLY)
46 | install(FILES
47 | "${PCL_BINARY_DIR}/PCLConfig.cmake"
48 | "${PCL_BINARY_DIR}/PCLConfigVersion.cmake"
49 | COMPONENT pclconfig
50 | DESTINATION ${PCLCONFIG_INSTALL_DIR})
--------------------------------------------------------------------------------
/features/include/pcl2/features/normals.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file normals.h
39 | * \brief Declares functions for estimating surface normals
40 | */
41 |
42 | #ifndef PCL2_NEIGHBORS_H
43 | #define PCL2_NEIGHBORS_H
44 |
45 | #include "pcl2/cloud.h"
46 | #include "pcl2/typed_matrix.h"
47 |
48 |
49 | namespace pcl2
50 | {
51 |
52 | Cloud estimateSurfaceNormals (const Cloud & cloud, float nhood_radius);
53 | Cloud estimateSurfaceNormals (const MatF & points, float nhood_radius);
54 |
55 | Cloud estimateSurfaceNormals (const MatF & surface_points, const MatF & query_points, float nhood_radius);
56 |
57 | Cloud estimateSurfaceNormalsKNN (const Cloud & cloud, int k);
58 |
59 | //
60 | // Cloud estimateSurfaceNormals (Cloud cloud, NeighborhoodSpec ns);
61 | // e.g., cld += estimateSurfaceNormals (cld, FixedRadius (0.1));
62 | // cld += estimateSurfaceNormals (cld, KNearest (0.1));
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/cmake/pcl_find_python.cmake:
--------------------------------------------------------------------------------
1 | find_package(PythonInterp)
2 | find_package(PythonLibs)
3 |
4 | if(PYTHONINTERP_FOUND)
5 | execute_process(COMMAND ${PYTHON_EXECUTABLE} --version
6 | ERROR_VARIABLE PYTHON_VERSION_FULL
7 | OUTPUT_STRIP_TRAILING_WHITESPACE)
8 |
9 | string(REGEX MATCH "[0-9]+.[0-9]+" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}")
10 | if(UNIX)
11 | set(PYTHON_PLUGIN_INSTALL_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages/opencv)
12 | if(APPLE)
13 | set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages CACHE PATH "Where to install the python packages.")
14 | else() #debian based assumed, install to the dist-packages.
15 | set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/dist-packages CACHE PATH "Where to install the python packages.")
16 | endif()
17 | endif()
18 | if(WIN32)
19 | get_filename_component(PYTHON_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${PYTHON_VERSION_MAJOR_MINOR}\\InstallPath]" ABSOLUTE CACHE)
20 | set(PYTHON_PLUGIN_INSTALL_PATH "${PYTHON_PATH}/Lib/site-packages/opencv")
21 | set(PYTHON_PACKAGES_PATH "${PYTHON_PATH}/Lib/site-packages")
22 | endif()
23 |
24 | if ("${PYTHON_VERSION_MAJOR_MINOR}" VERSION_GREATER 2.5)
25 | SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} -B)
26 | endif()
27 | endif(PYTHONINTERP_FOUND)
28 | find_package(PythonInterp)
29 | find_package(PythonLibs)
30 |
31 | if(PYTHONINTERP_FOUND)
32 | execute_process(COMMAND ${PYTHON_EXECUTABLE} --version
33 | ERROR_VARIABLE PYTHON_VERSION_FULL
34 | OUTPUT_STRIP_TRAILING_WHITESPACE)
35 |
36 | string(REGEX MATCH "[0-9]+.[0-9]+" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}")
37 | if(UNIX)
38 | set(PYTHON_PLUGIN_INSTALL_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages/opencv)
39 | if(APPLE)
40 | set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages CACHE PATH "Where to install the python packages.")
41 | else() #debian based assumed, install to the dist-packages.
42 | set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/dist-packages CACHE PATH "Where to install the python packages.")
43 | endif()
44 | endif()
45 | if(WIN32)
46 | get_filename_component(PYTHON_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${PYTHON_VERSION_MAJOR_MINOR}\\InstallPath]" ABSOLUTE CACHE)
47 | set(PYTHON_PLUGIN_INSTALL_PATH "${PYTHON_PATH}/Lib/site-packages/opencv")
48 | set(PYTHON_PACKAGES_PATH "${PYTHON_PATH}/Lib/site-packages")
49 | endif()
50 |
51 | if ("${PYTHON_VERSION_MAJOR_MINOR}" VERSION_GREATER 2.5)
52 | SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} -B)
53 | endif()
54 | endif(PYTHONINTERP_FOUND)
55 |
--------------------------------------------------------------------------------
/core/include/pcl2/impl/row.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file row.hpp
39 | * \brief Contains class definitions for pcl2::EigenMat and pcl2::ConstEigenMat
40 | */
41 |
42 | #ifndef PCL2_ROW_HPP
43 | #define PCL2_ROW_HPP
44 |
45 | #include "pcl2/row.h"
46 | #include "pcl2/impl/matrix_row_impl.hpp"
47 |
48 |
49 | template
50 | pcl2::Row::Row (boost::shared_ptr > matrix_ptr, size_t row) :
51 | TypedMat (typename core::MatRowImpl::Ptr (new core::MatRowImpl (matrix_ptr, row)))
52 | {
53 | typedef core::MatRowImpl Impl;
54 | mat_row_ptr_ = boost::dynamic_pointer_cast (matrix_ptr_);
55 | }
56 |
57 | template int
58 | pcl2::Row::getIndex () const
59 | {
60 | return (mat_row_ptr_->getIndex ());
61 | }
62 |
63 | template bool
64 | pcl2::Row::hasNext () const
65 | {
66 | return (mat_row_ptr_->hasNext ());
67 | }
68 |
69 | template void
70 | pcl2::Row::advance ()
71 | {
72 | mat_row_ptr_->advance ();
73 | }
74 |
75 | #endif
76 |
--------------------------------------------------------------------------------
/core/src/stats.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file stats.cpp
39 | * \brief Instantiate functions for computing statistical properties of a matrix
40 | */
41 |
42 | #include "pcl2/impl/stats.hpp"
43 |
44 | template pcl2::TypedMat pcl2::computeMean (const TypedMat &);
45 | template pcl2::TypedMat pcl2::computeMean (const TypedMat &);
46 |
47 | template pcl2::TypedMat pcl2::computeCovariance (const TypedMat &);
48 | template pcl2::TypedMat pcl2::computeCovariance (const TypedMat &);
49 |
50 | template pcl2::TypedMat pcl2::computeCovariance (const TypedMat &, const TypedMat &);
51 | template pcl2::TypedMat pcl2::computeCovariance (const TypedMat &, const TypedMat &);
52 |
53 | template void pcl2::computeMeanAndCovariance (const TypedMat &, TypedMat &, TypedMat &);
54 | template void pcl2::computeMeanAndCovariance (const TypedMat &, TypedMat &, TypedMat &);
55 |
--------------------------------------------------------------------------------
/core/include/pcl2/spatial_index.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2011, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file spatial_index.h
39 | * \brief Contains class declaration for pcl2::SpatialIndex
40 | */
41 |
42 | #ifndef PCL2_SPATIAL_INDEX_H
43 | #define PCL2_SPATIAL_INDEX_H
44 |
45 | // see http://en.wikipedia.org/wiki/Spatial_database#Spatial_Index
46 |
47 | #include "pcl2/typed_matrix.h"
48 | #include
49 |
50 | namespace pcl2
51 | {
52 |
53 | template
54 | class SpatialIndex
55 | {
56 | public:
57 | typedef TypedMat MatT;
58 | typedef boost::shared_ptr > Ptr;
59 |
60 | virtual void
61 | buildIndex (const MatT & input) = 0;
62 |
63 | virtual MatI
64 | findKNearestNeighbors (const MatT & query, size_t k) const = 0;
65 |
66 | virtual MatI
67 | findFixedRadiusNeighbors (const MatT & query, float r) const = 0;
68 |
69 | virtual std::pair
70 | findKNearestNeighborsAndDistances (const MatT & query, size_t k) const = 0;
71 |
72 | virtual std::pair
73 | findFixedRadiusNeighborsAndDistances (const MatT & query, float r) const = 0;
74 | };
75 |
76 | }
77 |
78 | #endif
79 |
--------------------------------------------------------------------------------
/cmake/uninstall_target.cmake.in:
--------------------------------------------------------------------------------
1 | if(NOT EXISTS "@PROJECT_BINARY_DIR@/install_manifest.txt")
2 | message(FATAL_ERROR "Cannot find install manifest: \"@PROJECT_BINARY_DIR@/install_manifest.txt\"")
3 | endif(NOT EXISTS "@PROJECT_BINARY_DIR@/install_manifest.txt")
4 |
5 | file(READ "@PROJECT_BINARY_DIR@/install_manifest.txt" files)
6 | string(REGEX REPLACE "\n" ";" files "${files}")
7 | foreach(file ${files})
8 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
9 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
10 | if(EXISTS "$ENV{DESTDIR}${file}" OR IS_SYMLINK "$ENV{DESTDIR}${file}")
11 | exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
12 | OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval)
13 | if(NOT "${rm_retval}" STREQUAL 0)
14 | message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
15 | endif(NOT "${rm_retval}" STREQUAL 0)
16 | else(EXISTS "$ENV{DESTDIR}${file}" OR IS_SYMLINK "$ENV{DESTDIR}${file}")
17 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
18 | endif(EXISTS "$ENV{DESTDIR}${file}" OR IS_SYMLINK "$ENV{DESTDIR}${file}")
19 | endforeach(file)
20 |
21 | # remove pcl directory in include (removes all files in it!)
22 | message(STATUS "Uninstalling \"@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_ROOT@\"")
23 | if(EXISTS "@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_ROOT@")
24 | exec_program("@CMAKE_COMMAND@"
25 | ARGS "-E remove_directory \"@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_ROOT@\""
26 | OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval)
27 | if(NOT "${rm_retval}" STREQUAL 0)
28 | message(FATAL_ERROR
29 | "Problem when removing \"@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_ROOT@\"")
30 | endif(NOT "${rm_retval}" STREQUAL 0)
31 | else(EXISTS "@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_ROOT@")
32 | message(STATUS
33 | "Directory \"@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_ROOT@\" does not exist.")
34 | endif(EXISTS "@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_ROOT@")
35 |
36 | # remove pcl directory in share (removes all files in it!)
37 | # created by CMakeLists.txt for PCLConfig.cmake
38 | message(STATUS "Uninstalling \"@CMAKE_INSTALL_PREFIX@/@PCLCONFIG_INSTALL_DIR@\"")
39 | if(EXISTS "@CMAKE_INSTALL_PREFIX@/@PCLCONFIG_INSTALL_DIR@")
40 | exec_program("@CMAKE_COMMAND@"
41 | ARGS "-E remove_directory \"@CMAKE_INSTALL_PREFIX@/@PCLCONFIG_INSTALL_DIR@\""
42 | OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval)
43 | if(NOT "${rm_retval}" STREQUAL 0)
44 | message(FATAL_ERROR
45 | "Problem when removing \"@CMAKE_INSTALL_PREFIX@/@PCLCONFIG_INSTALL_DIR@\"")
46 | endif(NOT "${rm_retval}" STREQUAL 0)
47 | else(EXISTS "@CMAKE_INSTALL_PREFIX@/@PCLCONFIG_INSTALL_DIR@")
48 | message(STATUS
49 | "Directory \"@CMAKE_INSTALL_PREFIX@/@PCLCONFIG_INSTALL_DIR@\" does not exist.")
50 | endif(EXISTS "@CMAKE_INSTALL_PREFIX@/@PCLCONFIG_INSTALL_DIR@")
51 |
--------------------------------------------------------------------------------
/core/src/matrix.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file matrix.cpp
39 | * \brief Contains class definition for \ref pcl2::Mat
40 | */
41 |
42 | #include
43 | #include "pcl2/matrix.h"
44 | #include "pcl2/matrix_impl.h"
45 | #include "pcl2/typed_matrix.h"
46 |
47 | #include "pcl2/matrix_view_impl.h"
48 |
49 | pcl2::Mat::Mat (const core::MatImpl::Ptr matrix_ptr) : matrix_ptr_ (matrix_ptr) {}
50 |
51 | pcl2::core::MatImpl::Ptr
52 | pcl2::Mat::getPtr ()
53 | {
54 | return (matrix_ptr_);
55 | }
56 |
57 | const pcl2::core::MatImpl::Ptr
58 | pcl2::Mat::getPtr () const
59 | {
60 | return (matrix_ptr_);
61 | }
62 |
63 | pcl2::Mat
64 | pcl2::Mat::copy () const
65 | {
66 | return (Mat (matrix_ptr_->copy ()));
67 | }
68 |
69 | size_t
70 | pcl2::Mat::rows () const
71 | {
72 | return (matrix_ptr_->rows ());
73 | }
74 |
75 | size_t
76 | pcl2::Mat::cols () const
77 | {
78 | return (matrix_ptr_->cols ());
79 | }
80 |
81 | pcl2::Mat
82 | pcl2::Mat::operator () (const TypedMat & indices)
83 | {
84 | typedef core::TypedMatImpl Impl;
85 | Impl::ConstPtr idx = boost::dynamic_pointer_cast (indices.getPtr ());
86 | return (Mat (matrix_ptr_->createView (idx)));
87 | }
88 |
--------------------------------------------------------------------------------
/core/include/pcl2/impl/eigen_matrix.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file eigen_matrix.hpp
39 | * \brief Contains class definitions for pcl2::EigenMat and pcl2::ConstEigenMat
40 | */
41 |
42 | #ifndef PCL2_EIGEN_MATRIX_HPP
43 | #define PCL2_EIGEN_MATRIX_HPP
44 |
45 | #include "pcl2/eigen_matrix.h"
46 |
47 | #include "pcl2/impl/typed_matrix.hpp"
48 | #include "pcl2/impl/eigen_matrix_impl.hpp"
49 |
50 | template
51 | pcl2::EigenMat::EigenMat (core::MatImpl::Ptr matrix) : TypedMat (matrix)
52 | {
53 | eigen_matrix_ptr_ = boost::dynamic_pointer_cast > (matrix);
54 | assert (eigen_matrix_ptr_);
55 | }
56 |
57 | template
58 | pcl2::EigenMat::EigenMat (const Mat & shared_matrix) : TypedMat (shared_matrix)
59 | {
60 | eigen_matrix_ptr_ = boost::dynamic_pointer_cast > (matrix_ptr_);
61 | assert (eigen_matrix_ptr_);
62 | }
63 |
64 | template
65 | pcl2::EigenMat::EigenMat (size_t rows, size_t cols) :
66 | TypedMat (typename core::EigenMatImpl::Ptr (new core::EigenMatImpl (rows, cols)))
67 | {
68 | eigen_matrix_ptr_ = boost::dynamic_pointer_cast > (matrix_ptr_);
69 | assert (eigen_matrix_ptr_);
70 | }
71 |
72 | #endif
73 |
--------------------------------------------------------------------------------
/cmake/Modules/FindFlann.cmake:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Find Flann
3 | #
4 | # This sets the following variables:
5 | # FLANN_FOUND - True if FLANN was found.
6 | # FLANN_INCLUDE_DIRS - Directories containing the FLANN include files.
7 | # FLANN_LIBRARIES - Libraries needed to use FLANN.
8 | # FLANN_DEFINITIONS - Compiler flags for FLANN.
9 |
10 | find_package(PkgConfig)
11 | pkg_check_modules(PC_FLANN flann)
12 | set(FLANN_DEFINITIONS ${PC_FLANN_CFLAGS_OTHER})
13 |
14 | find_path(FLANN_INCLUDE_DIR flann/flann.hpp
15 | HINTS ${PC_FLANN_INCLUDEDIR} ${PC_FLANN_INCLUDE_DIRS} "${FLANN_ROOT}" "$ENV{FLANN_ROOT}"
16 | PATHS "$ENV{PROGRAMFILES}/Flann" "$ENV{PROGRAMW6432}/Flann"
17 | "$ENV{PROGRAMFILES}/flann 1.6.9" "$ENV{PROGRAMW6432}/flann 1.6.9"
18 | PATH_SUFFIXES include)
19 |
20 | # Prefer static libraries in Windows over shared ones
21 | if(WIN32)
22 | find_library(FLANN_LIBRARY
23 | NAMES flann_cpp_s flann_cpp
24 | HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS} "${FLANN_ROOT}" "$ENV{FLANN_ROOT}"
25 | PATHS "$ENV{PROGRAMFILES}/Flann" "$ENV{PROGRAMW6432}/Flann"
26 | "$ENV{PROGRAMFILES}/flann 1.6.9" "$ENV{PROGRAMW6432}/flann 1.6.9"
27 | PATH_SUFFIXES lib)
28 |
29 | find_library(FLANN_LIBRARY_DEBUG
30 | NAMES flann_cpp_s-gd flann_cpp-gd flann_cpp_s flann_cpp
31 | HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS} "${FLANN_ROOT}" "$ENV{FLANN_ROOT}"
32 | PATHS "$ENV{PROGRAMFILES}/Flann" "$ENV{PROGRAMW6432}/Flann"
33 | "$ENV{PROGRAMFILES}/flann 1.6.9" "$ENV{PROGRAMW6432}/flann 1.6.9"
34 | PATH_SUFFIXES lib)
35 | else(WIN32)
36 | find_library(FLANN_LIBRARY
37 | NAMES flann_cpp
38 | HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS} "${FLANN_ROOT}" "$ENV{FLANN_ROOT}"
39 | PATH_SUFFIXES lib)
40 |
41 | find_library(FLANN_LIBRARY_DEBUG
42 | NAMES flann_cpp-gd flann_cpp
43 | HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS} "${FLANN_ROOT}" "$ENV{FLANN_ROOT}"
44 | PATH_SUFFIXES lib)
45 | endif(WIN32)
46 |
47 | if(NOT FLANN_LIBRARY_DEBUG)
48 | set(FLANN_LIBRARY_DEBUG ${FLANN_LIBRARY})
49 | endif(NOT FLANN_LIBRARY_DEBUG)
50 |
51 | set(FLANN_INCLUDE_DIRS ${FLANN_INCLUDE_DIR})
52 | set(FLANN_LIBRARIES optimized ${FLANN_LIBRARY} debug ${FLANN_LIBRARY_DEBUG})
53 |
54 | include(FindPackageHandleStandardArgs)
55 | find_package_handle_standard_args(Flann DEFAULT_MSG
56 | FLANN_LIBRARY FLANN_INCLUDE_DIR)
57 |
58 | mark_as_advanced(FLANN_LIBRARY FLANN_LIBRARY_DEBUG FLANN_INCLUDE_DIR)
59 |
60 | if(FLANN_FOUND)
61 | message(STATUS "FLANN found (include: ${FLANN_INCLUDE_DIRS}, lib: ${FLANN_LIBRARIES})")
62 | if(WIN32)
63 | get_filename_component(flann_lib ${FLANN_LIBRARY} NAME_WE)
64 | if("${flann_lib}" STREQUAL "flann_cpp_s")
65 | add_definitions(-DFLANN_STATIC)
66 | endif("${flann_lib}" STREQUAL "flann_cpp_s")
67 | endif(WIN32)
68 | endif(FLANN_FOUND)
69 |
70 |
--------------------------------------------------------------------------------
/core/include/pcl2/math.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file math.h
39 | * \brief Declares functions for performing basic arithmethic on matrices
40 | */
41 |
42 | #ifndef PCL2_MATH_H
43 | #define PCL2_MATH_H
44 |
45 | #include "pcl2/typed_matrix.h"
46 |
47 | namespace pcl2
48 | {
49 |
50 | template
51 | TypedMat
52 | computeSum (const TypedMat & input);
53 |
54 | template
55 | TypedMat
56 | computeProduct (const TypedMat & input);
57 |
58 | template
59 | TypedMat
60 | computeCumulativeSum (const TypedMat & input);
61 |
62 | template
63 | TypedMat
64 | computeCumulativeProduct (const TypedMat & input);
65 |
66 | template
67 | TypedMat
68 | computeOuterSum (const TypedMat & vec1, const TypedMat & vec2);
69 |
70 | template
71 | TypedMat
72 | computeOuterProduct (const TypedMat & vec1, const TypedMat & vec2);
73 |
74 | // --- Move these to a different file ---
75 | template
76 | TypedMat
77 | computeEigenvalues3x3 (const TypedMat & input);
78 |
79 | template
80 | TypedMat
81 | computeEigenvectors3x3 (const TypedMat & input);
82 |
83 | template
84 | void
85 | computeEigendecomposition3x3 (const TypedMat & input, TypedMat & eigenvalues, TypedMat & eigenvectors);
86 |
87 |
88 |
89 | }
90 | #endif
91 |
--------------------------------------------------------------------------------
/registration/include/pcl2/registration/impl/fit.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file fit.hpp
39 | * \brief Defines functions declared in fit.h
40 | */
41 |
42 | #include "pcl2/registration/fit.h"
43 |
44 | #include "pcl2/core.h"
45 | #include "pcl2/eigen_matrix.h"
46 | #include "pcl2/stats.h"
47 | #include "pcl2/math.h"
48 |
49 | #include "pcl2/conversions.h"
50 | #include
51 |
52 | template
53 | pcl2::TypedMat
54 | pcl2::fitPlaneLLS (const TypedMat & points)
55 | {
56 | typedef TypedMat MatT;
57 | MatT cov = computeCovariance (points);
58 | MatT eigvecs = computeEigenvectors3x3 (cov);
59 | MatT normal = eigvecs (0).copy ();
60 |
61 | ////// Double-check
62 | pcl::PointCloud::Ptr point_cloud = convertToPointCloudXYZ (points);
63 | Eigen::Vector4f plane_parameters;
64 | float curvature;
65 | pcl::computePointNormal (*point_cloud, plane_parameters, curvature);
66 | for (int i = 0; i < 3; ++i)
67 | {
68 | assert (fabs(normal (0, i) - plane_parameters (i)) < 1e-3 ||
69 | fabs(normal (0, i) + plane_parameters (i)) < 1e-3);
70 | }
71 | //////
72 |
73 | return (normal);
74 | }
75 |
76 |
77 | template
78 | pcl2::TypedMat
79 | pcl2::fitPlaneRANSAC (const TypedMat & points, float inlier_threshold)
80 | {
81 | const bool SORRY_NOT_IMPLEMENTED_YET = false;
82 | assert (SORRY_NOT_IMPLEMENTED_YET);
83 | }
84 |
--------------------------------------------------------------------------------
/core/include/pcl2/impl/stats.hpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file stats.hpp
39 | * \brief Defines functions for computing statistical properties of a matrix
40 | */
41 |
42 | #include "pcl2/stats.h"
43 | #include "pcl2/row.h"
44 | #include "pcl2/eigen_matrix.h"
45 | #include "pcl2/math.h"
46 |
47 | template
48 | pcl2::TypedMat
49 | pcl2::computeMean (const TypedMat & input)
50 | {
51 | EigenMat sum = computeSum (input);
52 | return (sum / input.rows ());
53 | }
54 |
55 | template
56 | pcl2::TypedMat
57 | pcl2::computeCovariance (const TypedMat & input)
58 | {
59 | TypedMat mean = computeMean (input);
60 | return (computeCovariance (input, mean));
61 | }
62 |
63 | template
64 | pcl2::TypedMat
65 | pcl2::computeCovariance (const TypedMat & input, const TypedMat & mean)
66 | {
67 | EigenMat unnormalized_cov (input.cols (), input.cols ());
68 | unnormalized_cov.fill (0);
69 | for (typename TypedMat::Row row = input (0); row.hasNext (); row.advance ())
70 | {
71 | TypedMat demeaned_row = row - mean;
72 | unnormalized_cov += computeOuterProduct (demeaned_row, demeaned_row);
73 | }
74 | return (unnormalized_cov / (input.rows () - 1));
75 | }
76 |
77 | template
78 | void
79 | pcl2::computeMeanAndCovariance (const TypedMat & input, TypedMat & mean, TypedMat & covariance)
80 | {
81 | mean = computeMean (input);
82 | covariance = computeCovariance (input, mean);
83 | }
84 |
--------------------------------------------------------------------------------
/core/include/pcl2/exception.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file exception.h
39 | * \brief Contains class definitions for pcl2::Exception and its various subclasses
40 | */
41 |
42 | #ifndef PCL2_EXCEPTION_H
43 | #define PCL2_EXCEPTION_H
44 |
45 | #include
46 |
47 | namespace pcl2
48 | {
49 |
50 | /** \brief The base exception class */
51 | class Exception
52 | {
53 | public:
54 | /** \brief Get the exception's description
55 | * \return A string describing the exception
56 | */
57 | virtual std::string what () { return ("GenericException"); }
58 | };
59 |
60 | /** \brief Bad cast exception
61 | *
62 | * Thrown when attempting to convert a pointer to an improper type
63 | */
64 | class BadCastException : public Exception
65 | {
66 | public:
67 | virtual std::string what () { return ("BadCastException"); }
68 | };
69 |
70 | /** \brief Channel not found exception
71 | *
72 | * Thrown when attempting to access a non-existent channel
73 | */
74 | class ChannelNotFoundException : public Exception
75 | {
76 | public:
77 | virtual std::string what () { return ("ChannelNotFoundException"); }
78 | };
79 |
80 | /** \brief Incompatible size exception
81 | *
82 | * Thrown when attempting to perform an operation with clouds/matrices whose
83 | * sizes are mismatched.
84 | */
85 | class IncompatibleSizeException : public Exception
86 | {
87 | public:
88 | virtual std::string what () { return ("IncompatibleSizesException"); }
89 | };
90 |
91 | }
92 |
93 | #endif // PCL2_EXCEPTION_H
94 |
--------------------------------------------------------------------------------
/cmake/pcl_find_sse.cmake:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Check for the presence of SSE and figure out the flags to use for it.
3 | macro(PCL_CHECK_FOR_SSE)
4 | include(CheckCXXSourceRuns)
5 | if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
6 | set(SSE_FLAGS)
7 |
8 | set(CMAKE_REQUIRED_FLAGS "-msse3")
9 | check_cxx_source_runs("
10 | #include
11 |
12 | int main()
13 | {
14 | __m128d a, b;
15 | double vals[2] = {0};
16 | a = _mm_loadu_pd(vals);
17 | b = _mm_hadd_pd(a,a);
18 | _mm_storeu_pd(vals, b);
19 | return 0;
20 | }"
21 | HAVE_SSE3_EXTENSIONS)
22 |
23 | set(CMAKE_REQUIRED_FLAGS "-msse2")
24 | check_cxx_source_runs("
25 | #include
26 |
27 | int main()
28 | {
29 | __m128d a, b;
30 | double vals[2] = {0};
31 | a = _mm_loadu_pd(vals);
32 | b = _mm_add_pd(a,a);
33 | _mm_storeu_pd(vals,b);
34 | return 0;
35 | }"
36 | HAVE_SSE2_EXTENSIONS)
37 |
38 | set(CMAKE_REQUIRED_FLAGS "-msse")
39 | check_cxx_source_runs("
40 | #include
41 | int main()
42 | {
43 | __m128 a, b;
44 | float vals[4] = {0};
45 | a = _mm_loadu_ps(vals);
46 | b = a;
47 | b = _mm_add_ps(a,b);
48 | _mm_storeu_ps(vals,b);
49 | return 0;
50 | }"
51 | HAVE_SSE_EXTENSIONS)
52 |
53 | set(CMAKE_REQUIRED_FLAGS)
54 |
55 | if(HAVE_SSE3_EXTENSIONS)
56 | set(SSE_FLAGS "-msse3 -mfpmath=sse")
57 | message(STATUS "Found SSE3 extensions, using flags: ${SSE_FLAGS}")
58 | elseif(HAVE_SSE2_EXTENSIONS)
59 | set(SSE_FLAGS "-msse2 -mfpmath=sse")
60 | message(STATUS "Found SSE2 extensions, using flags: ${SSE_FLAGS}")
61 | elseif(HAVE_SSE_EXTENSIONS)
62 | set(SSE_FLAGS "-msse -mfpmath=sse")
63 | message(STATUS "Found SSE extensions, using flags: ${SSE_FLAGS}")
64 | endif(HAVE_SSE3_EXTENSIONS)
65 | elseif(MSVC)
66 | check_cxx_source_runs("
67 | #include
68 |
69 | int main()
70 | {
71 | __m128d a, b;
72 | double vals[2] = {0};
73 | a = _mm_loadu_pd(vals);
74 | b = _mm_add_pd(a,a);
75 | _mm_storeu_pd(vals,b);
76 | return 0;
77 | }"
78 | HAVE_SSE2_EXTENSIONS)
79 |
80 | if(HAVE_SSE2_EXTENSIONS)
81 | set(SSE_FLAGS "/arch:SSE2 /fp:fast -D__SSE__ -D__SSE2__" )
82 | message(STATUS "Found SSE2 extensions, using flags: ${SSE_FLAGS}")
83 | endif(HAVE_SSE2_EXTENSIONS)
84 | endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
85 | endmacro(PCL_CHECK_FOR_SSE)
86 |
87 |
88 | ###############################################################################
89 | # Add the SSE flags to a target.
90 | # _name The name of the target to add the flags to.
91 | macro(PCL_ADD_SSE_FLAGS _name)
92 | if(SSE_FLAGS)
93 | PCL_ADD_CFLAGS(${_name} ${SSE_FLAGS})
94 | endif(SSE_FLAGS)
95 | endmacro(PCL_ADD_SSE_FLAGS)
96 |
97 |
--------------------------------------------------------------------------------
/cmake/Modules/FindGLEW.cmake:
--------------------------------------------------------------------------------
1 | # Copyright (c) 2009 Boudewijn Rempt
2 | #
3 | # Redistribution and use is allowed according to the terms of the BSD license.
4 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
5 | #
6 | # - try to find glew library and include files
7 | # GLEW_INCLUDE_DIR, where to find GL/glew.h, etc.
8 | # GLEW_LIBRARIES, the libraries to link against
9 | # GLEW_FOUND, If false, do not try to use GLEW.
10 | # Also defined, but not for general use are:
11 | # GLEW_GLEW_LIBRARY = the full path to the glew library.
12 |
13 | IF (WIN32)
14 |
15 | IF(CYGWIN)
16 |
17 | FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h)
18 |
19 | FIND_LIBRARY( GLEW_GLEW_LIBRARY glew32
20 | ${OPENGL_LIBRARY_DIR}
21 | /usr/lib/w32api
22 | /usr/X11R6/lib
23 | )
24 |
25 |
26 | ELSE(CYGWIN)
27 |
28 | FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
29 | $ENV{GLEW_ROOT_PATH}/include
30 | )
31 |
32 | FIND_LIBRARY( GLEW_GLEW_LIBRARY
33 | NAMES glew glew32
34 | PATHS
35 | $ENV{GLEW_ROOT_PATH}/lib
36 | ${OPENGL_LIBRARY_DIR}
37 | )
38 |
39 | ENDIF(CYGWIN)
40 |
41 | ELSE (WIN32)
42 |
43 | IF (APPLE)
44 | # These values for Apple could probably do with improvement.
45 | FIND_PATH( GLEW_INCLUDE_DIR glew.h
46 | /System/Library/Frameworks/GLEW.framework/Versions/A/Headers
47 | ${OPENGL_LIBRARY_DIR}
48 | )
49 | SET(GLEW_GLEW_LIBRARY "-framework GLEW" CACHE STRING "GLEW library for OSX")
50 | SET(GLEW_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
51 | ELSE (APPLE)
52 |
53 | FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
54 | /usr/include/GL
55 | /usr/openwin/share/include
56 | /usr/openwin/include
57 | /usr/X11R6/include
58 | /usr/include/X11
59 | /opt/graphics/OpenGL/include
60 | /opt/graphics/OpenGL/contrib/libglew
61 | )
62 |
63 | FIND_LIBRARY( GLEW_GLEW_LIBRARY GLEW
64 | /usr/openwin/lib
65 | /usr/X11R6/lib
66 | )
67 |
68 | ENDIF (APPLE)
69 |
70 | ENDIF (WIN32)
71 |
72 | SET( GLEW_FOUND "NO" )
73 | IF(GLEW_INCLUDE_DIR)
74 | IF(GLEW_GLEW_LIBRARY)
75 | # Is -lXi and -lXmu required on all platforms that have it?
76 | # If not, we need some way to figure out what platform we are on.
77 | SET( GLEW_LIBRARIES
78 | ${GLEW_GLEW_LIBRARY}
79 | ${GLEW_cocoa_LIBRARY}
80 | )
81 | SET( GLEW_FOUND "YES" )
82 |
83 | #The following deprecated settings are for backwards compatibility with CMake1.4
84 | SET (GLEW_LIBRARY ${GLEW_LIBRARIES})
85 | SET (GLEW_INCLUDE_PATH ${GLEW_INCLUDE_DIR})
86 |
87 | ENDIF(GLEW_GLEW_LIBRARY)
88 | ENDIF(GLEW_INCLUDE_DIR)
89 |
90 | IF(GLEW_FOUND)
91 | IF(NOT GLEW_FIND_QUIETLY)
92 | MESSAGE(STATUS "Found Glew: ${GLEW_LIBRARIES}")
93 | ENDIF(NOT GLEW_FIND_QUIETLY)
94 | ELSE(GLEW_FOUND)
95 | IF(GLEW_FIND_REQUIRED)
96 | MESSAGE(FATAL_ERROR "Could not find Glew")
97 | ENDIF(GLEW_FIND_REQUIRED)
98 | ENDIF(GLEW_FOUND)
99 |
100 | MARK_AS_ADVANCED(
101 | GLEW_INCLUDE_DIR
102 | GLEW_GLEW_LIBRARY
103 | GLEW_Xmu_LIBRARY
104 | GLEW_Xi_LIBRARY
105 | )
106 |
--------------------------------------------------------------------------------
/core/include/pcl2/row.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file row.h
39 | * \brief Contains class declarations for Row and ConstRow
40 | */
41 |
42 | #ifndef PCL2_ROW_H
43 | #define PCL2_ROW_H
44 |
45 | #include "pcl2/typed_matrix.h"
46 |
47 | #include
48 | #include
49 | #include
50 |
51 | namespace pcl2
52 | {
53 | template class TypedMat;
54 | namespace core
55 | {
56 | template class TypedMatImpl;
57 | template class MatRowImpl;
58 | }
59 |
60 | ///////////////////////////////////////////////////////////////////////////////
61 | /** \brief \todo Write me
62 | *
63 | * Extends the TypedMat class to...
64 | */
65 | template
66 | class Row : public TypedMat
67 | {
68 | protected:
69 | using TypedMat::matrix_ptr_;
70 |
71 | private:
72 | Row ();
73 |
74 | protected:
75 | /** \brief Construct a Row view into the provided TypedMatImpl
76 | */
77 | Row (boost::shared_ptr > matrix_ptr, size_t row);
78 |
79 | public:
80 | int
81 | getIndex () const;
82 |
83 | bool
84 | hasNext () const;
85 |
86 | void
87 | advance ();
88 |
89 | protected:
90 | /** \brief A shared pointer to the matrix implementation */
91 | boost::shared_ptr > mat_row_ptr_;
92 |
93 | friend class TypedMat;
94 | };
95 |
96 | template
97 | std::ostream& operator << (std::ostream& out, const pcl2::Row & row)
98 | {
99 | for (size_t i = 0; i < row.cols (); ++i)
100 | out << row (0, i) << " ";
101 |
102 | return (out);
103 | }
104 |
105 | }
106 |
107 | #endif
108 |
--------------------------------------------------------------------------------
/registration/src/icp.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file icp.cpp
39 | * \brief Defines functions and classes declared in icp.h
40 | */
41 |
42 | #include "pcl2/registration/icp.h"
43 | #include "pcl2/registration/transform.h"
44 |
45 | pcl2::ICP::ICP (size_t max_iterations) :
46 | max_iterations_ (max_iterations),
47 | correspondence_identification_ (new CorrespondenceIdentification),
48 | transformation_estimation_ (new RigidTransformationEstimation),
49 | converged_ (false),
50 | transformation_ (4, 4)
51 | {
52 | // todo: set transformation to the identity matrix
53 | }
54 |
55 | pcl2::Cloud
56 | pcl2::ICP::align (const Cloud & source, const Cloud & target)
57 | {
58 | Cloud aligned_source = source;
59 | for (size_t i = 0; i < max_iterations_; ++i)
60 | {
61 | // Identify correspondences
62 | PointCorrespondences correspondences =
63 | correspondence_identification_->identifyCorrespondences (aligned_source, target);
64 |
65 | // Estimate a rigid transformation between
66 | transformation_ *= transformation_estimation_->estimateTransformation (correspondences);
67 |
68 | // Transform source cloud
69 | aligned_source = transform (source, transformation_);
70 |
71 | // Check for convergence
72 | converged_ = false; /// \todo checkForConvergenceSomehow ();
73 | if (converged_)
74 | break;
75 | }
76 | return (aligned_source);
77 | }
78 |
79 |
80 |
81 | /// \todo Move me to a different file!
82 |
83 | pcl2::RigidTransformationEstimation::RigidTransformationEstimation () {}
84 |
85 | pcl2::MatF
86 | pcl2::RigidTransformationEstimation::estimateTransformation (const PointCorrespondences & correspondences)
87 | {
88 | EigenMat tform (4,4);
89 | return (tform);
90 | }
91 |
--------------------------------------------------------------------------------
/tools/cloud_intro.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | #include
39 | #include "pcl2/core.h"
40 | #include "pcl2/eigen_matrix.h"
41 |
42 | #include "pcl2/io/io.h"
43 | #include "pcl2/search/neighbors.h"
44 | #include "pcl2/registration/fit.h"
45 | #include "pcl2/create.h"
46 |
47 | #include "pcl2/search/kdtree.h"
48 |
49 | int
50 | main (int argc, char ** argv)
51 | {
52 | // Load a point cloud
53 | pcl2::Cloud bunny = pcl2::loadCloud ("../data/bunny.pcd");
54 |
55 | // Get the xyz channel from the cloud
56 | pcl2::MatF pts = bunny["xyz"];
57 |
58 | // Create a new mat to store the surface normals in
59 | pcl2::EigenMat normals (bunny.size (), 3);
60 |
61 | //// Build a spatial search index (this will be automated soon)
62 | //pcl2::search::KDTree tree;
63 | //tree.buildIndex (pts);
64 |
65 | // Loop over every point in the cloud
66 | pcl2::MatF::Row q_normal = normals (0);
67 | for (pcl2::MatF::Row q = pts (0); q.hasNext (); q.advance (), q_normal.advance ())
68 | {
69 | // Find the neighbors
70 | const float radius = 0.03;
71 | pcl2::MatI nn_idx = pcl2::findFixedRadiusNeighbors (bunny, q, radius);
72 | //pcl2::MatI nn_idx = tree.findFixedRadiusNeighbors (q, radius);
73 |
74 | // Fit a plane to the neighborhood and store the result
75 | q_normal << pcl2::fitPlaneLLS (pts (nn_idx));
76 | }
77 |
78 | // Add the new normals channel to the cloud...
79 | bunny += pcl2::Cloud ("normals", normals);
80 | // ... and add a dummy curvature channel, too, because pcd_viewer expects one
81 | bunny += pcl2::Cloud ("curvature", pcl2::createZeros (bunny.size (), 1));
82 |
83 | // Save the cloud for visualization
84 | pcl2::saveCloud ("./bunny_out.pcd", bunny);
85 |
86 | return (0);
87 | }
88 |
--------------------------------------------------------------------------------
/core/include/pcl2/create.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file create.h
39 | * \brief Declares functions for creating matrices
40 | */
41 |
42 | #ifndef PCL2_CREATE_H
43 | #define PCL2_CREATE_H
44 |
45 | #include "pcl2/eigen_matrix.h"
46 | #include
47 | #include
48 |
49 | namespace pcl2
50 | {
51 |
52 | template
53 | TypedMat
54 | createZeros (size_t rows, size_t cols)
55 | {
56 | EigenMat output (rows, cols); output << 0; return (output);
57 | }
58 |
59 | template
60 | TypedMat
61 | createOnes (size_t rows, size_t cols)
62 | {
63 | EigenMat output (rows, cols); output << 1; return (output);
64 | }
65 |
66 | template
67 | TypedMat
68 | createIdentity (size_t n)
69 | {
70 | EigenMat output (n, n);
71 | output << 0;
72 | for (size_t i = 0; i < n; ++i)
73 | output (i, i) = 1;
74 | return (output);
75 | }
76 |
77 | template
78 | TypedMat
79 | createRandom (size_t rows, size_t cols)
80 | {
81 | unsigned seed = static_cast (std::time(0));
82 | boost::mt19937 generator (seed);
83 | boost::uniform_01<> uniform_dist;
84 | boost::variate_generator > rand (generator, uniform_dist);
85 |
86 | EigenMat output (rows, cols);
87 | for (size_t j = 0; j < cols; ++j)
88 | for (size_t i = 0; i < rows; ++i)
89 | output (i, j) = rand ();
90 | return (output);
91 | }
92 |
93 | template
94 | TypedMat
95 | createSeries (T start, T end, T step=1)
96 | {
97 | size_t nr_elements = ceil(1.0*(end - start) / step);
98 | EigenMat output (nr_elements, 1);
99 |
100 | size_t i = 0;
101 | for (T x = start; x < end; x += step)
102 | output (i++, 0) = x;
103 |
104 | return (output);
105 | }
106 |
107 | }
108 |
109 | #endif
110 |
--------------------------------------------------------------------------------
/cmake/Modules/FindQhull.cmake:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Find QHULL
3 | #
4 | # This sets the following variables:
5 | # QHULL_FOUND - True if QHULL was found.
6 | # QHULL_INCLUDE_DIRS - Directories containing the QHULL include files.
7 | # QHULL_LIBRARIES - Libraries needed to use QHULL.
8 | # QHULL_DEFINITIONS - Compiler flags for QHULL.
9 |
10 | set(QHULL_MAJOR_VERSION 6)
11 |
12 | find_file(QHULL_HEADER
13 | NAMES libqhull/libqhull.h qhull.h
14 | HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}" "${QHULL_INCLUDE_DIR}"
15 | PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
16 | "$ENV{PROGRAMFILES}/qhull 6.2.0.1373" "$ENV{PROGRAMW6432}/qhull 6.2.0.1373"
17 | PATH_SUFFIXES qhull src/libqhull libqhull include)
18 |
19 | set(QHULL_HEADER "${QHULL_HEADER}" CACHE INTERNAL "QHull header" FORCE )
20 |
21 | if(QHULL_HEADER)
22 | get_filename_component(qhull_header ${QHULL_HEADER} NAME_WE)
23 | if("${qhull_header}" STREQUAL "qhull")
24 | set(HAVE_QHULL_2011 OFF)
25 | get_filename_component(QHULL_INCLUDE_DIR ${QHULL_HEADER} PATH)
26 | elseif("${qhull_header}" STREQUAL "libqhull")
27 | set(HAVE_QHULL_2011 ON)
28 | get_filename_component(QHULL_INCLUDE_DIR ${QHULL_HEADER} PATH)
29 | get_filename_component(QHULL_INCLUDE_DIR ${QHULL_INCLUDE_DIR} PATH)
30 | endif()
31 | else(QHULL_HEADER)
32 | set(QHULL_INCLUDE_DIR "QHULL_INCLUDE_DIR-NOTFOUND")
33 | endif(QHULL_HEADER)
34 |
35 | set(QHULL_INCLUDE_DIR "${QHULL_INCLUDE_DIR}" CACHE PATH "QHull include dir." FORCE)
36 |
37 | # Prefer static libraries in Windows over shared ones
38 | if(WIN32)
39 | find_library(QHULL_LIBRARY
40 | NAMES qhullstatic qhull qhull${QHULL_MAJOR_VERSION}
41 | HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}"
42 | PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
43 | "$ENV{PROGRAMFILES}/qhull 6.2.0.1373" "$ENV{PROGRAMW6432}/qhull 6.2.0.1373"
44 | PATH_SUFFIXES project build bin lib)
45 |
46 | find_library(QHULL_LIBRARY_DEBUG
47 | NAMES qhullstatic_d qhull_d qhull${QHULL_MAJOR_VERSION}_d qhull qhull${QHULL_MAJOR_VERSION}
48 | HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}"
49 | PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
50 | "$ENV{PROGRAMFILES}/qhull 6.2.0.1373" "$ENV{PROGRAMW6432}/qhull 6.2.0.1373"
51 | PATH_SUFFIXES project build bin lib)
52 | else(WIN32)
53 | find_library(QHULL_LIBRARY
54 | NAMES qhull qhull${QHULL_MAJOR_VERSION}
55 | HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}"
56 | PATH_SUFFIXES project build bin lib)
57 |
58 | find_library(QHULL_LIBRARY_DEBUG
59 | NAMES qhull_d qhull_d${QHULL_MAJOR_VERSION} qhull qhull${QHULL_MAJOR_VERSION}
60 | HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}"
61 | PATH_SUFFIXES project build bin lib)
62 | endif(WIN32)
63 |
64 | if(NOT QHULL_LIBRARY_DEBUG)
65 | set(QHULL_LIBRARY_DEBUG ${QHULL_LIBRARY})
66 | endif(NOT QHULL_LIBRARY_DEBUG)
67 |
68 | set(QHULL_INCLUDE_DIRS ${QHULL_INCLUDE_DIR})
69 | set(QHULL_LIBRARIES optimized ${QHULL_LIBRARY} debug ${QHULL_LIBRARY_DEBUG})
70 |
71 | include(FindPackageHandleStandardArgs)
72 | find_package_handle_standard_args(Qhull DEFAULT_MSG QHULL_LIBRARY
73 | QHULL_INCLUDE_DIR)
74 |
75 | mark_as_advanced(QHULL_LIBRARY QHULL_LIBRARY_DEBUG QHULL_INCLUDE_DIR)
76 |
77 | if(QHULL_FOUND)
78 | set(HAVE_QHULL ON)
79 | get_filename_component(qhull_lib ${QHULL_LIBRARY} NAME_WE)
80 | if(NOT "${qhull_lib}" STREQUAL "qhullstatic")
81 | add_definitions("-Dqh_QHpointer")
82 | endif(NOT "${qhull_lib}" STREQUAL "qhullstatic")
83 | message(STATUS "QHULL found (include: ${QHULL_INCLUDE_DIRS}, lib: ${QHULL_LIBRARIES})")
84 | endif(QHULL_FOUND)
85 |
--------------------------------------------------------------------------------
/core/include/pcl2/eigen_matrix.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file eigen_matrix.h
39 | * \brief Contains class declarations for EigenMat and ConstEigenMat
40 | */
41 |
42 | #ifndef PCL2_EIGEN_MATRIX_H
43 | #define PCL2_EIGEN_MATRIX_H
44 |
45 | #include "pcl2/typed_matrix.h"
46 |
47 | namespace pcl2
48 | {
49 |
50 | namespace core
51 | {
52 | template class EigenMatImpl;
53 | }
54 |
55 | ///////////////////////////////////////////////////////////////////////////////
56 | /** \brief A shared wrapper of an Eigen matrix
57 | *
58 | * Extends the TypedMat class to add constructors for creating new Eigen
59 | * matrices
60 | * \see ConstEigenMat
61 | */
62 | template
63 | class EigenMat : public TypedMat
64 | {
65 | protected:
66 | using TypedMat::matrix_ptr_;
67 |
68 | private:
69 | EigenMat ();
70 |
71 | protected:
72 | /** \brief A shared pointer to the implementation */
73 | typedef boost::shared_ptr MatImplPtr;
74 |
75 | /** \brief Construct a EigenMat around the provided MatImpl
76 | *
77 | * \throws Throws a BadCastException if the provided MatImpl cannot be cast
78 | * to an EigenMatrixImpl.
79 | * \todo Make this throw an exception instead of an assertion failure
80 | */
81 | EigenMat (MatImplPtr matrix);
82 |
83 | public:
84 | /** \brief Construct a EigenMat from a generic Mat.
85 | *
86 | * \throws Throws a BadCastException if the provided matrix cannot be cast to an
87 | * EigenMatrix.
88 | * \todo Make this throw an exception instead of an assertion failure
89 | */
90 | EigenMat (const Mat & shared_matrix);
91 |
92 | /** \brief Construct a new EigenMat with the specified number of rows and columns
93 | *
94 | * \param rows The number of rows
95 | * \param cols The number of cols
96 | */
97 | EigenMat (size_t rows, size_t cols);
98 |
99 | protected:
100 | /** \brief A shared pointer to the matrix implementation */
101 | boost::shared_ptr > eigen_matrix_ptr_;
102 | };
103 |
104 | }
105 |
106 | #endif
107 |
--------------------------------------------------------------------------------
/registration/include/pcl2/registration/fit.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file fit.h
39 | * \brief Declares example functions for fitting planes to point clouds
40 | */
41 |
42 | /// \todo Move this file (fit.h) to a different module (not registration)
43 |
44 | #ifndef PCL2_FIT_H
45 | #define PCL2_FIT_H
46 |
47 | #include "pcl2/cloud.h"
48 | #include "pcl2/typed_matrix.h"
49 |
50 | namespace pcl2
51 | {
52 |
53 | /** \brief Fit a plane to a given cloud of 3D points using Linear Least Squares (LLS)
54 | * \param cloud A cloud containing an "xyz" channel of 3D points
55 | * \return A MatF containing the 4 coefficients of the best fitting plane,
56 | * given in \f$ c_0 x + c_1 y + c_2 z = c_3 \f$ form
57 | */
58 | MatF fitPlaneLLS (const Cloud & cloud);
59 |
60 | /** \brief Fit a plane to a channel of 3D points using Linear Least Squares (LLS)
61 | * \param points An n by 3 MatF representing n 3D points
62 | * \return A MatF containing the 4 coefficients of the best fitting plane,
63 | * given in \f$ c_0 x + c_1 y + c_2 z = c_3 \f$ form
64 | */
65 | template
66 | TypedMat fitPlaneLLS (const TypedMat & points);
67 |
68 | /** \brief Fit a plane to a given cloud of 3D points using Random Sample Consensus (RANSAC)
69 | * \param cloud A cloud containing an "xyz" channel of 3D points
70 | * \param inlier_threshold The maximum point-to-plane distance at which a point will be considered an inlier
71 | * \return A MatF containing the 4 coefficients of the best fitting plane,
72 | * given in \f$ c_0 x + c_1 y + c_2 z = c_3 \f$ form
73 | */
74 | MatF fitPlaneRANSAC (const Cloud & cloud, float inlier_threshold);
75 |
76 | /** \brief Fit a plane to a channel of 3D points using Random Sample Consensus (RANSAC)
77 | * \param points An n by 3 MatF representing n 3D points
78 | * \param inlier_threshold The maximum point-to-plane distance at which a point will be considered an inlier
79 | * \return A MatF containing the 4 coefficients of the best fitting plane,
80 | * given in \f$ c_0 x + c_1 y + c_2 z = c_3 \f$ form
81 | */
82 | template
83 | TypedMat fitPlaneRANSAC (const TypedMat & points, float inlier_threshold);
84 |
85 | }
86 |
87 | #endif
88 |
--------------------------------------------------------------------------------
/cmake/pcl_all_in_one_installer.cmake:
--------------------------------------------------------------------------------
1 |
2 | if(WIN32)
3 | option(BUILD_all_in_one_installer "Build an all-in-one NSIS installer" OFF)
4 | endif(WIN32)
5 |
6 | if(BUILD_all_in_one_installer)
7 | get_filename_component(BOOST_ROOT "${Boost_INCLUDE_DIR}" PATH)
8 | get_filename_component(EIGEN_ROOT "${EIGEN_INCLUDE_DIRS}" PATH)
9 | get_filename_component(QHULL_ROOT "${QHULL_INCLUDE_DIRS}" PATH)
10 | get_filename_component(FLANN_ROOT "${FLANN_INCLUDE_DIRS}" PATH)
11 | get_filename_component(VTK_ROOT "${VTK_DIR}" PATH)
12 | get_filename_component(VTK_ROOT "${VTK_ROOT}" PATH)
13 | set(PCL_3RDPARTY_COMPONENTS)
14 | foreach(dep Eigen Boost Qhull Flann VTK)
15 | string(TOUPPER ${dep} DEP)
16 | install(
17 | DIRECTORY "${${DEP}_ROOT}"
18 | DESTINATION 3rdParty
19 | COMPONENT ${dep}
20 | PATTERN "*/Uninstall.exe" EXCLUDE
21 | )
22 | list(APPEND PCL_3RDPARTY_COMPONENTS ${dep})
23 | endforeach(dep)
24 |
25 | if(CMAKE_CL_64)
26 | set(OPENNI_PACKAGE "OpenNI-Win64-1.3.2-Dev.msi")
27 | set(OPENNI_URL "http://dev.pointclouds.org/attachments/download/360/${OPENNI_PACKAGE}")
28 | set(OPENNI_MD5 e54b5ede27b293c579c42dcede33b289)
29 | set(OPENNI_SENSOR_PACKAGE "Sensor-Win-OpenSource64-5.0.3.msi")
30 | set(OPENNI_SENSOR_URL "http://dev.pointclouds.org/attachments/download/359/${OPENNI_SENSOR_PACKAGE}")
31 | set(OPENNI_SENSOR_MD5 cbf4ce02d5ef430dca17833d5588e060)
32 | else(CMAKE_CL_64)
33 | set(OPENNI_PACKAGE "OpenNI-Win32-1.3.2-Dev.msi")
34 | set(OPENNI_URL "http://dev.pointclouds.org/attachments/download/361/${OPENNI_PACKAGE}")
35 | set(OPENNI_MD5 0b7118a0581abef411b58530d4039cf0)
36 | set(OPENNI_SENSOR_PACKAGE "Sensor-Win-OpenSource32-5.0.3.msi")
37 | set(OPENNI_SENSOR_URL "http://dev.pointclouds.org/attachments/download/358/${OPENNI_SENSOR_PACKAGE}")
38 | set(OPENNI_SENSOR_MD5 8bf14b2e813859f868fc316acb2d08fa)
39 | endif(CMAKE_CL_64)
40 |
41 | set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS " IntCmp $OpenNI_selected 0 noinstall_openni_packages\n")
42 |
43 | file(DOWNLOAD ${OPENNI_URL} "${CMAKE_CURRENT_BINARY_DIR}/${OPENNI_PACKAGE}"
44 | STATUS _openni_download_status LOG _openni_download_log
45 | EXPECTED_MD5 ${OPENNI_MD5}
46 | )
47 | list(GET _openni_download_status 0 _error_code)
48 | list(GET _openni_download_status 1 _error_message)
49 | if(_error_code EQUAL 0)
50 | install(
51 | FILES "${CMAKE_CURRENT_BINARY_DIR}/${OPENNI_PACKAGE}"
52 | DESTINATION 3rdParty/OpenNI
53 | COMPONENT OpenNI
54 | )
55 | list(APPEND PCL_3RDPARTY_COMPONENTS OpenNI)
56 | set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
57 | "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\n ExecWait 'msiexec /i \\\"$INSTDIR\\\\3rdParty\\\\OpenNI\\\\${OPENNI_PACKAGE}\\\" '")
58 | else(_error_code EQUAL 0)
59 | message("WARNING : Could not download ${OPENNI_URL}, error code : ${_error_code}, error message : ${_error_message}")
60 | endif(_error_code EQUAL 0)
61 |
62 | file(DOWNLOAD ${OPENNI_SENSOR_URL} "${CMAKE_CURRENT_BINARY_DIR}/${OPENNI_SENSOR_PACKAGE}"
63 | STATUS _openni_download_status LOG _openni_download_log
64 | EXPECTED_MD5 ${OPENNI_SENSOR_MD5}
65 | )
66 | list(GET _openni_download_status 0 _error_code)
67 | list(GET _openni_download_status 1 _error_message)
68 | if(_error_code EQUAL 0)
69 | install(
70 | FILES "${CMAKE_CURRENT_BINARY_DIR}/${OPENNI_SENSOR_PACKAGE}"
71 | DESTINATION 3rdParty/OpenNI
72 | COMPONENT OpenNI
73 | )
74 | list(APPEND PCL_3RDPARTY_COMPONENTS OpenNI)
75 | set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
76 | "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\n ExecWait 'msiexec /i \\\"$INSTDIR\\\\3rdParty\\\\OpenNI\\\\${OPENNI_SENSOR_PACKAGE}\\\" '")
77 | else(_error_code EQUAL 0)
78 | message("WARNING : Could not download ${OPENNI_SENSOR_URL}, error code : ${_error_code}, error message : ${_error_message}")
79 | endif(_error_code EQUAL 0)
80 | list(REMOVE_DUPLICATES PCL_3RDPARTY_COMPONENTS)
81 | set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}\n noinstall_openni_packages:\n")
82 | endif(BUILD_all_in_one_installer)
83 |
--------------------------------------------------------------------------------
/core/include/pcl2/matrix_impl.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file matrix_impl.h
39 | * \brief Contains class declaration for pcl2::MatImpl
40 | */
41 |
42 | #ifndef PCL2_MATRIX_IMPL_H
43 | #define PCL2_MATRIX_IMPL_H
44 |
45 | #include
46 |
47 | namespace pcl2
48 | {
49 | namespace core
50 | {
51 |
52 | template class TypedMatImpl;
53 |
54 | /** \brief An abstract class defining the matrix implementation interface.
55 | * For internal use only.
56 | *
57 | * Subclasses of MatImpl will provide the actual implementation for the Mat
58 | * class. They are responsible for storing the actual matrix data and providing
59 | * various methods for operating on it.
60 | *
61 | * \note These MatImpl classes are intended to be used exclusively by Mat
62 | * and its subclasses. PCL users are not meant to use MatImpl or any of its
63 | * subclasses in their code.
64 | */
65 | class MatImpl
66 | {
67 | public:
68 | /** \brief A shared pointer to an MatImpl */
69 | typedef boost::shared_ptr Ptr;
70 |
71 | /** \brief A const shared pointer to an MatImpl */
72 | typedef boost::shared_ptr ConstPtr;
73 |
74 | /** \brief Create a new copy of this matrix and its data
75 | *
76 | * \return A shared pointer to a new copy of this matrix
77 | */
78 | virtual MatImpl::Ptr copy () const = 0;
79 |
80 | /** \brief Create a new MatImpl of the given size
81 | *
82 | * \param rows The number of rows in the new matrix
83 | * \param cols The number of cols in the new matrix
84 | * \return A shared pointer to a new matrix
85 | */
86 | virtual MatImpl::Ptr createNew (size_t rows, size_t cols) const = 0;
87 |
88 | /** \brief Create a new MatViewImpl from this MatImpl and the provided
89 | * indices
90 | *
91 | * \param indices An matrix of integers indexing rows of this matrix
92 | * \return A shared pointer to a new MatViewImpl
93 | */
94 | virtual MatImpl::Ptr createView (const boost::shared_ptr > & indices) = 0;
95 |
96 | /** \brief Get the number of rows in the matrix
97 | *
98 | * \return The number of rows in the matrix
99 | */
100 | virtual size_t rows () const = 0;
101 |
102 | /** \brief Get the number of columns in the matrix
103 | *
104 | * \return The number of columns in the matrix
105 | */
106 | virtual size_t cols () const = 0;
107 |
108 | };
109 |
110 | } // namespace core
111 | } // namespace pcl2
112 |
113 | #endif
114 |
--------------------------------------------------------------------------------
/core/src/math.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Software License Agreement (BSD License)
3 | *
4 | * Point Cloud Library (PCL) - www.pointclouds.org
5 | * Copyright (c) 2009-2012, Willow Garage, Inc.
6 | *
7 | * All rights reserved.
8 | *
9 | * Redistribution and use in source and binary forms, with or without
10 | * modification, are permitted provided that the following conditions
11 | * are met:
12 | *
13 | * * Redistributions of source code must retain the above copyright
14 | * notice, this list of conditions and the following disclaimer.
15 | * * Redistributions in binary form must reproduce the above
16 | * copyright notice, this list of conditions and the following
17 | * disclaimer in the documentation and/or other materials provided
18 | * with the distribution.
19 | * * Neither the name of Willow Garage, Inc. nor the names of its
20 | * contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 | * POSSIBILITY OF SUCH DAMAGE.
35 | *
36 | */
37 |
38 | /** \file math.h
39 | * \brief Instantiate functions for performing basic arithmethic on matrices
40 | */
41 |
42 | #include "pcl2/impl/math.hpp"
43 |
44 | template pcl2::TypedMat pcl2::computeSum (const TypedMat &);
45 | template pcl2::TypedMat pcl2::computeSum (const TypedMat &);
46 | template pcl2::TypedMat pcl2::computeSum (const TypedMat &);
47 |
48 | template pcl2::TypedMat pcl2::computeProduct (const TypedMat &);
49 | template pcl2::TypedMat pcl2::computeProduct (const TypedMat &);
50 | template pcl2::TypedMat pcl2::computeProduct (const TypedMat &);
51 |
52 | template pcl2::TypedMat pcl2::computeCumulativeSum (const TypedMat &);
53 | template pcl2::TypedMat pcl2::computeCumulativeSum (const TypedMat &);
54 | template pcl2::TypedMat pcl2::computeCumulativeSum (const TypedMat &);
55 |
56 | template pcl2::TypedMat pcl2::computeCumulativeProduct (const TypedMat &);
57 | template pcl2::TypedMat pcl2::computeCumulativeProduct (const TypedMat &);
58 | template pcl2::TypedMat