├── CMakeLists.txt ├── ChangeLog.md ├── LICENSE ├── README.md ├── clean_emacs.sh ├── cmake ├── modules │ ├── Findo3d3xx_camera.cmake │ ├── Findo3d3xx_framegrabber.cmake │ ├── Findo3d3xx_image.cmake │ ├── Findo3d3xx_pcicclient.cmake │ ├── MacroOutOfSourceBuild.cmake │ ├── o3d3xx_version.cmake │ └── ubuntu_version.cmake ├── toolchains │ ├── eldk-armv7a-hf.cmake │ ├── linaro-arm-linux-gnueabihf.cmake │ ├── o3d303.cmake │ └── patches_arm-linux-gnueabihf │ │ ├── libc.so.patch │ │ └── libpthread.so.patch └── utils │ └── install_all_debs ├── doc ├── 100k.md ├── 20140820_O3D3xx_C2_sample_manual.pdf ├── O3D300_thermal_issues-EN.pdf ├── O3D303.pdf ├── O3D3xx_Operations_Manual.pdf ├── O3D3xx_Operations_Manual_Preliminary.pdf ├── attic │ ├── 100k.o3d3xxapp │ ├── custom_builds.md │ └── using.md ├── camera.json ├── cross_compiling.md ├── figures │ ├── 2d.png │ ├── 2d_old.png │ ├── 3d.png │ ├── office100k.png │ └── office23k.png ├── ifm-O3D303-PMD-3D-Camera-e-15-n.pdf ├── json │ ├── JSON-schema-0.6.x │ │ ├── application.json │ │ ├── bilateral_filter.json │ │ ├── device.json │ │ ├── exponential_filter.json │ │ ├── imager_config.json │ │ ├── logic_graph.json │ │ ├── logic_graph_runtime_info.json │ │ ├── mean_filter.json │ │ ├── median_filter.json │ │ ├── model.json │ │ ├── model_dimensioning.json │ │ ├── model_distance.json │ │ ├── model_level.json │ │ ├── network.json │ │ ├── o3d3xx.json │ │ ├── roi.json │ │ └── temporal_mean_filter.json │ ├── JSON-schema-1.1.x │ │ ├── application.json │ │ ├── bilateral_filter.json │ │ ├── device.json │ │ ├── exponential_filter.json │ │ ├── imager_config.json │ │ ├── logic_graph.json │ │ ├── logic_graph_runtime_info.json │ │ ├── mean_filter.json │ │ ├── median_filter.json │ │ ├── model.json │ │ ├── model_dimensioning.json │ │ ├── model_distance.json │ │ ├── model_level.json │ │ ├── network.json │ │ ├── o3d3xx.json │ │ ├── roi.json │ │ └── temporal_mean_filter.json │ ├── JSON-schema-1.2.x │ │ ├── application.json │ │ ├── bilateral_filter.json │ │ ├── device.json │ │ ├── exponential_filter.json │ │ ├── imager_config.json │ │ ├── logic_graph.json │ │ ├── logic_graph_runtime_info.json │ │ ├── mean_filter.json │ │ ├── median_filter.json │ │ ├── model.json │ │ ├── model_dimensioning.json │ │ ├── model_distance.json │ │ ├── model_level.json │ │ ├── network.json │ │ ├── o3d3xx.json │ │ ├── roi.json │ │ └── temporal_mean_filter.json │ ├── JSON-schema-1.3.x │ │ ├── application.json │ │ ├── bilateral_filter.json │ │ ├── clipping_cuboid.json │ │ ├── device.json │ │ ├── exponential_filter.json │ │ ├── imager_config.json │ │ ├── logic_graph.json │ │ ├── logic_graph_runtime_info.json │ │ ├── mean_filter.json │ │ ├── median_filter.json │ │ ├── model.json │ │ ├── model_dimensioning.json │ │ ├── model_distance.json │ │ ├── model_level.json │ │ ├── network.json │ │ ├── o3d3xx.json │ │ ├── roi.json │ │ └── temporal_mean_filter.json │ ├── JSON-schema-1.4.x │ │ └── param_diff_camera.txt │ ├── JSON-schema-1.5.698 │ │ ├── application.json │ │ ├── bilateral_filter.json │ │ ├── clipping_cuboid.json │ │ ├── device.json │ │ ├── exponential_filter.json │ │ ├── imager_config.json │ │ ├── logic_graph.json │ │ ├── logic_graph_runtime_info.json │ │ ├── mean_filter.json │ │ ├── median_filter.json │ │ ├── model.json │ │ ├── model_dimensioning.json │ │ ├── model_distance.json │ │ ├── model_level.json │ │ ├── model_volume.json │ │ ├── network.json │ │ ├── o3d3xx.json │ │ ├── roi.json │ │ └── temporal_mean_filter.json │ └── JSON-schema-1.6.x │ │ ├── application.json │ │ ├── bilateral_filter.json │ │ ├── clipping_cuboid.json │ │ ├── device.json │ │ ├── exponential_filter.json │ │ ├── imager_config.json │ │ ├── logic_graph.json │ │ ├── logic_graph_runtime_info.json │ │ ├── mean_filter.json │ │ ├── median_filter.json │ │ ├── model.json │ │ ├── model_dimensioning.json │ │ ├── model_distance.json │ │ ├── model_level.json │ │ ├── model_volume.json │ │ ├── network.json │ │ ├── o3d3xx.json │ │ ├── roi.json │ │ └── temporal_mean_filter.json ├── pcic_async_errors.md └── utils.md ├── firmware └── README.md └── modules ├── camera ├── CMakeLists.txt ├── include │ ├── o3d3xx_camera.h │ └── o3d3xx_camera │ │ ├── app_config.h │ │ ├── camera.hpp │ │ ├── cmdline_opts.h │ │ ├── device_config.h │ │ ├── err.h │ │ ├── imager_config.h │ │ ├── net_config.h │ │ ├── spatial_filter_config.h │ │ ├── temporal_filter_config.h │ │ ├── util.h │ │ └── version.h.in ├── o3d3xx_camera-config-version.cmake.in ├── src │ ├── CMakeLists.txt │ ├── bin │ │ ├── CMakeLists.txt │ │ ├── o3d3xx-config.cpp │ │ ├── o3d3xx-dump.cpp │ │ ├── o3d3xx-ifm-export.cpp │ │ ├── o3d3xx-ifm-import.cpp │ │ ├── o3d3xx-imager-types.cpp │ │ ├── o3d3xx-ls.cpp │ │ ├── o3d3xx-reboot.cpp │ │ ├── o3d3xx-reset.cpp │ │ ├── o3d3xx-rm.cpp │ │ ├── o3d3xx-trace.cpp │ │ └── o3d3xx-version.cpp │ └── libo3d3xx_camera │ │ ├── CMakeLists.txt │ │ ├── app_config.cpp │ │ ├── camera.cpp │ │ ├── cmdline_opts.cpp │ │ ├── device_config.cpp │ │ ├── err.cpp │ │ ├── imager_config.cpp │ │ ├── net_config.cpp │ │ ├── spatial_filter_config.cpp │ │ ├── temporal_filter_config.cpp │ │ ├── util.cpp │ │ └── version.cpp └── test │ ├── CMakeLists.txt │ ├── env.sh │ ├── o3d3xx-app-imager-tests.cpp │ ├── o3d3xx-basic-tests.cpp │ ├── o3d3xx-camera-testrunner.cpp │ ├── o3d3xx-camera-tests.cpp │ ├── o3d3xx-import-export-tests.cpp │ ├── o3d3xx-spatial-filter-tests.cpp │ └── o3d3xx-temporal-filter-tests.cpp ├── examples ├── CMakeLists.txt ├── README.md ├── ex-100k.cpp ├── ex-cartesian.cpp ├── ex-cartesian_compare.cpp ├── ex-change_ip.cpp ├── ex-exposure_times.cpp ├── ex-fast_app_switch.cpp ├── ex-file_io.cpp ├── ex-framegrabber_recycling.cpp ├── ex-oem_is_booted.cpp ├── ex-pcic_dos_attack.cpp ├── ex-pcicclient_async_messages.cpp └── ex-pcicclient_set_io.cpp ├── framegrabber ├── CMakeLists.txt ├── include │ ├── o3d3xx_framegrabber.h │ └── o3d3xx_framegrabber │ │ ├── byte_buffer.hpp │ │ ├── frame_grabber.h │ │ └── pcic_schema.h ├── o3d3xx_framegrabber-config-version.cmake.in ├── src │ ├── CMakeLists.txt │ ├── bin │ │ ├── CMakeLists.txt │ │ ├── o3d3xx-hz.cpp │ │ └── o3d3xx-schema.cpp │ └── libo3d3xx_framegrabber │ │ ├── CMakeLists.txt │ │ ├── byte_buffer.cpp │ │ ├── frame_grabber.cpp │ │ └── pcic_schema.cpp └── test │ ├── CMakeLists.txt │ ├── o3d3xx-frame_grabber-tests.cpp │ └── o3d3xx-framegrabber-testrunner.cpp ├── image ├── CMakeLists.txt ├── include │ ├── o3d3xx_image.h │ └── o3d3xx_image │ │ └── image.h ├── o3d3xx_image-config-version.cmake.in ├── src │ ├── CMakeLists.txt │ ├── bin │ │ ├── CMakeLists.txt │ │ └── o3d3xx-viewer.cpp │ └── libo3d3xx_image │ │ ├── CMakeLists.txt │ │ └── image.cpp └── test │ ├── CMakeLists.txt │ ├── o3d3xx-image-testrunner.cpp │ └── o3d3xx-image-tests.cpp ├── oem ├── CMakeLists.txt ├── README.md ├── cmake │ └── utils │ │ ├── oem-install.sh.in │ │ └── oem-uninstall.sh.in ├── doc │ ├── data │ │ ├── camera-2000-30-8.json │ │ ├── camera-3000-30-8.json │ │ ├── camera-4000-25-8.json │ │ ├── camera-5000-20-8.json │ │ ├── camera-5000-5-8.json │ │ ├── jitter-2000-30-8.txt │ │ ├── jitter-3000-30-8.txt │ │ ├── jitter-4000-25-8.txt │ │ ├── jitter-5000-20-8-A.txt │ │ ├── jitter-5000-20-8-B.txt │ │ ├── jitter-5000-20-8-C.txt │ │ ├── jitter-5000-20-8.txt │ │ └── jitter-5000-5-8.txt │ └── o3d3xx-oem-jitter.ipynb ├── etc │ └── setup.bash.in ├── include │ ├── o3d3xx_oem.h │ └── o3d3xx_oem │ │ ├── frame_grabber.h │ │ └── image_buffer.h ├── o3d3xx_oem-config-version.cmake.in ├── src │ ├── CMakeLists.txt │ ├── bin │ │ ├── CMakeLists.txt │ │ └── o3d3xx-oem-jitter.cpp │ └── libo3d3xx_oem │ │ ├── CMakeLists.txt │ │ ├── frame_grabber.cpp │ │ └── image_buffer.cpp └── test │ ├── CMakeLists.txt │ ├── o3d3xx-oem-framegrabber-tests.cpp │ └── o3d3xx-oem-testrunner.cpp └── pcicclient ├── CMakeLists.txt ├── include └── o3d3xx_pcicclient.h ├── o3d3xx_pcicclient-config-version.cmake.in ├── src ├── CMakeLists.txt ├── bin │ └── CMakeLists.txt └── libo3d3xx_pcicclient │ ├── CMakeLists.txt │ └── pcicclient.cpp └── test ├── CMakeLists.txt ├── o3d3xx-pcicclient-testrunner.cpp └── o3d3xx-pcicclient-tests.cpp /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(O3D3XX) 2 | cmake_minimum_required(VERSION 2.8.12) 3 | 4 | set(CMAKE_MODULE_PATH 5 | ${O3D3XX_SOURCE_DIR}/cmake/modules 6 | ${CMAKE_MODULE_PATH} 7 | ) 8 | 9 | # force an out-of-source build of the code 10 | include(MacroOutOfSourceBuild) 11 | macro_ensure_out_of_source_build( 12 | "Please build ${PROJECT_NAME} out-of-source") 13 | 14 | # how should we install? 15 | find_program(DPKG_CMD dpkg) 16 | if(NOT DPKG_CMD) 17 | set(O3D3XX_INSTALL_CMD "$(MAKE)") 18 | else() 19 | set(O3D3XX_INSTALL_CMD ${O3D3XX_SOURCE_DIR}/cmake/utils/install_all_debs) 20 | endif(NOT DPKG_CMD) 21 | 22 | include(ExternalProject) 23 | 24 | ################################################ 25 | ## o3d3xx-camera module 26 | ################################################ 27 | ExternalProject_Add(O3D3XX_CAMERA 28 | SOURCE_DIR ${O3D3XX_SOURCE_DIR}/modules/camera 29 | CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=/usr 30 | TEST_BEFORE_INSTALL 1 31 | TEST_COMMAND make check 32 | INSTALL_COMMAND sudo ${O3D3XX_INSTALL_CMD} install 33 | ) 34 | 35 | ExternalProject_Add_Step(O3D3XX_CAMERA 36 | package 37 | DEPENDEES test 38 | DEPENDERS install 39 | COMMAND ${CMAKE_COMMAND} -E chdir . make package 40 | WORKING_DIRECTORY O3D3XX_CAMERA-prefix/src/O3D3XX_CAMERA-build 41 | ) 42 | 43 | ################################################ 44 | ## o3d3xx-framegrabber module 45 | ################################################ 46 | 47 | ExternalProject_Add(O3D3XX_FRAMEGRABBER 48 | DEPENDS O3D3XX_CAMERA 49 | SOURCE_DIR ${O3D3XX_SOURCE_DIR}/modules/framegrabber 50 | CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=/usr 51 | TEST_BEFORE_INSTALL 1 52 | TEST_COMMAND make check 53 | INSTALL_COMMAND sudo ${O3D3XX_INSTALL_CMD} install 54 | ) 55 | 56 | ExternalProject_Add_Step(O3D3XX_FRAMEGRABBER 57 | package 58 | DEPENDEES test 59 | DEPENDERS install 60 | COMMAND ${CMAKE_COMMAND} -E chdir . make package 61 | WORKING_DIRECTORY O3D3XX_FRAMEGRABBER-prefix/src/O3D3XX_FRAMEGRABBER-build 62 | ) 63 | 64 | ################################################ 65 | ## o3d3xx-pcicclient module 66 | ################################################ 67 | 68 | ExternalProject_Add(O3D3XX_PCICCLIENT 69 | DEPENDS O3D3XX_CAMERA 70 | SOURCE_DIR ${O3D3XX_SOURCE_DIR}/modules/pcicclient 71 | CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=/usr 72 | TEST_BEFORE_INSTALL 1 73 | TEST_COMMAND make check 74 | INSTALL_COMMAND sudo ${O3D3XX_INSTALL_CMD} install 75 | ) 76 | 77 | ExternalProject_Add_Step(O3D3XX_PCICCLIENT 78 | package 79 | DEPENDEES test 80 | DEPENDERS install 81 | COMMAND ${CMAKE_COMMAND} -E chdir . make package 82 | WORKING_DIRECTORY O3D3XX_PCICCLIENT-prefix/src/O3D3XX_PCICCLIENT-build 83 | ) 84 | 85 | ################################################ 86 | ## o3d3xx-image module 87 | ################################################ 88 | 89 | ExternalProject_Add(O3D3XX_IMAGE 90 | DEPENDS O3D3XX_CAMERA O3D3XX_FRAMEGRABBER 91 | SOURCE_DIR ${O3D3XX_SOURCE_DIR}/modules/image 92 | CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=/usr 93 | TEST_BEFORE_INSTALL 1 94 | TEST_COMMAND make check 95 | INSTALL_COMMAND sudo ${O3D3XX_INSTALL_CMD} install 96 | ) 97 | 98 | ExternalProject_Add_Step(O3D3XX_IMAGE 99 | package 100 | DEPENDEES test 101 | DEPENDERS install 102 | COMMAND ${CMAKE_COMMAND} -E chdir . make package 103 | WORKING_DIRECTORY O3D3XX_IMAGE-prefix/src/O3D3XX_IMAGE-build 104 | ) 105 | -------------------------------------------------------------------------------- /clean_emacs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Recursively removes emacs backup files from your source directory. 4 | # 5 | echo "Cleaning up emacs backup files..." 6 | find . -name "*~" | xargs rm -f 7 | echo "OK" -------------------------------------------------------------------------------- /cmake/modules/Findo3d3xx_camera.cmake: -------------------------------------------------------------------------------- 1 | find_path(O3D3XX_CAMERA_INCLUDE_DIRS 2 | NAMES o3d3xx_camera.h 3 | PATHS /opt/libo3d3xx/include /usr/include /usr/local/include /usr/local/libo3d3xx/include 4 | NO_DEFAULT_PATH 5 | DOC "o3d3xx_camera Include directory" 6 | ) 7 | 8 | find_library(O3D3XX_CAMERA_LIBRARIES 9 | NAMES o3d3xx_camera libo3d3xx_camera_static.a 10 | PATHS /opt/libo3d3xx/lib /usr/lib /usr/local/lib /usr/local/libo3d3xx/lib 11 | NO_DEFAULT_PATH 12 | DOC "o3d3xx_camera shared object file" 13 | ) 14 | 15 | get_filename_component( 16 | O3D3XX_CAMERA_LIBRARY_DIR 17 | ${O3D3XX_CAMERA_LIBRARIES} 18 | DIRECTORY 19 | ) 20 | 21 | # kind of hacky 22 | include( 23 | "${O3D3XX_CAMERA_LIBRARY_DIR}/o3d3xx_camera/o3d3xx_camera-config-version.cmake" 24 | ) 25 | 26 | include(FindPackageHandleStandardArgs) 27 | find_package_handle_standard_args(O3D3XX_CAMERA 28 | FOUND_VAR O3D3XX_CAMERA_FOUND 29 | REQUIRED_VARS O3D3XX_CAMERA_LIBRARIES 30 | O3D3XX_CAMERA_INCLUDE_DIRS 31 | VERSION_VAR O3D3XX_CAMERA_VERSION 32 | ) 33 | 34 | set(_version_major ${o3d3xx_camera_FIND_VERSION_MAJOR}) 35 | set(_version_minor ${o3d3xx_camera_FIND_VERSION_MINOR}) 36 | set(_version_patch ${o3d3xx_camera_FIND_VERSION_PATCH}) 37 | set(O3D3XX_CAMERA_FIND_VERSION 38 | "${_version_major}.${_version_minor}.${_version_patch}") 39 | 40 | if("${O3D3XX_CAMERA_VERSION}" VERSION_LESS "${O3D3XX_CAMERA_FIND_VERSION}") 41 | set(O3D3XX_CAMERA_VERSION_COMPATIBLE FALSE) 42 | set(O3D3XX_CAMERA_VERSION_EXACT FALSE) 43 | else() 44 | set(O3D3XX_CAMERA_VERSION_COMPATIBLE TRUE) 45 | if ("${O3D3XX_CAMERA_VERSION}" VERSION_EQUAL "${O3D3XX_CAMERA_FIND_VERSION}") 46 | set(O3D3XX_CAMERA_VERSION_EXACT TRUE) 47 | else() 48 | set(O3D3XX_CAMERA_VERSION_EXACT FALSE) 49 | endif() 50 | endif() 51 | 52 | if(${o3d3xx_camera_FIND_VERSION_EXACT}) 53 | if(NOT ${O3D3XX_CAMERA_VERSION_EXACT}) 54 | message(FATAL_ERROR 55 | "o3d3xx_camera: ${o3d3xx_camera_FIND_VERSION} != ${O3D3XX_CAMERA_VERSION}") 56 | endif() 57 | endif() 58 | 59 | if(NOT ${O3D3XX_CAMERA_VERSION_COMPATIBLE}) 60 | message(FATAL_ERROR 61 | "o3d3xx_camera: ${O3D3XX_CAMERA_VERSION} is incompatible with ${o3d3xx_camera_FIND_VERSION}") 62 | endif() 63 | 64 | mark_as_advanced( 65 | O3D3XX_CAMERA_LIBRARIES 66 | O3D3XX_CAMERA_INCLUDE_DIRS 67 | ) 68 | 69 | # get_cmake_property(_variableNames VARIABLES) 70 | # foreach (_variableName ${_variableNames}) 71 | # message(STATUS "${_variableName}=${${_variableName}}") 72 | # endforeach() 73 | -------------------------------------------------------------------------------- /cmake/modules/Findo3d3xx_framegrabber.cmake: -------------------------------------------------------------------------------- 1 | find_path(O3D3XX_FRAMEGRABBER_INCLUDE_DIRS 2 | NAMES o3d3xx_framegrabber.h 3 | PATHS /opt/libo3d3xx/include /usr/include /usr/local/include /usr/local/libo3d3xx/include 4 | NO_DEFAULT_PATH 5 | DOC "o3d3xx_framegrabber Include directory" 6 | ) 7 | 8 | find_library(O3D3XX_FRAMEGRABBER_LIBRARIES 9 | NAMES o3d3xx_framegrabber libo3d3xx_framegrabber_static.a 10 | PATHS /opt/libo3d3xx/lib /usr/lib /usr/local/lib /usr/local/libo3d3xx/lib 11 | NO_DEFAULT_PATH 12 | DOC "o3d3xx_framegrabber shared object file" 13 | ) 14 | 15 | get_filename_component( 16 | O3D3XX_FRAMEGRABBER_LIBRARY_DIR 17 | ${O3D3XX_FRAMEGRABBER_LIBRARIES} 18 | DIRECTORY 19 | ) 20 | 21 | # kind of hacky 22 | include( 23 | "${O3D3XX_FRAMEGRABBER_LIBRARY_DIR}/o3d3xx_framegrabber/o3d3xx_framegrabber-config-version.cmake" 24 | ) 25 | 26 | include(FindPackageHandleStandardArgs) 27 | find_package_handle_standard_args(O3D3XX_FRAMEGRABBER 28 | FOUND_VAR O3D3XX_FRAMEGRABBER_FOUND 29 | REQUIRED_VARS O3D3XX_FRAMEGRABBER_LIBRARIES 30 | O3D3XX_FRAMEGRABBER_INCLUDE_DIRS 31 | VERSION_VAR O3D3XX_FRAMEGRABBER_VERSION 32 | ) 33 | 34 | set(_version_major ${o3d3xx_framegrabber_FIND_VERSION_MAJOR}) 35 | set(_version_minor ${o3d3xx_framegrabber_FIND_VERSION_MINOR}) 36 | set(_version_patch ${o3d3xx_framegrabber_FIND_VERSION_PATCH}) 37 | set(O3D3XX_FRAMEGRABBER_FIND_VERSION 38 | "${_version_major}.${_version_minor}.${_version_patch}") 39 | 40 | if("${O3D3XX_FRAMEGRABBER_VERSION}" VERSION_LESS "${O3D3XX_FRAMEGRABBER_FIND_VERSION}") 41 | set(O3D3XX_FRAMEGRABBER_VERSION_COMPATIBLE FALSE) 42 | set(O3D3XX_FRAMEGRABBER_VERSION_EXACT FALSE) 43 | else() 44 | set(O3D3XX_FRAMEGRABBER_VERSION_COMPATIBLE TRUE) 45 | if ("${O3D3XX_FRAMEGRABBER_VERSION}" VERSION_EQUAL "${O3D3XX_FRAMEGRABBER_FIND_VERSION}") 46 | set(O3D3XX_FRAMEGRABBER_VERSION_EXACT TRUE) 47 | else() 48 | set(O3D3XX_FRAMEGRABBER_VERSION_EXACT FALSE) 49 | endif() 50 | endif() 51 | 52 | if(${o3d3xx_framegrabber_FIND_VERSION_EXACT}) 53 | if(NOT ${O3D3XX_FRAMEGRABBER_VERSION_EXACT}) 54 | message(FATAL_ERROR 55 | "o3d3xx_framegrabber: ${o3d3xx_framegrabber_FIND_VERSION} != ${O3D3XX_FRAMEGRABBER_VERSION}") 56 | endif() 57 | endif() 58 | 59 | if(NOT ${O3D3XX_FRAMEGRABBER_VERSION_COMPATIBLE}) 60 | message(FATAL_ERROR 61 | "o3d3xx_framegrabber: ${O3D3XX_FRAMEGRABBER_VERSION} is incompatible with ${o3d3xx_framegrabber_FIND_VERSION}") 62 | endif() 63 | 64 | mark_as_advanced( 65 | O3D3XX_FRAMEGRABBER_LIBRARIES 66 | O3D3XX_FRAMEGRABBER_INCLUDE_DIRS 67 | ) 68 | 69 | # get_cmake_property(_variableNames VARIABLES) 70 | # foreach (_variableName ${_variableNames}) 71 | # message(STATUS "${_variableName}=${${_variableName}}") 72 | # endforeach() 73 | -------------------------------------------------------------------------------- /cmake/modules/Findo3d3xx_image.cmake: -------------------------------------------------------------------------------- 1 | find_path(O3D3XX_IMAGE_INCLUDE_DIRS 2 | NAMES o3d3xx_image.h 3 | PATHS /opt/libo3d3xx/include /usr/include /usr/local/include /usr/local/libo3d3xx/include 4 | NO_DEFAULT_PATH 5 | DOC "o3d3xx_image Include directory" 6 | ) 7 | 8 | find_library(O3D3XX_IMAGE_LIBRARIES 9 | NAMES o3d3xx_image libo3d3xx_image_static.a 10 | PATHS /opt/libo3d3xx/lib /usr/lib /usr/local/lib /usr/local/libo3d3xx/lib 11 | NO_DEFAULT_PATH 12 | DOC "o3d3xx_image shared object file" 13 | ) 14 | 15 | get_filename_component( 16 | O3D3XX_IMAGE_LIBRARY_DIR 17 | ${O3D3XX_IMAGE_LIBRARIES} 18 | DIRECTORY 19 | ) 20 | 21 | # kind of hacky 22 | include( 23 | "${O3D3XX_IMAGE_LIBRARY_DIR}/o3d3xx_image/o3d3xx_image-config-version.cmake" 24 | ) 25 | 26 | include(FindPackageHandleStandardArgs) 27 | find_package_handle_standard_args(O3D3XX_IMAGE 28 | FOUND_VAR O3D3XX_IMAGE_FOUND 29 | REQUIRED_VARS O3D3XX_IMAGE_LIBRARIES 30 | O3D3XX_IMAGE_INCLUDE_DIRS 31 | VERSION_VAR O3D3XX_IMAGE_VERSION 32 | ) 33 | 34 | set(_version_major ${o3d3xx_image_FIND_VERSION_MAJOR}) 35 | set(_version_minor ${o3d3xx_image_FIND_VERSION_MINOR}) 36 | set(_version_patch ${o3d3xx_image_FIND_VERSION_PATCH}) 37 | set(O3D3XX_IMAGE_FIND_VERSION 38 | "${_version_major}.${_version_minor}.${_version_patch}") 39 | 40 | if("${O3D3XX_IMAGE_VERSION}" VERSION_LESS "${O3D3XX_IMAGE_FIND_VERSION}") 41 | set(O3D3XX_IMAGE_VERSION_COMPATIBLE FALSE) 42 | set(O3D3XX_IMAGE_VERSION_EXACT FALSE) 43 | else() 44 | set(O3D3XX_IMAGE_VERSION_COMPATIBLE TRUE) 45 | if ("${O3D3XX_IMAGE_VERSION}" VERSION_EQUAL "${O3D3XX_IMAGE_FIND_VERSION}") 46 | set(O3D3XX_IMAGE_VERSION_EXACT TRUE) 47 | else() 48 | set(O3D3XX_IMAGE_VERSION_EXACT FALSE) 49 | endif() 50 | endif() 51 | 52 | if(${o3d3xx_image_FIND_VERSION_EXACT}) 53 | if(NOT ${O3D3XX_IMAGE_VERSION_EXACT}) 54 | message(FATAL_ERROR 55 | "o3d3xx_image: ${o3d3xx_image_FIND_VERSION} != ${O3D3XX_IMAGE_VERSION}") 56 | endif() 57 | endif() 58 | 59 | if(NOT ${O3D3XX_IMAGE_VERSION_COMPATIBLE}) 60 | message(FATAL_ERROR 61 | "o3d3xx_image: ${O3D3XX_IMAGE_VERSION} is incompatible with ${o3d3xx_image_FIND_VERSION}") 62 | endif() 63 | 64 | mark_as_advanced( 65 | O3D3XX_IMAGE_LIBRARIES 66 | O3D3XX_IMAGE_INCLUDE_DIRS 67 | ) 68 | 69 | # get_cmake_property(_variableNames VARIABLES) 70 | # foreach (_variableName ${_variableNames}) 71 | # message(STATUS "${_variableName}=${${_variableName}}") 72 | # endforeach() 73 | -------------------------------------------------------------------------------- /cmake/modules/Findo3d3xx_pcicclient.cmake: -------------------------------------------------------------------------------- 1 | find_path(O3D3XX_PCICCLIENT_INCLUDE_DIRS 2 | NAMES o3d3xx_pcicclient.h 3 | PATHS /opt/libo3d3xx/include /usr/include /usr/local/include /usr/local/libo3d3xx/include 4 | NO_DEFAULT_PATH 5 | DOC "o3d3xx_pcicclient Include directory" 6 | ) 7 | 8 | find_library(O3D3XX_PCICCLIENT_LIBRARIES 9 | NAMES o3d3xx_pcicclient libo3d3xx_pcicclient_static.a 10 | PATHS /opt/libo3d3xx/lib /usr/lib /usr/local/lib /usr/local/libo3d3xx/lib 11 | NO_DEFAULT_PATH 12 | DOC "o3d3xx_pcicclient shared object file" 13 | ) 14 | 15 | get_filename_component( 16 | O3D3XX_PCICCLIENT_LIBRARY_DIR 17 | ${O3D3XX_PCICCLIENT_LIBRARIES} 18 | DIRECTORY 19 | ) 20 | 21 | # kind of hacky 22 | include( 23 | "${O3D3XX_PCICCLIENT_LIBRARY_DIR}/o3d3xx_pcicclient/o3d3xx_pcicclient-config-version.cmake" 24 | ) 25 | 26 | include(FindPackageHandleStandardArgs) 27 | find_package_handle_standard_args(O3D3XX_PCICCLIENT 28 | FOUND_VAR O3D3XX_PCICCLIENT_FOUND 29 | REQUIRED_VARS O3D3XX_PCICCLIENT_LIBRARIES 30 | O3D3XX_PCICCLIENT_INCLUDE_DIRS 31 | VERSION_VAR O3D3XX_PCICCLIENT_VERSION 32 | ) 33 | 34 | set(_version_major ${o3d3xx_pcicclient_FIND_VERSION_MAJOR}) 35 | set(_version_minor ${o3d3xx_pcicclient_FIND_VERSION_MINOR}) 36 | set(_version_patch ${o3d3xx_pcicclient_FIND_VERSION_PATCH}) 37 | set(O3D3XX_PCICCLIENT_FIND_VERSION 38 | "${_version_major}.${_version_minor}.${_version_patch}") 39 | 40 | if("${O3D3XX_PCICCLIENT_VERSION}" VERSION_LESS "${O3D3XX_PCICCLIENT_FIND_VERSION}") 41 | set(O3D3XX_PCICCLIENT_VERSION_COMPATIBLE FALSE) 42 | set(O3D3XX_PCICCLIENT_VERSION_EXACT FALSE) 43 | else() 44 | set(O3D3XX_PCICCLIENT_VERSION_COMPATIBLE TRUE) 45 | if ("${O3D3XX_PCICCLIENT_VERSION}" VERSION_EQUAL "${O3D3XX_PCICCLIENT_FIND_VERSION}") 46 | set(O3D3XX_PCICCLIENT_VERSION_EXACT TRUE) 47 | else() 48 | set(O3D3XX_PCICCLIENT_VERSION_EXACT FALSE) 49 | endif() 50 | endif() 51 | 52 | if(${o3d3xx_pcicclient_FIND_VERSION_EXACT}) 53 | if(NOT ${O3D3XX_PCICCLIENT_VERSION_EXACT}) 54 | message(FATAL_ERROR 55 | "o3d3xx_pcicclient: ${o3d3xx_pcicclient_FIND_VERSION} != ${O3D3XX_PCICCLIENT_VERSION}") 56 | endif() 57 | endif() 58 | 59 | if(NOT ${O3D3XX_PCICCLIENT_VERSION_COMPATIBLE}) 60 | message(FATAL_ERROR 61 | "o3d3xx_pcicclient: ${O3D3XX_PCICCLIENT_VERSION} is incompatible with ${o3d3xx_pcicclient_FIND_VERSION}") 62 | endif() 63 | 64 | mark_as_advanced( 65 | O3D3XX_PCICCLIENT_LIBRARIES 66 | O3D3XX_PCICCLIENT_INCLUDE_DIRS 67 | ) 68 | 69 | # get_cmake_property(_variableNames VARIABLES) 70 | # foreach (_variableName ${_variableNames}) 71 | # message(STATUS "${_variableName}=${${_variableName}}") 72 | # endforeach() 73 | -------------------------------------------------------------------------------- /cmake/modules/MacroOutOfSourceBuild.cmake: -------------------------------------------------------------------------------- 1 | # Ensures that we do an out of source build 2 | 3 | MACRO(MACRO_ENSURE_OUT_OF_SOURCE_BUILD MSG) 4 | STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" 5 | "${CMAKE_BINARY_DIR}" insource) 6 | GET_FILENAME_COMPONENT(PARENTDIR ${CMAKE_SOURCE_DIR} PATH) 7 | STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" 8 | "${PARENTDIR}" insourcesubdir) 9 | IF(insource OR insourcesubdir) 10 | MESSAGE(FATAL_ERROR "${MSG}") 11 | ENDIF(insource OR insourcesubdir) 12 | ENDMACRO(MACRO_ENSURE_OUT_OF_SOURCE_BUILD) 13 | -------------------------------------------------------------------------------- /cmake/modules/o3d3xx_version.cmake: -------------------------------------------------------------------------------- 1 | ################################################ 2 | ## This is the single place to manage API 3 | ## version numbers 4 | ################################################ 5 | set(O3D3XX_VERSION_MAJOR 0) 6 | set(O3D3XX_VERSION_MINOR 7) 7 | set(O3D3XX_VERSION_PATCH 7) 8 | set(O3D3XX_VERSION_STRING 9 | "${O3D3XX_VERSION_MAJOR}.${O3D3XX_VERSION_MINOR}.${O3D3XX_VERSION_PATCH}") 10 | -------------------------------------------------------------------------------- /cmake/modules/ubuntu_version.cmake: -------------------------------------------------------------------------------- 1 | function(get_ubuntu_version VERSION_STRING) 2 | set(UBUNTU_VERSION ${VERSION_STRING}) 3 | set(UBUNTU_MAJOR "0") 4 | set(UBUNTU_MINOR "0") 5 | set(UBUNTU_PATCH "0") 6 | 7 | set(ETC_ISSUE "/etc/issue") 8 | set(ETC_ISSUE_CONTENTS "") 9 | 10 | if (UBUNTU_VERSION VERSION_EQUAL "0.0.0") 11 | if(EXISTS ${ETC_ISSUE}) 12 | file(READ "${ETC_ISSUE}" ETC_ISSUE_CONTENTS) 13 | string(REGEX MATCH 14 | "([0-9]+\\.)([0-9]+\\.?)([0-9]?)" 15 | UBUNTU_VERSION ${ETC_ISSUE_CONTENTS}) 16 | else() 17 | MESSAGE(WARNING "Could not read: " ${ETC_ISSUE}) 18 | endif() 19 | endif() 20 | 21 | string(REPLACE "." ";" UBUNTU_VERSION_LIST ${UBUNTU_VERSION}) 22 | list(LENGTH UBUNTU_VERSION_LIST vlen) 23 | if(NOT (vlen LESS 3)) 24 | list(GET UBUNTU_VERSION_LIST 0 UBUNTU_MAJOR) 25 | list(GET UBUNTU_VERSION_LIST 1 UBUNTU_MINOR) 26 | list(GET UBUNTU_VERSION_LIST 2 UBUNTU_PATCH) 27 | elseif(NOT (vlen LESS 2)) 28 | list(GET UBUNTU_VERSION_LIST 0 UBUNTU_MAJOR) 29 | list(GET UBUNTU_VERSION_LIST 1 UBUNTU_MINOR) 30 | elseif(NOT (vlen LESS 1)) 31 | list(GET UBUNTU_VERSION_LIST 0 UBUNTU_MAJOR) 32 | endif() 33 | 34 | set(UBUNTU_VERSION ${UBUNTU_VERSION} PARENT_SCOPE) 35 | set(UBUNTU_MAJOR ${UBUNTU_MAJOR} PARENT_SCOPE) 36 | set(UBUNTU_MINOR ${UBUNTU_MINOR} PARENT_SCOPE) 37 | set(UBUNTU_PATCH ${UBUNTU_PATCH} PARENT_SCOPE) 38 | 39 | # MESSAGE(STATUS "${ETC_ISSUE}: " ${ETC_ISSUE_CONTENTS}) 40 | MESSAGE(STATUS "UBUNTU_VERSION: " ${UBUNTU_VERSION}) 41 | MESSAGE(STATUS "UBUNTU_MAJOR: " ${UBUNTU_MAJOR}) 42 | MESSAGE(STATUS "UBUNTU_MINOR: " ${UBUNTU_MINOR}) 43 | MESSAGE(STATUS "UBUNTU_PATCH: " ${UBUNTU_PATCH}) 44 | endfunction() 45 | 46 | # To explicitly set your ubuntu version: 47 | # cmake -DUBUNTU_VERSION:STRING=16.04 .. 48 | set(UBUNTU_VERSION "0.0.0" CACHE STRING 49 | "User-overridable detected version of Ubuntu") 50 | -------------------------------------------------------------------------------- /cmake/toolchains/eldk-armv7a-hf.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Toolchain file for Linux on ARMv7a hard float (armhf) architecture 3 | # 4 | # Tested with the following cross-compilers: 5 | # 6 | # - Denx ELDK 5.5.3 armv7a-hf 7 | # ftp://ftp.denx.de/pub/eldk/5.5.3/targets/armv7a-hf 8 | # 9 | # From the above link, download this file: 10 | # eldk-eglibc-i686-arm-toolchain-qte-5.5.3.sh 11 | # 12 | # --------------------------------------------------------------- 13 | # --------------------------------------------------------------- 14 | # 15 | # IMPORTANT NOTE: 16 | # 17 | # On Ubuntu 14.04 LTS armhf I ran into linker issues with libc.so 18 | # and libpthread.so. Those files need to be patched in your mounted 19 | # rootfs prior to cross-compiling. Just to be clear, do not patch 20 | # the files on your embedded system -- they are fine. Said patches 21 | # are provided (as unified diffs) in `patches_arm-linux-gnueabihf`. 22 | # To apply: 23 | # 24 | # $ cd /mnt/rootfs/usr/lib/arm-linux-gnueabihf 25 | # $ sudo patch -b libc.so libc.so.patch 26 | # $ sudo patch -b libpthread.so libpthread.so.patch 27 | # 28 | # Backup files are made as `.orig` in the same directory. 29 | # 30 | set(CMAKE_SYSTEM_NAME Linux) 31 | set(CMAKE_SYSROOT /mnt/rootfs) 32 | 33 | set(CROSSTOOL_ROOT /opt/eldk-5.5.3/armv7a-hf/sysroots/i686-eldk-linux) 34 | set(CMAKE_C_COMPILER 35 | "${CROSSTOOL_ROOT}/usr/bin/arm-linux-gnueabi/arm-linux-gnueabi-gcc") 36 | set(CMAKE_CXX_COMPILER 37 | "${CROSSTOOL_ROOT}/usr/bin/arm-linux-gnueabi/arm-linux-gnueabi-g++") 38 | 39 | set(CMAKE_FIND_ROOT_PATH 40 | ${CMAKE_SYSROOT} 41 | ${CROSSTOOL_ROOT}/../armv7ahf-vfp-neon-linux-gnueabi 42 | ) 43 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 44 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 45 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 46 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 47 | 48 | set(CMAKE_INCLUDE_PATH /include /usr/include) 49 | set(CMAKE_LIBRARY_PATH /lib 50 | /lib/arm-linux-gnueabihf 51 | /lib/arm-linux-gnueabi 52 | /usr/lib 53 | /usr/lib/arm-linux-gnueabihf 54 | /usr/lib/arm-linux-gnueabi) 55 | 56 | set(CROSSTOOL_COMPILE_FLAGS 57 | "-march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon") 58 | 59 | set(CROSSTOOL_EXE_LINKER_FLAGS 60 | "-Wl,-rpath,${CMAKE_SYSROOT}/lib:${CMAKE_SYSROOT}/lib/arm-linux-gnueabihf") 61 | 62 | set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf") 63 | -------------------------------------------------------------------------------- /cmake/toolchains/linaro-arm-linux-gnueabihf.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Toolchain file for Linux on ARM hard float (armhf) architecture 3 | # 4 | # Tested with the following cross-compilers: 5 | # 6 | # - Linaro 4.8-2014.04: 7 | # http://releases.linaro.org/14.04/components/toolchain/binaries/ 8 | # 9 | # --------------------------------------------------------------- 10 | # --------------------------------------------------------------- 11 | # 12 | # IMPORTANT NOTE: 13 | # 14 | # On Ubuntu 14.04 LTS armhf I ran into linker issues with libc.so 15 | # and libpthread.so. Those files need to be patched in your mounted 16 | # rootfs prior to cross-compiling. Just to be clear, do not patch 17 | # the files on your embedded system -- they are fine. Said patches 18 | # are provided (as unified diffs) in `patches_arm-linux-gnueabihf`. 19 | # To apply: 20 | # 21 | # $ cd /mnt/rootfs/usr/lib/arm-linux-gnueabihf 22 | # $ sudo patch -b libc.so libc.so.patch 23 | # $ sudo patch -b libpthread.so libpthread.so.patch 24 | # 25 | # Backup files are made as `.orig` in the same directory. 26 | # 27 | set(CMAKE_SYSTEM_NAME Linux) 28 | set(CMAKE_SYSROOT /mnt/rootfs) 29 | 30 | set(CROSSTOOL_ROOT /opt/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux) 31 | set(CMAKE_C_COMPILER "${CROSSTOOL_ROOT}/bin/arm-linux-gnueabihf-gcc") 32 | set(CMAKE_CXX_COMPILER "${CROSSTOOL_ROOT}/bin/arm-linux-gnueabihf-g++") 33 | 34 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 35 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 36 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 37 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 38 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 39 | 40 | set(CROSSTOOL_EXE_LINKER_FLAGS 41 | "-Wl,-rpath,${CMAKE_SYSROOT}/lib:${CMAKE_SYSROOT}/lib/arm-linux-gnueabihf") 42 | 43 | set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf") 44 | -------------------------------------------------------------------------------- /cmake/toolchains/o3d303.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Toolchain for cross-building libo3d3xx for the O3D303 camera. 3 | # 4 | # NOTE: For this file to work, you must first: 5 | # source /opt/poky/1.8.1/environment-setup-armv7ahf-vfp-neon-poky-linux-gnueabi 6 | # 7 | 8 | set(CMAKE_SYSTEM_NAME Linux) 9 | set(CMAKE_SYSROOT /opt/poky/1.8.1/sysroots/armv7ahf-vfp-neon-poky-linux-gnueabi) 10 | set(SYSROOT_CONTRIB /opt/poky/contrib) 11 | set(CMAKE_FIND_ROOT_PATH ${SYSROOT_CONTRIB} ${CMAKE_SYSROOT}) 12 | 13 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 14 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 15 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 16 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 17 | 18 | set(CMAKE_LIBRARY_PATH /lib 19 | /usr/lib 20 | /usr/lib/arm-linux-gnueabihf) 21 | 22 | set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf") 23 | -------------------------------------------------------------------------------- /cmake/toolchains/patches_arm-linux-gnueabihf/libc.so.patch: -------------------------------------------------------------------------------- 1 | --- libc.so.BAK 2015-11-09 13:40:02.996183523 -0500 2 | +++ libc.so 2015-11-09 13:40:28.220382341 -0500 3 | @@ -2,4 +2,4 @@ 4 | Use the shared library, but some functions are only in 5 | the static library, so try that secondarily. */ 6 | OUTPUT_FORMAT(elf32-littlearm) 7 | -GROUP ( /lib/arm-linux-gnueabihf/libc.so.6 /usr/lib/arm-linux-gnueabihf/libc_nonshared.a AS_NEEDED ( /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 ) ) 8 | +GROUP ( libc.so.6 libc_nonshared.a AS_NEEDED ( ld-linux-armhf.so.3 ) ) 9 | -------------------------------------------------------------------------------- /cmake/toolchains/patches_arm-linux-gnueabihf/libpthread.so.patch: -------------------------------------------------------------------------------- 1 | --- libpthread.so.BAK 2015-11-09 13:43:40.073909127 -0500 2 | +++ libpthread.so 2015-11-09 13:44:32.022335036 -0500 3 | @@ -2,4 +2,4 @@ 4 | Use the shared library, but some functions are only in 5 | the static library, so try that secondarily. */ 6 | OUTPUT_FORMAT(elf32-littlearm) 7 | -GROUP ( /lib/arm-linux-gnueabihf/libpthread.so.0 /usr/lib/arm-linux-gnueabihf/libpthread_nonshared.a ) 8 | +GROUP ( libpthread.so.0 libpthread_nonshared.a ) 9 | -------------------------------------------------------------------------------- /cmake/utils/install_all_debs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | for deb in $(ls -1 *.deb) 5 | do 6 | dpkg -i ${deb} 7 | done 8 | -------------------------------------------------------------------------------- /doc/20140820_O3D3xx_C2_sample_manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/doc/20140820_O3D3xx_C2_sample_manual.pdf -------------------------------------------------------------------------------- /doc/O3D300_thermal_issues-EN.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/doc/O3D300_thermal_issues-EN.pdf -------------------------------------------------------------------------------- /doc/O3D303.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/doc/O3D303.pdf -------------------------------------------------------------------------------- /doc/O3D3xx_Operations_Manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/doc/O3D3xx_Operations_Manual.pdf -------------------------------------------------------------------------------- /doc/O3D3xx_Operations_Manual_Preliminary.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/doc/O3D3xx_Operations_Manual_Preliminary.pdf -------------------------------------------------------------------------------- /doc/attic/100k.o3d3xxapp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/doc/attic/100k.o3d3xxapp -------------------------------------------------------------------------------- /doc/attic/using.md: -------------------------------------------------------------------------------- 1 | Using libo3d3xx 2 | =============== 3 | 4 | A useful exercise for learning how to use the library would be to look at the 5 | code for the command-line utilities provided with `libo3d3xx`. In particular, 6 | the `o3d3xx-viewer` application would be instructive. That said, using the 7 | library basically boils down to: 8 | 9 | #include "o3d3xx.h" 10 | 11 | // instantiate the camera with default ip, xmlrpc port, and password 12 | o3d3xx::Camera::Ptr cam = std::make_shared(); 13 | 14 | // associate the camera with a frame grabber 15 | o3d3xx::FrameGrabber::Ptr fg = std::make_shared(cam); 16 | 17 | // create an buffer for holding the image data from the camera 18 | o3d3xx::ImageBuffer::Ptr buff = std::make_shared(); 19 | 20 | // now stream the data 21 | while (true) 22 | { 23 | // block for .5 sec waiting for data from the camera 24 | if (! fg->WaitForFrame(buff.get(), 500)) 25 | { 26 | continue; 27 | } 28 | 29 | // Now access to the current frame is available as: 30 | // 31 | // 1. A PCL point cloud 32 | // buff->Cloud() 33 | // 34 | // 2. OpenCV images 35 | // buff->DepthImage() 36 | // buff->ConfidenceImage() 37 | // buff->AmplitudeImage() 38 | // 39 | // Use these open-source libraries to build your application 40 | // 41 | } 42 | 43 | Other useful examples exist in the unit tests. 44 | -------------------------------------------------------------------------------- /doc/figures/2d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/doc/figures/2d.png -------------------------------------------------------------------------------- /doc/figures/2d_old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/doc/figures/2d_old.png -------------------------------------------------------------------------------- /doc/figures/3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/doc/figures/3d.png -------------------------------------------------------------------------------- /doc/figures/office100k.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/doc/figures/office100k.png -------------------------------------------------------------------------------- /doc/figures/office23k.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/doc/figures/office23k.png -------------------------------------------------------------------------------- /doc/ifm-O3D303-PMD-3D-Camera-e-15-n.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/doc/ifm-O3D303-PMD-3D-Camera-e-15-n.pdf -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/bilateral_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial bilateral filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | }, 13 | "SigmaPixel": { 14 | "type": "number", 15 | "minimum": 0, 16 | "default": 2, 17 | "attributes": [ "private" ] 18 | }, 19 | "SigmaDistance": { 20 | "type": "number", 21 | "minimum": 0, 22 | "default": 0.1, 23 | "attributes": [ "private" ] 24 | } 25 | }, 26 | 27 | "required": [ 28 | "MaskSize" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/exponential_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx temporal exponential filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MinSmoothDiff": { 8 | "type": "number", 9 | "minimum": 0, 10 | "default": 0.3, 11 | "attributes": [ "private" ] 12 | }, 13 | "MinSDAlpha": { 14 | "type": "number", 15 | "minimum": 0, 16 | "maximum": 1, 17 | "default": 0.2, 18 | "attributes": [ "private" ] 19 | }, 20 | "MaxSmoothDiff": { 21 | "type": "number", 22 | "minimum": 0, 23 | "default": 1, 24 | "attributes": [ "private" ] 25 | }, 26 | "MaxSDAlpha": { 27 | "type": "number", 28 | "minimum": 0, 29 | "maximum": 1, 30 | "default": 0.95, 31 | "attributes": [ "private" ] 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/logic_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Logic Layer format", 4 | "definitions": { 5 | "block": { 6 | "type": "object", 7 | "properties": { 8 | "type": { "type": "string" }, 9 | "properties": { 10 | "type": "object" 11 | } 12 | } 13 | }, 14 | "connector": { 15 | "type": "object", 16 | "properties": { 17 | "src": { "type": "string" }, 18 | "srcEP": { "type": "number" }, 19 | "dst": { "type": "string" }, 20 | "dstEP": {"type": "number" } 21 | }, 22 | "required": ["src", "srcEP","dst","dstEP"] 23 | } 24 | }, 25 | "type": "object", 26 | "properties": { 27 | "blocks": { 28 | "type":"object", 29 | "minProperties": 1, 30 | "additionalProperties": false, 31 | "patternProperties":{ 32 | "^B[0-9]+$": { "$ref": "#/definitions/block" } 33 | } 34 | }, 35 | "connectors": { 36 | "type":"object", 37 | "minProperties": 1, 38 | "additionalProperties": false, 39 | "patternProperties":{ 40 | "^C[0-9]+$": { "$ref": "#/definitions/connector" } 41 | } 42 | }, 43 | "IOMap": { 44 | "type":"object", 45 | "patternProperties": { 46 | "^(OUT1|OUT2|OUT3|IO1|IO2)$": { 47 | "type": "string", 48 | "pattern": "^(NONE|ERRPIN|RFT|AQUFIN|EVAFIN|USEROUT|ANALOG)$" 49 | } 50 | }, 51 | "additionalProperties": false 52 | } 53 | }, 54 | "required": ["blocks"] 55 | } 56 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/logic_graph_runtime_info.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Logic Layer format", 4 | "type": "object", 5 | "properties": { 6 | "connectors": { 7 | "type":"object", 8 | "patternProperties": { 9 | "^C[0-9]+$": { "type": [ "string", "number", "boolean", "integer" ]} 10 | } 11 | }, 12 | "error": { 13 | "type":"object", 14 | "properties": { 15 | "ErrorCode": {"type": "integer"}, 16 | "ErrorMessage": {"type": "string"} 17 | } 18 | } 19 | }, 20 | "required": ["connectors", "error"] 21 | } 22 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/mean_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial mean filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | } 13 | }, 14 | 15 | "required": [ 16 | "MaskSize" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/median_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial median filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | } 13 | }, 14 | 15 | "required": [ 16 | "MaskSize" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/model.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Model configuration", 4 | "type": "object", 5 | 6 | "oneOf": [ 7 | { "$ref": "model_distance.json" }, 8 | { "$ref": "model_level.json" }, 9 | { "$ref": "model_dimensioning.json" } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/model_dimensioning.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Dimensioning model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Dimensioning", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Dimensioning" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "FlowAngle": { 21 | "type": "number" 22 | }, 23 | "UseFlowAngle": { 24 | "type": "boolean" 25 | }, 26 | "BackgroundTaught": { 27 | "type": "boolean", 28 | "attributes": [ "readonly", "noexport" ] 29 | }, 30 | "ROIs": { 31 | "type": "string", 32 | "attributes": [ "readonly" ] 33 | }, 34 | "ObjectType": { 35 | "type": "integer", 36 | "minimum": 0, 37 | "maximum": 1 38 | }, 39 | "TeachData": { 40 | "type": "string", 41 | "attributes": [ "private", "noexport" ] 42 | }, 43 | "TeachROI": { 44 | "type": "string", 45 | "attributes": [ "private", "noexport" ] 46 | } 47 | }, 48 | 49 | "required": [ 50 | "Name", "Type", "FlowAngle", "UseFlowAngle", "ObjectType" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/model_distance.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Distance model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Distance", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Distance" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "SwitchPoint1": { 24 | "type": "number" 25 | }, 26 | "SwitchPoint2": { 27 | "type": "number" 28 | }, 29 | "ValueOfBenefit": { 30 | "type": "integer", 31 | "minimum": 0, 32 | "maximum": 2, 33 | "default": 0 34 | } 35 | }, 36 | 37 | "required": [ 38 | "Name", "Type", "ROIs", "SwitchPoint1", "SwitchPoint2", "ValueOfBenefit" 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/model_level.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Level model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Level", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Level" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "PrivateBackgroundType": { 24 | "type": "string", 25 | "enum": [ "undefined", "fixed", "taught" ], 26 | "default": "undefined", 27 | "attributes": [ "private", "noexport" ] 28 | }, 29 | "BackgroundType": { 30 | "type": "string", 31 | "enum": [ "undefined", "fixed", "taught" ], 32 | "attributes": [ "readonly" ] 33 | }, 34 | "BackgroundFixed": { 35 | "type": "number" 36 | }, 37 | "SwitchPoint1": { 38 | "type": "number" 39 | }, 40 | "SwitchPoint2": { 41 | "type": "number" 42 | }, 43 | "ValueOfBenefit": { 44 | "type": "integer", 45 | "minimum": 0, 46 | "maximum": 2, 47 | "default": 0 48 | }, 49 | "UseAnchorTracking": { 50 | "type": "boolean", 51 | "default": false 52 | }, 53 | "TeachData": { 54 | "type": "string", 55 | "attributes": [ "private", "noexport" ] 56 | }, 57 | "AnchorData": { 58 | "type": "string", 59 | "attributes": [ "private", "noexport" ] 60 | }, 61 | "CompletenessData": { 62 | "type": "string", 63 | "attributes": [ "private" ] 64 | } 65 | }, 66 | 67 | "required": [ 68 | "Name", "Type", "ROIs", "BackgroundType", "BackgroundFixed", "SwitchPoint1", "SwitchPoint2", "ValueOfBenefit" 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/network.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx network configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "StaticIPv4Address": { 8 | "type": "string", 9 | "format": "ipv4", 10 | "default": "192.168.0.69" 11 | }, 12 | "StaticIPv4SubNetMask": { 13 | "type": "string", 14 | "format": "ipv4", 15 | "default": "255.255.255.0" 16 | }, 17 | "StaticIPv4Gateway": { 18 | "type": "string", 19 | "format": "ipv4", 20 | "default": "192.168.0.201" 21 | }, 22 | "UseDHCP": { 23 | "type": "boolean", 24 | "default": false 25 | }, 26 | "NetworkSpeed": { 27 | "type": "integer", 28 | "minimum": 0, 29 | "maximum": 0, 30 | "default": 0 31 | }, 32 | "MACAddress": { 33 | "type": "string", 34 | "pattern": "^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$", 35 | "attributes": [ "readonly" ] 36 | } 37 | }, 38 | 39 | "required": [ 40 | "StaticIPv4Address", "StaticIPv4SubNetMask", "StaticIPv4Gateway", 41 | "UseDHCP" 42 | ] 43 | } -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/o3d3xx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx complete configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Device": { 8 | "$ref": "device.json" 9 | }, 10 | "Network": { 11 | "$ref": "network.json" 12 | }, 13 | "Applications": { 14 | "type": "array", 15 | "items": { 16 | "oneOf": [ { "$ref": "application.json" }, { "type": "null" } ] 17 | }, 18 | "minItems": 32, 19 | "maxItems": 32 20 | }, 21 | "Firmware": { 22 | "type": "string" 23 | } 24 | }, 25 | 26 | "required": [ "Device", "Network", "Applications", "Firmware" ] 27 | } 28 | 29 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/roi.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema#", 3 | "title": "O3D3xx ROI format", 4 | "type": "object", 5 | 6 | "properties": { 7 | "ROIs": { 8 | "type": "array", 9 | "items": { 10 | "oneOf": [ 11 | { 12 | "type": "object", 13 | "properties": { 14 | "id": { 15 | "type": "integer", 16 | "minimum": 0, 17 | "maximum": 63 18 | }, 19 | "group": { 20 | "type": "integer", 21 | "minimum": 0, 22 | "maximum": 63 23 | }, 24 | "type": { 25 | "enum": [ "Rect", "Ellipse" ] 26 | }, 27 | "width": { "type": "number" }, 28 | "height": { "type": "number" }, 29 | "angle": { "type": "number" }, 30 | "center_x": { "type": "number" }, 31 | "center_y": { "type": "number" } 32 | }, 33 | "required": ["id","group","type","width","height","angle","center_x","center_y"] 34 | }, 35 | { 36 | "type": "object", 37 | "properties": { 38 | "id": { 39 | "type": "integer", 40 | "minimum": 0, 41 | "maximum": 63 42 | }, 43 | "group": { 44 | "type": "integer", 45 | "minimum": 0, 46 | "maximum": 63 47 | }, 48 | "type": { 49 | "enum": [ "Poly" ] 50 | }, 51 | "points": { 52 | "type": "array", 53 | "items": { 54 | "type": "object", 55 | "properties": { 56 | "x": { "type": "number" }, 57 | "y": { "type": "number" } 58 | } 59 | } 60 | } 61 | }, 62 | "required": ["id","group","type","points"] 63 | } 64 | ] 65 | } 66 | }, 67 | "MultiROIs": { 68 | "type": "array", 69 | "items": { 70 | "type": "object", 71 | "properties": { 72 | "param": { 73 | "type": "object", 74 | "properties": { 75 | "shape": { "enum": ["Rect","Ellipse","Square","Circle","Hexagon"] }, 76 | "cols": {"type": "integer"}, 77 | "rows": {"type": "integer"}, 78 | "gridtype": { "enum": ["Regular"] }, 79 | "spacing": { "type": "number" }, 80 | "width": { "type": "number" }, 81 | "height": { "type": "number" }, 82 | "center_x": { "type": "number" }, 83 | "center_y": { "type": "number" }, 84 | "angle": { "type": "number" } 85 | } 86 | }, 87 | "rois": { 88 | "type": "array", 89 | "items": { 90 | "type": "integer", 91 | "minimum": 0, 92 | "maximum": 63 93 | } 94 | } 95 | } 96 | } 97 | } 98 | } 99 | } -------------------------------------------------------------------------------- /doc/json/JSON-schema-0.6.x/temporal_mean_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx temporal mean filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "NumberOfImages": { 8 | "type": "integer", 9 | "minimum": 2, 10 | "maximum": 25, 11 | "default": 2 12 | } 13 | }, 14 | 15 | "required": [ 16 | "NumberOfImages" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/bilateral_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial bilateral filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | }, 13 | "SigmaPixel": { 14 | "type": "number", 15 | "minimum": 0, 16 | "default": 2, 17 | "attributes": [ "private" ] 18 | }, 19 | "SigmaDistance": { 20 | "type": "number", 21 | "minimum": 0, 22 | "default": 0.1, 23 | "attributes": [ "private" ] 24 | } 25 | }, 26 | 27 | "required": [ 28 | "MaskSize" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/exponential_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx temporal exponential filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MinSmoothDiff": { 8 | "type": "number", 9 | "minimum": 0, 10 | "default": 0.3, 11 | "attributes": [ "private" ] 12 | }, 13 | "MinSDAlpha": { 14 | "type": "number", 15 | "minimum": 0, 16 | "maximum": 1, 17 | "default": 0.2, 18 | "attributes": [ "private" ] 19 | }, 20 | "MaxSmoothDiff": { 21 | "type": "number", 22 | "minimum": 0, 23 | "default": 1, 24 | "attributes": [ "private" ] 25 | }, 26 | "MaxSDAlpha": { 27 | "type": "number", 28 | "minimum": 0, 29 | "maximum": 1, 30 | "default": 0.95, 31 | "attributes": [ "private" ] 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/logic_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Logic Layer format", 4 | "definitions": { 5 | "block": { 6 | "type": "object", 7 | "properties": { 8 | "type": { "type": "string" }, 9 | "properties": { 10 | "type": "object" 11 | } 12 | } 13 | }, 14 | "connector": { 15 | "type": "object", 16 | "properties": { 17 | "src": { "type": "string" }, 18 | "srcEP": { "type": "number" }, 19 | "dst": { "type": "string" }, 20 | "dstEP": {"type": "number" } 21 | }, 22 | "required": ["src", "srcEP","dst","dstEP"] 23 | } 24 | }, 25 | "type": "object", 26 | "properties": { 27 | "blocks": { 28 | "type":"object", 29 | "minProperties": 1, 30 | "additionalProperties": false, 31 | "patternProperties":{ 32 | "^B[0-9]+$": { "$ref": "#/definitions/block" } 33 | } 34 | }, 35 | "connectors": { 36 | "type":"object", 37 | "minProperties": 1, 38 | "additionalProperties": false, 39 | "patternProperties":{ 40 | "^C[0-9]+$": { "$ref": "#/definitions/connector" } 41 | } 42 | }, 43 | "IOMap": { 44 | "type":"object", 45 | "patternProperties": { 46 | "^(OUT1|OUT2|OUT3|IO1|IO2)$": { 47 | "type": "string", 48 | "pattern": "^(NONE|ERRPIN|RFT|AQUFIN|EVAFIN|USEROUT|ANALOG)$" 49 | } 50 | }, 51 | "additionalProperties": false 52 | } 53 | }, 54 | "required": ["blocks"] 55 | } 56 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/logic_graph_runtime_info.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Logic Layer format", 4 | "type": "object", 5 | "properties": { 6 | "connectors": { 7 | "type":"object", 8 | "patternProperties": { 9 | "^C[0-9]+$": { "type": [ "string", "number", "boolean", "integer" ]} 10 | } 11 | }, 12 | "error": { 13 | "type":"object", 14 | "properties": { 15 | "ErrorCode": {"type": "integer"}, 16 | "ErrorMessage": {"type": "string"} 17 | } 18 | } 19 | }, 20 | "required": ["connectors", "error"] 21 | } 22 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/mean_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial mean filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | } 13 | }, 14 | 15 | "required": [ 16 | "MaskSize" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/median_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial median filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | } 13 | }, 14 | 15 | "required": [ 16 | "MaskSize" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/model.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Model configuration", 4 | "type": "object", 5 | 6 | "oneOf": [ 7 | { "$ref": "model_distance.json" }, 8 | { "$ref": "model_level.json" }, 9 | { "$ref": "model_dimensioning.json" } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/model_dimensioning.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Dimensioning model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Dimensioning", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Dimensioning" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "FlowAngle": { 21 | "type": "number" 22 | }, 23 | "UseFlowAngle": { 24 | "type": "boolean" 25 | }, 26 | "BackgroundTaught": { 27 | "type": "boolean", 28 | "attributes": [ "readonly", "noexport" ] 29 | }, 30 | "ROIs": { 31 | "type": "string", 32 | "attributes": [ "readonly" ] 33 | }, 34 | "ObjectType": { 35 | "type": "integer", 36 | "minimum": 0, 37 | "maximum": 1 38 | }, 39 | "TeachData": { 40 | "type": "string", 41 | "attributes": [ "private", "noexport" ] 42 | }, 43 | "TeachROI": { 44 | "type": "string", 45 | "attributes": [ "private", "noexport" ] 46 | } 47 | }, 48 | 49 | "required": [ 50 | "Name", "Type", "FlowAngle", "UseFlowAngle", "ObjectType" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/model_distance.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Distance model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Distance", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Distance" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "SwitchPoint1": { 24 | "type": "number" 25 | }, 26 | "SwitchPoint2": { 27 | "type": "number" 28 | }, 29 | "ValueOfBenefit": { 30 | "type": "integer", 31 | "minimum": 0, 32 | "maximum": 2, 33 | "default": 0 34 | } 35 | }, 36 | 37 | "required": [ 38 | "Name", "Type", "ROIs", "SwitchPoint1", "SwitchPoint2", "ValueOfBenefit" 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/model_level.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Level model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Level", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Level" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "PrivateBackgroundType": { 24 | "type": "string", 25 | "enum": [ "undefined", "fixed", "taught" ], 26 | "default": "undefined", 27 | "attributes": [ "private", "noexport" ] 28 | }, 29 | "BackgroundType": { 30 | "type": "string", 31 | "enum": [ "undefined", "fixed", "taught" ], 32 | "attributes": [ "readonly" ] 33 | }, 34 | "BackgroundFixed": { 35 | "type": "number" 36 | }, 37 | "SwitchPoint1": { 38 | "type": "number" 39 | }, 40 | "SwitchPoint2": { 41 | "type": "number" 42 | }, 43 | "ValueOfBenefit": { 44 | "type": "integer", 45 | "minimum": 0, 46 | "maximum": 2, 47 | "default": 0 48 | }, 49 | "UseAnchorTracking": { 50 | "type": "boolean", 51 | "default": false 52 | }, 53 | "TeachData": { 54 | "type": "string", 55 | "attributes": [ "private", "noexport" ] 56 | }, 57 | "AnchorData": { 58 | "type": "string", 59 | "attributes": [ "private", "noexport" ] 60 | }, 61 | "CompletenessData": { 62 | "type": "string", 63 | "attributes": [ "private" ] 64 | } 65 | }, 66 | 67 | "required": [ 68 | "Name", "Type", "ROIs", "BackgroundType", "BackgroundFixed", "SwitchPoint1", "SwitchPoint2", "ValueOfBenefit" 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/network.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx network configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "StaticIPv4Address": { 8 | "type": "string", 9 | "format": "ipv4", 10 | "default": "192.168.0.69" 11 | }, 12 | "StaticIPv4SubNetMask": { 13 | "type": "string", 14 | "format": "ipv4", 15 | "default": "255.255.255.0" 16 | }, 17 | "StaticIPv4Gateway": { 18 | "type": "string", 19 | "format": "ipv4", 20 | "default": "192.168.0.201" 21 | }, 22 | "UseDHCP": { 23 | "type": "boolean", 24 | "default": false 25 | }, 26 | "NetworkSpeed": { 27 | "type": "integer", 28 | "minimum": 0, 29 | "maximum": 0, 30 | "default": 0 31 | }, 32 | "MACAddress": { 33 | "type": "string", 34 | "pattern": "^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$", 35 | "attributes": [ "readonly" ] 36 | } 37 | }, 38 | 39 | "required": [ 40 | "StaticIPv4Address", "StaticIPv4SubNetMask", "StaticIPv4Gateway", 41 | "UseDHCP" 42 | ] 43 | } -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/o3d3xx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx complete configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Device": { 8 | "$ref": "device.json" 9 | }, 10 | "Network": { 11 | "$ref": "network.json" 12 | }, 13 | "Applications": { 14 | "type": "array", 15 | "items": { 16 | "oneOf": [ { "$ref": "application.json" }, { "type": "null" } ] 17 | }, 18 | "minItems": 32, 19 | "maxItems": 32 20 | }, 21 | "Firmware": { 22 | "type": "string" 23 | } 24 | }, 25 | 26 | "required": [ "Device", "Network", "Applications", "Firmware" ] 27 | } 28 | 29 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/roi.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema#", 3 | "title": "O3D3xx ROI format", 4 | "type": "object", 5 | 6 | "properties": { 7 | "ROIs": { 8 | "type": "array", 9 | "items": { 10 | "oneOf": [ 11 | { 12 | "type": "object", 13 | "properties": { 14 | "id": { 15 | "type": "integer", 16 | "minimum": 0, 17 | "maximum": 63 18 | }, 19 | "group": { 20 | "type": "integer", 21 | "minimum": 0, 22 | "maximum": 63 23 | }, 24 | "type": { 25 | "enum": [ "Rect", "Ellipse" ] 26 | }, 27 | "width": { "type": "number" }, 28 | "height": { "type": "number" }, 29 | "angle": { "type": "number" }, 30 | "center_x": { "type": "number" }, 31 | "center_y": { "type": "number" } 32 | }, 33 | "required": ["id","group","type","width","height","angle","center_x","center_y"] 34 | }, 35 | { 36 | "type": "object", 37 | "properties": { 38 | "id": { 39 | "type": "integer", 40 | "minimum": 0, 41 | "maximum": 63 42 | }, 43 | "group": { 44 | "type": "integer", 45 | "minimum": 0, 46 | "maximum": 63 47 | }, 48 | "type": { 49 | "enum": [ "Poly" ] 50 | }, 51 | "points": { 52 | "type": "array", 53 | "items": { 54 | "type": "object", 55 | "properties": { 56 | "x": { "type": "number" }, 57 | "y": { "type": "number" } 58 | } 59 | } 60 | } 61 | }, 62 | "required": ["id","group","type","points"] 63 | } 64 | ] 65 | } 66 | }, 67 | "MultiROIs": { 68 | "type": "array", 69 | "items": { 70 | "type": "object", 71 | "properties": { 72 | "param": { 73 | "type": "object", 74 | "properties": { 75 | "shape": { "enum": ["Rect","Ellipse","Square","Circle","Hexagon"] }, 76 | "cols": {"type": "integer"}, 77 | "rows": {"type": "integer"}, 78 | "gridtype": { "enum": ["Regular"] }, 79 | "spacing": { "type": "number" }, 80 | "width": { "type": "number" }, 81 | "height": { "type": "number" }, 82 | "center_x": { "type": "number" }, 83 | "center_y": { "type": "number" }, 84 | "angle": { "type": "number" } 85 | } 86 | }, 87 | "rois": { 88 | "type": "array", 89 | "items": { 90 | "type": "integer", 91 | "minimum": 0, 92 | "maximum": 63 93 | } 94 | } 95 | } 96 | } 97 | } 98 | } 99 | } -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.1.x/temporal_mean_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx temporal mean filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "NumberOfImages": { 8 | "type": "integer", 9 | "minimum": 2, 10 | "maximum": 25, 11 | "default": 2 12 | } 13 | }, 14 | 15 | "required": [ 16 | "NumberOfImages" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/bilateral_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial bilateral filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | }, 13 | "SigmaPixel": { 14 | "type": "number", 15 | "minimum": 0, 16 | "default": 2, 17 | "attributes": [ "private" ] 18 | }, 19 | "SigmaDistance": { 20 | "type": "number", 21 | "minimum": 0, 22 | "default": 0.1, 23 | "attributes": [ "private" ] 24 | } 25 | }, 26 | 27 | "required": [ 28 | "MaskSize" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/exponential_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx temporal exponential filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MinSmoothDiff": { 8 | "type": "number", 9 | "minimum": 0, 10 | "default": 0.3, 11 | "attributes": [ "private" ] 12 | }, 13 | "MinSDAlpha": { 14 | "type": "number", 15 | "minimum": 0, 16 | "maximum": 1, 17 | "default": 0.2, 18 | "attributes": [ "private" ] 19 | }, 20 | "MaxSmoothDiff": { 21 | "type": "number", 22 | "minimum": 0, 23 | "default": 1, 24 | "attributes": [ "private" ] 25 | }, 26 | "MaxSDAlpha": { 27 | "type": "number", 28 | "minimum": 0, 29 | "maximum": 1, 30 | "default": 0.95, 31 | "attributes": [ "private" ] 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/logic_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Logic Layer format", 4 | "definitions": { 5 | "block": { 6 | "type": "object", 7 | "properties": { 8 | "type": { "type": "string" }, 9 | "properties": { 10 | "type": "object" 11 | } 12 | } 13 | }, 14 | "connector": { 15 | "type": "object", 16 | "properties": { 17 | "src": { "type": "string" }, 18 | "srcEP": { "type": "number" }, 19 | "dst": { "type": "string" }, 20 | "dstEP": {"type": "number" } 21 | }, 22 | "required": ["src", "srcEP","dst","dstEP"] 23 | } 24 | }, 25 | "type": "object", 26 | "properties": { 27 | "blocks": { 28 | "type":"object", 29 | "minProperties": 1, 30 | "additionalProperties": false, 31 | "patternProperties":{ 32 | "^B[0-9]+$": { "$ref": "#/definitions/block" } 33 | } 34 | }, 35 | "connectors": { 36 | "type":"object", 37 | "minProperties": 1, 38 | "additionalProperties": false, 39 | "patternProperties":{ 40 | "^C[0-9]+$": { "$ref": "#/definitions/connector" } 41 | } 42 | }, 43 | "IOMap": { 44 | "type":"object", 45 | "patternProperties": { 46 | "^(OUT1|OUT2|OUT3|IO1|IO2)$": { 47 | "type": "string", 48 | "pattern": "^(NONE|ERRPIN|RFT|AQUFIN|EVAFIN|USEROUT|ANALOG|PCIC|USERIN)$" 49 | } 50 | }, 51 | "additionalProperties": false 52 | } 53 | }, 54 | "required": ["blocks"] 55 | } 56 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/logic_graph_runtime_info.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Logic Layer format", 4 | "type": "object", 5 | "properties": { 6 | "connectors": { 7 | "type":"object", 8 | "patternProperties": { 9 | "^C[0-9]+$": { "type": [ "string", "number", "boolean", "integer" ]} 10 | } 11 | }, 12 | "error": { 13 | "type":"object", 14 | "properties": { 15 | "ErrorCode": {"type": "integer"}, 16 | "ErrorMessage": {"type": "string"} 17 | } 18 | } 19 | }, 20 | "required": ["connectors", "error"] 21 | } 22 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/mean_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial mean filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | } 13 | }, 14 | 15 | "required": [ 16 | "MaskSize" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/median_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial median filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | } 13 | }, 14 | 15 | "required": [ 16 | "MaskSize" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/model.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Model configuration", 4 | "type": "object", 5 | 6 | "oneOf": [ 7 | { "$ref": "model_distance.json" }, 8 | { "$ref": "model_level.json" }, 9 | { "$ref": "model_dimensioning.json" } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/model_dimensioning.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Dimensioning model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Dimensioning", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Dimensioning" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "FlowAngle": { 21 | "type": "number" 22 | }, 23 | "UseFlowAngle": { 24 | "type": "boolean" 25 | }, 26 | "BackgroundTaught": { 27 | "type": "boolean", 28 | "attributes": [ "readonly", "noexport" ] 29 | }, 30 | "ROIs": { 31 | "type": "string", 32 | "attributes": [ "readonly" ] 33 | }, 34 | "ObjectType": { 35 | "type": "integer", 36 | "minimum": 0, 37 | "maximum": 1 38 | }, 39 | "TeachData": { 40 | "type": "string", 41 | "attributes": [ "private", "noexport" ] 42 | }, 43 | "TeachROI": { 44 | "type": "string", 45 | "attributes": [ "private", "noexport" ] 46 | } 47 | }, 48 | 49 | "required": [ 50 | "Name", "Type", "FlowAngle", "UseFlowAngle", "ObjectType" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/model_distance.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Distance model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Distance", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Distance" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "SwitchPoint1": { 24 | "type": "number" 25 | }, 26 | "SwitchPoint2": { 27 | "type": "number" 28 | }, 29 | "ValueOfBenefit": { 30 | "type": "integer", 31 | "minimum": 0, 32 | "maximum": 2, 33 | "default": 0 34 | } 35 | }, 36 | 37 | "required": [ 38 | "Name", "Type", "ROIs", "SwitchPoint1", "SwitchPoint2", "ValueOfBenefit" 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/model_level.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Level model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Level", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Level" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "PrivateBackgroundType": { 24 | "type": "string", 25 | "enum": [ "undefined", "fixed", "taught" ], 26 | "default": "undefined", 27 | "attributes": [ "private", "noexport" ] 28 | }, 29 | "BackgroundType": { 30 | "type": "string", 31 | "enum": [ "undefined", "fixed", "taught" ], 32 | "attributes": [ "readonly" ] 33 | }, 34 | "BackgroundFixed": { 35 | "type": "number" 36 | }, 37 | "SwitchPoint1": { 38 | "type": "number" 39 | }, 40 | "SwitchPoint2": { 41 | "type": "number" 42 | }, 43 | "ValueOfBenefit": { 44 | "type": "integer", 45 | "minimum": 0, 46 | "maximum": 2, 47 | "default": 0 48 | }, 49 | "UseAnchorTracking": { 50 | "type": "boolean", 51 | "default": false 52 | }, 53 | "TeachData": { 54 | "type": "string", 55 | "attributes": [ "private", "noexport" ] 56 | }, 57 | "AnchorData": { 58 | "type": "string", 59 | "attributes": [ "private", "noexport" ] 60 | }, 61 | "CompletenessData": { 62 | "type": "string", 63 | "attributes": [ "private" ] 64 | } 65 | }, 66 | 67 | "required": [ 68 | "Name", "Type", "ROIs", "BackgroundType", "BackgroundFixed", "SwitchPoint1", "SwitchPoint2", "ValueOfBenefit" 69 | ] 70 | } 71 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/network.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx network configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "StaticIPv4Address": { 8 | "type": "string", 9 | "format": "ipv4", 10 | "default": "192.168.0.69" 11 | }, 12 | "StaticIPv4SubNetMask": { 13 | "type": "string", 14 | "format": "ipv4", 15 | "default": "255.255.255.0" 16 | }, 17 | "StaticIPv4Gateway": { 18 | "type": "string", 19 | "format": "ipv4", 20 | "default": "192.168.0.201" 21 | }, 22 | "UseDHCP": { 23 | "type": "boolean", 24 | "default": false 25 | }, 26 | "NetworkSpeed": { 27 | "type": "integer", 28 | "minimum": 0, 29 | "maximum": 0, 30 | "default": 0 31 | }, 32 | "MACAddress": { 33 | "type": "string", 34 | "pattern": "^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$", 35 | "attributes": [ "readonly" ] 36 | } 37 | }, 38 | 39 | "required": [ 40 | "StaticIPv4Address", "StaticIPv4SubNetMask", "StaticIPv4Gateway", 41 | "UseDHCP" 42 | ] 43 | } -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/o3d3xx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx complete configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Device": { 8 | "$ref": "device.json" 9 | }, 10 | "Network": { 11 | "$ref": "network.json" 12 | }, 13 | "Applications": { 14 | "type": "array", 15 | "items": { 16 | "oneOf": [ { "$ref": "application.json" }, { "type": "null" } ] 17 | }, 18 | "minItems": 32, 19 | "maxItems": 32 20 | }, 21 | "Firmware": { 22 | "type": "string" 23 | } 24 | }, 25 | 26 | "required": [ "Device", "Network", "Applications", "Firmware" ] 27 | } 28 | 29 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/roi.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema#", 3 | "title": "O3D3xx ROI format", 4 | "type": "object", 5 | 6 | "properties": { 7 | "ROIs": { 8 | "type": "array", 9 | "items": { 10 | "oneOf": [ 11 | { 12 | "type": "object", 13 | "properties": { 14 | "id": { 15 | "type": "integer", 16 | "minimum": 0, 17 | "maximum": 63 18 | }, 19 | "group": { 20 | "type": "integer", 21 | "minimum": 0, 22 | "maximum": 63 23 | }, 24 | "type": { 25 | "enum": [ "Rect", "Ellipse" ] 26 | }, 27 | "width": { "type": "number" }, 28 | "height": { "type": "number" }, 29 | "angle": { "type": "number" }, 30 | "center_x": { "type": "number" }, 31 | "center_y": { "type": "number" } 32 | }, 33 | "required": ["id","group","type","width","height","angle","center_x","center_y"] 34 | }, 35 | { 36 | "type": "object", 37 | "properties": { 38 | "id": { 39 | "type": "integer", 40 | "minimum": 0, 41 | "maximum": 63 42 | }, 43 | "group": { 44 | "type": "integer", 45 | "minimum": 0, 46 | "maximum": 63 47 | }, 48 | "type": { 49 | "enum": [ "Poly" ] 50 | }, 51 | "points": { 52 | "type": "array", 53 | "items": { 54 | "type": "object", 55 | "properties": { 56 | "x": { "type": "number" }, 57 | "y": { "type": "number" } 58 | } 59 | } 60 | } 61 | }, 62 | "required": ["id","group","type","points"] 63 | } 64 | ] 65 | } 66 | }, 67 | "MultiROIs": { 68 | "type": "array", 69 | "items": { 70 | "type": "object", 71 | "properties": { 72 | "param": { 73 | "type": "object", 74 | "properties": { 75 | "shape": { "enum": ["Rect","Ellipse","Square","Circle","Hexagon"] }, 76 | "cols": {"type": "integer"}, 77 | "rows": {"type": "integer"}, 78 | "gridtype": { "enum": ["Regular"] }, 79 | "spacing": { "type": "number" }, 80 | "width": { "type": "number" }, 81 | "height": { "type": "number" }, 82 | "center_x": { "type": "number" }, 83 | "center_y": { "type": "number" }, 84 | "angle": { "type": "number" } 85 | } 86 | }, 87 | "rois": { 88 | "type": "array", 89 | "items": { 90 | "type": "integer", 91 | "minimum": 0, 92 | "maximum": 63 93 | } 94 | } 95 | } 96 | } 97 | } 98 | } 99 | } -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.2.x/temporal_mean_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx temporal mean filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "NumberOfImages": { 8 | "type": "integer", 9 | "minimum": 2, 10 | "maximum": 25, 11 | "default": 2 12 | } 13 | }, 14 | 15 | "required": [ 16 | "NumberOfImages" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/bilateral_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial bilateral filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | }, 13 | "SigmaPixel": { 14 | "type": "number", 15 | "minimum": 0, 16 | "default": 2, 17 | "attributes": [ "private" ] 18 | }, 19 | "SigmaDistance": { 20 | "type": "number", 21 | "minimum": 0, 22 | "default": 0.1, 23 | "attributes": [ "private" ] 24 | } 25 | }, 26 | 27 | "required": [ 28 | "MaskSize" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/clipping_cuboid.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx clipping cuboid configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Xmin": { 8 | "type": "number", 9 | "default": 0 10 | }, 11 | "Xmax": { 12 | "type": "number", 13 | "default": 0 14 | }, 15 | "Ymin": { 16 | "type": "number", 17 | "default": 0 18 | }, 19 | "Ymax": { 20 | "type": "number", 21 | "default": 0 22 | }, 23 | "Zmin": { 24 | "type": "number", 25 | "default": 0 26 | }, 27 | "Zmax": { 28 | "type": "number", 29 | "default": 0 30 | } 31 | }, 32 | 33 | "required": [ 34 | "XMin", "XMax", "YMin", "YMax", "ZMin", "ZMax" 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/exponential_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx temporal exponential filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MinSmoothDiff": { 8 | "type": "number", 9 | "minimum": 0, 10 | "default": 0.3, 11 | "attributes": [ "private" ] 12 | }, 13 | "MinSDAlpha": { 14 | "type": "number", 15 | "minimum": 0, 16 | "maximum": 1, 17 | "default": 0.2, 18 | "attributes": [ "private" ] 19 | }, 20 | "MaxSmoothDiff": { 21 | "type": "number", 22 | "minimum": 0, 23 | "default": 1, 24 | "attributes": [ "private" ] 25 | }, 26 | "MaxSDAlpha": { 27 | "type": "number", 28 | "minimum": 0, 29 | "maximum": 1, 30 | "default": 0.95, 31 | "attributes": [ "private" ] 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/logic_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Logic Layer format", 4 | "definitions": { 5 | "block": { 6 | "type": "object", 7 | "properties": { 8 | "type": { "type": "string" }, 9 | "properties": { 10 | "type": "object" 11 | } 12 | } 13 | }, 14 | "connector": { 15 | "type": "object", 16 | "properties": { 17 | "src": { "type": "string" }, 18 | "srcEP": { "type": "number" }, 19 | "dst": { "type": "string" }, 20 | "dstEP": {"type": "number" } 21 | }, 22 | "required": ["src", "srcEP","dst","dstEP"] 23 | } 24 | }, 25 | "type": "object", 26 | "properties": { 27 | "blocks": { 28 | "type":"object", 29 | "minProperties": 1, 30 | "additionalProperties": false, 31 | "patternProperties":{ 32 | "^B[0-9]+$": { "$ref": "#/definitions/block" } 33 | } 34 | }, 35 | "connectors": { 36 | "type":"object", 37 | "minProperties": 1, 38 | "additionalProperties": false, 39 | "patternProperties":{ 40 | "^C[0-9]+$": { "$ref": "#/definitions/connector" } 41 | } 42 | }, 43 | "IOMap": { 44 | "type":"object", 45 | "patternProperties": { 46 | "^(OUT1|OUT2|OUT3|IO1|IO2)$": { 47 | "type": "string", 48 | "pattern": "^(NONE|ERRPIN|RFT|AQUFIN|EVAFIN|USEROUT|ANALOG|PCIC|USERIN)$" 49 | } 50 | }, 51 | "additionalProperties": false 52 | } 53 | }, 54 | "required": ["blocks"] 55 | } 56 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/logic_graph_runtime_info.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Logic Layer format", 4 | "type": "object", 5 | "properties": { 6 | "connectors": { 7 | "type":"object", 8 | "patternProperties": { 9 | "^C[0-9]+$": { "type": [ "string", "number", "boolean", "integer" ]} 10 | } 11 | }, 12 | "error": { 13 | "type":"object", 14 | "properties": { 15 | "ErrorCode": {"type": "integer"}, 16 | "ErrorMessage": {"type": "string"} 17 | } 18 | } 19 | }, 20 | "required": ["connectors", "error"] 21 | } 22 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/mean_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial mean filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | } 13 | }, 14 | 15 | "required": [ 16 | "MaskSize" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/median_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial median filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | } 13 | }, 14 | 15 | "required": [ 16 | "MaskSize" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/model.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Model configuration", 4 | "type": "object", 5 | 6 | "oneOf": [ 7 | { "$ref": "model_distance.json" }, 8 | { "$ref": "model_level.json" }, 9 | { "$ref": "model_dimensioning.json" } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/model_dimensioning.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Dimensioning model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Dimensioning", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Dimensioning" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "FlowAngle": { 21 | "type": "number" 22 | }, 23 | "UseFlowAngle": { 24 | "type": "boolean" 25 | }, 26 | "BackgroundTaught": { 27 | "type": "boolean", 28 | "attributes": [ "readonly", "noexport" ] 29 | }, 30 | "ROIs": { 31 | "type": "string", 32 | "attributes": [ "readonly" ] 33 | }, 34 | "ObjectType": { 35 | "type": "integer", 36 | "minimum": 0, 37 | "maximum": 1 38 | }, 39 | "TeachData": { 40 | "type": "string", 41 | "attributes": [ "private", "noexport" ] 42 | }, 43 | "TeachROI": { 44 | "type": "string", 45 | "attributes": [ "private", "noexport" ] 46 | } 47 | }, 48 | 49 | "required": [ 50 | "Name", "Type", "FlowAngle", "UseFlowAngle", "ObjectType" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/model_distance.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Distance model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Distance", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Distance" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "SwitchPoint1": { 24 | "type": "number" 25 | }, 26 | "SwitchPoint2": { 27 | "type": "number" 28 | }, 29 | "ValueOfBenefit": { 30 | "type": "integer", 31 | "minimum": 0, 32 | "maximum": 2, 33 | "default": 0 34 | }, 35 | "UseAnchorTracking": { 36 | "type": "boolean", 37 | "default": false 38 | }, 39 | "HasAnchorTeachData": { 40 | "type": "boolean", 41 | "attributes": [ "readonly" ] 42 | }, 43 | "AnchorData": { 44 | "type": "string", 45 | "attributes": [ "private", "noexport" ] 46 | } 47 | }, 48 | 49 | "required": [ 50 | "Name", "Type", "ROIs", "SwitchPoint1", "SwitchPoint2", "ValueOfBenefit" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/model_level.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Level model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Level", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Level" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "PrivateBackgroundType": { 24 | "type": "string", 25 | "enum": [ "undefined", "fixed", "taught" ], 26 | "default": "undefined", 27 | "attributes": [ "private", "noexport" ] 28 | }, 29 | "BackgroundType": { 30 | "type": "string", 31 | "enum": [ "undefined", "fixed", "taught" ], 32 | "attributes": [ "readonly" ] 33 | }, 34 | "BackgroundFixed": { 35 | "type": "number" 36 | }, 37 | "SwitchPoint1": { 38 | "type": "number" 39 | }, 40 | "SwitchPoint2": { 41 | "type": "number" 42 | }, 43 | "ValueOfBenefit": { 44 | "type": "integer", 45 | "minimum": 0, 46 | "maximum": 2, 47 | "default": 0 48 | }, 49 | "UseAnchorTracking": { 50 | "type": "boolean", 51 | "default": false 52 | }, 53 | "HasAnchorTeachData": { 54 | "type": "boolean", 55 | "attributes": [ "readonly" ] 56 | }, 57 | "TeachData": { 58 | "type": "string", 59 | "attributes": [ "private", "noexport" ] 60 | }, 61 | "AnchorData": { 62 | "type": "string", 63 | "attributes": [ "private", "noexport" ] 64 | }, 65 | "CompletenessData": { 66 | "type": "string", 67 | "attributes": [ "private" ] 68 | } 69 | }, 70 | 71 | "required": [ 72 | "Name", "Type", "ROIs", "BackgroundType", "BackgroundFixed", "SwitchPoint1", "SwitchPoint2", "ValueOfBenefit" 73 | ] 74 | } 75 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/network.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx network configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "StaticIPv4Address": { 8 | "type": "string", 9 | "format": "ipv4", 10 | "default": "192.168.0.69" 11 | }, 12 | "StaticIPv4SubNetMask": { 13 | "type": "string", 14 | "format": "ipv4", 15 | "default": "255.255.255.0" 16 | }, 17 | "StaticIPv4Gateway": { 18 | "type": "string", 19 | "format": "ipv4", 20 | "default": "192.168.0.201" 21 | }, 22 | "UseDHCP": { 23 | "type": "boolean", 24 | "default": false 25 | }, 26 | "NetworkSpeed": { 27 | "type": "integer", 28 | "minimum": 0, 29 | "maximum": 0, 30 | "default": 0 31 | }, 32 | "MACAddress": { 33 | "type": "string", 34 | "pattern": "^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$", 35 | "attributes": [ "readonly" ] 36 | } 37 | }, 38 | 39 | "required": [ 40 | "StaticIPv4Address", "StaticIPv4SubNetMask", "StaticIPv4Gateway", 41 | "UseDHCP" 42 | ] 43 | } -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/o3d3xx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx complete configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Device": { 8 | "$ref": "device.json" 9 | }, 10 | "Network": { 11 | "$ref": "network.json" 12 | }, 13 | "Applications": { 14 | "type": "array", 15 | "items": { 16 | "oneOf": [ { "$ref": "application.json" }, { "type": "null" } ] 17 | }, 18 | "minItems": 32, 19 | "maxItems": 32 20 | }, 21 | "Firmware": { 22 | "type": "string" 23 | } 24 | }, 25 | 26 | "required": [ "Device", "Network", "Applications", "Firmware" ] 27 | } 28 | 29 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/roi.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema#", 3 | "title": "O3D3xx ROI format", 4 | "type": "object", 5 | 6 | "properties": { 7 | "ROIs": { 8 | "type": "array", 9 | "items": { 10 | "oneOf": [ 11 | { 12 | "type": "object", 13 | "properties": { 14 | "id": { 15 | "type": "integer", 16 | "minimum": 0, 17 | "maximum": 63 18 | }, 19 | "group": { 20 | "type": "integer", 21 | "minimum": 0, 22 | "maximum": 63 23 | }, 24 | "type": { 25 | "enum": [ "Rect", "Ellipse" ] 26 | }, 27 | "width": { "type": "number" }, 28 | "height": { "type": "number" }, 29 | "angle": { "type": "number" }, 30 | "center_x": { "type": "number" }, 31 | "center_y": { "type": "number" } 32 | }, 33 | "required": ["id","group","type","width","height","angle","center_x","center_y"] 34 | }, 35 | { 36 | "type": "object", 37 | "properties": { 38 | "id": { 39 | "type": "integer", 40 | "minimum": 0, 41 | "maximum": 63 42 | }, 43 | "group": { 44 | "type": "integer", 45 | "minimum": 0, 46 | "maximum": 63 47 | }, 48 | "type": { 49 | "enum": [ "Poly" ] 50 | }, 51 | "points": { 52 | "type": "array", 53 | "items": { 54 | "type": "object", 55 | "properties": { 56 | "x": { "type": "number" }, 57 | "y": { "type": "number" } 58 | } 59 | } 60 | } 61 | }, 62 | "required": ["id","group","type","points"] 63 | } 64 | ] 65 | } 66 | }, 67 | "MultiROIs": { 68 | "type": "array", 69 | "items": { 70 | "type": "object", 71 | "properties": { 72 | "param": { 73 | "type": "object", 74 | "properties": { 75 | "shape": { "enum": ["Rect","Ellipse","Square","Circle","Hexagon"] }, 76 | "cols": {"type": "integer"}, 77 | "rows": {"type": "integer"}, 78 | "gridtype": { "enum": ["Regular"] }, 79 | "spacing": { "type": "number" }, 80 | "width": { "type": "number" }, 81 | "height": { "type": "number" }, 82 | "center_x": { "type": "number" }, 83 | "center_y": { "type": "number" }, 84 | "angle": { "type": "number" } 85 | } 86 | }, 87 | "rois": { 88 | "type": "array", 89 | "items": { 90 | "type": "integer", 91 | "minimum": 0, 92 | "maximum": 63 93 | } 94 | } 95 | } 96 | } 97 | } 98 | } 99 | } -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.3.x/temporal_mean_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx temporal mean filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "NumberOfImages": { 8 | "type": "integer", 9 | "minimum": 2, 10 | "maximum": 25, 11 | "default": 2 12 | } 13 | }, 14 | 15 | "required": [ 16 | "NumberOfImages" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/bilateral_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial bilateral filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | }, 13 | "SigmaPixel": { 14 | "type": "number", 15 | "minimum": 0, 16 | "default": 2, 17 | "attributes": [ "private" ] 18 | }, 19 | "SigmaDistance": { 20 | "type": "number", 21 | "minimum": 0, 22 | "default": 0.1, 23 | "attributes": [ "private" ] 24 | } 25 | }, 26 | 27 | "required": [ 28 | "MaskSize" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/clipping_cuboid.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx clipping cuboid configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "XMin": { 8 | "type": "number" 9 | }, 10 | "XMax": { 11 | "type": "number" 12 | }, 13 | "YMin": { 14 | "type": "number" 15 | }, 16 | "YMax": { 17 | "type": "number" 18 | }, 19 | "ZMin": { 20 | "type": "number" 21 | }, 22 | "ZMax": { 23 | "type": "number" 24 | } 25 | }, 26 | 27 | "required": [ 28 | "XMin", "XMax", "YMin", "YMax", "ZMin", "ZMax" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/exponential_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx temporal exponential filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MinSmoothDiff": { 8 | "type": "number", 9 | "minimum": 0, 10 | "default": 0.3, 11 | "attributes": [ "private" ] 12 | }, 13 | "MinSDAlpha": { 14 | "type": "number", 15 | "minimum": 0, 16 | "maximum": 1, 17 | "default": 0.2, 18 | "attributes": [ "private" ] 19 | }, 20 | "MaxSmoothDiff": { 21 | "type": "number", 22 | "minimum": 0, 23 | "default": 1, 24 | "attributes": [ "private" ] 25 | }, 26 | "MaxSDAlpha": { 27 | "type": "number", 28 | "minimum": 0, 29 | "maximum": 1, 30 | "default": 0.95, 31 | "attributes": [ "private" ] 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/logic_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Logic Layer format", 4 | "definitions": { 5 | "block": { 6 | "type": "object", 7 | "properties": { 8 | "type": { "type": "string" }, 9 | "properties": { 10 | "type": "object" 11 | } 12 | } 13 | }, 14 | "connector": { 15 | "type": "object", 16 | "properties": { 17 | "src": { "type": "string" }, 18 | "srcEP": { "type": "number" }, 19 | "dst": { "type": "string" }, 20 | "dstEP": {"type": "number" } 21 | }, 22 | "required": ["src", "srcEP","dst","dstEP"] 23 | } 24 | }, 25 | "type": "object", 26 | "properties": { 27 | "blocks": { 28 | "type":"object", 29 | "minProperties": 1, 30 | "additionalProperties": false, 31 | "patternProperties":{ 32 | "^B[0-9]+$": { "$ref": "#/definitions/block" } 33 | } 34 | }, 35 | "connectors": { 36 | "type":"object", 37 | "minProperties": 1, 38 | "additionalProperties": false, 39 | "patternProperties":{ 40 | "^C[0-9]+$": { "$ref": "#/definitions/connector" } 41 | } 42 | }, 43 | "IOMap": { 44 | "type":"object", 45 | "patternProperties": { 46 | "^(OUT1|OUT2|OUT3|IO1|IO2)$": { 47 | "type": "string", 48 | "pattern": "^(NONE|ERRPIN|RFT|AQUFIN|EVAFIN|USEROUT|ANALOG|PCIC|USERIN)$" 49 | } 50 | }, 51 | "additionalProperties": false 52 | } 53 | }, 54 | "required": ["blocks"] 55 | } 56 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/logic_graph_runtime_info.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Logic Layer format", 4 | "type": "object", 5 | "properties": { 6 | "connectors": { 7 | "type":"object", 8 | "patternProperties": { 9 | "^C[0-9]+$": { "type": [ "string", "number", "boolean", "integer" ]} 10 | } 11 | }, 12 | "error": { 13 | "type":"object", 14 | "properties": { 15 | "ErrorCode": {"type": "integer"}, 16 | "ErrorMessage": {"type": "string"} 17 | } 18 | } 19 | }, 20 | "required": ["connectors", "error"] 21 | } 22 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/mean_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial mean filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | } 13 | }, 14 | 15 | "required": [ 16 | "MaskSize" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/median_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial median filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | } 13 | }, 14 | 15 | "required": [ 16 | "MaskSize" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/model.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Model configuration", 4 | "type": "object", 5 | 6 | "oneOf": [ 7 | { "$ref": "model_distance.json" }, 8 | { "$ref": "model_level.json" }, 9 | { "$ref": "model_volume.json" }, 10 | { "$ref": "model_dimensioning.json" } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/model_dimensioning.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Dimensioning model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Dimensioning", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Dimensioning" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "FlowAngle": { 21 | "type": "number" 22 | }, 23 | "UseFlowAngle": { 24 | "type": "boolean" 25 | }, 26 | "BackgroundTaught": { 27 | "type": "boolean", 28 | "attributes": [ "readonly", "noexport" ] 29 | }, 30 | "ROIs": { 31 | "type": "string", 32 | "attributes": [ "readonly" ] 33 | }, 34 | "ObjectType": { 35 | "type": "integer", 36 | "minimum": 0, 37 | "maximum": 1 38 | }, 39 | "TeachData": { 40 | "type": "string", 41 | "attributes": [ "private", "noexport" ] 42 | }, 43 | "TeachROI": { 44 | "type": "string", 45 | "attributes": [ "private", "noexport" ] 46 | } 47 | }, 48 | 49 | "required": [ 50 | "Name", "Type", "FlowAngle", "UseFlowAngle", "ObjectType" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/model_distance.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Distance model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Distance", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Distance" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "SwitchPoint1": { 24 | "type": "number" 25 | }, 26 | "SwitchPoint2": { 27 | "type": "number" 28 | }, 29 | "ValueOfBenefit": { 30 | "type": "integer", 31 | "minimum": 0, 32 | "maximum": 2, 33 | "default": 0 34 | }, 35 | "UseAnchorTracking": { 36 | "type": "boolean", 37 | "default": false 38 | }, 39 | "HasAnchorTeachData": { 40 | "type": "boolean", 41 | "attributes": [ "readonly" ] 42 | }, 43 | "AnchorData": { 44 | "type": "string", 45 | "attributes": [ "private", "noexport" ] 46 | } 47 | }, 48 | 49 | "required": [ 50 | "Name", "Type", "ROIs", "SwitchPoint1", "SwitchPoint2", "ValueOfBenefit" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/model_level.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Level model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Level", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Level" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "PrivateBackgroundType": { 24 | "type": "string", 25 | "enum": [ "undefined", "fixed", "taught" ], 26 | "default": "undefined", 27 | "attributes": [ "private", "noexport" ] 28 | }, 29 | "BackgroundType": { 30 | "type": "string", 31 | "enum": [ "undefined", "fixed", "taught" ], 32 | "attributes": [ "readonly" ] 33 | }, 34 | "BackgroundFixed": { 35 | "type": "number" 36 | }, 37 | "SwitchPoint1": { 38 | "type": "number" 39 | }, 40 | "SwitchPoint2": { 41 | "type": "number" 42 | }, 43 | "ValueOfBenefit": { 44 | "type": "integer", 45 | "minimum": 0, 46 | "maximum": 2, 47 | "default": 0 48 | }, 49 | "UseAnchorTracking": { 50 | "type": "boolean", 51 | "default": false 52 | }, 53 | "HasAnchorTeachData": { 54 | "type": "boolean", 55 | "attributes": [ "readonly" ] 56 | }, 57 | "TeachData": { 58 | "type": "string", 59 | "attributes": [ "private", "noexport" ] 60 | }, 61 | "AnchorData": { 62 | "type": "string", 63 | "attributes": [ "private", "noexport" ] 64 | }, 65 | "UseMotionOptimization": { 66 | "type": "boolean", 67 | "default": false 68 | }, 69 | "CompletenessData": { 70 | "type": "string", 71 | "attributes": [ "private" ] 72 | } 73 | }, 74 | 75 | "required": [ 76 | "Name", "Type", "ROIs", "BackgroundType", "BackgroundFixed", "SwitchPoint1", "SwitchPoint2", "ValueOfBenefit" 77 | ] 78 | } 79 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/model_volume.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Volume model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Volume", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Volume" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "PrivateBackgroundType": { 24 | "type": "string", 25 | "enum": [ "undefined", "fixed", "taught" ], 26 | "default": "undefined", 27 | "attributes": [ "private", "noexport" ] 28 | }, 29 | "BackgroundType": { 30 | "type": "string", 31 | "enum": [ "undefined", "fixed", "taught" ], 32 | "attributes": [ "readonly" ] 33 | }, 34 | "BackgroundFixed": { 35 | "type": "number" 36 | }, 37 | "SwitchPoint1": { 38 | "type": "number" 39 | }, 40 | "SwitchPoint2": { 41 | "type": "number" 42 | }, 43 | "PrivateReferenceVolumeType": { 44 | "type": "string", 45 | "enum": [ "undefined", "fixed", "taught" ], 46 | "default": "undefined", 47 | "attributes": [ "private", "noexport" ] 48 | }, 49 | "ReferenceVolumeType": { 50 | "type": "string", 51 | "enum": [ "undefined", "fixed", "taught" ], 52 | "attributes": [ "readonly" ] 53 | }, 54 | "ReferenceVolumeFixed": { 55 | "type": "number" 56 | }, 57 | "UseRelativeVolume": { 58 | "type": "boolean", 59 | "default": false 60 | }, 61 | "AllowNegativeVolumes": { 62 | "type": "boolean", 63 | "default": true 64 | }, 65 | "UseAnchorTracking": { 66 | "type": "boolean", 67 | "default": false 68 | }, 69 | "HasAnchorTeachData": { 70 | "type": "boolean", 71 | "attributes": [ "readonly" ] 72 | }, 73 | "TeachData": { 74 | "type": "string", 75 | "attributes": [ "private", "noexport" ] 76 | }, 77 | "AnchorData": { 78 | "type": "string", 79 | "attributes": [ "private", "noexport" ] 80 | }, 81 | "UseMotionOptimization": { 82 | "type": "boolean", 83 | "default": false 84 | }, 85 | "CompletenessData": { 86 | "type": "string", 87 | "attributes": [ "private" ] 88 | } 89 | }, 90 | 91 | "required": [ 92 | "Name", "Type", "ROIs", "BackgroundType", "BackgroundFixed" 93 | ] 94 | } 95 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/network.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx network configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "StaticIPv4Address": { 8 | "type": "string", 9 | "format": "ipv4", 10 | "default": "192.168.0.69" 11 | }, 12 | "StaticIPv4SubNetMask": { 13 | "type": "string", 14 | "format": "ipv4", 15 | "default": "255.255.255.0" 16 | }, 17 | "StaticIPv4Gateway": { 18 | "type": "string", 19 | "format": "ipv4", 20 | "default": "192.168.0.201" 21 | }, 22 | "UseDHCP": { 23 | "type": "boolean", 24 | "default": false 25 | }, 26 | "NetworkSpeed": { 27 | "type": "integer", 28 | "minimum": 0, 29 | "maximum": 0, 30 | "default": 0 31 | }, 32 | "MACAddress": { 33 | "type": "string", 34 | "pattern": "^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$", 35 | "attributes": [ "readonly" ] 36 | } 37 | }, 38 | 39 | "required": [ 40 | "StaticIPv4Address", "StaticIPv4SubNetMask", "StaticIPv4Gateway", 41 | "UseDHCP" 42 | ] 43 | } -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/o3d3xx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx complete configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Device": { 8 | "$ref": "device.json" 9 | }, 10 | "Network": { 11 | "$ref": "network.json" 12 | }, 13 | "Applications": { 14 | "type": "array", 15 | "items": { 16 | "oneOf": [ { "$ref": "application.json" }, { "type": "null" } ] 17 | }, 18 | "minItems": 32, 19 | "maxItems": 32 20 | }, 21 | 22 | "Firmware": { 23 | "type": "string", 24 | "pattern": "[0-9]+\\.[0-9]+\\.[0-9]+" 25 | }, 26 | 27 | "SchemaVersion" : { "type" : "integer" } 28 | }, 29 | 30 | "required": [ "Device", "Network", "Applications", "Firmware" ] 31 | } 32 | 33 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/roi.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema#", 3 | "title": "O3D3xx ROI format", 4 | "type": "object", 5 | 6 | "definitions": { 7 | "rect_ellipse": { 8 | "type": "object", 9 | "properties": { 10 | "type": { 11 | "enum": [ "Rect", "Ellipse" ] 12 | }, 13 | "width": { "type": "number" }, 14 | "height": { "type": "number" }, 15 | "angle": { "type": "number" }, 16 | "center_x": { "type": "number" }, 17 | "center_y": { "type": "number" } 18 | }, 19 | "required": [ "type", "width", "height", "angle", "center_x", "center_y" ] 20 | }, 21 | "poly": { 22 | "type": "object", 23 | "properties": { 24 | "type": { 25 | "enum": [ "Poly" ] 26 | }, 27 | "points": { 28 | "type": "array", 29 | "items": { 30 | "type": "object", 31 | "properties": { 32 | "x": { "type": "number" }, 33 | "y": { "type": "number" } 34 | } 35 | } 36 | } 37 | }, 38 | "required": [ "type", "points" ] 39 | }, 40 | "region": { 41 | "type": "object", 42 | "properties": { 43 | "id": { 44 | "type": "integer", 45 | "minimum": 0, 46 | "maximum": 63 47 | } 48 | }, 49 | "oneOf": [ 50 | { "$ref": "#/definitions/rect_ellipse" }, 51 | { "$ref": "#/definitions/poly" } 52 | ], 53 | "required": [ "id" ] 54 | }, 55 | "roi": { 56 | "type": "object", 57 | "allOf": [ 58 | { "$ref": "#/definitions/region" } 59 | ], 60 | "properties": { 61 | "group": { 62 | "type": "integer", 63 | "minimum": 0, 64 | "maximum": 63 65 | } 66 | }, 67 | "required": [ "group" ] 68 | }, 69 | "rod": { 70 | "allOf": [ 71 | { "$ref": "#/definitions/region" } 72 | ] 73 | } 74 | }, 75 | 76 | "properties": { 77 | "ROIs": { 78 | "type": "array", 79 | "items": { 80 | "allOf": [ 81 | { "$ref": "#/definitions/roi" } 82 | ] 83 | } 84 | }, 85 | "RODs": { 86 | "type": "array", 87 | "items": { 88 | "allOf": [ 89 | { "$ref": "#/definitions/rod" } 90 | ] 91 | } 92 | } 93 | } 94 | } 95 | 96 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.5.698/temporal_mean_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx temporal mean filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "NumberOfImages": { 8 | "type": "integer", 9 | "minimum": 2, 10 | "maximum": 25, 11 | "default": 2 12 | } 13 | }, 14 | 15 | "required": [ 16 | "NumberOfImages" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/bilateral_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial bilateral filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | }, 13 | "SigmaPixel": { 14 | "type": "number", 15 | "minimum": 0, 16 | "default": 2, 17 | "attributes": [ "private" ] 18 | }, 19 | "SigmaDistance": { 20 | "type": "number", 21 | "minimum": 0, 22 | "default": 0.1, 23 | "attributes": [ "private" ] 24 | } 25 | }, 26 | 27 | "required": [ 28 | "MaskSize" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/clipping_cuboid.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx clipping cuboid configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "XMin": { 8 | "type": "number" 9 | }, 10 | "XMax": { 11 | "type": "number" 12 | }, 13 | "YMin": { 14 | "type": "number" 15 | }, 16 | "YMax": { 17 | "type": "number" 18 | }, 19 | "ZMin": { 20 | "type": "number" 21 | }, 22 | "ZMax": { 23 | "type": "number" 24 | } 25 | }, 26 | 27 | "required": [ 28 | "XMin", "XMax", "YMin", "YMax", "ZMin", "ZMax" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/exponential_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx temporal exponential filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MinSmoothDiff": { 8 | "type": "number", 9 | "minimum": 0, 10 | "default": 0.3, 11 | "attributes": [ "private" ] 12 | }, 13 | "MinSDAlpha": { 14 | "type": "number", 15 | "minimum": 0, 16 | "maximum": 1, 17 | "default": 0.2, 18 | "attributes": [ "private" ] 19 | }, 20 | "MaxSmoothDiff": { 21 | "type": "number", 22 | "minimum": 0, 23 | "default": 1, 24 | "attributes": [ "private" ] 25 | }, 26 | "MaxSDAlpha": { 27 | "type": "number", 28 | "minimum": 0, 29 | "maximum": 1, 30 | "default": 0.95, 31 | "attributes": [ "private" ] 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/logic_graph.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Logic Layer format", 4 | "definitions": { 5 | "block": { 6 | "type": "object", 7 | "properties": { 8 | "type": { "type": "string" }, 9 | "properties": { 10 | "type": "object" 11 | } 12 | } 13 | }, 14 | "connector": { 15 | "type": "object", 16 | "properties": { 17 | "src": { "type": "string" }, 18 | "srcEP": { "type": "number" }, 19 | "dst": { "type": "string" }, 20 | "dstEP": {"type": "number" } 21 | }, 22 | "required": ["src", "srcEP","dst","dstEP"] 23 | } 24 | }, 25 | "type": "object", 26 | "properties": { 27 | "blocks": { 28 | "type":"object", 29 | "minProperties": 1, 30 | "additionalProperties": false, 31 | "patternProperties":{ 32 | "^B[0-9]+$": { "$ref": "#/definitions/block" } 33 | } 34 | }, 35 | "connectors": { 36 | "type":"object", 37 | "minProperties": 1, 38 | "additionalProperties": false, 39 | "patternProperties":{ 40 | "^C[0-9]+$": { "$ref": "#/definitions/connector" } 41 | } 42 | }, 43 | "IOMap": { 44 | "type":"object", 45 | "patternProperties": { 46 | "^(OUT1|OUT2|OUT3|IO1|IO2)$": { 47 | "type": "string", 48 | "pattern": "^(NONE|ERRPIN|RFT|AQUFIN|EVAFIN|USEROUT|ANALOG|PCIC|USERIN)$" 49 | } 50 | }, 51 | "additionalProperties": false 52 | } 53 | }, 54 | "required": ["blocks"] 55 | } 56 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/logic_graph_runtime_info.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Logic Layer format", 4 | "type": "object", 5 | "properties": { 6 | "connectors": { 7 | "type":"object", 8 | "patternProperties": { 9 | "^C[0-9]+$": { "type": [ "string", "number", "boolean", "integer" ]} 10 | } 11 | }, 12 | "error": { 13 | "type":"object", 14 | "properties": { 15 | "ErrorCode": {"type": "integer"}, 16 | "ErrorMessage": {"type": "string"} 17 | } 18 | } 19 | }, 20 | "required": ["connectors", "error"] 21 | } 22 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/mean_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial mean filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | } 13 | }, 14 | 15 | "required": [ 16 | "MaskSize" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/median_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx spatial median filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "MaskSize": { 8 | "type": "integer", 9 | "minimum": 0, 10 | "maximum": 1, 11 | "default": 0 12 | } 13 | }, 14 | 15 | "required": [ 16 | "MaskSize" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/model.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Model configuration", 4 | "type": "object", 5 | 6 | "oneOf": [ 7 | { "$ref": "model_distance.json" }, 8 | { "$ref": "model_level.json" }, 9 | { "$ref": "model_volume.json" }, 10 | { "$ref": "model_dimensioning.json" } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/model_dimensioning.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Dimensioning model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Dimensioning", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Dimensioning" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "FlowAngle": { 21 | "type": "number" 22 | }, 23 | "UseFlowAngle": { 24 | "type": "boolean" 25 | }, 26 | "BackgroundTaught": { 27 | "type": "boolean", 28 | "attributes": [ "readonly", "noexport" ] 29 | }, 30 | "ROIs": { 31 | "type": "string", 32 | "attributes": [ "readonly" ] 33 | }, 34 | "ObjectType": { 35 | "type": "integer", 36 | "minimum": 0, 37 | "maximum": 1 38 | }, 39 | "TeachData": { 40 | "type": "string", 41 | "attributes": [ "private", "noexport" ] 42 | }, 43 | "TeachROI": { 44 | "type": "string", 45 | "attributes": [ "private", "noexport" ] 46 | } 47 | }, 48 | 49 | "required": [ 50 | "Name", "Type", "FlowAngle", "UseFlowAngle", "ObjectType" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/model_distance.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Distance model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Distance", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Distance" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "SwitchPoint1": { 24 | "type": "number" 25 | }, 26 | "SwitchPoint2": { 27 | "type": "number" 28 | }, 29 | "ValueOfBenefit": { 30 | "type": "integer", 31 | "minimum": 0, 32 | "maximum": 2, 33 | "default": 0 34 | }, 35 | "UseAnchorTracking": { 36 | "type": "boolean", 37 | "default": false 38 | }, 39 | "HasAnchorTeachData": { 40 | "type": "boolean", 41 | "attributes": [ "readonly" ] 42 | }, 43 | "AnchorData": { 44 | "type": "string", 45 | "attributes": [ "private", "noexport" ] 46 | } 47 | }, 48 | 49 | "required": [ 50 | "Name", "Type", "ROIs", "SwitchPoint1", "SwitchPoint2", "ValueOfBenefit" 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/model_level.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Level model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Level", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Level" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "PrivateBackgroundType": { 24 | "type": "string", 25 | "enum": [ "undefined", "fixed", "taught" ], 26 | "default": "undefined", 27 | "attributes": [ "private", "noexport" ] 28 | }, 29 | "BackgroundType": { 30 | "type": "string", 31 | "enum": [ "undefined", "fixed", "taught" ], 32 | "attributes": [ "readonly" ] 33 | }, 34 | "BackgroundFixed": { 35 | "type": "number" 36 | }, 37 | "SwitchPoint1": { 38 | "type": "number" 39 | }, 40 | "SwitchPoint2": { 41 | "type": "number" 42 | }, 43 | "ValueOfBenefit": { 44 | "type": "integer", 45 | "minimum": 0, 46 | "maximum": 2, 47 | "default": 0 48 | }, 49 | "UseAnchorTracking": { 50 | "type": "boolean", 51 | "default": false 52 | }, 53 | "HasAnchorTeachData": { 54 | "type": "boolean", 55 | "attributes": [ "readonly" ] 56 | }, 57 | "TeachData": { 58 | "type": "string", 59 | "attributes": [ "private", "noexport" ] 60 | }, 61 | "AnchorData": { 62 | "type": "string", 63 | "attributes": [ "private", "noexport" ] 64 | }, 65 | "UseMotionOptimization": { 66 | "type": "boolean", 67 | "default": false 68 | }, 69 | "CompletenessData": { 70 | "type": "string", 71 | "attributes": [ "private" ] 72 | } 73 | }, 74 | 75 | "required": [ 76 | "Name", "Type", "ROIs", "BackgroundType", "BackgroundFixed", "SwitchPoint1", "SwitchPoint2", "ValueOfBenefit" 77 | ] 78 | } 79 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/model_volume.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx Volume model configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Name": { 8 | "type": "string" 9 | }, 10 | "PrivateType": { 11 | "type": "string", 12 | "default": "Volume", 13 | "attributes": [ "private", "noexport" ] 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "enum": [ "Volume" ], 18 | "attributes": [ "readonly" ] 19 | }, 20 | "ROIs": { 21 | "type": "string" 22 | }, 23 | "PrivateBackgroundType": { 24 | "type": "string", 25 | "enum": [ "undefined", "fixed", "taught" ], 26 | "default": "undefined", 27 | "attributes": [ "private", "noexport" ] 28 | }, 29 | "BackgroundType": { 30 | "type": "string", 31 | "enum": [ "undefined", "fixed", "taught" ], 32 | "attributes": [ "readonly" ] 33 | }, 34 | "BackgroundFixed": { 35 | "type": "number" 36 | }, 37 | "SwitchPoint1": { 38 | "type": "number" 39 | }, 40 | "SwitchPoint2": { 41 | "type": "number" 42 | }, 43 | "PrivateReferenceVolumeType": { 44 | "type": "string", 45 | "enum": [ "undefined", "fixed", "taught" ], 46 | "default": "undefined", 47 | "attributes": [ "private", "noexport" ] 48 | }, 49 | "ReferenceVolumeType": { 50 | "type": "string", 51 | "enum": [ "undefined", "fixed", "taught" ], 52 | "attributes": [ "readonly" ] 53 | }, 54 | "ReferenceVolumeFixed": { 55 | "type": "number" 56 | }, 57 | "UseRelativeVolume": { 58 | "type": "boolean", 59 | "default": false 60 | }, 61 | "AllowNegativeVolumes": { 62 | "type": "boolean", 63 | "default": true 64 | }, 65 | "UseAnchorTracking": { 66 | "type": "boolean", 67 | "default": false 68 | }, 69 | "HasAnchorTeachData": { 70 | "type": "boolean", 71 | "attributes": [ "readonly" ] 72 | }, 73 | "TeachData": { 74 | "type": "string", 75 | "attributes": [ "private", "noexport" ] 76 | }, 77 | "AnchorData": { 78 | "type": "string", 79 | "attributes": [ "private", "noexport" ] 80 | }, 81 | "UseMotionOptimization": { 82 | "type": "boolean", 83 | "default": false 84 | }, 85 | "CompletenessData": { 86 | "type": "string", 87 | "attributes": [ "private" ] 88 | } 89 | }, 90 | 91 | "required": [ 92 | "Name", "Type", "ROIs", "BackgroundType", "BackgroundFixed" 93 | ] 94 | } 95 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/network.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx network configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "StaticIPv4Address": { 8 | "type": "string", 9 | "format": "ipv4", 10 | "default": "192.168.0.69" 11 | }, 12 | "StaticIPv4SubNetMask": { 13 | "type": "string", 14 | "format": "ipv4", 15 | "default": "255.255.255.0" 16 | }, 17 | "StaticIPv4Gateway": { 18 | "type": "string", 19 | "format": "ipv4", 20 | "default": "192.168.0.201" 21 | }, 22 | "UseDHCP": { 23 | "type": "boolean", 24 | "default": false 25 | }, 26 | "NetworkSpeed": { 27 | "type": "integer", 28 | "minimum": 0, 29 | "maximum": 0, 30 | "default": 0 31 | }, 32 | "MACAddress": { 33 | "type": "string", 34 | "pattern": "^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$", 35 | "attributes": [ "readonly" ] 36 | } 37 | }, 38 | 39 | "required": [ 40 | "StaticIPv4Address", "StaticIPv4SubNetMask", "StaticIPv4Gateway", 41 | "UseDHCP" 42 | ] 43 | } -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/o3d3xx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx complete configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "Device": { 8 | "$ref": "device.json" 9 | }, 10 | "Network": { 11 | "$ref": "network.json" 12 | }, 13 | "Applications": { 14 | "type": "array", 15 | "items": { 16 | "oneOf": [ { "$ref": "application.json" }, { "type": "null" } ] 17 | }, 18 | "minItems": 32, 19 | "maxItems": 32 20 | }, 21 | 22 | "Firmware": { 23 | "type": "string", 24 | "pattern": "[0-9]+\\.[0-9]+\\.[0-9]+" 25 | }, 26 | 27 | "SchemaVersion" : { "type" : "integer" } 28 | }, 29 | 30 | "required": [ "Device", "Network", "Applications", "Firmware" ] 31 | } 32 | 33 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/roi.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/schema#", 3 | "title": "O3D3xx ROI format", 4 | "type": "object", 5 | 6 | "definitions": { 7 | "rect_ellipse": { 8 | "type": "object", 9 | "properties": { 10 | "type": { 11 | "enum": [ "Rect", "Ellipse" ] 12 | }, 13 | "width": { "type": "number" }, 14 | "height": { "type": "number" }, 15 | "angle": { "type": "number" }, 16 | "center_x": { "type": "number" }, 17 | "center_y": { "type": "number" } 18 | }, 19 | "required": [ "type", "width", "height", "angle", "center_x", "center_y" ] 20 | }, 21 | "poly": { 22 | "type": "object", 23 | "properties": { 24 | "type": { 25 | "enum": [ "Poly" ] 26 | }, 27 | "points": { 28 | "type": "array", 29 | "items": { 30 | "type": "object", 31 | "properties": { 32 | "x": { "type": "number" }, 33 | "y": { "type": "number" } 34 | } 35 | } 36 | } 37 | }, 38 | "required": [ "type", "points" ] 39 | }, 40 | "region": { 41 | "type": "object", 42 | "properties": { 43 | "id": { 44 | "type": "integer", 45 | "minimum": 0, 46 | "maximum": 63 47 | } 48 | }, 49 | "oneOf": [ 50 | { "$ref": "#/definitions/rect_ellipse" }, 51 | { "$ref": "#/definitions/poly" } 52 | ], 53 | "required": [ "id" ] 54 | }, 55 | "roi": { 56 | "type": "object", 57 | "allOf": [ 58 | { "$ref": "#/definitions/region" } 59 | ], 60 | "properties": { 61 | "group": { 62 | "type": "integer", 63 | "minimum": 0, 64 | "maximum": 63 65 | } 66 | }, 67 | "required": [ "group" ] 68 | }, 69 | "rod": { 70 | "allOf": [ 71 | { "$ref": "#/definitions/region" } 72 | ] 73 | } 74 | }, 75 | 76 | "properties": { 77 | "ROIs": { 78 | "type": "array", 79 | "items": { 80 | "allOf": [ 81 | { "$ref": "#/definitions/roi" } 82 | ] 83 | } 84 | }, 85 | "RODs": { 86 | "type": "array", 87 | "items": { 88 | "allOf": [ 89 | { "$ref": "#/definitions/rod" } 90 | ] 91 | } 92 | } 93 | } 94 | } 95 | 96 | -------------------------------------------------------------------------------- /doc/json/JSON-schema-1.6.x/temporal_mean_filter.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "title": "O3D3xx temporal mean filter configuration", 4 | "type": "object", 5 | 6 | "properties": { 7 | "NumberOfImages": { 8 | "type": "integer", 9 | "minimum": 2, 10 | "maximum": 25, 11 | "default": 2 12 | } 13 | }, 14 | 15 | "required": [ 16 | "NumberOfImages" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /doc/pcic_async_errors.md: -------------------------------------------------------------------------------- 1 | |Code-ID |Error| 2 | |--------|-----| 3 | |100000001| Maximum number of connections exceeded | 4 | |100000002| Internal failure during a D-Bus call| 5 | |100000003| Unspecified internal error| 6 | |100000004| Generic invalid parameter| 7 | |100000005| Invalid command| 8 | |100001000| Application configuration does not allow PCIC trigger| 9 | |100001001| Video mode does not allow PCIC trigger| 10 | |100001002| There is no application configured| 11 | |100001003| Invalid image id in I? Command| 12 | |100001004| Invalid pin id in o/O? Command| 13 | |100001005| Invalid pin configuration in o/O? Command | 14 | |100001006| Invalid conversion type selected| 15 | |100001007| No trigger was run yet| 16 | |110001001| Boot timeout| 17 | |110001002| Fatal software error| 18 | |110001003| Unknown hardware| 19 | |100001004| Invalid pin id in o/O? Command| 20 | |100001005| Invalid pin configuration in o/O? Command| 21 | |110001006| Trigger overrun| 22 | |110002000| Short circuit on Ready for Trigger| 23 | |110002001| Short circuit on OUT1| 24 | |110002002| Short circuit on OUT2| 25 | |110002003| Reverse feeding| 26 | |110003000| Vled over voltage| 27 | |110003001| Vled under voltage| 28 | |110003002| Vmod over voltage| 29 | |110003003| Vmod under voltage| 30 | |110003004| Mainboard over voltage| 31 | |110003005| Mainboard under voltage| 32 | |110003006| Supply over voltage| 33 | |110003007| Supply under voltage| 34 | |110003008| VFEMon alarm| 35 | |110003009| PMIC supply alarm| 36 | |110004000| Illumination over temperature| 37 | -------------------------------------------------------------------------------- /firmware/README.md: -------------------------------------------------------------------------------- 1 | The firmware files have been moved to the 2 | [o3d3xx-firmware](https://github.com/lovepark/o3d3xx-firmware) repository. -------------------------------------------------------------------------------- /modules/camera/include/o3d3xx_camera.h: -------------------------------------------------------------------------------- 1 | // -*- c++ -*- 2 | /* 3 | * Copyright (C) 2016 Love Park Robotics, LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distribted on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef __O3D3XX_CAMERA_MODULE_H__ 19 | #define __O3D3XX_CAMERA_MODULE_H__ 20 | 21 | #include "o3d3xx_camera/version.h" 22 | #include "o3d3xx_camera/err.h" 23 | #include "o3d3xx_camera/util.h" 24 | #include "o3d3xx_camera/cmdline_opts.h" 25 | #include "o3d3xx_camera/device_config.h" 26 | #include "o3d3xx_camera/net_config.h" 27 | #include "o3d3xx_camera/app_config.h" 28 | #include "o3d3xx_camera/spatial_filter_config.h" 29 | #include "o3d3xx_camera/temporal_filter_config.h" 30 | #include "o3d3xx_camera/imager_config.h" 31 | #include "o3d3xx_camera/camera.hpp" 32 | 33 | #endif // __O3D3XX_CAMERA_MODULE_H__ 34 | -------------------------------------------------------------------------------- /modules/camera/include/o3d3xx_camera/cmdline_opts.h: -------------------------------------------------------------------------------- 1 | // -*- c++ -*- 2 | /* 3 | * Copyright (C) 2014 Love Park Robotics, LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distribted on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef __O3D3XX_CMDLINE_OPTS_H__ 18 | #define __O3D3XX_CMDLINE_OPTS_H__ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace po = boost::program_options; 28 | 29 | namespace o3d3xx 30 | { 31 | /** 32 | * Thin wrapper on top of boost::program_options that packages up the command 33 | * line arguments used by the o3d3xx library command line tools. This class 34 | * is desgined for convenience. 35 | */ 36 | class CmdLineOpts 37 | { 38 | public: 39 | CmdLineOpts(const std::string& description); 40 | virtual ~CmdLineOpts() = default; 41 | 42 | // copy and move semantics 43 | CmdLineOpts(CmdLineOpts&&) = delete; 44 | CmdLineOpts& operator=(CmdLineOpts&&) = delete; 45 | CmdLineOpts(CmdLineOpts&) = delete; 46 | CmdLineOpts& operator=(const CmdLineOpts&) = delete; 47 | 48 | /** 49 | * Parses the defined command line options and also processes common 50 | * options like `--help' and `--version'. In the case of processing common 51 | * options it will write messages to the `out' argument. 52 | * 53 | * @param[in] argc Argument count (should come right from `main') 54 | * @param[in] argv Argument vector (should come right from `main') 55 | * @param[out] ip Pointer to a string to fill with the `--ip' arg 56 | * @param[out] xmlrpc_port Pointer to a uint32_t to fill with the 57 | * `--xmlrpc-port' arg 58 | * @param[out] password Point to a string to fill with the password 59 | * @param[in] fn A function that should be run after parsing the common 60 | * arguments but prior to returning. It should be noted that 61 | * this function will only run if the return value of this 62 | * function will be non-zero. Additionally, exceptions from 63 | * this passed in function will be propogated. 64 | * @param[in] out Output stream to write messages to, typically `std::cout' 65 | * 66 | * @return zero if the program should exit upon return (typically becuase 67 | * the user passed in `--help' or `--version' or `> 0' if the program 68 | * should continue processing. 69 | */ 70 | int Parse(int argc, const char **argv, 71 | std::string *ip = nullptr, 72 | std::uint32_t *xmlrpc_port = nullptr, 73 | std::string *password = nullptr, 74 | std::function fn = [](){ o3d3xx::Logging::Init(); }, 75 | std::ostream& out = std::cout); 76 | 77 | // provides raw acess to boost::program_options structures 78 | po::variables_map vm; 79 | po::options_description visible; 80 | 81 | }; // end: class CmdLineOpts 82 | 83 | } // end: namespace o3d3xx 84 | 85 | #endif // __O3D3XX_CMDLINE_OPTS_H__ 86 | -------------------------------------------------------------------------------- /modules/camera/include/o3d3xx_camera/err.h: -------------------------------------------------------------------------------- 1 | // -*- c++ -*- 2 | /* 3 | * Copyright (C) 2014 Love Park Robotics, LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distribted on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef __O3D3XX_ERR_H__ 19 | #define __O3D3XX_ERR_H__ 20 | 21 | #include 22 | 23 | extern const int O3D3XX_NO_ERRORS; 24 | extern const int O3D3XX_XMLRPC_FAILURE; 25 | extern const int O3D3XX_THREAD_INTERRUPTED; 26 | extern const int O3D3XX_IMG_CHUNK_NOT_FOUND; 27 | extern const int O3D3XX_XMLRPC_TIMEOUT; 28 | extern const int O3D3XX_XMLRPC_FINFAIL; 29 | extern const int O3D3XX_XMLRPC_OBJ_NOT_FOUND; 30 | extern const int O3D3XX_XMLRPC_INVALID_PARAM; 31 | extern const int O3D3XX_XMLRPC_INVALID_APPLICATION; 32 | extern const int O3D3XX_XMLRPC_APPLICATION_IN_EDIT_MODE; 33 | extern const int O3D3XX_XMLRPC_TOO_MANY_APPLICATIONS; 34 | extern const int O3D3XX_XMLRPC_NOT_EDITING_APPLICATION; 35 | extern const int O3D3XX_XMLRPC_EDIT_SESSION_ALREADY_ACTIVE; 36 | extern const int O3D3XX_XMLRPC_METHOD_NOT_FOUND; 37 | extern const int O3D3XX_EXPOSURE_TIME_NOT_ACCESSIBLE; 38 | extern const int O3D3XX_XMLRPC_VALUE_OUT_OF_RANGE; 39 | extern const int O3D3XX_IO_ERROR; 40 | extern const int O3D3XX_VALUE_OUT_OF_RANGE; 41 | extern const int O3D3XX_INVALID_ARGUMENT; 42 | extern const int O3D3XX_XMLRPC_EIP; 43 | extern const int O3D3XX_PCIC_BAD_REPLY; 44 | 45 | namespace o3d3xx 46 | { 47 | /** 48 | * @brief Human consumable string for a O3D3XX error 49 | * 50 | * @param[in] errnum The error number to translate into a string 51 | * @return A stringified version of the error 52 | */ 53 | const char *strerror(int errnum); 54 | 55 | /** 56 | * @brief Exception wrapper for library and system errors encountered by the 57 | * library. 58 | */ 59 | class error_t : public std::exception 60 | { 61 | public: 62 | /** 63 | * The ctor simply sets the error value into a local instance variable that 64 | * may be retrieved with a call to code(). 65 | */ 66 | error_t(int errnum); 67 | 68 | /** 69 | * Exception message. 70 | */ 71 | virtual const char *what() const noexcept; 72 | 73 | /** 74 | * Accessor to the underlying sensor error code. 75 | */ 76 | int code() const noexcept; 77 | 78 | private: 79 | /** 80 | * The error code from the sensor that this exception wraps. 81 | */ 82 | int errnum_; 83 | 84 | }; // end: class error_t 85 | 86 | } // end: namespace o3d3xx 87 | 88 | #endif // __O3D3XX_ERR_H__ 89 | -------------------------------------------------------------------------------- /modules/camera/include/o3d3xx_camera/temporal_filter_config.h: -------------------------------------------------------------------------------- 1 | // -*- c++ -*- 2 | /* 3 | * Copyright (C) 2015 Love Park Robotics, LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distribted on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | #ifndef __O3D3XX_TEMPORAL_FILTER_CONFIG_H__ 18 | #define __O3D3XX_TEMPORAL_FILTER_CONFIG_H__ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | namespace o3d3xx 26 | { 27 | /** 28 | * Base class for temporal filters. 29 | */ 30 | class TemporalFilterConfig 31 | { 32 | public: 33 | using Ptr = std::shared_ptr; 34 | TemporalFilterConfig(int type = 0, const std::string& type_str = "Off"); 35 | 36 | /** 37 | * Factory function for instantiating a TemporalFilterConfig instance 38 | * from a JSON string. 39 | * 40 | * @param[in] json A string of json encoding the filter config parameters. 41 | * 42 | * @param[in] filt_ptr A shared pointer to a TemporalFilterConfig to 43 | * bootstrap the default values from. 44 | * 45 | * @return A shared pointer to a TemporalFilterConfig reflecting the passed 46 | * in JSON encoding. 47 | */ 48 | static o3d3xx::TemporalFilterConfig::Ptr 49 | FromJSON(const std::string& json, 50 | o3d3xx::TemporalFilterConfig::Ptr filt_ptr = nullptr); 51 | 52 | /** 53 | * Serializes the current state of the filter confgi to JSON 54 | */ 55 | std::string ToJSON() const; 56 | 57 | // accessor/mutators 58 | int Type() const noexcept; 59 | std::string TypeStr() const noexcept; 60 | 61 | int NumberOfImages() const; 62 | void SetNumberOfImages(int n_imgs); 63 | 64 | protected: 65 | int type_; 66 | std::string type_str_; 67 | int number_of_images_; 68 | 69 | }; // end: class TemporalFilterConfig 70 | 71 | class TemporalMeanFilterConfig : public TemporalFilterConfig 72 | { 73 | public: 74 | using Ptr = std::shared_ptr; 75 | TemporalMeanFilterConfig(); 76 | 77 | }; // end: class TemporalMeanFilterConfig 78 | 79 | class TemporalAdaptiveExponentialFilterConfig : public TemporalFilterConfig 80 | { 81 | public: 82 | using Ptr = std::shared_ptr; 83 | TemporalAdaptiveExponentialFilterConfig(); 84 | 85 | }; // end: class TemporalAdaptiveExponentialFilterConfig 86 | 87 | } // end: namespace o3d3xx 88 | 89 | #endif // __O3D3XX_TEMPORAL_FILTER_CONFIG_H__ 90 | -------------------------------------------------------------------------------- /modules/camera/include/o3d3xx_camera/util.h: -------------------------------------------------------------------------------- 1 | // -*- c++ -*- 2 | /* 3 | * Copyright (C) 2014 Love Park Robotics, LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distribted on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef __O3D3XX_UTIL_H__ 19 | #define __O3D3XX_UTIL_H__ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace o3d3xx 29 | { 30 | /** 31 | * Wrapper to ensure google logging only initializes once. Secondarily, this 32 | * also acts as a very thin abstraction layer over the logging subsystem. 33 | */ 34 | class Logging 35 | { 36 | public: 37 | /** 38 | * Function used to initialize the library's logging subystem. This function 39 | * is thread safe _and_ idempotent. However, it must be called _at least 40 | * once_ prior to writing log messages. 41 | */ 42 | static void Init(); 43 | 44 | private: 45 | /** 46 | * Actually runs the one-time initialization code. 47 | */ 48 | static void _Init(); 49 | 50 | /** 51 | * Flag indicating the initialization state of the logging subsystem. 52 | */ 53 | static std::once_flag init_; 54 | 55 | }; // end: class Logging 56 | 57 | /** 58 | * The function converts an xmlrpc_c::value_struct into a 59 | * std::unordered_map. The assumption is that all keys and values are 60 | * strings. 61 | * 62 | * @param[in] xmlrpc_c::value_struct Structure of strings mapped to strings 63 | * @return std::unordered_map 64 | */ 65 | std::unordered_map const 66 | value_struct_to_map(const xmlrpc_c::value_struct& vs); 67 | 68 | /** 69 | * This function converts an xmlrpc_c::value_struct into a std::unordered_map 70 | * of std::unordered_map. The assumption is that the keys of both the inner 71 | * and outter maps are strings. The values of the inner map are also 72 | * strings. 73 | * 74 | * @param[in] xmlrpc_c::value_struct Structure of strings mapped to other 75 | * value_struct objects which map strings to stings. 76 | * @return std::unordered_map > 78 | */ 79 | std::unordered_map > const 81 | value_struct_to_map_of_maps(const xmlrpc_c::value_struct& vs); 82 | 83 | /** 84 | * Converts a string to a bool. 85 | */ 86 | bool stob(const std::string& s); 87 | 88 | } // end: namespace o3d3xx 89 | 90 | #endif // __O3D3XX_UTIL_H__ 91 | -------------------------------------------------------------------------------- /modules/camera/include/o3d3xx_camera/version.h.in: -------------------------------------------------------------------------------- 1 | // -*- c++ -*- 2 | /* 3 | * Copyright (C) 2014 Love Park Robotics, LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distribted on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef __O3D3XX_VERSION_H__ 19 | #define __O3D3XX_VERSION_H__ 20 | 21 | #define O3D3XX_LIBRARY_NAME "libo3d3xx" 22 | 23 | /* compile-time API version detection */ 24 | /* variable expansion comes from CMakeLists.txt -- don't mess with these */ 25 | #define O3D3XX_VERSION_MAJOR @O3D3XX_VERSION_MAJOR@ 26 | #define O3D3XX_VERSION_MINOR @O3D3XX_VERSION_MINOR@ 27 | #define O3D3XX_VERSION_PATCH @O3D3XX_VERSION_PATCH@ 28 | 29 | #define O3D3XX_MAKE_VERSION(major, minor, patch) \ 30 | ((major) * 10000 + (minor) * 100 + (patch)) 31 | #define O3D3XX_VERSION \ 32 | O3D3XX_MAKE_VERSION( \ 33 | O3D3XX_VERSION_MAJOR, \ 34 | O3D3XX_VERSION_MINOR, \ 35 | O3D3XX_VERSION_PATCH) 36 | 37 | namespace o3d3xx 38 | { 39 | /** 40 | * @brief Runtime API version detection 41 | * 42 | * @param[out] major Major version number 43 | * @param[out] minor Minor version number 44 | * @param[out] patch Patch version number 45 | */ 46 | void version(int *major, int *minor, int *patch); 47 | 48 | } // end: namespace o3d3xx 49 | 50 | #endif // __O3D3XX_VERSION_H__ 51 | -------------------------------------------------------------------------------- /modules/camera/o3d3xx_camera-config-version.cmake.in: -------------------------------------------------------------------------------- 1 | set(O3D3XX_CAMERA_VERSION "@O3D3XX_VERSION_STRING@") 2 | 3 | if("${O3D3XX_CAMERA_VERSION}" VERSION_LESS "${O3D3XX_CAMERA_FIND_VERSION}") 4 | set(O3D3XX_CAMERA_VERSION_COMPATIBLE FALSE) 5 | set(O3D3XX_CAMERA_VERSION_EXACT FALSE) 6 | else() 7 | set(O3D3XX_CAMERA_VERSION_COMPATIBLE TRUE) 8 | if ("${O3D3XX_CAMERA_VERSION}" VERSION_EQUAL "${O3D3XX_CAMERA_FIND_VERSION}") 9 | set(O3D3XX_CAMERA_VERSION_EXACT TRUE) 10 | else() 11 | set(O3D3XX_CAMERA_VERSION_EXACT FALSE) 12 | endif() 13 | endif() 14 | -------------------------------------------------------------------------------- /modules/camera/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(libo3d3xx_camera) 2 | add_subdirectory(bin) 3 | -------------------------------------------------------------------------------- /modules/camera/src/bin/o3d3xx-config.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Love Park Robotics, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include "o3d3xx_camera.h" 26 | 27 | // 28 | // Configures the camera based upon a JSON configuration file. 29 | // 30 | 31 | namespace po = boost::program_options; 32 | 33 | int main(int argc, const char** argv) 34 | { 35 | std::string camera_ip; 36 | std::uint32_t xmlrpc_port; 37 | std::string password; 38 | std::string infile; 39 | std::string json; 40 | 41 | try 42 | { 43 | o3d3xx::CmdLineOpts opts("o3d3xx Config"); 44 | 45 | po::options_description config_opts("Config Information"); 46 | config_opts.add_options() 47 | ("file,f", 48 | po::value()->default_value("-"), 49 | "Input JSON configuration file"); 50 | 51 | opts.visible.add(config_opts); 52 | 53 | if (! opts.Parse(argc, argv, &camera_ip, &xmlrpc_port, &password)) 54 | { 55 | return 0; 56 | } 57 | 58 | infile.assign(opts.vm["file"].as()); 59 | 60 | if (infile == "-") 61 | { 62 | std::string line; 63 | std::ostringstream buff; 64 | while (std::getline(std::cin, line)) 65 | { 66 | buff << line << std::endl; 67 | } 68 | 69 | json.assign(buff.str()); 70 | } 71 | else 72 | { 73 | std::ifstream ifs(infile, std::ios::in); 74 | if (! ifs) 75 | { 76 | throw o3d3xx::error_t(O3D3XX_IO_ERROR); 77 | } 78 | 79 | json.assign((std::istreambuf_iterator(ifs)), 80 | (std::istreambuf_iterator())); 81 | } 82 | 83 | o3d3xx::Camera::Ptr cam = 84 | std::make_shared(camera_ip, xmlrpc_port, password); 85 | 86 | cam->FromJSON(json); 87 | } 88 | catch (const std::exception& e) 89 | { 90 | std::cerr << "Failed to configure camera from JSON config '" 91 | << infile << "':" 92 | << std::endl << e.what() << std::endl; 93 | return 1; 94 | } 95 | 96 | return 0; 97 | } 98 | -------------------------------------------------------------------------------- /modules/camera/src/bin/o3d3xx-dump.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Love Park Robotics, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include "o3d3xx_camera.h" 23 | 24 | // 25 | // Dumps the current camera configuration to JSON. 26 | // 27 | 28 | int main(int argc, const char** argv) 29 | { 30 | std::string camera_ip; 31 | std::uint32_t xmlrpc_port; 32 | std::string password; 33 | 34 | try 35 | { 36 | o3d3xx::CmdLineOpts opts("o3d3xx Dump"); 37 | if (! opts.Parse(argc, argv, &camera_ip, &xmlrpc_port, &password)) 38 | { 39 | return 0; 40 | } 41 | 42 | o3d3xx::Camera::Ptr cam = 43 | std::make_shared(camera_ip, xmlrpc_port, password); 44 | 45 | std::cout << cam->ToJSON() << std::endl; 46 | } 47 | catch (const std::exception& e) 48 | { 49 | std::cerr << "Failed to dump camera configuration: " 50 | << std::endl << e.what() << std::endl; 51 | return 1; 52 | } 53 | 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /modules/camera/src/bin/o3d3xx-ls.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Love Park Robotics, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include "o3d3xx_camera.h" 23 | 24 | int main(int argc, const char** argv) 25 | { 26 | std::string camera_ip; 27 | std::uint32_t xmlrpc_port; 28 | std::string password; 29 | 30 | try 31 | { 32 | o3d3xx::CmdLineOpts opts("o3d3xx Application Listing"); 33 | if (! opts.Parse(argc, argv, &camera_ip, &xmlrpc_port, &password)) 34 | { 35 | return 0; 36 | } 37 | 38 | o3d3xx::Camera::Ptr cam = 39 | std::make_shared(camera_ip, xmlrpc_port, password); 40 | 41 | std::unordered_map params = 42 | cam->GetAllParameters(); 43 | 44 | int active_app = std::stoi(params["ActiveApplication"]); 45 | 46 | std::vector apps = cam->GetApplicationList(); 47 | for (auto& app : apps) 48 | { 49 | if (app.index == active_app) 50 | { 51 | std::cout << "* "; 52 | } 53 | else 54 | { 55 | std::cout << " "; 56 | } 57 | 58 | std::cout << "[" << app.index 59 | << "] id=" << app.id << ", name=" 60 | << app.name << ", description=" << app.description 61 | << std::endl; 62 | } 63 | 64 | } 65 | catch (const std::exception& e) 66 | { 67 | std::cerr << "Failed to list applications: " << e.what() << std::endl; 68 | return 1; 69 | } 70 | 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /modules/camera/src/bin/o3d3xx-reboot.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Love Park Robotics, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include "o3d3xx_camera.h" 23 | 24 | // 25 | // Soft reboot of the camera 26 | // 27 | 28 | int main(int argc, const char** argv) 29 | { 30 | std::string camera_ip; 31 | uint32_t xmlrpc_port; 32 | std::string password; 33 | o3d3xx::Camera::boot_mode mode = o3d3xx::Camera::boot_mode::PRODUCTIVE; 34 | 35 | try 36 | { 37 | o3d3xx::CmdLineOpts opts("o3d3xx Reboot"); 38 | 39 | po::options_description reboot_opts("Reboot Information"); 40 | reboot_opts.add_options() 41 | ("recovery,r", 42 | "If specified, the sensor will reboot into recovery mode"); 43 | 44 | opts.visible.add(reboot_opts); 45 | 46 | if (! opts.Parse(argc, argv, &camera_ip, &xmlrpc_port, &password)) 47 | { 48 | return 0; 49 | } 50 | 51 | if (opts.vm.count("recovery")) 52 | { 53 | mode = o3d3xx::Camera::boot_mode::RECOVERY; 54 | } 55 | 56 | o3d3xx::Camera::Ptr cam = 57 | std::make_shared(camera_ip, xmlrpc_port, password); 58 | 59 | cam->Reboot(mode); 60 | } 61 | catch (const std::exception& e) 62 | { 63 | std::cerr << "Failed to reboot camera: " << e.what() << std::endl; 64 | return 1; 65 | } 66 | 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /modules/camera/src/bin/o3d3xx-reset.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Love Park Robotics, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include "o3d3xx_camera.h" 24 | 25 | namespace po = boost::program_options; 26 | 27 | int main(int argc, const char** argv) 28 | { 29 | std::string camera_ip; 30 | uint32_t xmlrpc_port; 31 | std::string password; 32 | 33 | try 34 | { 35 | //--------------------------------------------------- 36 | // Handle command-line arguments 37 | //--------------------------------------------------- 38 | o3d3xx::CmdLineOpts opts("o3d3xx Factory Reset"); 39 | 40 | po::options_description reset_opts("Reset Information"); 41 | reset_opts.add_options() 42 | ("reboot", "Reboot the sensor after reset"); 43 | opts.visible.add(reset_opts); 44 | 45 | if (! opts.Parse(argc, argv, &camera_ip, &xmlrpc_port, &password)) 46 | { 47 | return 0; 48 | } 49 | 50 | //--------------------------------------------------- 51 | // Reset the camera 52 | //--------------------------------------------------- 53 | o3d3xx::Camera::Ptr cam = 54 | std::make_shared(camera_ip, xmlrpc_port, password); 55 | 56 | cam->RequestSession(); 57 | cam->SetOperatingMode(o3d3xx::Camera::operating_mode::EDIT); 58 | cam->FactoryReset(); 59 | 60 | if (opts.vm.count("reboot")) 61 | { 62 | cam->Reboot(); 63 | } 64 | } 65 | catch (const std::exception& e) 66 | { 67 | std::cerr << "Failed to reset camera: " << e.what() << std::endl; 68 | return 1; 69 | } 70 | 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /modules/camera/src/bin/o3d3xx-rm.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Love Park Robotics, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include "o3d3xx_camera.h" 26 | 27 | // 28 | // Removes an application at the specified index 29 | // 30 | 31 | namespace po = boost::program_options; 32 | 33 | int main(int argc, const char** argv) 34 | { 35 | std::string camera_ip; 36 | std::uint32_t xmlrpc_port; 37 | std::string password; 38 | int index; 39 | 40 | try 41 | { 42 | o3d3xx::CmdLineOpts opts("o3d3xx Remove Application"); 43 | 44 | po::options_description rm_opts("Remove"); 45 | rm_opts.add_options() 46 | ("index,i", 47 | po::value()->default_value(-1), 48 | "Index of application to remove"); 49 | 50 | opts.visible.add(rm_opts); 51 | 52 | if (! opts.Parse(argc, argv, &camera_ip, &xmlrpc_port, &password)) 53 | { 54 | return 0; 55 | } 56 | 57 | index = opts.vm["index"].as(); 58 | if (index > 0) 59 | { 60 | o3d3xx::Camera::Ptr cam = 61 | std::make_shared(camera_ip, xmlrpc_port, password); 62 | 63 | cam->RequestSession(); 64 | cam->SetOperatingMode(o3d3xx::Camera::operating_mode::EDIT); 65 | cam->DeleteApplication(index); 66 | } 67 | } 68 | catch (const std::exception& e) 69 | { 70 | std::cerr << "Failed to remove application at index='" 71 | << index << "':" 72 | << std::endl << e.what() << std::endl; 73 | return 1; 74 | } 75 | 76 | return 0; 77 | } 78 | -------------------------------------------------------------------------------- /modules/camera/src/bin/o3d3xx-trace.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 ifm syntron gmgh 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include "o3d3xx_camera.h" 23 | 24 | int main(int argc, const char** argv) 25 | { 26 | std::string camera_ip; 27 | std::uint32_t xmlrpc_port; 28 | std::string password; 29 | auto limit = 0; 30 | 31 | try 32 | { 33 | o3d3xx::CmdLineOpts opts("o3d3xx trace logs"); 34 | po::options_description trace_opts("Limit the amount of trace messages"); 35 | trace_opts.add_options() 36 | ("limit,l", 37 | po::value(), 38 | "Limit the amount of trace log messages printed. If not provided all are printed"); 39 | 40 | opts.visible.add(trace_opts); 41 | if (! opts.Parse(argc, argv, &camera_ip, &xmlrpc_port, &password)) 42 | { 43 | return 0; 44 | } 45 | if (opts.vm.count("limit")) 46 | { 47 | limit = std::max(1,opts.vm["limit"].as()); 48 | } 49 | 50 | o3d3xx::Camera::Ptr cam = 51 | std::make_shared(camera_ip, xmlrpc_port, password); 52 | 53 | std::vector logs = cam->GetTraceLogs(limit); 54 | 55 | for (auto& log : logs ) 56 | { 57 | std::cout << log 58 | << std::endl 59 | << std::flush; 60 | } 61 | 62 | } 63 | catch (const std::exception& e) 64 | { 65 | std::cerr << "Failed to get trace logs: " << e.what() << std::endl; 66 | return 1; 67 | } 68 | 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /modules/camera/src/bin/o3d3xx-version.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Love Park Robotics, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include "o3d3xx_camera.h" 19 | 20 | int main(int argc, const char **argv) 21 | { 22 | int major; 23 | int minor; 24 | int patch; 25 | 26 | o3d3xx::Logging::Init(); 27 | 28 | o3d3xx::version(&major, &minor, &patch); 29 | std::cout << O3D3XX_LIBRARY_NAME 30 | << ": version=" << major << "." 31 | << minor << "." << patch << std::endl; 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /modules/camera/src/libo3d3xx_camera/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_library(LIB_glog NAMES glog) 2 | find_library(LIB_xmlrpcxx NAMES xmlrpc++) 3 | find_library(LIB_xmlrpc_clientxx NAMES xmlrpc_client++) 4 | 5 | file(GLOB O3D3XX_CAMERA_SOURCES *.cpp) 6 | 7 | ################################################ 8 | ## Compile source once for both shared and static libs 9 | ################################################ 10 | add_library(o3d3xx_camera OBJECT ${O3D3XX_CAMERA_SOURCES}) 11 | set_property(TARGET o3d3xx_camera PROPERTY POSITION_INDEPENDENT_CODE 1) 12 | if(CMAKE_CROSSCOMPILING) 13 | set_target_properties(o3d3xx_camera PROPERTIES 14 | COMPILE_FLAGS "${CROSSTOOL_COMPILE_FLAGS}") 15 | endif(CMAKE_CROSSCOMPILING) 16 | 17 | ################################################ 18 | ## 19 | ## NOTE: While we could create a libary of the 20 | ## same name for both shared and static, it is 21 | ## my understading that while this will work 22 | ## fine on both Linux and Mac OS X, Windows will 23 | ## have a problem with that. So, the strategy 24 | ## is to produce a `libo3d3xx_camera.so' and a 25 | ## `libo3d3xx_camera_static.a'. 26 | ## 27 | ################################################ 28 | 29 | ################################################ 30 | ## Create the shared library 31 | ################################################ 32 | if(BUILD_SHARED_LIBS) 33 | add_library(o3d3xx_camera_shared SHARED $) 34 | target_link_libraries( 35 | o3d3xx_camera_shared 36 | ${LIB_glog} 37 | ${Boost_LIBRARIES} 38 | ${LIB_xmlrpcxx} 39 | ${LIB_xmlrpc_clientxx} 40 | ) 41 | 42 | set_target_properties(o3d3xx_camera_shared PROPERTIES 43 | VERSION 44 | "${O3D3XX_VERSION_MAJOR}.${O3D3XX_VERSION_MINOR}.${O3D3XX_VERSION_PATCH}" 45 | OUTPUT_NAME o3d3xx_camera 46 | LINKER_LANGUAGE CXX 47 | ) 48 | 49 | install( 50 | TARGETS o3d3xx_camera_shared 51 | DESTINATION lib 52 | EXPORT o3d3xx_camera-targets 53 | ) 54 | endif(BUILD_SHARED_LIBS) 55 | 56 | ################################################ 57 | ## Create the static library 58 | ################################################ 59 | if(BUILD_STATIC_LIBS) 60 | add_library(o3d3xx_camera_static STATIC $) 61 | target_link_libraries( 62 | o3d3xx_camera_static 63 | ${LIB_glog} 64 | ${Boost_LIBRARIES} 65 | ${LIB_xmlrpcxx} 66 | ${LIB_xmlrpc_clientxx} 67 | ) 68 | 69 | set_target_properties(o3d3xx_camera_static PROPERTIES 70 | LINKER_LANGUAGE CXX 71 | ) 72 | 73 | install( 74 | TARGETS o3d3xx_camera_static 75 | DESTINATION lib 76 | EXPORT o3d3xx_camera-targets 77 | ) 78 | endif(BUILD_STATIC_LIBS) 79 | -------------------------------------------------------------------------------- /modules/camera/src/libo3d3xx_camera/cmdline_opts.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Love Park Robotics, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "o3d3xx_camera/cmdline_opts.h" 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include "o3d3xx_camera/camera.hpp" 24 | #include "o3d3xx_camera/version.h" 25 | 26 | namespace po = boost::program_options; 27 | 28 | o3d3xx::CmdLineOpts::CmdLineOpts(const std::string& description) 29 | : visible(description) 30 | { 31 | // generic options 32 | po::options_description general("General"); 33 | general.add_options() 34 | ("version,v", "Print version string and exit") 35 | ("help,h", "Produce help message"); 36 | 37 | // options for connecting to the camera 38 | po::options_description connection_opts("Connection Information"); 39 | connection_opts.add_options() 40 | ("ip", 41 | po::value()->default_value(o3d3xx::DEFAULT_IP), 42 | "IP address of the camera") 43 | 44 | ("xmlrpc-port", 45 | po::value()->default_value(o3d3xx::DEFAULT_XMLRPC_PORT), 46 | "XMLRPC port of the camera") 47 | 48 | ("password", 49 | po::value()->default_value(o3d3xx::DEFAULT_PASSWORD), 50 | "Password for configuring the camera"); 51 | 52 | this->visible.add(general).add(connection_opts); 53 | } 54 | 55 | int 56 | o3d3xx::CmdLineOpts::Parse(int argc, const char **argv, 57 | std::string *ip, 58 | std::uint32_t *xmlrpc_port, 59 | std::string *password, 60 | std::function fn, 61 | std::ostream& out) 62 | { 63 | int retval = 1; 64 | int major, minor, patch; 65 | 66 | po::store(po::command_line_parser(argc, argv). 67 | options(this->visible).run(), this->vm); 68 | 69 | po::notify(this->vm); 70 | 71 | if (this->vm.count("help")) 72 | { 73 | out << this->visible << std::endl; 74 | retval = 0; 75 | } 76 | else if (this->vm.count("version")) 77 | { 78 | o3d3xx::version(&major, &minor, &patch); 79 | out << O3D3XX_LIBRARY_NAME 80 | << ": version=" << major << "." 81 | << minor << "." << patch << std::endl; 82 | retval = 0; 83 | } 84 | 85 | if (retval != 0) 86 | { 87 | if (ip != nullptr) 88 | { 89 | ip->assign(this->vm["ip"].as()); 90 | } 91 | 92 | if (xmlrpc_port != nullptr) 93 | { 94 | *xmlrpc_port = this->vm["xmlrpc-port"].as(); 95 | } 96 | 97 | if (password != nullptr) 98 | { 99 | password->assign(this->vm["password"].as()); 100 | } 101 | 102 | fn(); 103 | } 104 | 105 | return retval; 106 | } 107 | -------------------------------------------------------------------------------- /modules/camera/src/libo3d3xx_camera/version.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Love Park Robotics, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "o3d3xx_camera/version.h" 18 | 19 | void o3d3xx::version(int *major, int *minor, int *patch) 20 | { 21 | *major = O3D3XX_VERSION_MAJOR; 22 | *minor = O3D3XX_VERSION_MINOR; 23 | *patch = O3D3XX_VERSION_PATCH; 24 | } 25 | -------------------------------------------------------------------------------- /modules/camera/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(GTEST_CMAKE_DIR "/usr/src/gtest") 2 | enable_testing() 3 | add_subdirectory(${GTEST_CMAKE_DIR} gtest_bin EXCLUDE_FROM_ALL) 4 | file(GLOB CAMERA_TEST_SOURCES *.cpp) 5 | add_executable(o3d3xx-camera-tests ${CAMERA_TEST_SOURCES}) 6 | if(BUILD_SHARED_LIBS) 7 | target_link_libraries(o3d3xx-camera-tests gtest_main o3d3xx_camera_shared) 8 | else() 9 | target_link_libraries(o3d3xx-camera-tests gtest_main o3d3xx_camera_static) 10 | endif(BUILD_SHARED_LIBS) 11 | 12 | if(CMAKE_CROSSCOMPILING) 13 | set_target_properties(o3d3xx-camera-tests PROPERTIES 14 | COMPILE_FLAGS "${CROSSTOOL_COMPILE_FLAGS}" 15 | LINK_FLAGS "${CROSSTOOL_EXE_LINKER_FLAGS}") 16 | endif(CMAKE_CROSSCOMPILING) 17 | 18 | ################################################ 19 | ## If we are NOT cross-compiling, we create 20 | ## targets to run the tests. If we are cross- 21 | ## compiling, we install the built test suite 22 | ## so it can be run on the target machine. 23 | ################################################ 24 | if(NOT CMAKE_CROSSCOMPILING) 25 | # 26 | # For each test: 27 | # NAME = 28 | # COMMAND = 29 | # 30 | # NOTE: We can leverage gtest's "stress tesing" like: 31 | # 32 | # add_test(NAME mytest COMMAND o3d3xx-camera-tests --gtest_repeat=100000) 33 | # 34 | add_test(NAME o3d3xx-camera-tests COMMAND o3d3xx-camera-tests) 35 | add_custom_target(check 36 | COMMAND o3d3xx-camera-tests 37 | DEPENDS o3d3xx-camera-tests) 38 | add_custom_target(stress 39 | COMMAND o3d3xx-camera-tests --gtest_repeat=100 40 | DEPENDS o3d3xx-camera-tests) 41 | 42 | # 43 | # NOTE: If you just want to run one test (or a subset of the tests) you can, 44 | # for example: 45 | # 46 | # $ GTEST_FILTER=DenseImageTest.ImageSize make check 47 | # 48 | else() 49 | install(TARGETS o3d3xx-camera-tests DESTINATION test) 50 | install(FILES 51 | ${O3D3XX_CAMERA_BINARY_DIR}/test/gtest_bin/libgtest.so 52 | ${O3D3XX_CAMERA_BINARY_DIR}/test/gtest_bin/libgtest_main.so 53 | DESTINATION test/gtest_bin) 54 | 55 | install(FILES 56 | ${O3D3XX_CAMERA_SOURCE_DIR}/test/env.sh 57 | DESTINATION test 58 | PERMISSIONS OWNER_EXECUTE 59 | OWNER_WRITE 60 | OWNER_READ 61 | GROUP_EXECUTE 62 | GROUP_READ 63 | WORLD_EXECUTE 64 | WORLD_READ) 65 | 66 | endif(NOT CMAKE_CROSSCOMPILING) 67 | -------------------------------------------------------------------------------- /modules/camera/test/env.sh: -------------------------------------------------------------------------------- 1 | export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:`pwd`/gtest_bin 2 | -------------------------------------------------------------------------------- /modules/camera/test/o3d3xx-basic-tests.cpp: -------------------------------------------------------------------------------- 1 | #include "o3d3xx_camera.h" 2 | #include 3 | #include "gtest/gtest.h" 4 | 5 | // exception mechanism 6 | TEST(General_Tests, Exceptions) 7 | { 8 | bool ex_caught = false; 9 | 10 | // example of throwing a library error 11 | try 12 | { 13 | throw(o3d3xx::error_t(O3D3XX_NO_ERRORS)); 14 | } 15 | catch (const o3d3xx::error_t& ex) 16 | { 17 | ex_caught = true; 18 | EXPECT_EQ(O3D3XX_NO_ERRORS, ex.code()); 19 | EXPECT_STREQ(o3d3xx::strerror(O3D3XX_NO_ERRORS), ex.what()); 20 | } 21 | EXPECT_TRUE(ex_caught); 22 | ex_caught = false; 23 | 24 | // example of throwing a system error 25 | try 26 | { 27 | throw(o3d3xx::error_t(EAGAIN)); 28 | } 29 | catch (const o3d3xx::error_t& ex) 30 | { 31 | ex_caught = true; 32 | EXPECT_EQ(EAGAIN, ex.code()); 33 | EXPECT_STREQ(o3d3xx::strerror(EAGAIN), ex.what()); 34 | } 35 | EXPECT_TRUE(ex_caught); 36 | ex_caught = false; 37 | } 38 | 39 | // versioning 40 | TEST(General_Tests, Version) 41 | { 42 | int major, minor, patch; 43 | 44 | o3d3xx::version(&major, &minor, &patch); 45 | EXPECT_EQ(O3D3XX_VERSION, O3D3XX_MAKE_VERSION(major, minor, patch)); 46 | } 47 | -------------------------------------------------------------------------------- /modules/camera/test/o3d3xx-camera-testrunner.cpp: -------------------------------------------------------------------------------- 1 | #include "o3d3xx_camera.h" 2 | #include 3 | #include "gtest/gtest.h" 4 | 5 | int main(int argc, char **argv) 6 | { 7 | FLAGS_logbuflevel = -1; 8 | o3d3xx::Logging::Init(); 9 | // keeps the unit test output cleaner 10 | google::SetStderrLogging(google::FATAL); 11 | ::testing::InitGoogleTest(&argc, argv); 12 | return RUN_ALL_TESTS(); 13 | } 14 | -------------------------------------------------------------------------------- /modules/camera/test/o3d3xx-import-export-tests.cpp: -------------------------------------------------------------------------------- 1 | #include "o3d3xx_camera.h" 2 | #include 3 | #include 4 | #include 5 | #include "gtest/gtest.h" 6 | 7 | TEST(ImportExport_Tests, ImportExportApp) 8 | { 9 | o3d3xx::Camera::Ptr cam = 10 | std::make_shared(); 11 | 12 | cam->RequestSession(); 13 | cam->SetOperatingMode(o3d3xx::Camera::operating_mode::EDIT); 14 | 15 | std::vector apps = 16 | cam->GetApplicationList(); 17 | 18 | int orig_num_apps = apps.size(); 19 | int active_idx = cam->GetDeviceConfig()->ActiveApplication(); 20 | 21 | std::vector bytes; 22 | ASSERT_NO_THROW(bytes = cam->ExportIFMApp(active_idx)); 23 | 24 | int new_idx = -1; 25 | ASSERT_NO_THROW(new_idx = cam->ImportIFMApp(bytes)); 26 | 27 | apps = cam->GetApplicationList(); 28 | ASSERT_EQ(apps.size(), orig_num_apps+1); 29 | 30 | ASSERT_NO_THROW(cam->DeleteApplication(new_idx)); 31 | 32 | apps = cam->GetApplicationList(); 33 | ASSERT_EQ(apps.size(), orig_num_apps); 34 | } 35 | -------------------------------------------------------------------------------- /modules/examples/ex-change_ip.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 ifm syntron gmbh 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // ex-change_ip.cpp 19 | // 20 | // Change the IPv4 address of the camera 21 | // 22 | 23 | #include 24 | #include 25 | #include "o3d3xx_camera.h" 26 | #include "o3d3xx_framegrabber.h" 27 | 28 | int main(int argc, const char **argv) 29 | { 30 | o3d3xx::Logging::Init(); 31 | 32 | o3d3xx::Camera::Ptr cam = std::make_shared(); 33 | cam->RequestSession(); 34 | cam->SetOperatingMode(o3d3xx::Camera::operating_mode::EDIT); 35 | 36 | o3d3xx::NetConfig::Ptr net = cam->GetNetConfig(); 37 | bool has_changed = true; 38 | net->SetStaticIPv4Address("192.168.0.70"); 39 | cam->SetNetConfig(net.get(), &has_changed); 40 | cam->SaveNet(); 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /modules/examples/ex-file_io.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Love Park Robotics, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // ex-file_io.cpp 19 | // 20 | // Capture a frame from the camera, and write the data out to files. For 21 | // exemplary purposes, we will write the amplitdue and radial distance images 22 | // to PNG files and the point cloud to a PCD file. 23 | // 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include "o3d3xx_camera.h" 31 | #include "o3d3xx_framegrabber.h" 32 | #include "o3d3xx_image.h" 33 | 34 | int main(int argc, const char **argv) 35 | { 36 | o3d3xx::Logging::Init(); 37 | 38 | o3d3xx::Camera::Ptr cam = std::make_shared(); 39 | o3d3xx::ImageBuffer::Ptr img = std::make_shared(); 40 | o3d3xx::FrameGrabber::Ptr fg = 41 | std::make_shared( 42 | cam, o3d3xx::IMG_AMP|o3d3xx::IMG_RDIS|o3d3xx::IMG_CART); 43 | 44 | if (! fg->WaitForFrame(img.get(), 1000)) 45 | { 46 | std::cerr << "Timeout waiting for camera!" << std::endl; 47 | return -1; 48 | } 49 | 50 | pcl::io::savePCDFileASCII("point_cloud.pcd", *(img->Cloud())); 51 | imwrite("amplitude.png", img->AmplitudeImage()); 52 | imwrite("radial_distance.png", img->DepthImage()); 53 | 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /modules/examples/ex-framegrabber_recycling.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Love Park Robotics, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // ex-framegrabber_recycling.cpp 19 | // 20 | // This example is in response to: 21 | // 22 | // https://github.com/lovepark/libo3d3xx/issues/45 23 | // 24 | // It demonstrates how to make your framegrabbing robust to the camera 25 | // "disappearing" e.g., due to power cycling, lost network, etc. 26 | // 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include "o3d3xx_camera.h" 34 | #include "o3d3xx_framegrabber.h" 35 | 36 | int main(int argc, const char **argv) 37 | { 38 | o3d3xx::Logging::Init(); 39 | 40 | // Ctrl-C to exit the program 41 | std::signal(SIGINT, 42 | [](int sig) 43 | { 44 | std::cout << "Bye" << std::endl; 45 | std::exit(0); 46 | }); 47 | 48 | o3d3xx::Camera::Ptr cam = std::make_shared(); 49 | o3d3xx::FrameGrabber::Ptr fg = std::make_shared(cam); 50 | o3d3xx::ByteBuffer::Ptr buff = std::make_shared(); 51 | 52 | double thresh = 3.0; 53 | auto last_frame = std::chrono::steady_clock::now(); 54 | 55 | while (true) 56 | { 57 | if (! fg->WaitForFrame(buff.get(), 1000)) 58 | { 59 | std::cout << "Timeout waiting for camera!" << std::endl; 60 | 61 | auto now = std::chrono::steady_clock::now(); 62 | auto diff = now - last_frame; 63 | if (std::chrono::duration_cast(diff).count() > 64 | thresh) 65 | { 66 | std::cout << "Restarting FrameGrabber..." << std::endl; 67 | fg.reset(new o3d3xx::FrameGrabber(cam)); 68 | } 69 | 70 | continue; 71 | } 72 | 73 | last_frame = std::chrono::steady_clock::now(); 74 | std::cout << "Got frame!" << std::endl; 75 | } 76 | 77 | return 0; 78 | } 79 | -------------------------------------------------------------------------------- /modules/examples/ex-oem_is_booted.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 ifm syntron gmbh 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // 18 | // ex-oem_is_booted.cpp 19 | // 20 | // Check if the camera is completly booted. 21 | // What is mostly useful for an on camera application. 22 | // 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include "o3d3xx_camera.h" 31 | 32 | bool wait_for_camera(o3d3xx::Camera::Ptr cam, int seconds) 33 | { 34 | seconds = std::max(seconds,1); 35 | std::unordered_map sw_version; 36 | auto start = std::chrono::steady_clock::now(); 37 | std::chrono::duration duration(0); 38 | bool isValid=false; 39 | 40 | while( (!isValid) && (duration < std::chrono::seconds( seconds ) ) ) 41 | { 42 | try 43 | { 44 | sw_version = cam->GetSWVersion(); 45 | } 46 | catch ( ... ) 47 | { 48 | // Not able to get SW version 49 | } 50 | duration = std::chrono::steady_clock::now() - start; 51 | 52 | if(sw_version["Algorithm_Version"].empty()) 53 | std::this_thread::sleep_for (std::chrono::seconds(1)); 54 | else 55 | isValid=true; 56 | } 57 | 58 | return ( isValid ); 59 | } 60 | 61 | int main(int argc, const char **argv) 62 | { 63 | const auto seconds_to_wait = 20; 64 | o3d3xx::Logging::Init(); 65 | o3d3xx::Camera::Ptr cam = o3d3xx::Camera::Ptr(new o3d3xx::Camera()); 66 | 67 | std::cout << "Waiting for the camera to operate: " << std::flush; 68 | if(wait_for_camera(cam, seconds_to_wait)) 69 | { 70 | std::cout << "[done]" << std::endl; 71 | } 72 | else 73 | { 74 | std::cout << "[TIMEOUT]" << std::endl; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /modules/examples/ex-pcicclient_async_messages.cpp: -------------------------------------------------------------------------------- 1 | // -*- c++ -*- 2 | /* 3 | * Copyright (C) 2017 Kuhn & Völkel GmbH 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distribted on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | // 19 | // ex-pcicclient_async_messages.cpp 20 | // 21 | // Shows how to use the PCICClient module to receive asynchronous 22 | // notification (and error) messages from the camera. 23 | // 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | // Camera configuration string: 32 | // * Create two applications with indices 1 and 2 33 | // and activate application with index 2 34 | const char *config = R"CONFIG( 35 | { 36 | "o3d3xx": 37 | { 38 | "Device": 39 | { 40 | "ActiveApplication": "2" 41 | }, 42 | "Apps": 43 | [ 44 | { 45 | "Name": "PCICClient Example 2a", 46 | "Description": "First application", 47 | "Index" : "1" 48 | }, 49 | { 50 | "Name": "PCICClient Example 2b", 51 | "Description": "Second application", 52 | "Index" : "2" 53 | } 54 | ] 55 | } 56 | } 57 | )CONFIG"; 58 | 59 | 60 | int main(int argc, char** argv) 61 | { 62 | // Create camera 63 | o3d3xx::Camera::Ptr cam = std::make_shared(); 64 | 65 | // Configure two applications on the camera 66 | cam->FromJSON(config); 67 | 68 | // Create pcic interface 69 | o3d3xx::PCICClient::Ptr pcic = std::make_shared(cam); 70 | 71 | // Set notification (and error) callbacks, which simply print received messages 72 | pcic->SetNotificationCallback([](const std::string& notification) 73 | { 74 | std::cout << "Notification: " << notification << std::endl; 75 | }); 76 | 77 | pcic->SetErrorCallback([](const std::string& error) 78 | { 79 | std::cout << "Error: " << error << std::endl; 80 | }); 81 | 82 | // Switch between applications (and receive notification 000500000) 83 | std::cout << "Switch to application 1" << std::endl; 84 | pcic->Call("a01"); 85 | std::this_thread::sleep_for(std::chrono::seconds(1)); 86 | 87 | std::cout << "Switch to application 2" << std::endl; 88 | pcic->Call("a02"); 89 | std::this_thread::sleep_for(std::chrono::seconds(1)); 90 | 91 | return 0; 92 | } 93 | -------------------------------------------------------------------------------- /modules/framegrabber/include/o3d3xx_framegrabber.h: -------------------------------------------------------------------------------- 1 | // -*- c++ -*- 2 | /* 3 | * Copyright (C) 2016 Love Park Robotics, LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distribted on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef __O3D3XX_FRAMEGRABBER_MODULE_H__ 19 | #define __O3D3XX_FRAMEGRABBER_MODULE_H__ 20 | 21 | #include "o3d3xx_framegrabber/pcic_schema.h" 22 | #include "o3d3xx_framegrabber/byte_buffer.hpp" 23 | #include "o3d3xx_framegrabber/frame_grabber.h" 24 | 25 | #endif // __O3D3XX_FRAMEGRABBER_MODULE_H__ 26 | -------------------------------------------------------------------------------- /modules/framegrabber/include/o3d3xx_framegrabber/pcic_schema.h: -------------------------------------------------------------------------------- 1 | // -*- c++ -*- 2 | /* 3 | * Copyright (C) 2016 Love Park Robotics, LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distribted on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef __O3D3XX_PCIC_SCHEMA_H__ 19 | #define __O3D3XX_PCIC_SCHEMA_H__ 20 | 21 | #include 22 | #include 23 | 24 | namespace o3d3xx 25 | { 26 | extern const std::uint16_t DEFAULT_SCHEMA_MASK; 27 | 28 | // Constants used to create "pluggable schema masks" 29 | extern const std::uint16_t IMG_RDIS; // radial distance 30 | extern const std::uint16_t IMG_AMP; // normalized amplitude 31 | extern const std::uint16_t IMG_RAMP; // raw amplitude 32 | extern const std::uint16_t IMG_CART; // Cartesian 33 | extern const std::uint16_t IMG_UVEC; // Unit vectors 34 | extern const std::uint16_t EXP_TIME; // Exposure times 35 | extern const std::uint16_t ILLU_TEMP; // Illumination temperature 36 | 37 | /** 38 | * Utility function to build a PCIC schema from a mask 39 | * 40 | * @param[in] mask The mask to use to build the schema 41 | * @return The PCIC schema as a string 42 | */ 43 | std::string make_pcic_schema(std::uint16_t mask); 44 | 45 | /** 46 | * Utility function to create a schema mask from a string. 47 | * 48 | * The passed in string should contain valid symbolic constants `OR'd` 49 | * together. For example: IMG_RDIS|IMG_AMP|IMG_RAMP|IMG_CART|IMG_UVEC 50 | * 51 | * @param[in] in The string to parse to generate the mask 52 | * @return The PCIC schema encoed by the `in` string. 53 | */ 54 | std::uint16_t schema_mask_from_string(const std::string& in); 55 | 56 | } // end: namespace o3d3xx 57 | 58 | #endif // __O3D3XX_PCIC_SCHEMA_H__ 59 | -------------------------------------------------------------------------------- /modules/framegrabber/o3d3xx_framegrabber-config-version.cmake.in: -------------------------------------------------------------------------------- 1 | set(O3D3XX_FRAMEGRABBER_VERSION "@O3D3XX_VERSION_STRING@") 2 | 3 | if("${O3D3XX_FRAMEGRABBER_VERSION}" 4 | VERSION_LESS "${O3D3XX_FRAMEGRABBER_FIND_VERSION}") 5 | set(O3D3XX_FRAMEGRABBER_VERSION_COMPATIBLE FALSE) 6 | set(O3D3XX_FRAMEGRABBER_VERSION_EXACT FALSE) 7 | else() 8 | set(O3D3XX_FRAMEGRABBER_VERSION_COMPATIBLE TRUE) 9 | if ("${O3D3XX_FRAMEGRABBER_VERSION}" 10 | VERSION_EQUAL "${O3D3XX_FRAMEGRABBER_FIND_VERSION}") 11 | set(O3D3XX_FRAMEGRABBER_VERSION_EXACT TRUE) 12 | else() 13 | set(O3D3XX_FRAMEGRABBER_VERSION_EXACT FALSE) 14 | endif() 15 | endif() 16 | -------------------------------------------------------------------------------- /modules/framegrabber/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(libo3d3xx_framegrabber) 2 | add_subdirectory(bin) 3 | -------------------------------------------------------------------------------- /modules/framegrabber/src/bin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################ 2 | ## Build the command-line tools 3 | ################################################ 4 | find_library(LIB_boost_program_options NAMES boost_program_options) 5 | 6 | # Empty list 7 | set(O3D3XX_FRAMEGRABBER_EXE_TARGETS) 8 | 9 | #----------------------------------------------- 10 | # o3d3xx-hz 11 | #----------------------------------------------- 12 | if(BUILD_EXE_HZ) 13 | add_executable(o3d3xx-hz o3d3xx-hz.cpp) 14 | 15 | if(BUILD_SHARED_LIBS) 16 | target_link_libraries(o3d3xx-hz 17 | o3d3xx_framegrabber_shared 18 | ${O3D3XX_CAMERA_LIBRARIES} 19 | ${LIB_boost_program_options}) 20 | else() 21 | target_link_libraries(o3d3xx-hz 22 | o3d3xx_framegrabber_static 23 | ${O3D3XX_CAMERA_LIBRARIES} 24 | ${LIB_boost_program_options} 25 | ) 26 | endif(BUILD_SHARED_LIBS) 27 | 28 | install(TARGETS o3d3xx-hz DESTINATION bin) 29 | 30 | list(APPEND O3D3XX_FRAMEGRABBER_EXE_TARGETS o3d3xx-hz) 31 | else() 32 | message(STATUS "Skipping o3d3xx-hz") 33 | endif(BUILD_EXE_HZ) 34 | 35 | #----------------------------------------------- 36 | # o3d3xx-schema 37 | #----------------------------------------------- 38 | if(BUILD_EXE_SCHEMA) 39 | add_executable(o3d3xx-schema o3d3xx-schema.cpp) 40 | 41 | if(BUILD_SHARED_LIBS) 42 | target_link_libraries(o3d3xx-schema 43 | o3d3xx_framegrabber_shared 44 | ${O3D3XX_CAMERA_LIBRARIES} 45 | ${LIB_boost_program_options}) 46 | else() 47 | target_link_libraries(o3d3xx-schema 48 | o3d3xx_framegrabber_static 49 | ${O3D3XX_CAMERA_LIBRARIES} 50 | ${LIB_boost_program_options} 51 | ) 52 | endif(BUILD_SHARED_LIBS) 53 | 54 | install(TARGETS o3d3xx-schema DESTINATION bin) 55 | 56 | list(APPEND O3D3XX_FRAMEGRABBER_EXE_TARGETS o3d3xx-schema) 57 | else() 58 | message(STATUS "Skipping o3d3xx-schema") 59 | endif(BUILD_EXE_SCHEMA) 60 | 61 | #----------------------------------------------- 62 | #----------------------------------------------- 63 | #----------------------------------------------- 64 | if(CMAKE_CROSSCOMPILING) 65 | foreach(exe_target ${O3D3XX_FRAMEGRABBER_EXE_TARGETS}) 66 | set_target_properties(${exe_target} PROPERTIES 67 | LINK_FLAGS "${CROSSTOOL_EXE_LINKER_FLAGS}" 68 | COMPILE_FLAGS "${CROSSTOOL_COMPILE_FLAGS}") 69 | endforeach(exe_target) 70 | endif(CMAKE_CROSSCOMPILING) 71 | -------------------------------------------------------------------------------- /modules/framegrabber/src/libo3d3xx_framegrabber/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_library(LIB_glog NAMES glog) 2 | find_library(LIB_xmlrpcxx NAMES xmlrpc++) 3 | find_library(LIB_xmlrpc_clientxx NAMES xmlrpc_client++) 4 | 5 | file(GLOB O3D3XX_FRAMEGRABBER_SOURCES *.cpp) 6 | 7 | ################################################ 8 | ## Compile source once for both shared and static libs 9 | ################################################ 10 | add_library(o3d3xx_framegrabber OBJECT ${O3D3XX_FRAMEGRABBER_SOURCES}) 11 | set_property(TARGET o3d3xx_framegrabber PROPERTY POSITION_INDEPENDENT_CODE 1) 12 | if(CMAKE_CROSSCOMPILING) 13 | set_target_properties(o3d3xx_framegrabber PROPERTIES 14 | COMPILE_FLAGS "${CROSSTOOL_COMPILE_FLAGS}") 15 | endif(CMAKE_CROSSCOMPILING) 16 | 17 | ################################################ 18 | ## Create the shared library 19 | ################################################ 20 | if(BUILD_SHARED_LIBS) 21 | add_library(o3d3xx_framegrabber_shared 22 | SHARED $) 23 | target_link_libraries( 24 | o3d3xx_framegrabber_shared 25 | ${O3D3XX_CAMERA_LIBRARIES} 26 | ${LIB_glog} 27 | ${Boost_LIBRARIES} 28 | ${LIB_xmlrpcxx} 29 | ${LIB_xmlrpc_clientxx} 30 | ${CMAKE_THREAD_LIBS_INIT} 31 | ) 32 | 33 | set_target_properties(o3d3xx_framegrabber_shared PROPERTIES 34 | VERSION 35 | "${O3D3XX_VERSION_MAJOR}.${O3D3XX_VERSION_MINOR}.${O3D3XX_VERSION_PATCH}" 36 | OUTPUT_NAME o3d3xx_framegrabber 37 | LINKER_LANGUAGE CXX 38 | ) 39 | 40 | install( 41 | TARGETS o3d3xx_framegrabber_shared 42 | DESTINATION lib 43 | EXPORT o3d3xx_framegrabber-targets 44 | ) 45 | endif(BUILD_SHARED_LIBS) 46 | 47 | ################################################ 48 | ## Create the static library 49 | ################################################ 50 | if(BUILD_STATIC_LIBS) 51 | add_library(o3d3xx_framegrabber_static 52 | STATIC $) 53 | target_link_libraries( 54 | o3d3xx_framegrabber_static 55 | ${O3D3XX_CAMERA_LIBRARIES} 56 | ${LIB_glog} 57 | ${Boost_LIBRARIES} 58 | ${LIB_xmlrpcxx} 59 | ${LIB_xmlrpc_clientxx} 60 | ) 61 | 62 | set_target_properties(o3d3xx_framegrabber_static PROPERTIES 63 | LINKER_LANGUAGE CXX 64 | ) 65 | 66 | install( 67 | TARGETS o3d3xx_framegrabber_static 68 | DESTINATION lib 69 | EXPORT o3d3xx_framegrabber-targets 70 | ) 71 | endif(BUILD_STATIC_LIBS) 72 | -------------------------------------------------------------------------------- /modules/framegrabber/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(GTEST_CMAKE_DIR "/usr/src/gtest") 2 | enable_testing() 3 | add_subdirectory(${GTEST_CMAKE_DIR} gtest_bin EXCLUDE_FROM_ALL) 4 | file(GLOB FRAMEGRABBER_TEST_SOURCES *.cpp) 5 | add_executable(o3d3xx-framegrabber-tests 6 | ${FRAMEGRABBER_TEST_SOURCES}) 7 | if(BUILD_SHARED_LIBS) 8 | target_link_libraries(o3d3xx-framegrabber-tests 9 | gtest_main o3d3xx_framegrabber_shared 10 | ${O3D3XX_CAMERA_LIBRARIES} 11 | ) 12 | else() 13 | target_link_libraries(o3d3xx-framegrabber-tests 14 | gtest_main o3d3xx_framegrabber_static 15 | ${O3D3XX_CAMERA_LIBRARIES} 16 | ) 17 | endif(BUILD_SHARED_LIBS) 18 | 19 | if(CMAKE_CROSSCOMPILING) 20 | set_target_properties(o3d3xx-framegrabber-tests PROPERTIES 21 | COMPILE_FLAGS "${CROSSTOOL_COMPILE_FLAGS}" 22 | LINK_FLAGS "${CROSSTOOL_EXE_LINKER_FLAGS}") 23 | endif(CMAKE_CROSSCOMPILING) 24 | 25 | ################################################ 26 | ## If we are NOT cross-compiling, we create 27 | ## targets to run the tests. If we are cross- 28 | ## compiling, we install the built test suite 29 | ## so it can be run on the target machine. 30 | ################################################ 31 | if(NOT CMAKE_CROSSCOMPILING) 32 | add_test(NAME o3d3xx-framegrabber-tests COMMAND o3d3xx-framegrabber-tests) 33 | add_custom_target(check 34 | COMMAND o3d3xx-framegrabber-tests 35 | DEPENDS o3d3xx-framegrabber-tests) 36 | add_custom_target(stress 37 | COMMAND o3d3xx-framegrabber-tests --gtest_repeat=100 38 | DEPENDS o3d3xx-framegrabber-tests) 39 | else() 40 | install(TARGETS o3d3xx-framegrabber-tests DESTINATION test) 41 | #install(FILES 42 | # ${O3D3XX_FRAMEGRABBER_BINARY_DIR}/test/gtest_bin/libgtest.so 43 | # ${O3D3XX_FRAMEGRABBER_BINARY_DIR}/test/gtest_bin/libgtest_main.so 44 | # DESTINATION test/gtest_bin) 45 | 46 | endif(NOT CMAKE_CROSSCOMPILING) 47 | -------------------------------------------------------------------------------- /modules/framegrabber/test/o3d3xx-framegrabber-testrunner.cpp: -------------------------------------------------------------------------------- 1 | #include "o3d3xx_camera.h" 2 | #include 3 | #include "gtest/gtest.h" 4 | 5 | int main(int argc, char **argv) 6 | { 7 | FLAGS_logbuflevel = -1; 8 | o3d3xx::Logging::Init(); 9 | // keeps the unit test output cleaner 10 | google::SetStderrLogging(google::FATAL); 11 | ::testing::InitGoogleTest(&argc, argv); 12 | return RUN_ALL_TESTS(); 13 | } 14 | -------------------------------------------------------------------------------- /modules/image/include/o3d3xx_image.h: -------------------------------------------------------------------------------- 1 | // -*- c++ -*- 2 | /* 3 | * Copyright (C) 2016 Love Park Robotics, LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distribted on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef __O3D3XX_IMAGE_MODULE_H__ 19 | #define __O3D3XX_IMAGE_MODULE_H__ 20 | 21 | #include "o3d3xx_image/image.h" 22 | 23 | #endif // __O3D3XX_IMAGE_MODULE_H__ 24 | -------------------------------------------------------------------------------- /modules/image/o3d3xx_image-config-version.cmake.in: -------------------------------------------------------------------------------- 1 | set(O3D3XX_IMAGE_VERSION "@O3D3XX_VERSION_STRING@") 2 | 3 | if("${O3D3XX_IMAGE_VERSION}" 4 | VERSION_LESS "${O3D3XX_IMAGE_FIND_VERSION}") 5 | set(O3D3XX_IMAGE_VERSION_COMPATIBLE FALSE) 6 | set(O3D3XX_IMAGE_VERSION_EXACT FALSE) 7 | else() 8 | set(O3D3XX_IMAGE_VERSION_COMPATIBLE TRUE) 9 | if ("${O3D3XX_IMAGE_VERSION}" 10 | VERSION_EQUAL "${O3D3XX_IMAGE_FIND_VERSION}") 11 | set(O3D3XX_IMAGE_VERSION_EXACT TRUE) 12 | else() 13 | set(O3D3XX_IMAGE_VERSION_EXACT FALSE) 14 | endif() 15 | endif() 16 | -------------------------------------------------------------------------------- /modules/image/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(libo3d3xx_image) 2 | add_subdirectory(bin) 3 | -------------------------------------------------------------------------------- /modules/image/src/bin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################ 2 | ## Build the command-line tools 3 | ################################################ 4 | 5 | # Empty list 6 | set(O3D3XX_IMAGE_EXE_TARGETS) 7 | 8 | find_library(LIB_boost_program_options NAMES boost_program_options) 9 | 10 | #----------------------------------------------- 11 | # o3d3xx-viewer 12 | #----------------------------------------------- 13 | if(BUILD_EXE_VIEWER) 14 | add_executable(o3d3xx-viewer o3d3xx-viewer.cpp) 15 | 16 | if(BUILD_SHARED_LIBS) 17 | target_link_libraries(o3d3xx-viewer 18 | o3d3xx_image_shared 19 | ${O3D3XX_CAMERA_LIBRARIES} 20 | ${O3D3XX_FRAMEGRABBER_LIBRARIES} 21 | ${PCL_VISUALIZATION_LIBRARIES} 22 | ${OpenCV_LIBRARIES} 23 | ${LIB_boost_program_options} 24 | ) 25 | else() 26 | target_link_libraries(o3d3xx-viewer 27 | o3d3xx_image_static 28 | ${O3D3XX_CAMERA_LIBRARIES} 29 | ${O3D3XX_FRAMEGRABBER_LIBRARIES} 30 | ${PCL_VISUALIZATION_LIBRARIES} 31 | ${OpenCV_LIBRARIES} 32 | ${LIB_boost_program_options} 33 | ) 34 | endif(BUILD_SHARED_LIBS) 35 | 36 | set_target_properties(o3d3xx-viewer PROPERTIES 37 | AUTOMOC TRUE 38 | COMPILE_FLAGS "-Wno-deprecated" 39 | ) 40 | 41 | install(TARGETS o3d3xx-viewer DESTINATION bin) 42 | 43 | list(APPEND O3D3XX_EXE_TARGETS o3d3xx-viewer) 44 | else() 45 | message(STATUS "Skipping o3d3xx-viewer") 46 | endif(BUILD_EXE_VIEWER) 47 | 48 | #----------------------------------------------- 49 | #----------------------------------------------- 50 | #----------------------------------------------- 51 | if(CMAKE_CROSSCOMPILING) 52 | foreach(exe_target ${O3D3XX_IMAGE_EXE_TARGETS}) 53 | set_target_properties(${exe_target} PROPERTIES 54 | LINK_FLAGS "${CROSSTOOL_EXE_LINKER_FLAGS}" 55 | COMPILE_FLAGS "${CROSSTOOL_COMPILE_FLAGS}") 56 | endforeach(exe_target) 57 | endif(CMAKE_CROSSCOMPILING) 58 | -------------------------------------------------------------------------------- /modules/image/src/libo3d3xx_image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_library(LIB_glog NAMES glog) 2 | find_library(LIB_xmlrpcxx NAMES xmlrpc++) 3 | find_library(LIB_xmlrpc_clientxx NAMES xmlrpc_client++) 4 | 5 | file(GLOB O3D3XX_IMAGE_SOURCES *.cpp) 6 | 7 | ################################################ 8 | ## Compile source once for both shared and static libs 9 | ################################################ 10 | add_library(o3d3xx_image OBJECT ${O3D3XX_IMAGE_SOURCES}) 11 | set_property(TARGET o3d3xx_image PROPERTY POSITION_INDEPENDENT_CODE 1) 12 | if(CMAKE_CROSSCOMPILING) 13 | set_target_properties(o3d3xx_image PROPERTIES 14 | COMPILE_FLAGS "${CROSSTOOL_COMPILE_FLAGS}") 15 | endif(CMAKE_CROSSCOMPILING) 16 | 17 | ################################################ 18 | ## Create the shared library 19 | ################################################ 20 | if(BUILD_SHARED_LIBS) 21 | add_library(o3d3xx_image_shared 22 | SHARED $) 23 | target_link_libraries( 24 | o3d3xx_image_shared 25 | ${O3D3XX_CAMERA_LIBRARIES} 26 | ${O3D3XX_FRAMEGRABBER_LIBRARIES} 27 | ${OpenCV_LIBRARIES} 28 | ${LIB_glog} 29 | ${LIB_xmlrpcxx} 30 | ${LIB_xmlrpc_clientxx} 31 | ) 32 | 33 | set_target_properties(o3d3xx_image_shared PROPERTIES 34 | VERSION 35 | "${O3D3XX_VERSION_MAJOR}.${O3D3XX_VERSION_MINOR}.${O3D3XX_VERSION_PATCH}" 36 | OUTPUT_NAME o3d3xx_image 37 | LINKER_LANGUAGE CXX 38 | ) 39 | 40 | install( 41 | TARGETS o3d3xx_image_shared 42 | DESTINATION lib 43 | EXPORT o3d3xx_image-targets 44 | ) 45 | endif(BUILD_SHARED_LIBS) 46 | 47 | ################################################ 48 | ## Create the static library 49 | ################################################ 50 | if(BUILD_STATIC_LIBS) 51 | add_library(o3d3xx_image_static 52 | STATIC $) 53 | target_link_libraries( 54 | o3d3xx_image_static 55 | ${O3D3XX_CAMERA_LIBRARIES} 56 | ${O3D3XX_FRAMEGRABBER_LIBRARIES} 57 | ${OpenCV_LIBRARIES} 58 | ${LIB_glog} 59 | ${LIB_xmlrpcxx} 60 | ${LIB_xmlrpc_clientxx} 61 | ) 62 | 63 | set_target_properties(o3d3xx_image_static PROPERTIES 64 | LINKER_LANGUAGE CXX 65 | ) 66 | 67 | install( 68 | TARGETS o3d3xx_image_static 69 | DESTINATION lib 70 | EXPORT o3d3xx_image-targets 71 | ) 72 | endif(BUILD_STATIC_LIBS) 73 | -------------------------------------------------------------------------------- /modules/image/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_library(LIB_boost_system NAMES boost_system) 2 | 3 | set(GTEST_CMAKE_DIR "/usr/src/gtest") 4 | enable_testing() 5 | add_subdirectory(${GTEST_CMAKE_DIR} gtest_bin EXCLUDE_FROM_ALL) 6 | file(GLOB IMAGE_TEST_SOURCES *.cpp) 7 | add_executable(o3d3xx-image-tests 8 | ${IMAGE_TEST_SOURCES}) 9 | if(BUILD_SHARED_LIBS) 10 | target_link_libraries(o3d3xx-image-tests 11 | gtest_main o3d3xx_image_shared 12 | ${LIB_boost_system} 13 | ${O3D3XX_FRAMEGRABBER_LIBRARIES} 14 | ${O3D3XX_CAMERA_LIBRARIES}) 15 | else() 16 | target_link_libraries(o3d3xx-image-tests 17 | gtest_main o3d3xx_image_static 18 | ${LIB_boost_system} 19 | ${O3D3XX_FRAMEGRABBER_LIBRARIES} 20 | ${O3D3XX_CAMERA_LIBRARIES}) 21 | endif(BUILD_SHARED_LIBS) 22 | 23 | if(CMAKE_CROSSCOMPILING) 24 | set_target_properties(o3d3xx-image-tests PROPERTIES 25 | COMPILE_FLAGS "${CROSSTOOL_COMPILE_FLAGS}" 26 | LINK_FLAGS "${CROSSTOOL_EXE_LINKER_FLAGS}") 27 | endif(CMAKE_CROSSCOMPILING) 28 | 29 | ################################################ 30 | ## If we are NOT cross-compiling, we create 31 | ## targets to run the tests. If we are cross- 32 | ## compiling, we install the built test suite 33 | ## so it can be run on the target machine. 34 | ################################################ 35 | if(NOT CMAKE_CROSSCOMPILING) 36 | add_test(NAME o3d3xx-image-tests COMMAND o3d3xx-image-tests) 37 | add_custom_target(check 38 | COMMAND o3d3xx-image-tests 39 | DEPENDS o3d3xx-image-tests) 40 | add_custom_target(stress 41 | COMMAND o3d3xx-image-tests --gtest_repeat=100 42 | DEPENDS o3d3xx-image-tests) 43 | else() 44 | install(TARGETS o3d3xx-image-tests DESTINATION test) 45 | #install(FILES 46 | # ${O3D3XX_IMAGE_BINARY_DIR}/test/gtest_bin/libgtest.so 47 | # ${O3D3XX_IMAGE_BINARY_DIR}/test/gtest_bin/libgtest_main.so 48 | # DESTINATION test/gtest_bin) 49 | 50 | endif(NOT CMAKE_CROSSCOMPILING) 51 | -------------------------------------------------------------------------------- /modules/image/test/o3d3xx-image-testrunner.cpp: -------------------------------------------------------------------------------- 1 | #include "o3d3xx_camera.h" 2 | #include 3 | #include "gtest/gtest.h" 4 | 5 | int main(int argc, char **argv) 6 | { 7 | FLAGS_logbuflevel = -1; 8 | o3d3xx::Logging::Init(); 9 | // keeps the unit test output cleaner 10 | google::SetStderrLogging(google::FATAL); 11 | ::testing::InitGoogleTest(&argc, argv); 12 | return RUN_ALL_TESTS(); 13 | } 14 | -------------------------------------------------------------------------------- /modules/oem/cmake/utils/oem-install.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -f /tmp/@TGZ_FILE@ ] && [ -f /tmp/install_manifest.txt ]; then 4 | cd / && tar xvzf /tmp/@TGZ_FILE@ 5 | echo "" >> /tmp/install_manifest.txt 6 | if [ ! -d @O3D3XX_OEM_ETC_DIR@ ]; then 7 | mkdir -p @O3D3XX_OEM_ETC_DIR@ 8 | fi 9 | cp /tmp/install_manifest.txt @O3D3XX_OEM_ETC_DIR@/ 10 | chown -R oem.oem @O3D3XX_OEM_ETC_DIR@ 11 | cd /tmp && rm @TGZ_FILE@ install_manifest.txt 12 | fi 13 | -------------------------------------------------------------------------------- /modules/oem/cmake/utils/oem-uninstall.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -f @O3D3XX_OEM_ETC_DIR@/install_manifest.txt ]; then 4 | while read INFILE 5 | do 6 | if [ -f "${INFILE}" ] || [ -L "${INFILE}" ]; then 7 | rm -f "${INFILE}" 8 | fi 9 | done < @O3D3XX_OEM_ETC_DIR@/install_manifest.txt 10 | 11 | rm -rf @O3D3XX_OEM_ETC_DIR@ 12 | fi 13 | -------------------------------------------------------------------------------- /modules/oem/etc/setup.bash.in: -------------------------------------------------------------------------------- 1 | export LD_LIBRARY_PATH=@CPACK_INSTALL_PREFIX@/lib:${LD_LIBRARY_PATH} 2 | export PATH=@CPACK_INSTALL_PREFIX@/bin:${PATH} 3 | -------------------------------------------------------------------------------- /modules/oem/include/o3d3xx_oem.h: -------------------------------------------------------------------------------- 1 | // -*- c++ -*- 2 | /* 3 | * Copyright (C) 2017 Love Park Robotics, LLC 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distribted on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef __O3D3XX_OEM_MODULE_H__ 19 | #define __O3D3XX_OEM_MODULE_H__ 20 | 21 | #include "o3d3xx_oem/image_buffer.h" 22 | #include "o3d3xx_oem/frame_grabber.h" 23 | 24 | #endif // __O3D3XX_OEM_MODULE_H__ 25 | -------------------------------------------------------------------------------- /modules/oem/o3d3xx_oem-config-version.cmake.in: -------------------------------------------------------------------------------- 1 | set(O3D3XX_OEM_VERSION "@O3D3XX_VERSION_STRING@") 2 | 3 | if("${O3D3XX_OEM_VERSION}" 4 | VERSION_LESS "${O3D3XX_OEM_FIND_VERSION}") 5 | set(O3D3XX_OEM_VERSION_COMPATIBLE FALSE) 6 | set(O3D3XX_OEM_VERSION_EXACT FALSE) 7 | else() 8 | set(O3D3XX_OEM_VERSION_COMPATIBLE TRUE) 9 | if ("${O3D3XX_OEM_VERSION}" 10 | VERSION_EQUAL "${O3D3XX_OEM_FIND_VERSION}") 11 | set(O3D3XX_OEM_VERSION_EXACT TRUE) 12 | else() 13 | set(O3D3XX_OEM_VERSION_EXACT FALSE) 14 | endif() 15 | endif() 16 | -------------------------------------------------------------------------------- /modules/oem/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(libo3d3xx_oem) 2 | add_subdirectory(bin) 3 | -------------------------------------------------------------------------------- /modules/oem/src/bin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################ 2 | ## Build the command-line tools 3 | ################################################ 4 | find_library(LIB_boost_program_options NAMES boost_program_options) 5 | 6 | #----------------------------------------------- 7 | # o3d3xx-oem-jitter 8 | #----------------------------------------------- 9 | if(BUILD_EXE_JITTER) 10 | add_executable(o3d3xx-oem-jitter o3d3xx-oem-jitter.cpp) 11 | 12 | target_link_libraries(o3d3xx-oem-jitter 13 | o3d3xx_oem_shared 14 | ${OpenCV_LIBRARIES} 15 | ${O3D3XX_CAMERA_LIBRARIES} 16 | ${LIB_boost_program_options}) 17 | 18 | install(TARGETS o3d3xx-oem-jitter DESTINATION bin) 19 | else() 20 | message(STATUS "Skipping o3d3xx-oem-jitter") 21 | endif() 22 | -------------------------------------------------------------------------------- /modules/oem/src/libo3d3xx_oem/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_library(LIB_glog NAMES glog) 2 | find_library(LIB_opencv_core NAMES opencv_core) 3 | find_library(LIB_resultsync NAMES resultsync) 4 | 5 | file(GLOB O3D3XX_OEM_SOURCES *.cpp) 6 | 7 | add_library(o3d3xx_oem OBJECT ${O3D3XX_OEM_SOURCES}) 8 | set_property(TARGET o3d3xx_oem PROPERTY POSITION_INDEPENDENT_CODE 1) 9 | 10 | add_library(o3d3xx_oem_shared SHARED $) 11 | target_link_libraries(o3d3xx_oem_shared 12 | ${LIB_glog} 13 | ${LIB_opencv_core} 14 | ${LIB_resultsync} 15 | ${O3D3XX_CAMERA_LIBRARIES} 16 | ${O3D3XX_FRAMEGRABBER_LIBRARIES} 17 | ${O3D3XX_IMAGE_LIBRARIES} 18 | ${CMAKE_THREAD_LIBS_INIT} 19 | ) 20 | 21 | set_target_properties(o3d3xx_oem_shared PROPERTIES 22 | VERSION 23 | "${O3D3XX_VERSION_MAJOR}.${O3D3XX_VERSION_MINOR}.${O3D3XX_VERSION_PATCH}" 24 | OUTPUT_NAME o3d3xx_oem 25 | LINKER_LANGUAGE CXX 26 | ) 27 | 28 | install(TARGETS o3d3xx_oem_shared DESTINATION lib) 29 | -------------------------------------------------------------------------------- /modules/oem/src/libo3d3xx_oem/frame_grabber.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 Love Park Robotics, LLC 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distribted on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | o3d3xx::oem::FrameGrabber::FrameGrabber(o3d3xx::Camera::Ptr cam, 26 | std::uint16_t mask) 27 | : cam_(cam), 28 | mask_(mask), 29 | frame_client_(std::make_shared()) 30 | { } 31 | 32 | bool 33 | o3d3xx::oem::FrameGrabber::WaitForFrame(o3d3xx::oem::ImageBuffer* buff, 34 | long timeout_millis) 35 | { 36 | ifm::resultsync::Frame* frame = 37 | this->frame_client_->waitForFrame(timeout_millis); 38 | 39 | if (frame == nullptr) 40 | { 41 | LOG(WARNING) << "Timeout waiting for frame from resultsync!"; 42 | return false; 43 | } 44 | 45 | buff->Organize(frame, this->mask_); 46 | 47 | delete frame; 48 | return true; 49 | } 50 | -------------------------------------------------------------------------------- /modules/oem/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(GTEST_CMAKE_DIR "${SYSROOT_CONTRIB}/usr/src/gtest") 2 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${SYSROOT_CONTRIB}/usr/include") 3 | 4 | enable_testing() 5 | add_subdirectory(${GTEST_CMAKE_DIR} gtest_bin EXCLUDE_FROM_ALL) 6 | file(GLOB TEST_SOURCES *.cpp) 7 | add_executable(o3d3xx-oem-tests ${TEST_SOURCES}) 8 | target_link_libraries(o3d3xx-oem-tests 9 | gtest_main o3d3xx_oem_shared 10 | ${O3D3XX_FRAMEGRABBER_LIBRARIES} 11 | ${O3D3XX_CAMERA_LIBRARIES} 12 | ${O3D3XX_IMAGE_LIBRARIES} 13 | ${Boost_LIBRARIES} 14 | ) 15 | 16 | install(TARGETS o3d3xx-oem-tests DESTINATION bin) 17 | -------------------------------------------------------------------------------- /modules/oem/test/o3d3xx-oem-testrunner.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char **argv) 5 | { 6 | o3d3xx::Logging::Init(); 7 | ::testing::InitGoogleTest(&argc, argv); 8 | return RUN_ALL_TESTS(); 9 | } 10 | -------------------------------------------------------------------------------- /modules/pcicclient/o3d3xx_pcicclient-config-version.cmake.in: -------------------------------------------------------------------------------- 1 | set(O3D3XX_PCICCLIENT_VERSION "@O3D3XX_VERSION_STRING@") 2 | 3 | if("${O3D3XX_PCICCLIENT_VERSION}" 4 | VERSION_LESS "${O3D3XX_PCICCLIENT_FIND_VERSION}") 5 | set(O3D3XX_PCICCLIENT_VERSION_COMPATIBLE FALSE) 6 | set(O3D3XX_PCICCLIENT_VERSION_EXACT FALSE) 7 | else() 8 | set(O3D3XX_PCICCLIENT_VERSION_COMPATIBLE TRUE) 9 | if ("${O3D3XX_PCICCLIENT_VERSION}" 10 | VERSION_EQUAL "${O3D3XX_PCICCLIENT_FIND_VERSION}") 11 | set(O3D3XX_PCICCLIENT_VERSION_EXACT TRUE) 12 | else() 13 | set(O3D3XX_PCICCLIENT_VERSION_EXACT FALSE) 14 | endif() 15 | endif() 16 | -------------------------------------------------------------------------------- /modules/pcicclient/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(libo3d3xx_pcicclient) 2 | add_subdirectory(bin) 3 | -------------------------------------------------------------------------------- /modules/pcicclient/src/bin/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ifm/libo3d3xx/89d26a524bceee2f6ed20d9adf28414096635aa1/modules/pcicclient/src/bin/CMakeLists.txt -------------------------------------------------------------------------------- /modules/pcicclient/src/libo3d3xx_pcicclient/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_library(LIB_glog NAMES glog) 2 | find_library(LIB_xmlrpcxx NAMES xmlrpc++) 3 | find_library(LIB_xmlrpc_clientxx NAMES xmlrpc_client++) 4 | 5 | file(GLOB O3D3XX_PCICCLIENT_SOURCES *.cpp) 6 | 7 | ################################################ 8 | ## Compile source once for both shared and static libs 9 | ################################################ 10 | add_library(o3d3xx_pcicclient OBJECT ${O3D3XX_PCICCLIENT_SOURCES}) 11 | set_property(TARGET o3d3xx_pcicclient PROPERTY POSITION_INDEPENDENT_CODE 1) 12 | if(CMAKE_CROSSCOMPILING) 13 | set_target_properties(o3d3xx_pcicclient PROPERTIES 14 | COMPILE_FLAGS "${CROSSTOOL_COMPILE_FLAGS}") 15 | endif(CMAKE_CROSSCOMPILING) 16 | 17 | ################################################ 18 | ## Create the shared library 19 | ################################################ 20 | if(BUILD_SHARED_LIBS) 21 | add_library(o3d3xx_pcicclient_shared 22 | SHARED $) 23 | target_link_libraries( 24 | o3d3xx_pcicclient_shared 25 | ${O3D3XX_CAMERA_LIBRARIES} 26 | ${LIB_glog} 27 | ${Boost_LIBRARIES} 28 | ${LIB_xmlrpcxx} 29 | ${LIB_xmlrpc_clientxx} 30 | ${CMAKE_THREAD_LIBS_INIT} 31 | ) 32 | 33 | set_target_properties(o3d3xx_pcicclient_shared PROPERTIES 34 | VERSION 35 | "${O3D3XX_VERSION_MAJOR}.${O3D3XX_VERSION_MINOR}.${O3D3XX_VERSION_PATCH}" 36 | OUTPUT_NAME o3d3xx_pcicclient 37 | LINKER_LANGUAGE CXX 38 | ) 39 | 40 | install( 41 | TARGETS o3d3xx_pcicclient_shared 42 | DESTINATION lib 43 | EXPORT o3d3xx_pcicclient-targets 44 | ) 45 | endif(BUILD_SHARED_LIBS) 46 | 47 | ################################################ 48 | ## Create the static library 49 | ################################################ 50 | if(BUILD_STATIC_LIBS) 51 | add_library(o3d3xx_pcicclient_static 52 | STATIC $) 53 | target_link_libraries( 54 | o3d3xx_pcicclient_static 55 | ${O3D3XX_CAMERA_LIBRARIES} 56 | ${LIB_glog} 57 | ${Boost_LIBRARIES} 58 | ${LIB_xmlrpcxx} 59 | ${LIB_xmlrpc_clientxx} 60 | ) 61 | 62 | set_target_properties(o3d3xx_pcicclient_static PROPERTIES 63 | LINKER_LANGUAGE CXX 64 | ) 65 | 66 | install( 67 | TARGETS o3d3xx_pcicclient_static 68 | DESTINATION lib 69 | EXPORT o3d3xx_pcicclient-targets 70 | ) 71 | endif(BUILD_STATIC_LIBS) 72 | -------------------------------------------------------------------------------- /modules/pcicclient/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(GTEST_CMAKE_DIR "/usr/src/gtest") 2 | enable_testing() 3 | add_subdirectory(${GTEST_CMAKE_DIR} gtest_bin EXCLUDE_FROM_ALL) 4 | file(GLOB PCICCLIENT_TEST_SOURCES *.cpp) 5 | add_executable(o3d3xx-pcicclient-tests 6 | ${PCICCLIENT_TEST_SOURCES}) 7 | if(BUILD_SHARED_LIBS) 8 | target_link_libraries(o3d3xx-pcicclient-tests 9 | gtest_main o3d3xx_pcicclient_shared 10 | ${O3D3XX_CAMERA_LIBRARIES} 11 | ) 12 | else() 13 | target_link_libraries(o3d3xx-pcicclient-tests 14 | gtest_main o3d3xx_pcicclient_static 15 | ${O3D3XX_CAMERA_LIBRARIES} 16 | ) 17 | endif(BUILD_SHARED_LIBS) 18 | 19 | if(CMAKE_CROSSCOMPILING) 20 | set_target_properties(o3d3xx-pcicclient-tests PROPERTIES 21 | COMPILE_FLAGS "${CROSSTOOL_COMPILE_FLAGS}" 22 | LINK_FLAGS "${CROSSTOOL_EXE_LINKER_FLAGS}") 23 | endif(CMAKE_CROSSCOMPILING) 24 | 25 | ################################################ 26 | ## If we are NOT cross-compiling, we create 27 | ## targets to run the tests. If we are cross- 28 | ## compiling, we install the built test suite 29 | ## so it can be run on the target machine. 30 | ################################################ 31 | if(NOT CMAKE_CROSSCOMPILING) 32 | add_test(NAME o3d3xx-pcicclient-tests COMMAND o3d3xx-pcicclient-tests) 33 | add_custom_target(check 34 | COMMAND o3d3xx-pcicclient-tests 35 | DEPENDS o3d3xx-pcicclient-tests) 36 | add_custom_target(stress 37 | COMMAND o3d3xx-pcicclient-tests --gtest_repeat=100 38 | DEPENDS o3d3xx-pcicclient-tests) 39 | else() 40 | install(TARGETS o3d3xx-pcicclient-tests DESTINATION test) 41 | #install(FILES 42 | # ${O3D3XX_PCICCLIENT_BINARY_DIR}/test/gtest_bin/libgtest.so 43 | # ${O3D3XX_PCICCLIENT_BINARY_DIR}/test/gtest_bin/libgtest_main.so 44 | # DESTINATION test/gtest_bin) 45 | 46 | endif(NOT CMAKE_CROSSCOMPILING) 47 | -------------------------------------------------------------------------------- /modules/pcicclient/test/o3d3xx-pcicclient-testrunner.cpp: -------------------------------------------------------------------------------- 1 | #include "o3d3xx_camera.h" 2 | #include 3 | #include "gtest/gtest.h" 4 | 5 | int main(int argc, char **argv) 6 | { 7 | FLAGS_logbuflevel = -1; 8 | o3d3xx::Logging::Init(); 9 | // keeps the unit test output cleaner 10 | google::SetStderrLogging(google::FATAL); 11 | ::testing::InitGoogleTest(&argc, argv); 12 | return RUN_ALL_TESTS(); 13 | } 14 | -------------------------------------------------------------------------------- /modules/pcicclient/test/o3d3xx-pcicclient-tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "gtest/gtest.h" 6 | #include "o3d3xx_camera.h" 7 | #include "o3d3xx_pcicclient.h" 8 | 9 | class PCICClientTest : public ::testing::Test 10 | { 11 | protected: 12 | virtual void SetUp() 13 | { 14 | cam_ = std::make_shared(); 15 | cam_->RequestSession(); 16 | cam_->SetOperatingMode(o3d3xx::Camera::operating_mode::EDIT); 17 | 18 | dev_ = cam_->GetDeviceConfig(); 19 | old_active_idx_ = dev_->ActiveApplication(); 20 | 21 | idx_ = cam_->CopyApplication(old_active_idx_); 22 | dev_->SetActiveApplication(idx_); 23 | cam_->SetDeviceConfig(dev_.get()); 24 | cam_->SaveDevice(); 25 | cam_->CancelSession(); 26 | } 27 | 28 | virtual void TearDown() 29 | { 30 | cam_->RequestSession(); 31 | cam_->SetOperatingMode(o3d3xx::Camera::operating_mode::EDIT); 32 | dev_->SetActiveApplication(old_active_idx_); 33 | cam_->SetDeviceConfig(dev_.get()); 34 | cam_->SaveDevice(); 35 | cam_->DeleteApplication(idx_); 36 | } 37 | 38 | o3d3xx::Camera::Ptr cam_; 39 | o3d3xx::DeviceConfig::Ptr dev_; 40 | int idx_ = -1; 41 | int old_active_idx_ = -1; 42 | }; 43 | 44 | TEST_F(PCICClientTest, IncomingResponseMessage) 45 | { 46 | o3d3xx::PCICClient::Ptr pc = std::make_shared(cam_); 47 | 48 | for(int i = 0; i < 5; ++i) 49 | { 50 | std::string result = pc->Call("C?"); 51 | EXPECT_GT(result.size(), 0); 52 | } 53 | 54 | pc->Stop(); 55 | } 56 | 57 | TEST_F(PCICClientTest, InvalidCommandLength) 58 | { 59 | o3d3xx::PCICClient::Ptr pc = std::make_shared(cam_); 60 | 61 | for(int i = 0; i < 5; ++i) 62 | { 63 | std::string result = pc->Call("Ca?"); 64 | EXPECT_STREQ(result.c_str(), "?"); 65 | } 66 | 67 | pc->Stop(); 68 | } 69 | --------------------------------------------------------------------------------