diff --git a/cmake/Modules/FindCGAL.cmake b/cmake/Modules/FindCGAL.cmake index b44ea93..47167fb 100644 --- a/cmake/Modules/FindCGAL.cmake +++ b/cmake/Modules/FindCGAL.cmake @@ -8,6 +8,21 @@ # CGAL_LIBRARIES : all libraries in one variable (use this in your CMakeLists) # CGAL_LIBRARY_DIR : library path # CGAL_CGAL_LIBRARY : full path to library +# +# NOTE: CGAL has changed their naming conventions +# over the years, e.g. CGALimageIO is now CGAL_ImageIO +# This find script tries to find the old and the +# new, so it's guaranteed to print a warning about +# libraries it did not find. +# +# NEW LIBRARY VARIABLES: +#-------------------------- +# CGAL_CGAL_Core_LIBRARY +# CGAL_CGAL_ImageIO_LIBRARY +# CGAL_CGAL_Qt4_LIBRARY +# +# OLD LIBRARY VARIABLES: +# ------------------------- # CGAL_CGALQt_LIBRARY : full path to library # CGAL_CGALPDB_LIBRARY : full path to library # CGAL_CGALimageIO_LIBRARY : full path to library @@ -20,7 +35,7 @@ include( SimplePackageFind ) set( PACKAGE_NAME CGAL ) set( PACKAGE_DIRS CGAL ) set( PACKAGE_REQ_LIBRARY CGAL ) -set( PACKAGE_REQ_INCLUDE CGAL/CGALversion.h ) +set( PACKAGE_REQ_INCLUDE CGAL/version.h CGAL/CGALversion.h ) simple_package_find("${PACKAGE_NAME}" "${PACKAGE_DIRS}" @@ -28,10 +43,17 @@ simple_package_find("${PACKAGE_NAME}" "${PACKAGE_REQ_INCLUDE}" ) +# NOTE: CGAL has changed their naming conventions +# over the years, e.g. CGALimageIO is now CGAL_ImageIO +# This find script tries to find the old and the +# new, so it's guaranteed to ################################################ if( ${PACKAGE_FOUND} ) set( LIBRARY_NAMES CGAL + CGAL_Core + CGAL_ImageIO + CGAL_Qt4 CGALQt CGALPDB CGALimageIO diff --git a/cmake/Modules/FindOpenCV-irg.cmake b/cmake/Modules/FindOpenCV-irg.cmake deleted file mode 100644 index bc268fc..0000000 --- a/cmake/Modules/FindOpenCV-irg.cmake +++ /dev/null @@ -1,76 +0,0 @@ -###################################################################### -# Find script for OpenCV -# -# The FindOpenCV script provided by Willow Garage follows Boost -# convention for variable names, (i.e. MyProject_VARIABLE) not -# the CMake variable convention (i.e. MYPROJECT_VARIABLE) -# We create variables in their form for compatibility -# -# Output Variables: -# ----------------- -# OpenCV_FOUND : TRUE if search succeded -# OpenCV_INCLUDE_DIR : include path -# OpenCV_LIBRARIES : libraries in one variable (use this in your CMakeLists) -# OpenCV_LIBRARY_DIR : library path -# OPENCV_opencv_LIBRARY : full path to cv -# -###################################################################### - -include( SimplePackageFind ) - -set( PACKAGE_NAME OpenCV ) -set( PACKAGE_DIRS opencv ) -set( PACKAGE_REQ_LIBRARY opencv_core ) -set( PACKAGE_REQ_INCLUDE opencv2/opencv.hpp ) - -simple_package_find("${PACKAGE_NAME}" - "${PACKAGE_DIRS}" - "${PACKAGE_REQ_LIBRARY}" - "${PACKAGE_REQ_INCLUDE}" -) - -## -## find paths to package libraries -## -################################################ -if( ${PACKAGE_FOUND} ) - - set( LIBRARY_NAMES - opencv_calib3d - opencv_contrib - opencv_core - opencv_features2d - opencv_flann - opencv_gpu - opencv_highgui - opencv_imgproc - opencv_legacy - opencv_ml - opencv_objdetect - opencv_ts - opencv_video - ) - get_library_list(OPENCV ${OPENCV_LIBRARY_DIR} "d" "${LIBRARY_NAMES}") - - ## Compatibility variables - set( OpenCV_FOUND ${OPENCV_FOUND} ) - set( OpenCV_INCLUDE_DIR ${OPENCV_INCLUDE_DIR} ) - set( OpenCV_LIBRARIES ${OPENCV_LIBRARIES} ) - set( OpenCV_LIBRARY_DIR ${OPENCV_LIBRARY_DIR} ) - set( OPENCV_LIB_COMPONENTS ${LIBRARY_NAMES} ) - set( OpenCV_DIR ${OPENCV_ROOT_DIR} ) - - #Find OpenCV version - find_file( OPENCV_VERSION_H opencv2/core/version.hpp PATHS ${OpenCV_INCLUDE_DIR} NO_DEFAULT_PATH) - if(OPENCV_VERSION_H) - file(STRINGS ${OPENCV_VERSION_H} OpenCV_VERSIONS_TMP REGEX "^#define CV_[A-Z]+_VERSION[ \t]+[0-9]+$") - string(REGEX REPLACE ".*#define CV_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_MAJOR ${OpenCV_VERSIONS_TMP}) - string(REGEX REPLACE ".*#define CV_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_MINOR ${OpenCV_VERSIONS_TMP}) - string(REGEX REPLACE ".*#define CV_SUBMINOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_PATCH ${OpenCV_VERSIONS_TMP}) - set(OpenCV_VERSION ${OpenCV_VERSION_MAJOR}.${OpenCV_VERSION_MINOR}.${OpenCV_VERSION_PATCH} CACHE STRING "" FORCE) - else(OPENCV_VERSION_H) - message( SEND_ERROR " Could not find OpenCV version header") - endif(OPENCV_VERSION_H) - -endif( ${PACKAGE_FOUND} ) - diff --git a/cmake/Modules/FindOpenCV-useConfig.cmake b/cmake/Modules/FindOpenCV-useConfig.cmake deleted file mode 100644 index 472fdef..0000000 --- a/cmake/Modules/FindOpenCV-useConfig.cmake +++ /dev/null @@ -1,103 +0,0 @@ -# this is a chopped-down version of the FindOpenCV.cmake script from -# WillowGarage. Modifying that script became too convoluted, so -# we keep things simple and throw out the old stuff - -if(EXISTS "${OpenCVConfig_FILE}") - include("${OpenCVConfig_FILE}") - - if(WIN32) - # sigh. OpenCV_INSTALL_PATH is invalid on windows, - # so derive OpenCV_DIR from OpenCV_LIB_DIR - # XXX This will fail if OpenCV_LIB_DIR has more than one entry - string( REGEX REPLACE "/[^/]*$" "" OpenCV_DIR ${OpenCV_LIB_DIR} ) - else(WIN32) - set( OpenCV_DIR ${OpenCV_INSTALL_PATH} ) - endif(WIN32) - - ## Awesome. OpenCVConfig.cmake has changed yet again and - ## no longer has the OpenCV_LIB_DIR variable (at least on - ## Ubuntu 14.04) So lets try and guess what it is, shall we? - if( NOT OpenCV_LIB_DIR ) - if(CMAKE_VERSION VERSION_GREATER 2.8.4) - include(GNUInstallDirs) - else(CMAKE_VERSION VERSION_GREATER 2.8.4) - # if we're using an ancient cmake, just fake it - set(CMAKE_INSTALL_LIBDIR lib) - endif(CMAKE_VERSION VERSION_GREATER 2.8.4) - find_library( OPENCV_CORE_LIB opencv_core - HINTS ${OpenCV_INSTALL_PATH}/lib - ${OpenCV_INSTALL_PATH}/${CMAKE_INSTALL_LIBDIR} - NO_DEFAULT_PATH ) - string(REGEX REPLACE "/[^/]*$" "" OpenCV_LIB_DIR ${OPENCV_CORE_LIB}) - unset(OPENCV_CORE_LIB CACHE) - endif( NOT OpenCV_LIB_DIR ) - - ## print out the important variables to help debug if things go wrong - message( STATUS " OpenCV_INSTALL_PATH=${OpenCV_INSTALL_PATH}") - message( STATUS " OpenCV_LIB_DIR=${OpenCV_LIB_DIR}") - - ## Search for a specific version - set(CVLIB_SUFFIX "${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}") - - if(NOT OPENCV_LIB_COMPONENTS) - set(OPENCV_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS}) - endif(NOT OPENCV_LIB_COMPONENTS) - -else(EXISTS "${OpenCVConfig_FILE}") - - message( SEND_ERROR " OpenCVConfig_FILE is '${OpenCVConfig_FILE}'. This script should only be called if OpenCVConfig_FILE exists." ) - -endif(EXISTS "${OpenCVConfig_FILE}") - -set(OpenCV_LIBS "") -set(OpenCV_FOUND_TMP true) -## Loop over each component to determine full path -foreach(__CVLIB ${OPENCV_LIB_COMPONENTS}) - - find_library(OpenCV_${__CVLIB}_LIBRARY_DEBUG - NAMES "${__CVLIB}${CVLIB_SUFFIX}d" "lib${__CVLIB}${CVLIB_SUFFIX}d" "${__CVLIB}d" - PATHS ${OpenCV_LIB_DIR} - NO_DEFAULT_PATH) - find_library(OpenCV_${__CVLIB}_LIBRARY_RELEASE - NAMES "${__CVLIB}${CVLIB_SUFFIX}" "lib${__CVLIB}${CVLIB_SUFFIX}" "${__CVLIB}" - PATHS ${OpenCV_LIB_DIR} - NO_DEFAULT_PATH) - - # clear the cache value - set(OpenCV_${__CVLIB}_LIBRARY "" CACHE STRING "" FORCE) - - if(OpenCV_${__CVLIB}_LIBRARY_DEBUG AND OpenCV_${__CVLIB}_LIBRARY_RELEASE) - set(OpenCV_${__CVLIB}_LIBRARY debug ${OpenCV_${__CVLIB}_LIBRARY_DEBUG} optimized ${OpenCV_${__CVLIB}_LIBRARY_RELEASE} CACHE STRING "" FORCE) - elseif(OpenCV_${__CVLIB}_LIBRARY_DEBUG) - set(OpenCV_${__CVLIB}_LIBRARY ${OpenCV_${__CVLIB}_LIBRARY_DEBUG} CACHE STRING "" FORCE) - elseif(OpenCV_${__CVLIB}_LIBRARY_RELEASE) - set(OpenCV_${__CVLIB}_LIBRARY ${OpenCV_${__CVLIB}_LIBRARY_RELEASE} CACHE STRING "" FORCE) - else() - message(STATUS " OpenCV_${__CVLIB}_LIBRARY not found." ) - message(STATUS " OpenCV_LIB_DIR=${OpenCV_LIB_DIR} " ) - message(STATUS " __CVLIB=${__CVLIB} " ) - set(OpenCV_FOUND_TMP false) - endif() - - #Add to the general list - if(OpenCV_${__CVLIB}_LIBRARY) - set(OpenCV_LIBS ${OpenCV_LIBS} ${OpenCV_${__CVLIB}_LIBRARY}) - endif(OpenCV_${__CVLIB}_LIBRARY) - -endforeach(__CVLIB) - -set( OpenCV_FOUND ${OpenCV_FOUND_TMP} CACHE BOOL "" FORCE ) -set( OpenCV_LIBRARIES "${OpenCV_LIBS}" ) - -##==================================================== -if(NOT OpenCV_FOUND) - # make FIND_PACKAGE friendly - if(NOT OpenCV_FIND_QUIETLY) - if(OpenCV_FIND_REQUIRED) - message(FATAL_ERROR "OpenCV required but some headers or libs not found. ${ERR_MSG}") - else(OpenCV_FIND_REQUIRED) - message(STATUS "WARNING: OpenCV was not found. ${ERR_MSG}") - endif(OpenCV_FIND_REQUIRED) - endif(NOT OpenCV_FIND_QUIETLY) -endif(NOT OpenCV_FOUND) -##==================================================== diff --git a/cmake/Modules/FindOpenCV-willow.cmake b/cmake/Modules/FindOpenCV-willow.cmake deleted file mode 100644 index 3ee2537..0000000 --- a/cmake/Modules/FindOpenCV-willow.cmake +++ /dev/null @@ -1,265 +0,0 @@ -########################################################### -# Find OpenCV Library -# See http://sourceforge.net/projects/opencvlibrary/ -#---------------------------------------------------------- -# -## 1: Setup: -# The following variables are optionally searched for defaults -# OpenCV_DIR: Base directory of OpenCv tree to use. -# -## 2: Variable -# The following are set after configuration is done: -# -# OpenCV_FOUND -# OpenCV_LIBS -# OpenCV_INCLUDE_DIR -# OpenCV_VERSION (OpenCV_VERSION_MAJOR, OpenCV_VERSION_MINOR, OpenCV_VERSION_PATCH) -# -# -# Deprecated variable are used to maintain backward compatibility with -# the script of Jan Woetzel (2006/09): www.mip.informatik.uni-kiel.de/~jw -# OpenCV_INCLUDE_DIRS -# OpenCV_LIBRARIES -# OpenCV_LINK_DIRECTORIES -# -## 3: Version -# -# 2013/12/11 Mark Allan, add search for opencv2 include directory and warn about include path -# 2010/10/19 Mark Allan, remove conditional around 'backwards comatibility' because those variables are conventional -# 2010/09/15 Mark Allan, Improve find behavior for rpm installs of OpenCV -# 2010/04/07 Benoit Rat, Correct a bug when OpenCVConfig.cmake is not found. -# 2010/03/24 Benoit Rat, Add compatibility for when OpenCVConfig.cmake is not found. -# 2010/03/22 Benoit Rat, Creation of the script. -# -# -# tested with: -# - OpenCV 2.1: MinGW, MSVC2008 -# - OpenCV 2.0: MinGW, MSVC2008, GCC4 -# -# -## 4: Licence: -# -# LGPL 2.1 : GNU Lesser General Public License Usage -# Alternatively, this file may be used under the terms of the GNU Lesser - -# General Public License version 2.1 as published by the Free Software -# Foundation and appearing in the file LICENSE.LGPL included in the -# packaging of this file. Please review the following information to -# ensure the GNU Lesser General Public License version 2.1 requirements -# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -# -#---------------------------------------------------------- -cmake_minimum_required(VERSION 2.6.3) # 'unset' command was added in version 2.6.3 - -find_path(OpenCV_DIR "OpenCVConfig.cmake" DOC "Root directory of OpenCV") - -#message(STATUS " (dbg) OpenCVConfig_FILE = ${OpenCVConfig_FILE}") -# OpenCVConfig may not be in root dir, so look for -# in in a few other places -find_file(OpenCVConfig_FILE "OpenCVConfig.cmake" - PATHS ${OpenCV_DIR} - ${OpenCV_DIR}/share/opencv - /usr/share/opencv - /usr/local/share/opencv - /opt/local/share/opencv - /opt/local/lib/cmake - DOC "Full path of OpenCVConfig.cmake" - NO_DEFAULT_PATH) -#message(STATUS " (dbg) OpenCVConfig_FILE = ${OpenCVConfig_FILE}") - -# if OpenCV_DIR is not set but OpenCVConfig.cmake was found, try to -# find cv.h and use it to set OpenCV_DIR -if(NOT OpenCV_DIR AND EXISTS ${OpenCVConfig_FILE}) - # places to look for cv.h - string( REGEX REPLACE "/[^/]*/[^/]*/[^/]*$" "" TMP_OPENCV_ROOT_1 ${OpenCVConfig_FILE} ) - string( REGEX REPLACE "/[^/]*/[^/]*/[^/]*/[^/]*$" "" TMP_OPENCV_ROOT_2 ${OpenCVConfig_FILE} ) - string( REGEX REPLACE "/[^/]*$" "" TMP_OPENCV_ROOT_3 ${OpenCVConfig_FILE} ) - - find_file(TMP_OPENCV_CV_H_FILE "cv.h" - PATHS "${TMP_OPENCV_ROOT_1}" "${TMP_OPENCV_ROOT_2}" "${TMP_OPENCV_ROOT_3}" - PATH_SUFFIXES "include/opencv" - DOC "tmp" - NO_DEFAULT_PATH ) - - # mallan: cv.h is a deprecated header. Look for new version... - if( NOT EXISTS ${TMP_OPENCV_CV_H_FILE} ) - set( HAVE_OLD_OPENCV_HEADERS FALSE ) - find_file(TMP_OPENCV_CV_H_FILE "opencv.hpp" - PATHS "${TMP_OPENCV_ROOT_1}" "${TMP_OPENCV_ROOT_2}" "${TMP_OPENCV_ROOT_3}" - PATH_SUFFIXES "include/opencv2" - DOC "tmp" - NO_DEFAULT_PATH ) - else( NOT EXISTS ${TMP_OPENCV_CV_H_FILE} ) - set( HAVE_OLD_OPENCV_HEADERS TRUE ) - endif( NOT EXISTS ${TMP_OPENCV_CV_H_FILE} ) - - if( EXISTS ${TMP_OPENCV_CV_H_FILE} ) - # remove include/opencv/cv.h and set root dir - string ( REGEX REPLACE "/[^/]*/[^/]*/[^/]*$" "" TMP_OPENCV_ROOT ${TMP_OPENCV_CV_H_FILE} ) - set( OpenCV_DIR ${TMP_OPENCV_ROOT} CACHE PATH "Root directory of OpenCV" FORCE ) - endif( EXISTS ${TMP_OPENCV_CV_H_FILE} ) - unset( TMP_OPENCV_CV_H_FILE CACHE ) - unset( TMP_OPENCV_ROOT_1 ) - unset( TMP_OPENCV_ROOT_2 ) -endif(NOT OpenCV_DIR AND EXISTS ${OpenCVConfig_FILE}) - -##==================================================== -## Find OpenCV libraries -##---------------------------------------------------- -if(EXISTS "${OpenCV_DIR}") - - #When its possible to use the Config script use it. - if(EXISTS "${OpenCVConfig_FILE}") - - ## Include the standard CMake script - include("${OpenCVConfig_FILE}") - ## Search for a specific version - set(CVLIB_SUFFIX "${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}") - - ## Changes to OpenCVConfig.cmake in 2.3 cause some headaches, - ## so try to add some backwards compatibility - #message(STATUS " debug: OPENCV_LIB_COMPONENTS=${OPENCV_LIB_COMPONENTS}") - #message(STATUS " debug: OpenCV_LIB_COMPONENTS=${OpenCV_LIB_COMPONENTS}") - if(NOT OPENCV_LIB_COMPONENTS) - set(OPENCV_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS}) - endif(NOT OPENCV_LIB_COMPONENTS) - #message(STATUS " debug: OPENCV_LIB_COMPONENTS=${OPENCV_LIB_COMPONENTS}") - - #Otherwise it try to guess it. - else(EXISTS "${OpenCVConfig_FILE}") - - ## FIXME this probably no longer works for 2.3+ - find_path(OpenCV_INCLUDE_DIR "cv.h" PATHS "${OpenCV_DIR}" PATH_SUFFIXES "include" "include/opencv" DOC "") - if(EXISTS ${OpenCV_INCLUDE_DIR}) - include_directories(${OpenCV_INCLUDE_DIR}) - endif(EXISTS ${OpenCV_INCLUDE_DIR}) - - ## FIXME this probably no longer works for 2.3+ - ## Find OpenCV version by looking at cvver.h - file(STRINGS ${OpenCV_INCLUDE_DIR}/cvver.h OpenCV_VERSIONS_TMP REGEX "^#define CV_[A-Z]+_VERSION[ \t]+[0-9]+$") - string(REGEX REPLACE ".*#define CV_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_MAJOR ${OpenCV_VERSIONS_TMP}) - string(REGEX REPLACE ".*#define CV_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_MINOR ${OpenCV_VERSIONS_TMP}) - string(REGEX REPLACE ".*#define CV_SUBMINOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_PATCH ${OpenCV_VERSIONS_TMP}) - set(OpenCV_VERSION ${OpenCV_VERSION_MAJOR}.${OpenCV_VERSION_MINOR}.${OpenCV_VERSION_PATCH} CACHE STRING "" FORCE) - set(CVLIB_SUFFIX "${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}") - - if( "${OpenCV_VERSION}" VERSION_GREATER "2.2.99" ) - set(OPENCV_LIB_COMPONENTS - opencv_core - opencv_imgproc - opencv_highgui - opencv_ml - opencv_features2d - opencv_video - opencv_objdetect - opencv_calib3d - opencv_flann - opencv_contrib - opencv_legacy - opencv_gpu ) - else( "${OpenCV_VERSION}" VERSION_GREATER "2.2.9" ) - # old library names - set(OPENCV_LIB_COMPONENTS - cxcore - cv - ml - highgui - cvaux ) - endif( "${OpenCV_VERSION}" VERSION_GREATER "2.2.9" ) - - endif(EXISTS "${OpenCVConfig_FILE}") - - - ## Initiate the variable before the loop - set(OpenCV_LIBS "") - set(OpenCV_FOUND_TMP true) - - ## Loop over each component to determine full path - foreach(__CVLIB ${OPENCV_LIB_COMPONENTS}) - - find_library(OpenCV_${__CVLIB}_LIBRARY_DEBUG - NAMES "${__CVLIB}${CVLIB_SUFFIX}d" "lib${__CVLIB}${CVLIB_SUFFIX}d" "${__CVLIB}d" - PATHS "${OpenCV_DIR}/lib" - NO_DEFAULT_PATH) - find_library(OpenCV_${__CVLIB}_LIBRARY_RELEASE - NAMES "${__CVLIB}${CVLIB_SUFFIX}" "lib${__CVLIB}${CVLIB_SUFFIX}" "${__CVLIB}" - PATHS "${OpenCV_DIR}/lib" - NO_DEFAULT_PATH) - - #Remove the cache value - set(OpenCV_${__CVLIB}_LIBRARY "" CACHE STRING "" FORCE) - - #both debug/release - if(OpenCV_${__CVLIB}_LIBRARY_DEBUG AND OpenCV_${__CVLIB}_LIBRARY_RELEASE) - set(OpenCV_${__CVLIB}_LIBRARY debug ${OpenCV_${__CVLIB}_LIBRARY_DEBUG} optimized ${OpenCV_${__CVLIB}_LIBRARY_RELEASE} CACHE STRING "" FORCE) - #only debug - elseif(OpenCV_${__CVLIB}_LIBRARY_DEBUG) - set(OpenCV_${__CVLIB}_LIBRARY ${OpenCV_${__CVLIB}_LIBRARY_DEBUG} CACHE STRING "" FORCE) - #only release - elseif(OpenCV_${__CVLIB}_LIBRARY_RELEASE) - set(OpenCV_${__CVLIB}_LIBRARY ${OpenCV_${__CVLIB}_LIBRARY_RELEASE} CACHE STRING "" FORCE) - #no library found - else() - set(OpenCV_FOUND_TMP false) - endif() - - #Add to the general list - if(OpenCV_${__CVLIB}_LIBRARY) - set(OpenCV_LIBS ${OpenCV_LIBS} ${OpenCV_${__CVLIB}_LIBRARY}) - endif(OpenCV_${__CVLIB}_LIBRARY) - - endforeach(__CVLIB) - - - set(OpenCV_FOUND ${OpenCV_FOUND_TMP} CACHE BOOL "" FORCE) - - -else(EXISTS "${OpenCV_DIR}") - set(ERR_MSG "Please specify OpenCV directory using OpenCV_DIR env. variable") -endif(EXISTS "${OpenCV_DIR}") -##==================================================== - - -##==================================================== -## Print message -##---------------------------------------------------- -if(NOT OpenCV_FOUND) - # make FIND_PACKAGE friendly - if(NOT OpenCV_FIND_QUIETLY) - if(OpenCV_FIND_REQUIRED) - message(FATAL_ERROR "OpenCV required but some headers or libs not found. ${ERR_MSG}") - else(OpenCV_FIND_REQUIRED) - message(STATUS "WARNING: OpenCV was not found. ${ERR_MSG}") - endif(OpenCV_FIND_REQUIRED) - endif(NOT OpenCV_FIND_QUIETLY) -endif(NOT OpenCV_FOUND) -##==================================================== - - -##==================================================== -## Backward compatibility -##---------------------------------------------------- -#if(OpenCV_FOUND) -#option(OpenCV_BACKWARD_COMPA "Add some variable to make this script compatible with the other version of FindOpenCV.cmake" false) -#if(OpenCV_BACKWARD_COMPA) - - #find_path(OpenCV_INCLUDE_DIRS "cv.h" PATHS "${OpenCV_DIR}" PATH_SUFFIXES "include" "include/opencv" DOC "Include directory") - if( HAVE_OLD_OPENCV_HEADERS ) - find_path(OpenCV_INCLUDE_DIR "opencv/cv.h" HINTS "${OpenCV_DIR}" PATH_SUFFIXES "include" "include/opencv" DOC "Include directory") - else( HAVE_OLD_OPENCV_HEADERS ) - find_path(OpenCV_INCLUDE_DIR "opencv2/opencv.hpp" HINTS "${OpenCV_DIR}" PATH_SUFFIXES "include" DOC "Include directory") - endif( HAVE_OLD_OPENCV_HEADERS ) - set(OpenCV_LIBRARIES "${OpenCV_LIBS}" CACHE STRING "" FORCE) - -#endif(OpenCV_BACKWARD_COMPA) -#endif(OpenCV_FOUND) -##==================================================== -if(OpenCV_FOUND) - if(HAVE_OLD_OPENCV_HEADERS) - message(STATUS " NOTE: The old OpenCV headers exist (i.e. include/opencv/cv.h) but these are deprecated") - message(STATUS " and should not be used. Use include/opencv2/opencv.hpp") - else(HAVE_OLD_OPENCV_HEADERS) - message(STATUS " NOTE: OpenCV was found, but the old-style headers (i.e. include/opencv/cv.h) do not exist") - message(STATUS " That is fine, as long as all code has already been updated to use the new headers.") - endif(HAVE_OLD_OPENCV_HEADERS) -endif(OpenCV_FOUND) diff --git a/cmake/Modules/FindOpenCV.cmake b/cmake/Modules/FindOpenCV.cmake deleted file mode 100644 index 5f0f68d..0000000 --- a/cmake/Modules/FindOpenCV.cmake +++ /dev/null @@ -1,65 +0,0 @@ -###################################################################### -# Master find script for OpenCV. -# -# Delegates to one of two other FindOpenCV scripts based -# on whether OpenCVConfig.cmake is found. -# -# ** NOTE ** the FindOpenCV script from Willow Garage uses -# Boost capitalization convention (MyProject_VARIABLE) -# instead of CMake caps convention (MYPROJECT_VARIABLE) -# for cmake variables. *We adopt their convention for compatibility* -# -# Output Variables: -# ----------------- -# OpenCV_FOUND : TRUE if search succeded -# OpenCV_INCLUDE_DIR : include path -# OpenCV_LIBRARIES : libraries in one variable (use this in your CMakeLists) -# OpenCV_VERSION : software version in the form "X.Y.Z" -# OpenCV_VERSION_MAJOR : X -# OpenCV_VERSION_MINOR : Y -# OpenCV_VERSION_PATCH : Z -# -###################################################################### -include( SetIrgPaths ) - -message(STATUS "Looking for OpenCV...") - -find_file(OpenCVConfig_FILE "OpenCVConfig.cmake" - HINTS ${OPENCV_ROOT_DIR} - $ENV{OPENCV_ROOT} - ${IRG_PACKAGES_DIR}/opencv - PATH_SUFFIXES - share/OpenCV - share/opencv - share - DOC "Location of OpenCVConfig.cmake" -) - -if( EXISTS ${OpenCVConfig_FILE} ) - - message( STATUS " Found ${OpenCVConfig_FILE}" ) - #message( STATUS " Using FindOpenCV-willow.cmake" ) - #find_package( OpenCV-willow ) - message( STATUS " Using FindOpenCV-useConfig.cmake" ) - find_package( OpenCV-useConfig ) - -else( EXISTS ${OpenCVConfig_FILE} ) - - message( STATUS " Could not find OpenCVConfig.cmake" ) - message( STATUS " Using FindOpenCV-irg.cmake" ) - find_package( OpenCV-irg ) - -endif( EXISTS ${OpenCVConfig_FILE}) - -if( OpenCV_FOUND ) - message( STATUS " Found OpenCV version ${OpenCV_VERSION} in ${OpenCV_DIR}" ) - if(CMAKE_COMPILER_IS_GNUCXX) - message(STATUS "gcc version is ${GCC_MINORVERSION}") - if (GCC_MINORVERSION VERSION_LESS "4.3" ) - message(STATUS "*** OpenCV adding -Wno-non-virtual-dtor to CMAKE_CXX_FLAGS") - set( CMAKE_CXX_FLAGS "-Wno-non-virtual-dtor" ) - endif (GCC_MINORVERSION VERSION_LESS "4.3") - endif(CMAKE_COMPILER_IS_GNUCXX) - #message( STATUS " OpenCV_LIBRARIES=${OpenCV_LIBRARIES}") - #message( STATUS " OpenCV_INCLUDE_DIR=${OpenCV_INCLUDE_DIR}") -endif( OpenCV_FOUND ) diff --git a/cmake/Modules/FindRtiDds.cmake b/cmake/Modules/FindRtiDds.cmake index 53e4639..42f1846 100644 --- a/cmake/Modules/FindRtiDds.cmake +++ b/cmake/Modules/FindRtiDds.cmake @@ -86,22 +86,27 @@ if( NOT BIGENDIAN ) set( RTIDDS_DEFINES ${RTIDDS_DEFINES} RTI_ENDIAN_LITTLE ) endif( NOT BIGENDIAN ) -# set the scripts search path +# set the scripts/bin search path #-------------------------------------------------- set( SCRIPTS_SEARCH_PATH "" ) if( RTIDDS_ROOT_DIR ) - set( SCRIPTS_SEARCH_PATH ${RTIDDS_ROOT_DIR}/scripts ) + set( SCRIPTS_SEARCH_PATH ${RTIDDS_ROOT_DIR}/bin + ${RTIDDS_ROOT_DIR}/scripts + ) else( RTIDDS_ROOT_DIR ) set( PKG_DIR_NAME ndds ) # default search path set( SCRIPTS_SEARCH_PATH ${SCRIPTS_SEARCH_PATH} + ${IRG_PACKAGES_DIR}/${PKG_DIR_NAME}/bin ${IRG_PACKAGES_DIR}/${PKG_DIR_NAME}/scripts + /usr/local/${PKG_DIR_NAME}/bin /usr/local/${PKG_DIR_NAME}/scripts /usr/local/bin /usr/bin + c:/devel/${PKG_DIR_NAME}/bin c:/devel/${PKG_DIR_NAME}/scripts ) @@ -112,7 +117,9 @@ else( RTIDDS_ROOT_DIR ) set( ENV_VAR_VALUE $ENV{${ENV_VAR_NAME}} ) if( ENV_VAR_VALUE ) message( STATUS " ${ENV_VAR_NAME} environment variable is set to ${ENV_VAR_VALUE}" ) - set( SCRIPTS_SEARCH_PATH ${ENV_VAR_VALUE}/scripts ) + set( SCRIPTS_SEARCH_PATH ${ENV_VAR_VALUE}/bin + ${ENV_VAR_VALUE}/scripts + ) endif( ENV_VAR_VALUE ) endforeach( ENV_VAR_NAME ${ENV_VAR_NAMES} ) @@ -136,14 +143,15 @@ if( RTIDDS_IDL_COMMAND ) get_filename_component(RTIDDS_ROOT_DIR ${_RTIDDS_ROOT_DIR} REALPATH) set( NDDSHOME ${RTIDDS_ROOT_DIR} ) + set( ENV_NDDSARCH $ENV{NDDSARCH} ) # guess the rti architecture string # this is absolutely horrible... even in their own # scripts they have a fragile way to guess their # architecture string. So, we do our best... #-------------------------------------------------- - if( $ENV{NDDSARCH} ) - message( STATUS " NDDSARCH environment variable is set to $ENV{NDDSARCH}" ) - set(RTIDDS_ARCHITECTURE $ENV{NDDSARCH}) + if( ENV_NDDSARCH ) + message( STATUS " NDDSARCH environment variable is set to \"${ENV_NDDSARCH}\"" ) + set(RTIDDS_ARCHITECTURE ${ENV_NDDSARCH}) else( $ENV{NDDSARCH} ) message( STATUS " NDDSARCH environment variable is NOT set. Will try to guess architecture string..." ) set(RTIDDS_ARCHITECTURE "INVALID" ) # default value @@ -193,7 +201,7 @@ if( RTIDDS_IDL_COMMAND ) message(STATUS "") endif( NOT RTILIB_SUBDIR ) string(REGEX MATCH "[^/]*$" RTIDDS_ARCHITECTURE ${RTILIB_SUBDIR}) - endif( $ENV{NDDSARCH} ) + endif( ENV_NDDSARCH ) message( STATUS " Using \"${RTIDDS_ARCHITECTURE}\" for RTI architecture string" ) diff --git a/cmake/Modules/GenerateRtiDdsIdl.cmake b/cmake/Modules/GenerateRtiDdsIdl.cmake index 3edd6e9..6c0e3c8 100644 --- a/cmake/Modules/GenerateRtiDdsIdl.cmake +++ b/cmake/Modules/GenerateRtiDdsIdl.cmake @@ -57,7 +57,8 @@ macro( rtidds_wrap_idl ) set( EXT_XML ".xml" ) set( RTIDDS_EXPORT "NDDS_USER_DLL_EXPORT" ) - set( RTIDDS_IDL_FLAGS -language C++ -replace -namespace -convertToXml) + set( RTIDDS_IDL_FLAGS -language C++ -replace -namespace ) + set( RTIDDS_XML_FLAGS -replace -namespace -convertToXml) if( WIN32 ) if( EXPORT_SUFFIX ) set( RTIDDS_EXPORT "NDDS_USER_DLL_EXPORT_${EXPORT_SUFFIX}" ) @@ -72,7 +73,20 @@ macro( rtidds_wrap_idl ) set( RTIDDS_IDL_GENERATED "" ) set( RTIDDS_IDL_GENERATED_HEADERS "" ) set( RTIDDS_IDL_GENERATED_XMLS "" ) - + + get_filename_component(IDL_COMMAND_PATH ${RTIDDS_IDL_COMMAND} DIRECTORY) + find_file(RTIDDS_IDL_SERVER + NAMES rtiddsgen_server + HINTS ${IDL_COMMAND_PATH} + DOC "Path to RTI DDS IDL compiler (server mode)" + ) + set(_RTIDDS_IDL_COMMAND ${RTIDDS_IDL_COMMAND}) + if(RTIDDS_IDL_SERVER) + message(STATUS "Found ${RTIDDS_IDL_SERVER}: will use that instead, to speed up build") + set(_RTIDDS_IDL_COMMAND ${RTIDDS_IDL_SERVER}) + endif(RTIDDS_IDL_SERVER) + + # add a custom command set for idl files #----------------------------------------------------- foreach( IDL_FILENAME ${ARGN} ) @@ -134,22 +148,39 @@ macro( rtidds_wrap_idl ) endif (DEBUG_IDL_DEPENDENCIES) - #message( STATUS "COMMAND = ${EXTRA_ENVIRONMENT} ${RTIDDS_IDL_COMMAND}" ) + #message( STATUS "COMMAND = ${EXTRA_ENVIRONMENT} ${_RTIDDS_IDL_COMMAND}" ) #message( STATUS " ARGS = ${RTIDDS_IDL_FLAGS} ${EXTRA_RTIDDS_IDL_ARGS}" ) #message( STATUS " -I${SRCDIR} ${RTIDDS_IDL_INCLUDES} " ) #message( STATUS " -d ${OOSDIR} ${SRCDIR}/${IDL_BASE}.idl" ) # setup the command + # RTI DDS 5.2 IDL compiler will no longer generate c++ and xml + # with the same invocation of rtiddsgen, so we have to run it twice. #----------------------------------------------------- - add_custom_command( - OUTPUT ${IDL_OUTPUT_FILES} - DEPENDS ${DEPEND_FILE_LIST} - COMMAND ${EXTRA_ENVIRONMENT} ${RTIDDS_IDL_COMMAND} - ARGS ${RTIDDS_IDL_FLAGS} ${EXTRA_RTIDDS_IDL_ARGS} - -I${SRCDIR} ${RTIDDS_IDL_INCLUDES} - -d ${OOSDIR} ${SRCDIR}/${IDL_BASE}.idl - ) - + if(RTIDDS_VERSION VERSION_LESS 5.2.0) + add_custom_command( + OUTPUT ${IDL_OUTPUT_FILES} + DEPENDS ${DEPEND_FILE_LIST} + COMMAND ${EXTRA_ENVIRONMENT} ${_RTIDDS_IDL_COMMAND} + ARGS ${RTIDDS_IDL_FLAGS} ${EXTRA_RTIDDS_IDL_ARGS} -convertToXml + -I${SRCDIR} ${RTIDDS_IDL_INCLUDES} + -d ${OOSDIR} ${SRCDIR}/${IDL_BASE}.idl + ) + else(RTIDDS_VERSION VERSION_LESS 5.2.0) + add_custom_command( + OUTPUT ${IDL_OUTPUT_FILES} + DEPENDS ${DEPEND_FILE_LIST} + COMMAND ${EXTRA_ENVIRONMENT} ${_RTIDDS_IDL_COMMAND} + ARGS ${RTIDDS_IDL_FLAGS} ${EXTRA_RTIDDS_IDL_ARGS} + -I${SRCDIR} ${RTIDDS_IDL_INCLUDES} + -d ${OOSDIR} ${SRCDIR}/${IDL_BASE}.idl + COMMAND ${EXTRA_ENVIRONMENT} ${_RTIDDS_IDL_COMMAND} + ARGS ${RTIDDS_XML_FLAGS} ${EXTRA_RTIDDS_IDL_ARGS} + -I${SRCDIR} ${RTIDDS_IDL_INCLUDES} + -d ${OOSDIR} ${SRCDIR}/${IDL_BASE}.idl + ) + endif(RTIDDS_VERSION VERSION_LESS 5.2.0) + set( RTIDDS_IDL_GENERATED_HEADERS ${IDL_OUTPUT_HEADERS} ${RTIDDS_IDL_GENERATED_HEADERS} @@ -165,6 +196,27 @@ macro( rtidds_wrap_idl ) ${RTIDDS_IDL_GENERATED_XMLS} ) + ## copy header to devel/include if we are using catkin + ## and header is under ${PROJECT}/src/... + ##--------------------------------------------------- + string( REGEX MATCH "${CMAKE_SOURCE_DIR}/.*/src/.*" IS_SRC_MODULE ${CMAKE_CURRENT_SOURCE_DIR} ) + if(catkin_FOUND AND IS_SRC_MODULE ) + # extract "module" path. Requires that directories are named ${PROJECT}/src/${MODULE} + string( REGEX REPLACE "${CMAKE_SOURCE_DIR}/.*/src/" "" MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" ) + + set( RTIDDSIDL_OUTPUT_TARGET RtiDdsIdl_${IDL_BASE} ) + add_custom_target( ${RTIDDSIDL_OUTPUT_TARGET} ALL DEPENDS ${IDL_OUTPUT_FILES} ) + + set( RTIDDSIDL_DEVEL_DEST ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION}/${MODULE_PATH} ) + foreach( IDL_GENERATED_HEADER ${IDL_OUTPUT_HEADERS} ) + get_filename_component( IDL_HEADER_FILENAME ${IDL_GENERATED_HEADER} NAME ) + add_custom_command( + TARGET ${RTIDDSIDL_OUTPUT_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${IDL_GENERATED_HEADER} ${RTIDDSIDL_DEVEL_DEST}/${IDL_HEADER_FILENAME} + ) + endforeach() + endif( catkin_FOUND AND IS_SRC_MODULE ) endforeach( IDL_FILENAME ) endmacro( rtidds_wrap_idl ) diff --git a/configure.sh b/configure.sh index a1de890..0bd8965 100755 --- a/configure.sh +++ b/configure.sh @@ -92,7 +92,7 @@ target="install" usage_string="$0 [-h] [-p install_path] [-b buildname] [-a acetao_path] [-m miro_path][-c ] [-t make_target]" -optstring="hp:b:a:t:cC" +optstring="hp:b:a:m:t:cC" # Print the help message (list all the options) print_help() @@ -305,6 +305,14 @@ else fi +if [ -z ${miro_dir} ] ; then + miro_flag="" +else + miro_canonical=`canonicalize ${miro_dir}` + miro_flag="-DMIRO_ROOT_DIR:PATH=${miro_canonical}" +fi + + echo "=== ${0} flags:" echo " prefix: $install_path" echo " build: $build_path" @@ -343,11 +351,11 @@ build_module "irgUtil" "${BUILD_TYPE} " build_module "kn" "${BUILD_TYPE} \ ${acetao_flag}" -build_module "knDds" "${BUILD_TYPE} -DMIRO_ROOT_DIR:PATH=${install_path}\ +build_module "knDds" "${BUILD_TYPE} ${miro_flag} \ ${acetao_flag}" build_module "knRapid" "${BUILD_TYPE} \ - -DMIRO_ROOT_DIR:PATH=${install_path}\ + ${miro_flag} \ ${acetao_flag}" echo diff --git a/irgUtil/CMakeLists.txt b/irgUtil/CMakeLists.txt index 42d0e28..10c7f8f 100644 --- a/irgUtil/CMakeLists.txt +++ b/irgUtil/CMakeLists.txt @@ -1,11 +1,12 @@ cmake_minimum_required(VERSION 2.8.3) project(irgUtil) -if (${CATKIN_TOPLEVEL}) -find_package(catkin REQUIRED COMPONENTS - irg_cmake -) -endif(${CATKIN_TOPLEVEL}) +if (CATKIN_DEVEL_PREFIX) + find_package(catkin REQUIRED COMPONENTS + irg_cmake + ) + include_directories( ${CATKIN_DEVEL_PREFIX}/include ) +endif(CATKIN_DEVEL_PREFIX) if (catkin_FOUND) ################################### diff --git a/irgUtil/src/irgUtmll/CMakeLists.txt b/irgUtil/src/irgUtmll/CMakeLists.txt index 73d1a2a..8fe6c06 100644 --- a/irgUtil/src/irgUtmll/CMakeLists.txt +++ b/irgUtil/src/irgUtmll/CMakeLists.txt @@ -28,7 +28,7 @@ add_library(${LIB_NAME} SHARED set( TARGETS utmToLatLon - latLonToUtm + latLonToUtm ) foreach( TEST_TARGET ${TARGETS} ) diff --git a/kn/CMakeLists.txt b/kn/CMakeLists.txt index 58cc619..044a368 100644 --- a/kn/CMakeLists.txt +++ b/kn/CMakeLists.txt @@ -1,49 +1,62 @@ cmake_minimum_required(VERSION 2.8.3) project(kn) -if (${CATKIN_TOPLEVEL}) +################################### +## catkin ## +################################### +if (CATKIN_DEVEL_PREFIX) find_package(catkin REQUIRED COMPONENTS irg_cmake ) -endif(${CATKIN_TOPLEVEL}) + include_directories( ${CATKIN_DEVEL_PREFIX}/include ) +endif(CATKIN_DEVEL_PREFIX) -if (catkin_FOUND) -################################### -## catkin specific configuration ## -################################### -catkin_package( - INCLUDE_DIRS src - LIBRARIES knShare knMath knGeometry knFrameStore knMotorShare - ) -else (catkin_FOUND) +if (NOT catkin_FOUND) set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake/Modules ${CMAKE_MODULE_PATH} ) -include( SetArchitecture ) -include( SetupBuildSwitch ) -include( SetupConfigureFile ) -include( SetupInstall ) -include( SetupRPATH ) -include( SetupCTest ) -include( SetupWarnLevel ) -include( SetupUtilities ) -include( UserOptions ) + include( SetArchitecture ) + include( SetupBuildSwitch ) + include( SetupConfigureFile ) + include( SetupInstall ) + include( SetupRPATH ) + include( SetupCTest ) + include( SetupWarnLevel ) + include( SetupUtilities ) + include( UserOptions ) ## we have to play some tricks to get install ## path to "stick" in Windows ##------------------------------------------------ set( ${PROJECT_UPPER}_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/../${ARCHITECTURE}" CACHE PATH "irg apps install path") set( CMAKE_INSTALL_PREFIX ${${PROJECT_UPPER}_INSTALL_PREFIX} CACHE INTERNAL "" ) -endif (catkin_FOUND) +endif (NOT catkin_FOUND) # find dependencies find_package( ACE REQUIRED ) find_package( Eigen3 ) -find_package( Boost COMPONENTS chrono ) -find_package( Boost 1.46 REQUIRED program_options signals thread system ) +# find_package( Boost 1.46 REQUIRED program_options signals thread system chrono ) +find_package( Boost 1.46 REQUIRED program_options thread system chrono ) find_package( GTest ) find_package( Doxygen ) +if (catkin_FOUND) + ################################### + ## catkin specific configuration ## + ################################### + catkin_package( + INCLUDE_DIRS src + LIBRARIES knShare knMath knGeometry knFrameStore knMotorShare + CFG_EXTRAS kn-extras.cmake + DEPENDS ACE Boost + ) + ## set variable with full path of extras file so we can append library info + set_cfg_extras_file() + + # add devel/include - this should add to persistent catkin metadata + list(APPEND ${PROJECT_NAME}_INCLUDE_DIRS ${CATKIN_DEVEL_PREFIX}/include) +endif( catkin_FOUND ) + ## We must add the in-source and out-of-source ## include paths ##-------------------------------------------- @@ -64,8 +77,9 @@ setup_ctest() # everything needs to include boost headers, so set it # up at the top level for convinience ##----------------------------------------------- -include_directories( +include_directories(SYSTEM ${Boost_INCLUDE_DIR} + ${EIGEN3_INCLUDE_DIRS} ) #----------------------------------- @@ -93,3 +107,4 @@ install_export() #------------------------------------ print_build_switches() + diff --git a/kn/cmake/kn-extras.cmake.develspace.in b/kn/cmake/kn-extras.cmake.develspace.in new file mode 100644 index 0000000..85542c8 --- /dev/null +++ b/kn/cmake/kn-extras.cmake.develspace.in @@ -0,0 +1,8 @@ +# source: kn-extras.cmake.develspace.in + +## Create INCLUDE_DIR variable for downstream packages +set(KN_INCLUDE_DIR @CATKIN_DEVEL_PREFIX@/include) + +## add include dirs to catkin_INCLUDE_DIRS +set( catkin_INCLUDE_DIRS ${catkin_INCLUDE_DIRS} ${KN_INCLUDE_DIR} ) + diff --git a/kn/cmake/kn-extras.cmake.installspace.in b/kn/cmake/kn-extras.cmake.installspace.in new file mode 100644 index 0000000..52e98d1 --- /dev/null +++ b/kn/cmake/kn-extras.cmake.installspace.in @@ -0,0 +1,8 @@ +# source: kn-extras.cmake.installspace.in + +## Create INCLUDE_DIR variable for downstream packages +set(KN_INCLUDE_DIR @CMAKE_INSTALL_PREFIX@/include ) + +## add include dirs to catkin_INCLUDE_DIRS +set( catkin_INCLUDE_DIRS ${catkin_INCLUDE_DIRS} ${KN_INCLUDE_DIR} ) + diff --git a/kn/src/knFrameStore/FrameStoreSingleton.cpp b/kn/src/knFrameStore/FrameStoreSingleton.cpp index 17db116..4533fc9 100644 --- a/kn/src/knFrameStore/FrameStoreSingleton.cpp +++ b/kn/src/knFrameStore/FrameStoreSingleton.cpp @@ -23,7 +23,5 @@ namespace kn Singleton FrameStoreSingleton::instance; } -#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template kn::Singleton * kn::Singleton ::s_instance; -#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ +KN_SINGLETON_TEMPLATE_INSTANTIATION(kn::Singleton) diff --git a/kn/src/knGeometry/PointCloud.h b/kn/src/knGeometry/PointCloud.h index 4d85dd5..8b4d381 100644 --- a/kn/src/knGeometry/PointCloud.h +++ b/kn/src/knGeometry/PointCloud.h @@ -97,6 +97,10 @@ namespace kn void clear(); + inline void setTimestamp(const ACE_Time_Value& t) { + timestamp = t; + } + inline void setPointAttributeFormat(PointAttributeFormats format) { attFormat = format; } diff --git a/kn/src/knMath/ATrans.cpp b/kn/src/knMath/ATrans.cpp index 742936d..680acd1 100644 --- a/kn/src/knMath/ATrans.cpp +++ b/kn/src/knMath/ATrans.cpp @@ -27,7 +27,7 @@ namespace kn std::ostream& operator<< (std::ostream& ostr, ATrans2Out const& rhs) { - Eigen::Rotation2Dd theta = 0.; + Eigen::Rotation2Dd theta(0.); theta.fromRotationMatrix(rhs.transform().rotation()); ostr << "(" << rhs.transform().translation().x() << ", " << rhs.transform().translation().y() diff --git a/kn/src/knMath/ATrans.h b/kn/src/knMath/ATrans.h index f7ba06a..3b7082c 100644 --- a/kn/src/knMath/ATrans.h +++ b/kn/src/knMath/ATrans.h @@ -23,6 +23,7 @@ #include #include +#include #include "knConfig.h" #include "knMath_Export.h" @@ -122,7 +123,7 @@ namespace kn ATrans2 step(ATrans2 const& pose, double curvature, double crab, double crabRate, double speed, double interval) { - if (isnan(curvature)) { + if (std::isnan(curvature)) { // Wheels are aligning, cannot calculate new pose return pose; } diff --git a/kn/src/knMath/CMakeLists.txt b/kn/src/knMath/CMakeLists.txt index 6326e94..326d63f 100644 --- a/kn/src/knMath/CMakeLists.txt +++ b/kn/src/knMath/CMakeLists.txt @@ -24,6 +24,7 @@ set( HEADERS Quaternion.h RotMat3d.h Vector.h + Functions.h ) include_directories( diff --git a/kn/src/knMath/EulerAngles.h b/kn/src/knMath/EulerAngles.h index ee30bb7..a7ad640 100644 --- a/kn/src/knMath/EulerAngles.h +++ b/kn/src/knMath/EulerAngles.h @@ -68,6 +68,27 @@ namespace kn return atan2(rotationMatrix(1,0), rotationMatrix(0,0)); } + inline + double + rotationMatrixToYaw(Matrix2x2 const& rotationMatrix) + { + return atan2(rotationMatrix.coeff(1,0), rotationMatrix.coeff(0,0)); + + } + + inline + double + angleOfVector2d(Eigen::Vector2d const& v) { + return atan2(v.y(), v.x()); + } + + inline + Eigen::Matrix2d rotationFromUnitVector(Eigen::Vector2d const& v) { + Eigen::Matrix2d r; + r << v.x(), -v.y(), v.y(), v.x(); + return r; + } + /** @ingroup knMath * * @brief Convert rotation matrix to euler angles. diff --git a/kn/src/knMath/Functions.h b/kn/src/knMath/Functions.h new file mode 100644 index 0000000..934007a --- /dev/null +++ b/kn/src/knMath/Functions.h @@ -0,0 +1,64 @@ +//========================================================================== +// +// File: Functions.h +// +// PROJECT: kn +// +// $Author: pedersen $ +// $Date: July 2008 $ +// $Revision: $ +// +// (c) Copyright NASA Ames Research Center. All rights reserved. +//=========================================================================== + +#ifndef kn_Functions_h +#define kn_Functions_h + +#include + +namespace kn +{ + template + inline T degrees(T x) { return x * 180.0 / M_PI; } + + template + inline T radians(T x) { return x * M_PI / 180.0; } + + template + inline int signum(T x, T epsilon = T(0)) { return (epsilon < x) - (x < epsilon); } + + template + inline void mod(T& x, T y) + /*!< replace x by x mod y, extending C++ % to give valid + results for all signs of x and y : + By convention: + mod(x, y) has same sign as y. + x mod 0 is undefined. + x < 0 ==> mod(x,y) in [0,y) + x%y in (-abs(y),0] + + This guarantees that mod(x,y) is always a valid + index for example. + */ + { + x %= y; + if ((x < 0 && y > 0) || (y < 0 && x > 0)) + x += y; + } + + template + inline T sqr(T x) { return x*x; }; + + template + inline T cube(T x) { return x*x*x; }; + + template + inline T mean(T a,T2 b) { return (a+(T)b)/2; }; + + template + inline A linear_scale(A value, B min, C max) + { + return (value <= min ? 0 : value >= max ? 1 : (value-min)/(max-min)); + } +} +#endif // kn_Functions_h diff --git a/kn/src/knMath/Vector.h b/kn/src/knMath/Vector.h index bf6a513..10e58ab 100644 --- a/kn/src/knMath/Vector.h +++ b/kn/src/knMath/Vector.h @@ -31,45 +31,51 @@ namespace kn /** * @defgroup knMath Math * @brief The Math module of kn provides a set of typedef's and some helper classes to the Eigen math library. - * + * * The core idea behind this module is to down-select the vast set of capabilities of Eigen data-types, * to a number of "obviously preferred ones. */ - + + typedef Eigen::VectorXd Vector; + /** @ingroup knMath */ typedef Eigen::Vector3d Vector3; /** @ingroup knMath */ + typedef Eigen::Vector3f Vector3f; + /** @ingroup knMath */ typedef Eigen::Vector2d Vector2; - typedef Eigen::VectorXd Vector; + typedef Eigen::VectorXd Vector; - typedef Eigen::Vector2i Vector2i; - typedef Eigen::Vector3i Vector3i; + typedef Eigen::Vector2i Vector2i; + typedef Eigen::Vector3i Vector3i; /** @ingroup knMath */ - typedef Eigen::VectorXd MathVectorDouble; + typedef Eigen::VectorXd MathVectorDouble; /** @ingroup knMath */ typedef std::vector > Vector2Vector; /** @ingroup knMath */ typedef std::vector > Vector3Vector; + /** @ingroup knMath */ + typedef std::vector > Vector3fVector; //Eigen 3.2+ defines .hasNaN() and .allFinite() (briefly called isFinite), but //until we're using at least that version everywhere, we need our own //To keep life simple, these are defined generically but will only compile //of course on Eigen types template - inline bool vectorHasNaN(const VecType &vec) - { - //cute parallel trick copied from Eigen source: NaN doesn't equal anything - return !((vec.array()==vec.array()).all()); - } + inline bool vectorHasNaN(const VecType &vec) + { + //cute parallel trick copied from Eigen source: NaN doesn't equal anything + return !((vec.array()==vec.array()).all()); + } template - inline bool vectorIsFinite(const VecType &vec) - { - //cute parallel trick copied from Eigen source: inf-inf = nan, nan-nan=nan - return !(vectorHasNaN(vec-vec)); - } + inline bool vectorIsFinite(const VecType &vec) + { + //cute parallel trick copied from Eigen source: inf-inf = nan, nan-nan=nan + return !(vectorHasNaN(vec-vec)); + } } diff --git a/kn/src/knMotorShare/WheelGroupFuture.cpp b/kn/src/knMotorShare/WheelGroupFuture.cpp index 5062464..1307af3 100644 --- a/kn/src/knMotorShare/WheelGroupFuture.cpp +++ b/kn/src/knMotorShare/WheelGroupFuture.cpp @@ -25,7 +25,7 @@ namespace kn { std::ostream& operator<< (std::ostream& ostr, WheelGroupFuture const& rhs) { - Eigen::Rotation2Dd theta = 0.; + Eigen::Rotation2Dd theta(0.); theta.fromRotationMatrix(rhs.offset.rotation()); ostr << "{"; ostr << static_cast(rhs); diff --git a/kn/src/knShare/Array2DView.cpp b/kn/src/knShare/Array2DView.cpp index 0e62b10..748c184 100644 --- a/kn/src/knShare/Array2DView.cpp +++ b/kn/src/knShare/Array2DView.cpp @@ -47,7 +47,7 @@ namespace kn m_sizeX(0), m_sizeY(0) { - set_size(x, y); + resize(x, y); } int @@ -67,7 +67,7 @@ namespace kn } void - Array2DViewBase::set_size(size_t x, size_t y) + Array2DViewBase::resize(size_t x, size_t y) { if (x != m_sizeX || y != m_sizeY) { diff --git a/kn/src/knShare/Array2DView.h b/kn/src/knShare/Array2DView.h index 36a2e13..d2ce998 100644 --- a/kn/src/knShare/Array2DView.h +++ b/kn/src/knShare/Array2DView.h @@ -71,7 +71,7 @@ namespace kn static int iLog2(int x); protected: - void set_size(size_t x, size_t y); + void resize(size_t x, size_t y); private: size_t m_sizeX; @@ -125,9 +125,9 @@ namespace kn return m_cells[index(x, y)]; } - void set_size(size_t x, size_t y) { + void resize(size_t x, size_t y) { if (x != sizeX() || y != sizeY()) { - Array2DViewBase::set_size(x, y); + Array2DViewBase::resize(x, y); if (x > 0 && y > 0) { m_cells.reset(new Cell[numCells()]); } diff --git a/kn/src/knShare/LruPool.h b/kn/src/knShare/LruPool.h index 0afa02a..e8d85a6 100644 --- a/kn/src/knShare/LruPool.h +++ b/kn/src/knShare/LruPool.h @@ -32,7 +32,7 @@ namespace kn { public: typedef T Type; - typedef shared_ptr TypePtr; + typedef boost::shared_ptr TypePtr; LruPool(size_t minPoolSize, int maxPoolSize = 0, bool reclaim = false) : m_minPoolSize(minPoolSize), @@ -110,4 +110,4 @@ namespace kn size_t m_maxUtilization; }; } -#endif // kn_LruPool_h \ No newline at end of file +#endif // kn_LruPool_h diff --git a/kn/src/knShare/Singleton.h b/kn/src/knShare/Singleton.h index 5df2a64..c6fcb26 100644 --- a/kn/src/knShare/Singleton.h +++ b/kn/src/knShare/Singleton.h @@ -24,6 +24,19 @@ #include "SmartPtr.h" #include "Mutex.h" +#ifdef ACE_SINGLETON_TEMPLATE_INSTANTIATE +# define KN_SINGLETON_TEMPLATE_INSTANTIATE(SINGLETON_TYPE, CLASS, LOCK) \ + ACE_SINGLETON_TEMPLATE_INSTANTIATE(SINGLETON_TYPE, CLASS, LOCK) +#else +#define KN_SINGLETON_TEMPLATE_INSTANTIATE(SINGLETON_TYPE, CLASS, LOCK) +#endif + +#ifdef ACE_SINGLETON_TEMPLATE_INSTANTIATION +# define KN_SINGLETON_TEMPLATE_INSTANTIATION(T) \ + ACE_SINGLETON_TEMPLATE_INSTANTIATION(T) +#else +# define KN_SINGLETON_TEMPLATE_INSTANTIATION(T) +#endif /** @defgroup knShare Shared * diff --git a/kn/src/knShare/StateMachine.h b/kn/src/knShare/StateMachine.h index 8a7770e..9dcbd5f 100644 --- a/kn/src/knShare/StateMachine.h +++ b/kn/src/knShare/StateMachine.h @@ -95,7 +95,7 @@ namespace kn int eventIdx(std::string const& event) const; }; - typedef boost::signals2::signal5 TransitionSignal; + typedef boost::signals2::signal TransitionSignal; StateMachine(std::string const& name = "Subsystem"); virtual ~StateMachine() throw(); diff --git a/kn/src/knShare/StateMachineRepository.cpp b/kn/src/knShare/StateMachineRepository.cpp index 8b8feca..20bf108 100644 --- a/kn/src/knShare/StateMachineRepository.cpp +++ b/kn/src/knShare/StateMachineRepository.cpp @@ -18,7 +18,4 @@ ******************************************************************************/ #include "StateMachineRepository.h" -// does this evaluate to true on any of our target platforms? -#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template kn::Singleton * kn::Singleton::s_instance_; -#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ +KN_SINGLETON_TEMPLATE_INSTANTIATION(kn::Singleton >); diff --git a/kn/src/knShare/Time.h b/kn/src/knShare/Time.h index e385efa..9601a49 100644 --- a/kn/src/knShare/Time.h +++ b/kn/src/knShare/Time.h @@ -69,6 +69,20 @@ namespace kn friend knShare_Export std::ostream& operator<<(std::ostream& ostr, Time6 const& timestamp); }; + + inline double tv2d(TimePoint const& time) + { + duration durationInSeconds(time.time_since_epoch()); + + return durationInSeconds.count(); + } + inline double tv2d(Duration const& d) + { + duration durationInSeconds(d); + + return durationInSeconds.count(); + } + } #endif diff --git a/kn/src/knShare/tests/libknC/libC.cpp b/kn/src/knShare/tests/libknC/libC.cpp index 37c4061..6894ca9 100644 --- a/kn/src/knShare/tests/libknC/libC.cpp +++ b/kn/src/knShare/tests/libknC/libC.cpp @@ -29,17 +29,7 @@ struct Bar Bar bar; -// From ace/README: -//ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION -// For the GCC compiler -// on AIX, HPUX and VxWorks we have to -// explicitly instantiate static template -// members else we get multiple instances -// of the same static. -#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) - template kn::Singleton * kn::Singleton::s_instance; - template kn::Singleton * kn::Singleton::s_instance; - template kn::Singleton > * - kn::Singleton >::s_instance; -#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ +KN_SINGLETON_TEMPLATE_INSTANTIATION(kn::Singleton); +KN_SINGLETON_TEMPLATE_INSTANTIATION(kn::Singleton); +KN_SINGLETON_TEMPLATE_INSTANTIATION(kn::Singleton); diff --git a/knDds/CMakeLists.txt b/knDds/CMakeLists.txt index 495d381..9b9e143 100644 --- a/knDds/CMakeLists.txt +++ b/knDds/CMakeLists.txt @@ -1,7 +1,42 @@ +cmake_minimum_required(VERSION 2.8.3) project(knDds) -cmake_minimum_required(VERSION 2.6) -set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake/Modules ${CMAKE_MODULE_PATH} ) +################################### +## catkin ## +################################### +if (CATKIN_DEVEL_PREFIX) + find_package(catkin REQUIRED COMPONENTS + irg_cmake + kn + Miro + ) + include_directories( ${CATKIN_DEVEL_PREFIX}/include ) +endif(CATKIN_DEVEL_PREFIX) + +if (NOT catkin_FOUND) + + set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake/Modules ${CMAKE_MODULE_PATH} ) + + include( SetArchitecture ) + include( SetupBuildSwitch ) + include( SetupConfigureFile ) + include( SetupInstall ) + include( SetupRPATH ) + include( SetupUtilities ) + include( SetupWarnLevel ) + include( UserOptions ) + + ## we have to play some tricks to get install + ## path to "stick" in Windows + ##------------------------------------------------ + set( KNDDS_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/../${ARCHITECTURE}" CACHE PATH "knDds install path") + set( CMAKE_INSTALL_PREFIX ${KNDDS_INSTALL_PREFIX} CACHE INTERNAL "" ) + + find_package( Miro ) + find_package( kn ) + +endif (NOT catkin_FOUND) + if( CMAKE_COMPILER_IS_GNUCXX ) message( STATUS "****************************************************") @@ -11,36 +46,34 @@ if( CMAKE_COMPILER_IS_GNUCXX ) set( WARN_FLAGS "-fno-strict-aliasing -Wall -Woverloaded-virtual -Wno-write-strings" ) endif( CMAKE_COMPILER_IS_GNUCXX ) -include( SetArchitecture ) -include( SetupBuildSwitch ) -include( SetupConfigureFile ) -include( SetupInstall ) -include( SetupRPATH ) -include( SetupUtilities ) -include( SetupWarnLevel ) -include( UserOptions ) - -## we have to play some tricks to get install -## path to "stick" in Windows -##------------------------------------------------ -set( KNDDS_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/../${ARCHITECTURE}" CACHE PATH "KNDDS install path") -set( CMAKE_INSTALL_PREFIX ${KNDDS_INSTALL_PREFIX} CACHE INTERNAL "" ) - - #--------------------------------------------- # make RTI DDS optional add_build_var( WITH_DDS NOT APPLE ) -find_package_if( RtiDds KNDDS_BUILD_WITH_DDS ) +find_package( RtiDds ) + +if( MIRO_BUILD_WITH_QT5 ) + message(STATUS "FOUND QT 5") + find_package(Qt5Widgets REQUIRED) + find_package(Qt5Xml REQUIRED) + if (Qt5_POSITION_INDEPENDENT_CODE) + SET(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + include_directories(SYSTEM "${Qt5Widgets_INCLUDE_DIRS}") + include_directories(SYSTEM "${Qt5Xml_INCLUDE_DIRS}") +else() + message(STATUS "FOUND QT 4") + find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED) + include(${QT_USE_FILE}) + include_directories(SYSTEM "${QT_INCLUDE_DIR}") + include_directories(SYSTEM "${QT_QTXML_INCLUDE_DIR}") + include_directories(SYSTEM "${QT_QTCORE_INCLUDE_DIR}") +endif() find_package( ACE ) -find_package( Qt4 ) find_package( PThreads-win32 ) find_package( Boost 1.50.0 COMPONENTS program_options filesystem system chrono) -find_package( Miro ) -find_package( kn ) - find_package( Doxygen ) add_build_var( WITH_DDS_LBPlugin NOT APPLE ) @@ -53,6 +86,30 @@ build_with_var( WITH_DDS_LBPlugin RTIDDS_LB_FOUND ) build_with_var( WITH_DDS_Monitor RTIDDS_MON_FOUND ) build_with_var( WITH_RTI_DistLogger RTIDDS_DLOGGER_FOUND ) +if (RTIDDS_FOUND) + set(knDDS_EXPORT_LIBRARIES knDds knDdsUtil) +endif (RTIDDS_FOUND) + +message("knDDS_EXPORT_LIBRARIES ${knDDS_EXPORT_LIBRARIES}") + +if (catkin_FOUND) + ################################### + ## catkin specific configuration ## + ################################### + catkin_package( + INCLUDE_DIRS src + LIBRARIES ${knDDS_EXPORT_LIBRARIES} + CATKIN_DEPENDS kn Miro + CFG_EXTRAS knDds-extras.cmake + DEPENDS + ) + ## set variable with full path of extras file so we can append library info + set_cfg_extras_file() + + # add devel/include - this should add to persistent catkin metadata + list(APPEND ${PROJECT_NAME}_INCLUDE_DIRS ${CATKIN_DEVEL_PREFIX}/include) +endif(catkin_FOUND) + ## We must add the in-source and out-of-source ## include paths ##-------------------------------------------- @@ -63,6 +120,9 @@ include_directories( include_directories( ${KN_INCLUDE_DIR} + ${catkin_INCLUDE_DIRS} +) +include_directories(SYSTEM ${Boost_INCLUDE_DIR} ) @@ -87,7 +147,8 @@ install_export() # package script #------------------------------------ -include( CMakePack.txt ) +#include( CMakePack.txt ) #------------------------------------ print_build_switches() + diff --git a/knDds/cmake/knDds-extras.cmake.develspace.in b/knDds/cmake/knDds-extras.cmake.develspace.in new file mode 100644 index 0000000..f96df6a --- /dev/null +++ b/knDds/cmake/knDds-extras.cmake.develspace.in @@ -0,0 +1,8 @@ +# source: knDds-extras.cmake.develspace.in + +## Create INCLUDE_DIR variable for downstream packages +set(KNDDS_INCLUDE_DIR @CATKIN_DEVEL_PREFIX@/include) + +## add include dirs to catkin_INCLUDE_DIRS +set( catkin_INCLUDE_DIRS ${catkin_INCLUDE_DIRS} ${KNDDS_INCLUDE_DIR} ) + diff --git a/knDds/cmake/knDds-extras.cmake.installspace.in b/knDds/cmake/knDds-extras.cmake.installspace.in new file mode 100644 index 0000000..1baca03 --- /dev/null +++ b/knDds/cmake/knDds-extras.cmake.installspace.in @@ -0,0 +1,8 @@ +# source: knDds-extras.cmake.installspace.in + +## Create INCLUDE_DIR variable for downstream packages +set(KNDDS_INCLUDE_DIR @CMAKE_INSTALL_PREFIX@/include ) + +## add include dirs to catkin_INCLUDE_DIRS +set( catkin_INCLUDE_DIRS ${catkin_INCLUDE_DIRS} ${KNDDS_INCLUDE_DIR} ) + diff --git a/knDds/package.xml b/knDds/package.xml new file mode 100644 index 0000000..fc041c8 --- /dev/null +++ b/knDds/package.xml @@ -0,0 +1,17 @@ + + + knDds + 1.0.0 + DDS helpers of soraCore + Hans Utz + + Apache2 + + catkin + + irg_cmake + + kn + Miro + + diff --git a/knDds/src/knDds/CMakeLists.txt b/knDds/src/knDds/CMakeLists.txt index 57ad0b8..3ba7d7f 100644 --- a/knDds/src/knDds/CMakeLists.txt +++ b/knDds/src/knDds/CMakeLists.txt @@ -50,9 +50,6 @@ add_library( ${LIB_NAME} SHARED include_directories( ${ACE_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${RAPID_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} ) @@ -62,11 +59,24 @@ add_target_definitions( ${LIB_NAME} ${EXPORT_DEFINE} ) # DDS defines apply to all projects in this directory add_srcdir_definitions( ${RTIDDS_DEFINES} ) +## NOTE catkin_build +## Unexplained linking failures in examples ocurred on Ubuntu 14.04 with the +## RTI 5.2.3.15_ROUTING-198-eng-build, but not 5.2.3 release. Adding ${CMAKE_DL_LIBS} (dl) +## to the link line on the examples did not fix the problem, but adding ${CMAKE_DL_LIBS} +## immediately after ${RTIDDS_LIBRARIES} does. Note that ${RTIDDS_LIBRARIES} ALREADY has +## -ldl in the variable. However, while the RTIDDS_LIBRARIES variable has the full paths +## to the RTI libraries, the link line does NOT. I don't know if it is catkin or cmake +## that is munging the contents of the RTIDDS_LIBRARIES variable. + target_link_libraries( ${LIB_NAME} ${ACE_LIBRARIES} ${MIRO_miroXml_LIBRARY} ${RTIDDS_LIBRARIES} + ${CMAKE_DL_LIBS} ${KN_knShare_LIBRARY} + ${catkin_LIBRARIES} + ${QT_QTXML_LIBRARY} + ${QT_QTCORE_LIBRARY} ) if ( KNDDS_HAS_DDS_LBPlugin ) diff --git a/knDds/src/knDds/DdsEntityRepositories.cpp b/knDds/src/knDds/DdsEntityRepositories.cpp index 4bf70d6..7e3d456 100644 --- a/knDds/src/knDds/DdsEntityRepositories.cpp +++ b/knDds/src/knDds/DdsEntityRepositories.cpp @@ -19,6 +19,8 @@ #include "DdsEntityRepositories.h" #include "DdsSupport.h" +#include "knShare/Singleton.h" + #include "miro/Log.h" namespace kn @@ -269,3 +271,7 @@ namespace kn throw ENotRegistered(name); } } +KN_SINGLETON_TEMPLATE_INSTANTIATE(ACE_Unmanaged_Singleton, kn::DdsDomainParticipantRepository, ACE_SYNCH_RECURSIVE_MUTEX); + +KN_SINGLETON_TEMPLATE_INSTANTIATE(ACE_Unmanaged_Singleton, kn::DdsPublisherRepository, ACE_SYNCH_RECURSIVE_MUTEX); +KN_SINGLETON_TEMPLATE_INSTANTIATE(ACE_Unmanaged_Singleton, kn::DdsSubscriberRepository, ACE_SYNCH_RECURSIVE_MUTEX); diff --git a/knDds/src/knDds/DdsTypeRegistrator.cpp b/knDds/src/knDds/DdsTypeRegistrator.cpp index 04ba2b5..0a8283a 100644 --- a/knDds/src/knDds/DdsTypeRegistrator.cpp +++ b/knDds/src/knDds/DdsTypeRegistrator.cpp @@ -18,9 +18,13 @@ ******************************************************************************/ #include "DdsTypeRegistrator.h" +#include "knShare/Singleton.h" + namespace kn { DdsTypeRegistratorBase::~DdsTypeRegistratorBase() throw() {} } +KN_SINGLETON_TEMPLATE_INSTANTIATE(ACE_Singleton, kn::DdsTypeRegistratorRepository, ACE_SYNCH_RECURSIVE_MUTEX); + diff --git a/knDds/src/knDds/DdsTypedSupplier.h b/knDds/src/knDds/DdsTypedSupplier.h index 8584b51..c25607b 100644 --- a/knDds/src/knDds/DdsTypedSupplier.h +++ b/knDds/src/knDds/DdsTypedSupplier.h @@ -117,6 +117,7 @@ namespace kn virtual DataWriter& dataWriter() throw() { return dynamic_cast(*m_writer); } + bool hasSubscribers(); protected: /** hook to modify qos immediately before creation of DataWriter. Default implementation does nothing. */ @@ -140,6 +141,8 @@ namespace kn DDS::Topic * m_topic; Type * m_instance; + + DDS::InstanceHandleSeq m_subCheck; }; /** @@ -266,7 +269,9 @@ namespace kn if (m_instance == NULL) { throw("TypeSupport::create_data error"); } - + + // 0 max size InstanceHandleSeq used to check if we have subscribers + m_subCheck.loan_contiguous((DDS::InstanceHandle_t*)NULL, 0, 0); } /** @@ -318,6 +323,18 @@ namespace kn return *m_instance; } + /** + * fast check to see if there are any subscribers for this supplier's data + */ + template + bool + DdsTypedSupplier::hasSubscribers() + { + if(dataWriter().get_matched_subscriptions(m_subCheck) == DDS_RETCODE_OUT_OF_RESOURCES) + return true; + return false; + } + /** * publish passed-in data */ diff --git a/knDds/src/knDds/examples/rawWriter.cpp b/knDds/src/knDds/examples/rawWriter.cpp index 94669b0..9bd7bea 100644 --- a/knDds/src/knDds/examples/rawWriter.cpp +++ b/knDds/src/knDds/examples/rawWriter.cpp @@ -15,7 +15,7 @@ using namespace std; // 0020 00 01 e7 c2 1c f2 00 18 fe 2b 52 54 50 53 02 01 ........ .+RTPS.. // 0030 01 01 4e 44 44 53 50 49 4e 47 ..NDDSPI NG -char pingBuffer[] = { +unsigned char pingBuffer[] = { 0x52, 0x54, 0x50, 0x53, 0x02, 0x01, 0x01, 0x01, // RTPS 2.1 RTI 0x4e, 0x44, 0x44, 0x53, 0x50, 0x49, 0x4e, 0x47 // NDDSPING }; @@ -43,7 +43,7 @@ int const pingSize = sizeof(pingBuffer); // total packet size // [ENTITY] // RawWriter -char participantBuffer[] = { +unsigned char participantBuffer[] = { 0x52, 0x54, 0x50, 0x53, 0x02, 0x01, 0x01, 0x01, // RTPS 2.1 RTI 0xc1, 0x10, 0xb0, 0x9f, 0x00, 0x00, 0x3a, 0x02, 0x00, 0x00, 0x00, 0x01, // hostId(8) - IP, appId(12), counter(16) // info TS @@ -115,7 +115,7 @@ int const guidAppIdI = 68; // 00a0 00 00 00 00 00 00 ...... -char buffer[] = { +unsigned char buffer[] = { 0x52, 0x54, 0x50, 0x53, 0x02, 0x01, 0x01, 0x01, // RTPS 2.1 RTI 0xc1, 0x10, 0xb0, 0x9f, 0x00, 0x00, 0x3a, 0x02, 0x00, 0x00, 0x00, 0x01, // hostId(8) - IP, appId(12), counter(16) // info TS diff --git a/knDds/src/knDdsTools/ddsDomainInfo/CMakeLists.txt b/knDds/src/knDdsTools/ddsDomainInfo/CMakeLists.txt index 9f62cd7..fd53814 100644 --- a/knDds/src/knDdsTools/ddsDomainInfo/CMakeLists.txt +++ b/knDds/src/knDdsTools/ddsDomainInfo/CMakeLists.txt @@ -24,11 +24,6 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${ACE_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTGUI_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} - ${QT_QTNETWORK_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} ${KNDDS_INCLUDE_DIR} ) diff --git a/knDds/src/knDdsUtil/CMakeLists.txt b/knDds/src/knDdsUtil/CMakeLists.txt index c7c87b8..84cc614 100644 --- a/knDds/src/knDdsUtil/CMakeLists.txt +++ b/knDds/src/knDdsUtil/CMakeLists.txt @@ -22,9 +22,6 @@ include_directories( ${ACE_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ) link_libraries( diff --git a/knRapid/CMakeLists.txt b/knRapid/CMakeLists.txt index c392def..3322fce 100644 --- a/knRapid/CMakeLists.txt +++ b/knRapid/CMakeLists.txt @@ -1,60 +1,121 @@ +cmake_minimum_required(VERSION 2.8.3) project(knRapid) -cmake_minimum_required(VERSION 2.6) - -set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake/Modules ${CMAKE_MODULE_PATH} ) - -if( CMAKE_COMPILER_IS_GNUCXX ) - message( STATUS "****************************************************") - message( STATUS "** Manually setting compiler flags to prevent") - message( STATUS "** strict-aliasing warnings in DDS generated files") - message( STATUS "****************************************************") - set( WARN_FLAGS "-fno-strict-aliasing -Wall -Woverloaded-virtual -Wno-write-strings" ) - - if( NOT SETUP_WARN_LEVEL_HAS_RUN ) - message( STATUS "** disable --as-needed because k10controller *wants* 'unecessary' shared libs to be linked **") - set( CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed" CACHE STRING "" FORCE ) - endif( NOT SETUP_WARN_LEVEL_HAS_RUN ) - -endif( CMAKE_COMPILER_IS_GNUCXX ) - -include( SetArchitecture ) -include( SetupBuildSwitch ) -include( SetupConfigureFile ) -include( SetupInstall ) -include( SetupRPATH ) -include( SetupUtilities ) -include( SetupWarnLevel ) -include( UserOptions ) - -## we have to play some tricks to get install -## path to "stick" in Windows -##------------------------------------------------ -set( RAPID_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/../${ARCHITECTURE}" CACHE PATH "RAPID install path") -set( CMAKE_INSTALL_PREFIX ${RAPID_INSTALL_PREFIX} CACHE INTERNAL "" ) +################################### +## catkin ## +################################### +if (CATKIN_DEVEL_PREFIX) + find_package(catkin REQUIRED COMPONENTS + irg_cmake + irgUtil + Miro + kn + knDds + ) + include_directories( ${CATKIN_DEVEL_PREFIX}/include ) +endif(CATKIN_DEVEL_PREFIX) + +if (NOT catkin_FOUND) + ## standard CMake setup + set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake/Modules ${CMAKE_MODULE_PATH} ) + + if( CMAKE_COMPILER_IS_GNUCXX ) + message( STATUS "****************************************************") + message( STATUS "** Manually setting compiler flags to prevent") + message( STATUS "** strict-aliasing warnings in DDS generated files") + message( STATUS "****************************************************") + set( WARN_FLAGS "-fno-strict-aliasing -Wall -Woverloaded-virtual -Wno-write-strings" ) + + if( NOT SETUP_WARN_LEVEL_HAS_RUN ) + message( STATUS "** disable --as-needed because k10controller *wants* 'unecessary' shared libs to be linked **") + set( CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed" CACHE STRING "" FORCE ) + endif( NOT SETUP_WARN_LEVEL_HAS_RUN ) + + endif( CMAKE_COMPILER_IS_GNUCXX ) + + include( SetArchitecture ) + include( SetupBuildSwitch ) + include( SetupConfigureFile ) + include( SetupInstall ) + include( SetupRPATH ) + include( SetupUtilities ) + include( SetupWarnLevel ) + include( UserOptions ) + + ## we have to play some tricks to get install + ## path to "stick" in Windows + ##------------------------------------------------ + set( RAPID_INSTALL_PREFIX "${PROJECT_SOURCE_DIR}/../${ARCHITECTURE}" CACHE PATH "RAPID install path") + set( CMAKE_INSTALL_PREFIX ${RAPID_INSTALL_PREFIX} CACHE INTERNAL "" ) + + find_package( IrgUtil ) + find_package( Miro ) + find_package( kn ) + find_package( knDds ) +endif (NOT catkin_FOUND) #--------------------------------------------- # make RTI DDS optional add_build_var( WITH_DDS NOT APPLE ) -find_package_if( RtiDds KNRAPID_BUILD_WITH_DDS ) +find_package( RtiDds ) + +if( MIRO_BUILD_WITH_QT5 ) + message(STATUS "FOUND QT 5") + find_package(Qt5Widgets REQUIRED) + find_package(Qt5Xml REQUIRED) + find_package(Qt5Network REQUIRED) + if (Qt5_POSITION_INDEPENDENT_CODE) + SET(CMAKE_POSITION_INDEPENDENT_CODE ON) + endif() + include_directories(SYSTEM "${Qt5Widgets_INCLUDE_DIRS}") + include_directories(SYSTEM "${Qt5Xml_INCLUDE_DIRS}") + include_directories(SYSTEM "${Qt5Network_INCLUDE_DIRS}") + set(QT_QTXML_LIBRARY Qt5::Xml) + set(QT_QTCORE_LIBRARY Qt5::Widgets) + set(QT_QTNETWORK_LIBRARY Qt5::Network) +else() + message(STATUS "FOUND QT 4") + find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED) + include(${QT_USE_FILE}) + include_directories(SYSTEM "${QT_INCLUDE_DIR}") + include_directories(SYSTEM "${QT_QTXML_INCLUDE_DIR}") + include_directories(SYSTEM "${QT_QTCORE_INCLUDE_DIR}") + include_directories(SYSTEM "${QT_QTNETWORK_INCLUDE_DIR}") +endif() find_package( ACE ) -find_package( Qt4 ) find_package( PThreads-win32 ) find_package( CURL ) find_package( Boost 1.50.0 COMPONENTS program_options filesystem system thread bind function) find_package( Eigen3 ) find_package( Threads ) - -find_package( IrgUtil ) -find_package( Miro ) -find_package( kn ) -find_package( knDds ) - find_package( Doxygen ) -build_with_var( WITH_DDS RTIDDS_FOUND ) +build_with_var( WITH_DDS RTIDDS_FOUND ) + +set(knRapid_EXPORT_LIBRARIES knSystemInfo) #knFetchPool +if (RTIDDS_FOUND) + set(knRapid_EXPORT_LIBRARIES ${knRapid_EXPORT_LIBRARIES} rapidDds rapidIo rapidExtDds rapidExtIo rapidExtArcDds rapidExtArcIo rapidCommanding) +endif (RTIDDS_FOUND) + +if (catkin_FOUND) + ################################### + ## catkin specific configuration ## + ################################### + catkin_package( + INCLUDE_DIRS src # NOTE: see knRapid-extras.cmake for additional include dirs + LIBRARIES ${knRapid_EXPORT_LIBRARIES} + CFG_EXTRAS knRapid-extras.cmake + CATKIN_DEPENDS knDds + ) + ## set variable with full path of extras file so we can append library info + set_cfg_extras_file() + + # add devel/include - this should add to persistent catkin metadata + list(APPEND ${PROJECT_NAME}_INCLUDE_DIRS ${CATKIN_DEVEL_PREFIX}/include) +endif(catkin_FOUND) + ## We must add the in-source and out-of-source ## include paths @@ -63,6 +124,10 @@ build_with_var( WITH_DDS RTIDDS_FOUND ) include_directories( ${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src + ${catkin_INCLUDE_DIRS} + ${CATKIN_DEVEL_PREFIX}/include +) +include_directories(SYSTEM ${Boost_INCLUDE_DIR} ) @@ -75,7 +140,10 @@ setup_configure_file() # Defaults #----------------------------------- -link_libraries( ${CMAKE_THREAD_LIBS_INIT} ) +link_libraries( + ${CMAKE_THREAD_LIBS_INIT} + ${catkin_LIBRARIES} +) if( WIN32 ) link_directories( ${Boost_LIBRARY_DIRS} ) @@ -94,7 +162,8 @@ install_export() # package script #------------------------------------ -include( CMakePack.txt ) +#include( CMakePack.txt ) #------------------------------------ print_build_switches() + diff --git a/knRapid/cmake/knRapid-extras.cmake.develspace.in b/knRapid/cmake/knRapid-extras.cmake.develspace.in new file mode 100644 index 0000000..5eb3fb4 --- /dev/null +++ b/knRapid/cmake/knRapid-extras.cmake.develspace.in @@ -0,0 +1,24 @@ +# source: knRapid-extras.cmake.develspace.in + +## Create INCLUDE_DIR variable for downstream packages that +## include knRapid rtiddsgen generated headers +set(KNRAPID_INCLUDE_DIR @CATKIN_DEVEL_PREFIX@/include + @CATKIN_DEVEL_PREFIX@/include/rapidDds + @CATKIN_DEVEL_PREFIX@/include/rapidExtDds + @CATKIN_DEVEL_PREFIX@/include/rapidExtArcDds ) + +set(KNRAPID_rapidDds_IDL_DIR @PROJECT_SOURCE_DIR@/src/rapidDds ) +set(KNRAPID_rapidExtDds_IDL_DIR @PROJECT_SOURCE_DIR@/src/rapidExtDds ) +set(KNRAPID_rapidExtArcDds_IDL_DIR @PROJECT_SOURCE_DIR@/src/rapidExtArcDds ) + +## add include dirs to catkin_INCLUDE_DIRS +set( catkin_INCLUDE_DIRS ${catkin_INCLUDE_DIRS} ${KNRAPID_INCLUDE_DIR} ) + +if( NOT KNRAPID_COMPILER_FLAGS_HAS_RUN ) + if( CMAKE_COMPILER_IS_GNUCXX ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings" + CACHE STRING "Flags used by the C++ compiler during all build types." + FORCE ) + endif () + set( KNRAPID_COMPILER_FLAGS_HAS_RUN ON CACHE INTERNAL "one-time setup of compiler warning flags for generated DDS code" FORCE) +endif() diff --git a/knRapid/cmake/knRapid-extras.cmake.installspace.in b/knRapid/cmake/knRapid-extras.cmake.installspace.in new file mode 100644 index 0000000..cdf07e0 --- /dev/null +++ b/knRapid/cmake/knRapid-extras.cmake.installspace.in @@ -0,0 +1,24 @@ +# source: knRapid-extras.cmake.installspace.in + +## Create INCLUDE_DIR variable for downstream packages that +## include knRapid rtiddsgen generated headers +set(KNRAPID_INCLUDE_DIR @CMAKE_INSTALL_PREFIX@/include + @CMAKE_INSTALL_PREFIX@/include/rapidDds + @CMAKE_INSTALL_PREFIX@/include/rapidExtDds + @CMAKE_INSTALL_PREFIX@/include/rapidExtArcDds ) + +set(KNRAPID_rapidDds_IDL_DIR @CMAKE_INSTALL_PREFIX@/idl/rapidDds) +set(KNRAPID_rapidExtDds_IDL_DIR @CMAKE_INSTALL_PREFIX@/idl/rapidExtDds) +set(KNRAPID_rapidExtArcDds_IDL_DIR @CMAKE_INSTALL_PREFIX@/idl/rapidExtArcDds) + +## add include dirs to catkin_INCLUDE_DIRS +set( catkin_INCLUDE_DIRS ${catkin_INCLUDE_DIRS} ${KNRAPID_INCLUDE_DIR} ) + +if( NOT KNRAPID_COMPILER_FLAGS_HAS_RUN ) + if( CMAKE_COMPILER_IS_GNUCXX ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings" + CACHE STRING "Flags used by the C++ compiler during all build types." + FORCE ) + endif () + set( KNRAPID_COMPILER_FLAGS_HAS_RUN ON CACHE INTERNAL "one-time setup of compiler warning flags for generated DDS code" FORCE) +endif() diff --git a/knRapid/etc/RAPID_QOS_PROFILES.xml b/knRapid/etc/RAPID_QOS_PROFILES.xml index 052f0d3..35bb69d 100644 --- a/knRapid/etc/RAPID_QOS_PROFILES.xml +++ b/knRapid/etc/RAPID_QOS_PROFILES.xml @@ -115,6 +115,14 @@ dds.transport.UDPv4.builtin.parent.deny_multicast_interfaces 10.10.1.*,10.30.10.*,192.168.3.255,169.254.194.2,192.168.1.*,192.9.202.1,192.168.5.*,192.168.10.*,192.168.122.* + @@ -127,6 +135,14 @@ 0 + + @@ -136,6 +152,13 @@ ASYNCHRONOUS_PUBLISH_MODE_QOS + @@ -236,6 +259,9 @@ + + + @@ -251,7 +277,7 @@ - + RELIABLE_RELIABILITY_QOS @@ -577,6 +603,8 @@ + + diff --git a/knRapid/examples/dds/CMakeLists.txt b/knRapid/examples/dds/CMakeLists.txt index cdb5a15..3014a70 100644 --- a/knRapid/examples/dds/CMakeLists.txt +++ b/knRapid/examples/dds/CMakeLists.txt @@ -1,4 +1,4 @@ -add_subdirectory( HelloWorld ) +#add_subdirectory( HelloWorld ) diff --git a/knRapid/examples/dds/HelloWorld/CMakeLists.txt b/knRapid/examples/dds/HelloWorld/CMakeLists.txt index 629b7d6..e9431d1 100644 --- a/knRapid/examples/dds/HelloWorld/CMakeLists.txt +++ b/knRapid/examples/dds/HelloWorld/CMakeLists.txt @@ -8,7 +8,7 @@ rtidds_wrap_idl( ${ALL_IDL_FILENAMES} ) include_directories( ${RTIDDS_INCLUDE_DIR} ) link_libraries( ${RTIDDS_LIBRARIES} ) -add_library( ${LIB_NAME} STATIC +add_library( ${LIB_NAME} ${RTIDDS_IDL_GENERATED} ) diff --git a/knRapid/examples/poseProvider/CMakeLists.txt b/knRapid/examples/poseProvider/CMakeLists.txt index 7bc907c..20331e9 100644 --- a/knRapid/examples/poseProvider/CMakeLists.txt +++ b/knRapid/examples/poseProvider/CMakeLists.txt @@ -14,9 +14,6 @@ include_directories( ${Boost_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} ${EIGEN3_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ) link_libraries( diff --git a/knRapid/package.xml b/knRapid/package.xml new file mode 100644 index 0000000..9a1cfca --- /dev/null +++ b/knRapid/package.xml @@ -0,0 +1,17 @@ + + + knRapid + 1.0.0 + Rapid Implementation of soraCore + Hans Utz + + Apache2 + + catkin + irg_cmake + + irgUtil + kn + knDds + Miro + diff --git a/knRapid/src/CMakeLists.txt b/knRapid/src/CMakeLists.txt index cdf8452..57e98bb 100644 --- a/knRapid/src/CMakeLists.txt +++ b/knRapid/src/CMakeLists.txt @@ -12,12 +12,12 @@ add_build_switch( rapidExtIo KNRAPID_HAS_DDS AND EIGEN3_FOUND ) add_build_switch( rapidExtArcIo KNRAPID_HAS_DDS AND EIGEN3_FOUND ) add_build_switch( rapidExtTraclabsIo KNRAPID_HAS_DDS AND EIGEN3_FOUND ) add_build_switch( rapidCommanding KNRAPID_HAS_DDS ) #AND NOT WIN32 ) # compile failure in ACE_NS_Thread.inl -add_build_switch( rapidFrameStore EIGEN3_FOUND) -add_build_switch( knFrameStoreSvc EIGEN3_FOUND ) -add_build_switch( knSystemInfo MIRO_miroXml_LIBRARY AND NOT APPLE AND UNIX ) +add_build_switch( rapidFrameStore KNRAPID_HAS_DDS AND EIGEN3_FOUND) +add_build_switch( knFrameStoreSvc KNRAPID_HAS_DDS AND EIGEN3_FOUND ) +add_build_switch( knSystemInfo NOT APPLE AND UNIX ) add_build_switch( knSystemInfoSvc KNRAPID_HAS_DDS AND KNRAPID_BUILD_knSystemInfo ) -add_build_switch( knFetchPool MIRO_miroXml_LIBRARY AND QT_FOUND ) -add_build_switch( knRaft KNRAPID_BUILD_rapidCommanding AND IRGUTIL_irgSha1_LIBRARY AND KNRAPID_BUILD_knFetchPool ) +add_subdirectory( knFetchPool ) +add_build_switch( knRaft KNRAPID_BUILD_rapidCommanding ) add_build_switch( knProcessManager KNRAPID_HAS_DDS AND UNIX ) diff --git a/knRapid/src/knFetchPool/CMakeLists.txt b/knRapid/src/knFetchPool/CMakeLists.txt index a743928..98d691a 100644 --- a/knRapid/src/knFetchPool/CMakeLists.txt +++ b/knRapid/src/knFetchPool/CMakeLists.txt @@ -34,10 +34,6 @@ endif( CURL_FOUND AND CURL_HAS_SSH ) include_directories( ${ACE_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${KN_INCLUDE_DIR} ) @@ -49,6 +45,7 @@ link_libraries ( ${MIRO_miroCore_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} + ${QT_LIBRARIES} ) if( CURL_FOUND AND CURL_HAS_SSH ) diff --git a/knRapid/src/knFrameStoreSvc/CMakeLists.txt b/knRapid/src/knFrameStoreSvc/CMakeLists.txt index 4d4818a..dd2e38d 100644 --- a/knRapid/src/knFrameStoreSvc/CMakeLists.txt +++ b/knRapid/src/knFrameStoreSvc/CMakeLists.txt @@ -27,10 +27,6 @@ include_directories ( ${EIGEN3_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} ${KNDDS_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${ACE_INCLUDE_DIR} ) @@ -73,6 +69,7 @@ add_target_definitions( ${LIB_NAME} ${EXPORT_DEFINE} ) set (CONFIG_FILES MarscapeFrames.xml RoverscapeFrames.xml + Mvp2014Frames.xml FieldTestSiteFrames.xml K10RedFrames.xml K10RedUpdaterConfig.xml diff --git a/knRapid/src/knFrameStoreSvc/Mvp2014Frames.xml b/knRapid/src/knFrameStoreSvc/Mvp2014Frames.xml new file mode 100644 index 0000000..f375b04 --- /dev/null +++ b/knRapid/src/knFrameStoreSvc/Mvp2014Frames.xml @@ -0,0 +1,42 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/knRapid/src/knProcessManager/CMakeLists.txt b/knRapid/src/knProcessManager/CMakeLists.txt index 305224b..5b34923 100644 --- a/knRapid/src/knProcessManager/CMakeLists.txt +++ b/knRapid/src/knProcessManager/CMakeLists.txt @@ -35,10 +35,7 @@ include_directories ( ${RTIDDS_INCLUDE_DIR} ${KN_INCLUDE_DIR} ${Boost_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} - ${CMAKE_BINARY_DIR}/src/rapidDds + ${CMAKE_CURRENT_BINARY_DIR}/../rapidDds ) link_libraries ( diff --git a/knRapid/src/knRaft/CMakeLists.txt b/knRapid/src/knRaft/CMakeLists.txt index bf3cb74..ed59c45 100644 --- a/knRapid/src/knRaft/CMakeLists.txt +++ b/knRapid/src/knRaft/CMakeLists.txt @@ -34,9 +34,6 @@ include_directories( ${KNDDS_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} ${Boost_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ) link_directories( ${Boost_LIBRARY_DIRS} ) diff --git a/knRapid/src/knRaft/FileAnnouncer.cpp b/knRapid/src/knRaft/FileAnnouncer.cpp index aaf42d7..160267d 100644 --- a/knRapid/src/knRaft/FileAnnouncer.cpp +++ b/knRapid/src/knRaft/FileAnnouncer.cpp @@ -93,11 +93,11 @@ FileAnnouncer::announceFile(const char* path, } m_publisher->sendEvent(); - return TRUE; + return true; } KN_ERROR_OSTR("FileAnnouncer: file \"" << path << "\" is invalid: exists=" << fi.exists() << ", isFile=" << fi.isFile() << ", isReadable=" << fi.isReadable()); - return FALSE; + return false; } diff --git a/knRapid/src/knSystemInfo/CMakeLists.txt b/knRapid/src/knSystemInfo/CMakeLists.txt index bd8ccaf..6638a1b 100644 --- a/knRapid/src/knSystemInfo/CMakeLists.txt +++ b/knRapid/src/knSystemInfo/CMakeLists.txt @@ -42,10 +42,6 @@ set( HEADERS include_directories( ${ACE_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${KN_INCLUDE_DIR} ) @@ -55,6 +51,8 @@ add_definitions(-D${EXPORT_DEFINE}) link_libraries( ${MIRO_miroXml_LIBRARY} ${KN_knShare_LIBRARY} + ${QT_QTXML_LIBRARY} + ${QT_QTCORE_LIBRARY} ) add_library(${LIB_NAME} SHARED diff --git a/knRapid/src/knSystemInfo/CpuInfo.cpp b/knRapid/src/knSystemInfo/CpuInfo.cpp index f425977..f335a98 100644 --- a/knRapid/src/knSystemInfo/CpuInfo.cpp +++ b/knRapid/src/knSystemInfo/CpuInfo.cpp @@ -23,6 +23,7 @@ #include #include +#include namespace kn { @@ -32,87 +33,99 @@ namespace kn m_params(params), m_lastCpuInfo(params.numCpus) { + if (m_params.numCpus == 0) { + m_params.numCpus = numCpus(); + m_lastCpuInfo.resize(m_params.numCpus); + } + + + } - - int - CpuInfo::getCpu(Data& cpu, unsigned int index) + + int + CpuInfo::sampleInfo(DataVector& cpus) { + cpus.resize(m_params.numCpus); + const char* proc = m_params.proc.c_str(); + char foundCPU[64]; int rc = -1; ifstream is(proc); if (is.is_open()) { - char buffer[BUFFER_SIZE]; - memset(buffer, 0, BUFFER_SIZE); - char foundCPU[10]; - memset(foundCPU, 0, 10); - - int r = 0; - stringstream name; - name << "cpu" << index; - const char* expectCPU = name.str().c_str(); - - while ( !is.eof() ) { - is.getline(buffer, BUFFER_SIZE); + string line; + + for (size_t i = 0; i < m_params.numCpus; ++i) { + if (is.eof()) { + break; + } + std::getline(is, line); - // found the cpu we are looking for - if (strncmp(buffer, expectCPU, 4) == 0) { - Data cpuInfo; - r = sscanf(buffer, "%s %u %u %u %u\n", - foundCPU, - &cpuInfo.user, - &cpuInfo.nice, - &cpuInfo.system, - &cpuInfo.idle); - + if (line.substr(0, 3) != "cpu") { + break; + } + + Data cpuInfo; + int r = sscanf(line.c_str(), "%s %u %u %u %u\n", + foundCPU, + &cpuInfo.user, + &cpuInfo.nice, + &cpuInfo.system, + &cpuInfo.idle); - if ( r == 5 ) { - cpuInfo.busy = - cpuInfo.user + - cpuInfo.system + - cpuInfo.nice; - - float dSum = ( (cpuInfo.busy - m_lastCpuInfo[index].busy) + - (cpuInfo.idle - m_lastCpuInfo[index].idle) ); - - cpu.user = (unsigned int)((float)(cpuInfo.user - m_lastCpuInfo[index].user) / dSum * 10000); - cpu.nice = (unsigned int)((float)(cpuInfo.nice - m_lastCpuInfo[index].nice) / dSum * 10000); - cpu.system = (unsigned int)((float)(cpuInfo.system - m_lastCpuInfo[index].system) / dSum * 10000); - cpu.idle = (unsigned int)((float)(cpuInfo.idle - m_lastCpuInfo[index].idle) / dSum * 10000); - cpu.busy = (unsigned int)((float)(cpuInfo.busy - m_lastCpuInfo[index].busy) / dSum * 10000); + if ( r == 5 ) { + cpuInfo.busy = + cpuInfo.user + + cpuInfo.system + + cpuInfo.nice; - m_lastCpuInfo[index] = cpuInfo; + float dSum = ( (cpuInfo.busy - m_lastCpuInfo[i].busy) + + (cpuInfo.idle - m_lastCpuInfo[i].idle) ); - rc = 0; - } - else { - MIRO_LOG_OSTR(LL_ERROR, "Error parsing cpu info for: " << expectCPU); - } - break; + cpus[i].name = foundCPU; + cpus[i].user = (unsigned int)((float)(cpuInfo.user - m_lastCpuInfo[i].user) / dSum * 10000); + cpus[i].nice = (unsigned int)((float)(cpuInfo.nice - m_lastCpuInfo[i].nice) / dSum * 10000); + cpus[i].system = (unsigned int)((float)(cpuInfo.system - m_lastCpuInfo[i].system) / dSum * 10000); + cpus[i].idle = (unsigned int)((float)(cpuInfo.idle - m_lastCpuInfo[i].idle) / dSum * 10000); + cpus[i].busy = (unsigned int)((float)(cpuInfo.busy - m_lastCpuInfo[i].busy) / dSum * 10000); + + m_lastCpuInfo[i] = cpuInfo; + + rc = 0; + } + else { + MIRO_LOG_OSTR(LL_ERROR, "Error parsing cpu info for: " << i); } } - - if (strncmp(buffer, expectCPU, 4) != 0) - MIRO_LOG_OSTR(LL_WARNING, expectCPU << " not found!"); } else MIRO_LOG_OSTR(LL_ERROR,"Cannot read " << proc << ": " << strerror(errno)); return rc; } - - int - CpuInfo::sampleInfo(DataVector& cpus) + + int CpuInfo::numCpus() { - int rc = 0; + int cnt = 0; + const char* proc = m_params.proc.c_str(); - cpus.resize(m_params.numCpus); - for (unsigned int i = 0; i < m_params.numCpus; ++i) { - int rc = getCpu(cpus[i], i); - if (rc != 0) - break; + ifstream is(proc); + if (is.is_open()) { + + string line; + while (!is.eof()) { + if (!getline(is, line)) { + break; + } + + if (line.substr(0, 3) != "cpu") { + break; + } + ++cnt; + } } - return rc; - } + return cnt; + } + } diff --git a/knRapid/src/knSystemInfo/CpuInfo.h b/knRapid/src/knSystemInfo/CpuInfo.h index 6375be5..9f6f5c3 100644 --- a/knRapid/src/knSystemInfo/CpuInfo.h +++ b/knRapid/src/knSystemInfo/CpuInfo.h @@ -20,20 +20,20 @@ #define kn_BatteryInfo_h #include "knSystemInfo_Export.h" +#include "knSystemInfo/SystemInfoParameters.h" #include namespace kn { - class CpuParameters; - class CpuInfoParameters; - /** Publishes system information: laptop battery, ram/cpu/net usage, ect. to an event channel */ class knSystemInfo_Export CpuInfo { public: struct Data { + std::string name; + unsigned int user; unsigned int nice; unsigned int system; @@ -45,11 +45,14 @@ namespace kn CpuInfo(CpuInfoParameters const& params); int sampleInfo(DataVector& cpus); + unsigned int numCpus() const { + return m_params.numCpus; + } private: - int getCpu(Data& cpu, unsigned int index); + int numCpus(); - CpuInfoParameters const& m_params; + CpuInfoParameters m_params; DataVector m_lastCpuInfo; static int const BUFFER_SIZE = 256; diff --git a/knRapid/src/knSystemInfo/FilesystemInfo.cpp b/knRapid/src/knSystemInfo/FilesystemInfo.cpp index 332a1ae..9874fd3 100644 --- a/knRapid/src/knSystemInfo/FilesystemInfo.cpp +++ b/knRapid/src/knSystemInfo/FilesystemInfo.cpp @@ -23,14 +23,22 @@ #include +#include + namespace kn { using namespace std; FilesystemInfo::FilesystemInfo(FilesystemInfoParameters const& params) : - m_params(params), - m_lastFilesystemInfo(params.volumes.size()) - {} + m_params(params) + { + StringVector volumes; + volumes.reserve(params.volumes.size()); + for (size_t i = 0; i < m_params.volumes.size(); ++i) { + volumes.push_back(m_params.volumes[i].name); + } + m_params.volumes = this->collectFileSystems(volumes); + } int @@ -68,4 +76,35 @@ namespace kn } return rc; } + + std::vector FilesystemInfo::collectFileSystems(StringVector const& volumeNames) + { + StringVector names(volumeNames); + sort(names.begin(), names.end()); + StringVector::iterator iter = unique(names.begin(), names.end()); + names.erase(iter, names.end()); + + vector volumes; + + std::ifstream is("/proc/mounts"); + string line; + while (is.good() && ! is.eof()) { + std::getline(is, line); + if (line.substr(0, 5) != "/dev/") { + continue; + } + + FilesystemParameters volume; + stringstream sstr(line); + sstr >> volume.name; + sstr >> volume.path; + + if (names.empty() || binary_search(names.begin(), names.end(), volume.name)) { + volumes.push_back(volume); + } + } + + return volumes; + } + } diff --git a/knRapid/src/knSystemInfo/FilesystemInfo.h b/knRapid/src/knSystemInfo/FilesystemInfo.h index b896bb8..74702b5 100644 --- a/knRapid/src/knSystemInfo/FilesystemInfo.h +++ b/knRapid/src/knSystemInfo/FilesystemInfo.h @@ -20,14 +20,13 @@ #define kn_FilesystemInfo_h #include "knSystemInfo_Export.h" +#include "knSystemInfo/SystemInfoParameters.h" #include +#include namespace kn { - class FilesystemParameters; - class FilesystemInfoParameters; - /** Publishes system information: laptop battery, ram/cpu/net usage, ect. to an event channel */ class knSystemInfo_Export FilesystemInfo { @@ -39,16 +38,20 @@ namespace kn unsigned long long available; }; typedef std::vector DataVector; + typedef std::vector StringVector; FilesystemInfo(FilesystemInfoParameters const& params); int sampleInfo(DataVector& ifs); + FilesystemInfoParameters const& params() const { + return m_params; + } private: int getFilesystem(Data& info, unsigned int index); + std::vector< FilesystemParameters > collectFileSystems(const std::vector< std::string >& volumeNames); - FilesystemInfoParameters const& m_params; - DataVector m_lastFilesystemInfo; + FilesystemInfoParameters m_params; static const int BUFFER_SIZE = 256; }; diff --git a/knRapid/src/knSystemInfo/MemoryInfo.cpp b/knRapid/src/knSystemInfo/MemoryInfo.cpp index c8e109c..9ac0ac0 100644 --- a/knRapid/src/knSystemInfo/MemoryInfo.cpp +++ b/knRapid/src/knSystemInfo/MemoryInfo.cpp @@ -17,7 +17,6 @@ ******************************************************************************/ #include "MemoryInfo.h" -#include "SystemInfoParameters.h" #include "miro/Log.h" @@ -60,6 +59,12 @@ namespace kn int i = sscanf(buffer, "MemFree: %u kB\n", &memory.free); if (i != 1) { MIRO_LOG(LL_ERROR, "Error parsing MemFree."); + } + } + else if (!strncmp(buffer, "MemAvailable:", 8)) { + int i = sscanf(buffer, "MemAvailable: %u kB\n", &memory.available); + if (i != 1) { + MIRO_LOG(LL_ERROR, "Error parsing MemAvailable."); rc = -1; } } diff --git a/knRapid/src/knSystemInfo/MemoryInfo.h b/knRapid/src/knSystemInfo/MemoryInfo.h index 37619b8..c6fd0e7 100644 --- a/knRapid/src/knSystemInfo/MemoryInfo.h +++ b/knRapid/src/knSystemInfo/MemoryInfo.h @@ -20,11 +20,11 @@ #define kn_MemoryInfo_h #include "knSystemInfo_Export.h" +#include "knSystemInfo/SystemInfoParameters.h" + namespace kn { - class MemoryInfoParameters; - /** Publishes system information: laptop battery, ram/cpu/net usage, ect. to an event channel */ class knSystemInfo_Export MemoryInfo { @@ -34,6 +34,7 @@ namespace kn unsigned int cached; unsigned int buffers; unsigned int free; + unsigned int available; unsigned int swap; }; @@ -43,7 +44,7 @@ namespace kn int sampleInfo(Data& memory); private: - MemoryInfoParameters const& m_params; + MemoryInfoParameters m_params; unsigned int m_total; static const int BUFFER_SIZE = 256; diff --git a/knRapid/src/knSystemInfo/NetTrafficInfo.h b/knRapid/src/knSystemInfo/NetTrafficInfo.h index c170c20..6050749 100644 --- a/knRapid/src/knSystemInfo/NetTrafficInfo.h +++ b/knRapid/src/knSystemInfo/NetTrafficInfo.h @@ -20,14 +20,12 @@ #define kn_NetTrafficInfo_h #include "knSystemInfo_Export.h" +#include "knSystemInfo/SystemInfoParameters.h" #include namespace kn { - class NetTrafficParameters; - class NetTrafficInfoParameters; - /** Publishes system information: laptop battery, ram/cpu/net usage, ect. to an event channel */ class knSystemInfo_Export NetTrafficInfo { @@ -39,16 +37,19 @@ namespace kn unsigned int txErrors; unsigned int rxErrors; }; - typedef std::vector DataVector; + typedef std::vector DataVector; NetTrafficInfo(NetTrafficInfoParameters const& params); int sampleInfo(DataVector& ifs); + NetTrafficInfoParameters const& params() const { + return m_params; + } private: int getNetTraffic(Data& interface, unsigned int index); - NetTrafficInfoParameters const& m_params; + NetTrafficInfoParameters m_params; DataVector m_lastNetTrafficInfo; static const int BUFFER_SIZE = 256; diff --git a/knRapid/src/knSystemInfoSvc/CMakeLists.txt b/knRapid/src/knSystemInfoSvc/CMakeLists.txt index 5a2aee0..c691188 100644 --- a/knRapid/src/knSystemInfoSvc/CMakeLists.txt +++ b/knRapid/src/knSystemInfoSvc/CMakeLists.txt @@ -28,10 +28,6 @@ include_directories( ${ACE_INCLUDE_DIR} ${KN_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ) diff --git a/knRapid/src/rapidCommanding/CMakeLists.txt b/knRapid/src/rapidCommanding/CMakeLists.txt index 4813ce4..2e33881 100644 --- a/knRapid/src/rapidCommanding/CMakeLists.txt +++ b/knRapid/src/rapidCommanding/CMakeLists.txt @@ -45,9 +45,6 @@ include_directories( ${KNDDS_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} ${Boost_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ) # there's some wicked weird black magic going on w/ boost @@ -68,6 +65,7 @@ target_link_libraries( ${LIB_NAME} ${KNDDS_knDds_LIBRARY} ${MIRO_miroXml_LIBRARY} ${RTIDDS_LIBRARIES} + ${QT_QTXML_LIBRARY} ) # export define only applies to lib diff --git a/knRapid/src/rapidCommanding/MobilitySubsysImplBase.cpp b/knRapid/src/rapidCommanding/MobilitySubsysImplBase.cpp index fbffa11..6ffca7e 100644 --- a/knRapid/src/rapidCommanding/MobilitySubsysImplBase.cpp +++ b/knRapid/src/rapidCommanding/MobilitySubsysImplBase.cpp @@ -70,6 +70,9 @@ namespace rapid case 4: // STOPALLMOTION amiRef = this->abort(); break; + case 5: // MOVEGOAL2D + amiRef = this->moveGoal2D(cmd); + break; default: boost::throw_exception(EBadSyntax(string("Unknown Mobility command cmdName:") + cmd.cmdName)); } @@ -119,6 +122,14 @@ namespace rapid }; int const NUM_SIMPLEMOVE6DOF_ARGUMENTS = sizeof(simpleMove6DofArguments) / sizeof(KeyTypePair); + KeyTypePair moveGoal2DArguments[] = { + { MOBILITY_METHOD_MOVEGOAL2D_PARAM_FRAME_NAME, MOBILITY_METHOD_MOVEGOAL2D_DTYPE_FRAME_NAME }, + { MOBILITY_METHOD_MOVEGOAL2D_PARAM_END_LOCATION, MOBILITY_METHOD_MOVEGOAL2D_DTYPE_END_LOCATION }, + { MOBILITY_METHOD_MOVEGOAL2D_PARAM_END_LOCATION_TOLERANCE, MOBILITY_METHOD_MOVEGOAL2D_DTYPE_END_LOCATION_TOLERANCE }, + { MOBILITY_METHOD_MOVEGOAL2D_PARAM_GOAL_ID, MOBILITY_METHOD_MOVEGOAL2D_DTYPE_GOAL_ID } + }; + int const NUM_MOVEGOAL2D_ARGUMENTS = sizeof(moveGoal2DArguments) / sizeof(KeyTypePair); + int const NULL_ARGUMENTS = 0; struct Cmd @@ -134,7 +145,8 @@ namespace rapid { MOBILITY_METHOD_MOVE6DOF, NUM_MOVE6DOF_ARGUMENTS, move6DofArguments, true }, { MOBILITY_METHOD_SIMPLEMOVE, NUM_SIMPLEMOVE_ARGUMENTS, simpleMoveArguments, true }, { MOBILITY_METHOD_SIMPLEMOVE6DOF, NUM_SIMPLEMOVE6DOF_ARGUMENTS, simpleMove6DofArguments, true }, - { MOBILITY_METHOD_STOPALLMOTION, NULL_ARGUMENTS, NULL, false } + { MOBILITY_METHOD_STOPALLMOTION, NULL_ARGUMENTS, NULL, false }, + { MOBILITY_METHOD_MOVEGOAL2D, NUM_MOVEGOAL2D_ARGUMENTS, moveGoal2DArguments, true }, }; static int const MOBILITY_COMMANDS = sizeof(commands) / sizeof (Cmd); } @@ -191,4 +203,12 @@ namespace rapid { boost::throw_exception(EExecFailed(string("Mobility command command not supported: abort"))); } + + MobilitySubsysImplBase::FuturePtr + MobilitySubsysImplBase::moveGoal2D(Command const& cmd) + { + boost::throw_exception(EExecFailed(string("Mobility command command not supported: ") + cmd.cmdName)); + } + + } diff --git a/knRapid/src/rapidCommanding/MobilitySubsysImplBase.h b/knRapid/src/rapidCommanding/MobilitySubsysImplBase.h index 7cfee58..55a3d15 100644 --- a/knRapid/src/rapidCommanding/MobilitySubsysImplBase.h +++ b/knRapid/src/rapidCommanding/MobilitySubsysImplBase.h @@ -40,6 +40,7 @@ namespace rapid virtual FuturePtr simpleMove6Dof(rapid::Command const& cmd); virtual FuturePtr moveTo6Dof(rapid::Command const& cmd); virtual FuturePtr abort(); + virtual FuturePtr moveGoal2D(rapid::Command const& cmd); static rapid::SubsystemType const * typeDescription(); }; diff --git a/knRapid/src/rapidCommanding/RapidSubsystemRepository.cpp b/knRapid/src/rapidCommanding/RapidSubsystemRepository.cpp index ef85f41..04c9812 100644 --- a/knRapid/src/rapidCommanding/RapidSubsystemRepository.cpp +++ b/knRapid/src/rapidCommanding/RapidSubsystemRepository.cpp @@ -1,6 +1,3 @@ #include "RapidSubsystemRepository.h" -// does this evaluate to true on any of our target platforms? -#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template kn::Singleton * kn::Singleton::s_instance; -#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ +KN_SINGLETON_TEMPLATE_INSTANTIATION(kn::Repository); diff --git a/knRapid/src/rapidDds/AccessControlState.idl b/knRapid/src/rapidDds/AccessControlState.idl index 89d201a..e6284cd 100644 --- a/knRapid/src/rapidDds/AccessControlState.idl +++ b/knRapid/src/rapidDds/AccessControlState.idl @@ -1,3 +1,6 @@ +#ifndef rapid_AccessControlState_idl +#define rapid_AccessControlState_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -51,3 +54,5 @@ module rapid { public String32Sequence16 requestors; }; }; + +#endif // rapid_AccessControlState_idl diff --git a/knRapid/src/rapidDds/Ack.idl b/knRapid/src/rapidDds/Ack.idl index 0935be1..69b4b3b 100644 --- a/knRapid/src/rapidDds/Ack.idl +++ b/knRapid/src/rapidDds/Ack.idl @@ -1,3 +1,6 @@ +#ifndef rapid_Ack_idl +#define rapid_Ack_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -82,3 +85,5 @@ module rapid { public String128 message; }; }; + +#endif // rapid_Ack_idl diff --git a/knRapid/src/rapidDds/AgentConfig.idl b/knRapid/src/rapidDds/AgentConfig.idl index fa5718a..01e1bac 100644 --- a/knRapid/src/rapidDds/AgentConfig.idl +++ b/knRapid/src/rapidDds/AgentConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_AgentConfig_idl +#define rapid_AgentConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -77,3 +80,5 @@ module rapid { }; }; + +#endif // rapid_AgentConfig_idl diff --git a/knRapid/src/rapidDds/AgentState.idl b/knRapid/src/rapidDds/AgentState.idl index 571f911..d54f832 100644 --- a/knRapid/src/rapidDds/AgentState.idl +++ b/knRapid/src/rapidDds/AgentState.idl @@ -1,3 +1,6 @@ +#ifndef rapid_AgentState_idl +#define rapid_AgentState_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -47,3 +50,5 @@ module rapid { }; + +#endif // rapid_AgentState_idl diff --git a/knRapid/src/rapidDds/AthleteDefs.idl b/knRapid/src/rapidDds/AthleteDefs.idl index 3f448c4..83691e9 100644 --- a/knRapid/src/rapidDds/AthleteDefs.idl +++ b/knRapid/src/rapidDds/AthleteDefs.idl @@ -1,3 +1,6 @@ +#ifndef rapid_AthleteDefs_idl +#define rapid_AthleteDefs_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -88,3 +91,5 @@ module rapid { const String16 INT_TYPE_KEY = "__INT__"; }; + +#endif // rapid_AthleteDefs_idl diff --git a/knRapid/src/rapidDds/BaseTypes.idl b/knRapid/src/rapidDds/BaseTypes.idl index b2596e3..9f0ff29 100644 --- a/knRapid/src/rapidDds/BaseTypes.idl +++ b/knRapid/src/rapidDds/BaseTypes.idl @@ -1,3 +1,6 @@ +#ifndef rapid_BaseTypes_idl +#define rapid_BaseTypes_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -156,9 +159,9 @@ module rapid { case RAPID_STRING: String128 s; case RAPID_VEC3d: - Vec3d vec3d; //@copy /**< vector */ + Vec3d vec3d; case RAPID_MAT33f: - Mat33f mat33f; //@copy /**< rotation matrix */ + Mat33f mat33f; }; typedef sequence ParameterSequence16; typedef sequence ParameterSequence64; @@ -250,3 +253,5 @@ module rapid { typedef sequence NamedOptionSetValueSequence16; typedef sequence NamedOptionSetValueSequence32; }; + +#endif // rapid_BaseTypes_idl diff --git a/knRapid/src/rapidDds/Command.idl b/knRapid/src/rapidDds/Command.idl index 7d5e26f..f7d92de 100644 --- a/knRapid/src/rapidDds/Command.idl +++ b/knRapid/src/rapidDds/Command.idl @@ -1,3 +1,6 @@ +#ifndef rapid_Command_idl +#define rapid_Command_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -86,3 +89,5 @@ module rapid { public String64 targetCmdId; }; }; + +#endif // rapid_Command_idl diff --git a/knRapid/src/rapidDds/CommandConfig.idl b/knRapid/src/rapidDds/CommandConfig.idl index 16b430d..e84d056 100644 --- a/knRapid/src/rapidDds/CommandConfig.idl +++ b/knRapid/src/rapidDds/CommandConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_CommandConfig_idl +#define rapid_CommandConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -85,3 +88,5 @@ module rapid { }; }; + +#endif // rapid_CommandConfig_idl diff --git a/knRapid/src/rapidDds/CommandConstants.idl b/knRapid/src/rapidDds/CommandConstants.idl index f658762..d6408ba 100644 --- a/knRapid/src/rapidDds/CommandConstants.idl +++ b/knRapid/src/rapidDds/CommandConstants.idl @@ -1,3 +1,6 @@ +#ifndef rapid_CommandConstants_idl +#define rapid_CommandConstants_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -181,25 +184,20 @@ module rapid { const DataType MOBILITY_METHOD_SIMPLEMOVE6DOF_DTYPE_ROT = RAPID_MAT33f; const String32 MOBILITY_METHOD_MOVE = "move"; - const String32 MOBILITY_METHOD_MOVE_PARAM_FRAME_NAME = "referenceFrame"; const DataType MOBILITY_METHOD_MOVE_DTYPE_FRAME_NAME = RAPID_STRING; - //@copy-declaration /** Can be defined as a rotation about an axis. */ const String32 MOBILITY_METHOD_MOVE_PARAM_END_LOCATION = "xyt"; const DataType MOBILITY_METHOD_MOVE_DTYPE_END_LOCATION = RAPID_VEC3d; - //@copy-declaration /** //@copy-declaration * The x,y,theta tolerance for waypoint. Theta is specified in radians. For a non-directional waypoint, use //@copy-declaration * negative or > PI value. //@copy-declaration */ const String32 MOBILITY_METHOD_MOVE_PARAM_END_LOCATION_TOLERANCE = "xytTolerance"; const DataType MOBILITY_METHOD_MOVE_DTYPE_END_LOCATION_TOLERANCE = RAPID_VEC3d; - //@copy-declaration /** In meters/sec. */ const String32 MOBILITY_METHOD_MOVE_PARAM_HINTED_SPEED = "hintedSpeed"; const DataType MOBILITY_METHOD_MOVE_DTYPE_HINTED_SPEED = RAPID_FLOAT; - const String32 MOBILITY_METHOD_MOVE_PARAM_NAV_ALGO = "navAlgo"; const DataType MOBILITY_METHOD_MOVE_DTYPE_NAV_ALGO = RAPID_STRING; @@ -212,13 +210,22 @@ module rapid { const DataType MOBILITY_METHOD_MOVE6DOF_DTYPE_END_LOCATION_TOLERANCE = RAPID_VEC3d; const String32 MOBILITY_METHOD_MOVE6DOF_PARAM_ROT = "rot"; const DataType MOBILITY_METHOD_MOVE6DOF_DTYPE_ROT = RAPID_MAT33f; - //@copy-declaration /** In meters/sec. */ const String32 MOBILITY_METHOD_MOVE6DOF_PARAM_HINTED_SPEED = "hintedSpeed"; const DataType MOBILITY_METHOD_MOVE6DOF_DTYPE_HINTED_SPEED = RAPID_FLOAT; const String32 MOBILITY_METHOD_MOVE6DOF_PARAM_NAV_ALGO = "navAlgo"; const DataType MOBILITY_METHOD_MOVE6DOF_DTYPE_NAV_ALGO = RAPID_STRING; + const String32 MOBILITY_METHOD_MOVEGOAL2D = "moveGoal2D"; + const String32 MOBILITY_METHOD_MOVEGOAL2D_PARAM_FRAME_NAME = "referenceFrame"; + const DataType MOBILITY_METHOD_MOVEGOAL2D_DTYPE_FRAME_NAME = RAPID_STRING; + const String32 MOBILITY_METHOD_MOVEGOAL2D_PARAM_END_LOCATION = "xyt"; + const DataType MOBILITY_METHOD_MOVEGOAL2D_DTYPE_END_LOCATION = RAPID_VEC3d; + const String32 MOBILITY_METHOD_MOVEGOAL2D_PARAM_END_LOCATION_TOLERANCE = "xytTolerance"; + const DataType MOBILITY_METHOD_MOVEGOAL2D_DTYPE_END_LOCATION_TOLERANCE = RAPID_VEC3d; + const String32 MOBILITY_METHOD_MOVEGOAL2D_PARAM_GOAL_ID = "goalId"; + const DataType MOBILITY_METHOD_MOVEGOAL2D_DTYPE_GOAL_ID = RAPID_STRING; + //@copy-declaration /** Navigation Algorithm for MobilityCommand. */ const String32 NAV_ALGO_SAFE = "RAPID_NAV_SAFE"; const String32 NAV_ALGO_BLIND = "RAPID_NAV_BLIND"; @@ -379,3 +386,5 @@ module rapid { const String32 RAFT_METHOD_SETBANDWIDTH = "setBandwidth"; }; + +#endif // rapid_CommandConstants_idl diff --git a/knRapid/src/rapidDds/FileAnnounce.idl b/knRapid/src/rapidDds/FileAnnounce.idl index 6a189d4..b595697 100644 --- a/knRapid/src/rapidDds/FileAnnounce.idl +++ b/knRapid/src/rapidDds/FileAnnounce.idl @@ -1,3 +1,6 @@ +#ifndef rapid_FileAnnounce_idl +#define rapid_FileAnnounce_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -47,3 +50,5 @@ module rapid { public KeyTypeValueSequence16 metaData; }; }; + +#endif // rapid_FileAnnounce_idl diff --git a/knRapid/src/rapidDds/FileQueueConfig.idl b/knRapid/src/rapidDds/FileQueueConfig.idl index 1014d69..41a4c71 100644 --- a/knRapid/src/rapidDds/FileQueueConfig.idl +++ b/knRapid/src/rapidDds/FileQueueConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_FileQueueConfig_idl +#define rapid_FileQueueConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -52,3 +55,5 @@ module rapid { }; }; + +#endif // rapid_FileQueueConfig_idl diff --git a/knRapid/src/rapidDds/FileQueueEntryState.idl b/knRapid/src/rapidDds/FileQueueEntryState.idl index 5e83f7e..c434588 100644 --- a/knRapid/src/rapidDds/FileQueueEntryState.idl +++ b/knRapid/src/rapidDds/FileQueueEntryState.idl @@ -1,3 +1,6 @@ +#ifndef rapid_FileQueueEntryState_idl +#define rapid_FileQueueEntryState_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -72,3 +75,5 @@ module rapid { public short channelId; }; }; + +#endif // rapid_FileQueueEntryState_idl diff --git a/knRapid/src/rapidDds/FileQueueReceiverSample.idl b/knRapid/src/rapidDds/FileQueueReceiverSample.idl index f2d406b..af92322 100644 --- a/knRapid/src/rapidDds/FileQueueReceiverSample.idl +++ b/knRapid/src/rapidDds/FileQueueReceiverSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_FileQueueReceiverSample_idl +#define rapid_FileQueueReceiverSample_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -53,3 +56,5 @@ module rapid { public long completedFiles; }; }; + +#endif // rapid_FileQueueReceiverSample_idl diff --git a/knRapid/src/rapidDds/FileQueueSample.idl b/knRapid/src/rapidDds/FileQueueSample.idl index 624cbc5..4718c23 100644 --- a/knRapid/src/rapidDds/FileQueueSample.idl +++ b/knRapid/src/rapidDds/FileQueueSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_FileQueueSample_idl +#define rapid_FileQueueSample_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -51,3 +54,5 @@ module rapid { }; }; + +#endif // rapid_FileQueueSample_idl diff --git a/knRapid/src/rapidDds/FileQueueState.idl b/knRapid/src/rapidDds/FileQueueState.idl index 60a5bd8..a888634 100644 --- a/knRapid/src/rapidDds/FileQueueState.idl +++ b/knRapid/src/rapidDds/FileQueueState.idl @@ -1,3 +1,6 @@ +#ifndef rapid_FileQueueState_idl +#define rapid_FileQueueState_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -77,3 +80,5 @@ module rapid { public ChannelStateSequence channels; }; }; + +#endif // rapid_FileQueueState_idl diff --git a/knRapid/src/rapidDds/FrameStoreConfig.idl b/knRapid/src/rapidDds/FrameStoreConfig.idl index 2951271..f5e40b3 100644 --- a/knRapid/src/rapidDds/FrameStoreConfig.idl +++ b/knRapid/src/rapidDds/FrameStoreConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_FrameStoreConfig_idl +#define rapid_FrameStoreConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -67,3 +70,5 @@ module rapid { }; }; + +#endif // rapid_FrameStoreConfig_idl diff --git a/knRapid/src/rapidDds/Header.idl b/knRapid/src/rapidDds/Header.idl index d24f920..79c2a73 100644 --- a/knRapid/src/rapidDds/Header.idl +++ b/knRapid/src/rapidDds/Header.idl @@ -1,3 +1,6 @@ +#ifndef rapid_Header_idl +#define rapid_Header_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -46,3 +49,5 @@ module rapid { long serial; }; }; + +#endif // rapid_Header_idl diff --git a/knRapid/src/rapidDds/ImageMetadata.idl b/knRapid/src/rapidDds/ImageMetadata.idl index 9647c30..f408c28 100644 --- a/knRapid/src/rapidDds/ImageMetadata.idl +++ b/knRapid/src/rapidDds/ImageMetadata.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ImageMetadata_idl +#define rapid_ImageMetadata_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -17,6 +20,13 @@ module rapid { const String32 IMG_V_FOV_KEY = "IMG_V_FOV"; const String32 IMG_H_FOV_KEY = "IMG_H_FOV"; + const String32 IMG_CROP_X_KEY = "CROP_X"; + const String32 IMG_CROP_Y_KEY = "CROP_Y"; + const String32 IMG_CROP_W_KEY = "CROP_WIDTH"; + const String32 IMG_CROP_H_KEY = "CROP_HEIGHT"; + const String32 IMG_JPEG_Q_KEY = "JPEG_QUALITY"; + const String32 IMG_MIN_SEP_KEY = "MIN_SEPARATION"; + const String32 IMG_ROT_ANG_KEY = "ROT_ANGLE"; //@copy-declaration /** //@copy-declaration * Holds status information for an image sensor - typically a camera, but could be a laser scanner, gpr, or @@ -53,3 +63,5 @@ module rapid { }; }; + +#endif // rapid_ImageMetadata_idl diff --git a/knRapid/src/rapidDds/ImageSensorSample.idl b/knRapid/src/rapidDds/ImageSensorSample.idl index fa77911..7dfb735 100644 --- a/knRapid/src/rapidDds/ImageSensorSample.idl +++ b/knRapid/src/rapidDds/ImageSensorSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ImageSensorSample_idl +#define rapid_ImageSensorSample_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -48,3 +51,5 @@ module rapid { public ImageData data; }; }; + +#endif // rapid_ImageSensorSample_idl diff --git a/knRapid/src/rapidDds/ImageSensorState.idl b/knRapid/src/rapidDds/ImageSensorState.idl index c4b6c7f..983db38 100644 --- a/knRapid/src/rapidDds/ImageSensorState.idl +++ b/knRapid/src/rapidDds/ImageSensorState.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ImageSensorState_idl +#define rapid_ImageSensorState_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -29,3 +32,5 @@ module rapid { }; }; + +#endif // rapid_ImageSensorState_idl diff --git a/knRapid/src/rapidDds/JointConfig.idl b/knRapid/src/rapidDds/JointConfig.idl index 9e628c7..56ed94d 100644 --- a/knRapid/src/rapidDds/JointConfig.idl +++ b/knRapid/src/rapidDds/JointConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_JointConfig_idl +#define rapid_JointConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -65,3 +68,5 @@ module rapid { }; }; + +#endif // rapid_JointConfig_idl diff --git a/knRapid/src/rapidDds/JointSample.idl b/knRapid/src/rapidDds/JointSample.idl index 3d5918a..d68f4d1 100644 --- a/knRapid/src/rapidDds/JointSample.idl +++ b/knRapid/src/rapidDds/JointSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_JointSample_idl +#define rapid_JointSample_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -84,3 +87,5 @@ module rapid { }; }; + +#endif // rapid_JointSample_idl diff --git a/knRapid/src/rapidDds/K10Defs.idl b/knRapid/src/rapidDds/K10Defs.idl index 26ffd1f..c480866 100644 --- a/knRapid/src/rapidDds/K10Defs.idl +++ b/knRapid/src/rapidDds/K10Defs.idl @@ -1,3 +1,6 @@ +#ifndef rapid_K10Defs_idl +#define rapid_K10Defs_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -39,3 +42,5 @@ module rapid { }; }; }; + +#endif // rapid_K10Defs_idl diff --git a/knRapid/src/rapidDds/MIMETypesConstants.idl b/knRapid/src/rapidDds/MIMETypesConstants.idl index 6ad5be7..f7e9d56 100644 --- a/knRapid/src/rapidDds/MIMETypesConstants.idl +++ b/knRapid/src/rapidDds/MIMETypesConstants.idl @@ -1,3 +1,6 @@ +#ifndef rapid_MIMETypesConstants_idl +#define rapid_MIMETypesConstants_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -39,3 +42,5 @@ module rapid { const String32 MIME_IMAGE_EXR = "image/x-exr"; // OpenEXR }; + +#endif // rapid_MIMETypesConstants_idl diff --git a/knRapid/src/rapidDds/MacroConfig.idl b/knRapid/src/rapidDds/MacroConfig.idl index 19ee27b..5b17f9d 100644 --- a/knRapid/src/rapidDds/MacroConfig.idl +++ b/knRapid/src/rapidDds/MacroConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_MacroConfig_idl +#define rapid_MacroConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -68,3 +71,5 @@ module rapid { }; }; + +#endif // rapid_MacroConfig_idl diff --git a/knRapid/src/rapidDds/MacroState.idl b/knRapid/src/rapidDds/MacroState.idl index bbfa611..c88cbf4 100644 --- a/knRapid/src/rapidDds/MacroState.idl +++ b/knRapid/src/rapidDds/MacroState.idl @@ -1,3 +1,6 @@ +#ifndef rapid_MacroState_idl +#define rapid_MacroState_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -49,3 +52,5 @@ module rapid { }; }; + +#endif // rapid_MacroState_idl diff --git a/knRapid/src/rapidDds/Message.idl b/knRapid/src/rapidDds/Message.idl index 016f944..b8aefc5 100644 --- a/knRapid/src/rapidDds/Message.idl +++ b/knRapid/src/rapidDds/Message.idl @@ -1,3 +1,6 @@ +#ifndef rapid_Message_idl +#define rapid_Message_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -22,3 +25,5 @@ module rapid { public Header hdr; //@key }; }; + +#endif // rapid_Message_idl diff --git a/knRapid/src/rapidDds/PointCloudConfig.idl b/knRapid/src/rapidDds/PointCloudConfig.idl index 462a15d..6606596 100644 --- a/knRapid/src/rapidDds/PointCloudConfig.idl +++ b/knRapid/src/rapidDds/PointCloudConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_PointCloudConfig_idl +#define rapid_PointCloudConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -38,6 +41,10 @@ module rapid { //@copy-declaration *
  • PS_ECHO: echo # for multiple returns. unsigned byte (0-255) //@copy-declaration *
  • PS_LAYER4_ECHO4: first 4 bits are layer (0-15), second 4 bits are echo (0-15) //@copy-declaration *
  • PS_PULSE: pulse index. unsigned byte (0-255) + //@copy-declaration *
  • PS_RGB332: RGB packed into single byte + //@copy-declaration *
  • PS_RGB565: Assumes both attribute bytes are used for 16 bit color. + //@copy-declaration * 1st byte: upper 3 bits are first 3 bits of green, lower 5 bits are red + //@copy-declaration * 2nd byte: upper 3 bits are second 3 bits of green, lower 5 bits are blue //@copy-declaration * //@copy-declaration */ enum PointSampleAttributeMode { @@ -46,7 +53,9 @@ module rapid { PS_LAYER, PS_ECHO, PS_LAYER4_ECHO4, - PS_PULSE + PS_PULSE, + PS_RGB332, + PS_RGB565 }; //@copy-c-declaration class PointCloudConfigTypeSupport; @@ -79,3 +88,5 @@ module rapid { }; }; + +#endif // rapid_PointCloudConfig_idl diff --git a/knRapid/src/rapidDds/PointCloudSample.idl b/knRapid/src/rapidDds/PointCloudSample.idl index 6c3690c..38d047e 100644 --- a/knRapid/src/rapidDds/PointCloudSample.idl +++ b/knRapid/src/rapidDds/PointCloudSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_PointCloudSample_idl +#define rapid_PointCloudSample_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -87,3 +90,5 @@ module rapid { }; }; + +#endif // rapid_PointCloudSample_idl diff --git a/knRapid/src/rapidDds/PositionConfig.idl b/knRapid/src/rapidDds/PositionConfig.idl index 274797e..e62a0f2 100644 --- a/knRapid/src/rapidDds/PositionConfig.idl +++ b/knRapid/src/rapidDds/PositionConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_PositionConfig_idl +#define rapid_PositionConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -53,3 +56,5 @@ module rapid { }; }; + +#endif // rapid_PositionConfig_idl diff --git a/knRapid/src/rapidDds/PositionSample.idl b/knRapid/src/rapidDds/PositionSample.idl index 780dd28..796f524 100644 --- a/knRapid/src/rapidDds/PositionSample.idl +++ b/knRapid/src/rapidDds/PositionSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_PositionSample_idl +#define rapid_PositionSample_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -44,3 +47,5 @@ module rapid { public ValueSequence64 values; }; }; + +#endif // rapid_PositionSample_idl diff --git a/knRapid/src/rapidDds/QueueState.idl b/knRapid/src/rapidDds/QueueState.idl index de9b424..0408b5c 100644 --- a/knRapid/src/rapidDds/QueueState.idl +++ b/knRapid/src/rapidDds/QueueState.idl @@ -1,3 +1,6 @@ +#ifndef rapid_QueueState_idl +#define rapid_QueueState_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -102,3 +105,5 @@ module rapid{ public SingleQueue sent; }; }; + +#endif // rapid_QueueState_idl diff --git a/knRapid/src/rapidDds/RapidConstants.idl b/knRapid/src/rapidDds/RapidConstants.idl index 54cd741..09ef26b 100644 --- a/knRapid/src/rapidDds/RapidConstants.idl +++ b/knRapid/src/rapidDds/RapidConstants.idl @@ -1,3 +1,6 @@ +#ifndef rapid_RapidConstants_idl +#define rapid_RapidConstants_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -50,3 +53,5 @@ module rapid { const String64 ACCESSCONTROL_STATE_TOPIC = "rapid_accesscontrol_state"; }; + +#endif // rapid_RapidConstants_idl diff --git a/knRapid/src/rapidDds/TextMessage.idl b/knRapid/src/rapidDds/TextMessage.idl index b3d98f6..4147547 100644 --- a/knRapid/src/rapidDds/TextMessage.idl +++ b/knRapid/src/rapidDds/TextMessage.idl @@ -1,3 +1,6 @@ +#ifndef rapid_TextMessage_idl +#define rapid_TextMessage_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -59,3 +62,5 @@ module rapid { public String2K message; }; }; + +#endif // rapid_TextMessage_idl diff --git a/knRapid/src/rapidExtArcDds/BatteryPackConfig.idl b/knRapid/src/rapidExtArcDds/BatteryPackConfig.idl index 7d4f688..45e12b3 100644 --- a/knRapid/src/rapidExtArcDds/BatteryPackConfig.idl +++ b/knRapid/src/rapidExtArcDds/BatteryPackConfig.idl @@ -31,4 +31,5 @@ module rapid }; }; }; -#endif + +#endif // rapid_ext_arc_BatteryPackConfig_idl diff --git a/knRapid/src/rapidExtArcDds/BatteryPackSample.idl b/knRapid/src/rapidExtArcDds/BatteryPackSample.idl index 55c5761..86845da 100644 --- a/knRapid/src/rapidExtArcDds/BatteryPackSample.idl +++ b/knRapid/src/rapidExtArcDds/BatteryPackSample.idl @@ -1,5 +1,5 @@ -#ifndef rapid_BatteryPackSample_idl -#define rapid_BatteryPackSample_idl +#ifndef rapid_ext_arc_BatteryPackSample_idl +#define rapid_ext_arc_BatteryPackSample_idl #include "BaseTypes.idl" #include "Message.idl" @@ -124,4 +124,5 @@ module rapid }; }; }; -#endif + +#endif // rapid_ext_arc_BatteryPackSample_idl diff --git a/knRapid/src/rapidExtArcDds/DlpConfig.idl b/knRapid/src/rapidExtArcDds/DlpConfig.idl index 92d2587..5cf61f5 100644 --- a/knRapid/src/rapidExtArcDds/DlpConfig.idl +++ b/knRapid/src/rapidExtArcDds/DlpConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_DlpConfig_idl +#define rapid_ext_arc_DlpConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -65,3 +68,5 @@ module rapid }; }; }; + +#endif // rapid_ext_arc_DlpConfig_idl diff --git a/knRapid/src/rapidExtArcDds/DlpSample.idl b/knRapid/src/rapidExtArcDds/DlpSample.idl index 85c1a13..9a5ee3e 100644 --- a/knRapid/src/rapidExtArcDds/DlpSample.idl +++ b/knRapid/src/rapidExtArcDds/DlpSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_DlpSample_idl +#define rapid_ext_arc_DlpSample_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -59,3 +62,5 @@ module rapid }; }; }; + +#endif // rapid_ext_arc_DlpSample_idl diff --git a/knRapid/src/rapidExtArcDds/EphemerisConfig.idl b/knRapid/src/rapidExtArcDds/EphemerisConfig.idl index 0009c50..e5181c0 100644 --- a/knRapid/src/rapidExtArcDds/EphemerisConfig.idl +++ b/knRapid/src/rapidExtArcDds/EphemerisConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_EphemerisConfig_idl +#define rapid_ext_arc_EphemerisConfig_idl + // -*- idl -*- /* * Copyright (c) 2009 United States Government as represented by the @@ -48,3 +51,5 @@ module rapid }; }; }; + +#endif // rapid_ext_arc_EphemerisConfig_idl diff --git a/knRapid/src/rapidExtArcDds/EphemerisSample.idl b/knRapid/src/rapidExtArcDds/EphemerisSample.idl index 892fb2e..a7c5076 100644 --- a/knRapid/src/rapidExtArcDds/EphemerisSample.idl +++ b/knRapid/src/rapidExtArcDds/EphemerisSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_EphemerisSample_idl +#define rapid_ext_arc_EphemerisSample_idl + // -*- idl -*- /* * Copyright (c) 2009 United States Government as represented by the @@ -40,3 +43,5 @@ module rapid }; }; }; + +#endif // rapid_ext_arc_EphemerisSample_idl diff --git a/knRapid/src/rapidExtArcDds/ExtArcCommandConstants.idl b/knRapid/src/rapidExtArcDds/ExtArcCommandConstants.idl index 657209f..46c7607 100644 --- a/knRapid/src/rapidExtArcDds/ExtArcCommandConstants.idl +++ b/knRapid/src/rapidExtArcDds/ExtArcCommandConstants.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_ExtArcCommandConstants_idl +#define rapid_ext_arc_ExtArcCommandConstants_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -108,6 +111,36 @@ module rapid { const String32 IMGSTREAM_METHOD_setResolution_PARAM_divisor = "divisor"; // 1 == full res, 2 = half res, etc. const DataType IMGSTREAM_METHOD_setResolution_DTYPE_divisor = RAPID_INT; + const String32 IMGSTREAM_METHOD_setResizeWidth = "setResizeWidth"; + const String32 IMGSTREAM_METHOD_setResizeWidth_PARAM_width = "width"; + const DataType IMGSTREAM_METHOD_setResizeWidth_DTYPE_width = RAPID_INT; + + const String32 IMGSTREAM_METHOD_setResizeHeight = "setResizeHeight"; + const String32 IMGSTREAM_METHOD_setResizeHeight_PARAM_height = "height"; + const DataType IMGSTREAM_METHOD_setResizeHeight_DTYPE_height = RAPID_INT; + + const String32 IMGSTREAM_METHOD_setResize = "setResize"; + const String32 IMGSTREAM_METHOD_setResize_PARAM_width = "width"; + const DataType IMGSTREAM_METHOD_setResize_DTYPE_width = RAPID_INT; + const String32 IMGSTREAM_METHOD_setResize_PARAM_height = "height"; + const DataType IMGSTREAM_METHOD_setResize_DTYPE_height = RAPID_INT; + + // Compression quality + const String32 IMGSTREAM_METHOD_setResizeQuality = "setResizeQuality"; + const String32 IMGSTREAM_METHOD_setResizeQuality_PARAM_quality = "quality"; // resize quality, 0~4 (0 always nearest neighbor) + const DataType IMGSTREAM_METHOD_setResizeQuality_DTYPE_quality = RAPID_INT; + + const String32 IMGSTREAM_METHOD_setCrop = "setCrop"; + const String32 IMGSTREAM_METHOD_setCrop_PARAM_cropX = "cropX"; + const DataType IMGSTREAM_METHOD_setCrop_DTYPE_cropX = RAPID_INT; + const String32 IMGSTREAM_METHOD_setCrop_PARAM_cropY = "cropY"; + const DataType IMGSTREAM_METHOD_setCrop_DTYPE_cropY = RAPID_INT; + const String32 IMGSTREAM_METHOD_setCrop_PARAM_width = "width"; + const DataType IMGSTREAM_METHOD_setCrop_DTYPE_width = RAPID_INT; + const String32 IMGSTREAM_METHOD_setCrop_PARAM_height = "height"; + const DataType IMGSTREAM_METHOD_setCrop_DTYPE_height = RAPID_INT; + + // Compression quality const String32 IMGSTREAM_METHOD_setQuality = "setQuality"; const String32 IMGSTREAM_METHOD_setQuality_PARAM_quality = "quality"; // jpeg quality, range 0-100 const DataType IMGSTREAM_METHOD_setQuality_DTYPE_quality = RAPID_INT; @@ -116,12 +149,32 @@ module rapid { const String32 IMGSTREAM_METHOD_setSaveImages_PARAM_saveImages = "saveImages"; const DataType IMGSTREAM_METHOD_setSaveImages_DTYPE_saveImages = RAPID_BOOL; + const String32 IMGSTREAM_METHOD_setRotationAngle = "setRotationAngle"; + const String32 IMGSTREAM_METHOD_setRotationAngle_PARAM_rotationAngle = "rotationAngle"; + const DataType IMGSTREAM_METHOD_setRotationAngle_DTYPE_rotationAngle = RAPID_INT; + const String32 IMGSTREAM_METHOD_reconnect = "reconnect"; + const String32 ADVNAV = "AdvNav"; const String32 ADVNAV_METHOD_startGlobalAlign = "startGlobalAlign"; + + const String32 ROSBRIDGE = "RosBridge"; + const String32 ROSBRIDGE_METHOD_setMinSeparation = "setMinSeparation"; + const String32 ROSBRIDGE_METHOD_setMinSeparation_PARAM_msec = "msec"; // min separation between images in milliseconds + const DataType ROSBRIDGE_METHOD_setMinSeparation_DTYPE_msec = RAPID_INT; + + const String32 GIMBAL = "Gimbal"; + const String32 GIMBAL_METHOD_setPanTilt = "setPanTilt"; + const String32 GIMBAL_METHOD_setPanTilt_PARAM_pan = "pan"; + const DataType GIMBAL_METHOD_setPanTilt_DTYPE_pan = RAPID_FLOAT; + const String32 GIMBAL_METHOD_setPanTilt_PARAM_tilt = "tilt"; + const DataType GIMBAL_METHOD_setPanTilt_DTYPE_tilt = RAPID_FLOAT; + }; }; }; + +#endif // rapid_ext_arc_ExtArcCommandConstants_idl diff --git a/knRapid/src/rapidExtArcDds/ExtArcConstants.idl b/knRapid/src/rapidExtArcDds/ExtArcConstants.idl index 7260555..31d7b08 100644 --- a/knRapid/src/rapidExtArcDds/ExtArcConstants.idl +++ b/knRapid/src/rapidExtArcDds/ExtArcConstants.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_ExtArcConstants_idl +#define rapid_ext_arc_ExtArcConstants_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -41,9 +44,11 @@ module rapid { const String64 SPECTRUM_SAMPLE_TOPIC = "rapid_spectrum_sample"; const String64 STATEMACHINE_CONFIG_TOPIC = "rapid_statemachine_config"; const String64 STATEMACHINE_STATE_TOPIC = "rapid_statemachine_state"; - const String64 TRACKEDOBJECT_CONFIG_TOPIC = "rapid_trackedobject_config"; - const String64 TRACKEDOBJECT_SAMPLE_TOPIC = "rapid_trackedobject_sample"; const String64 WHEELGROUP_SAMPLE_TOPIC = "rapid_wheelgroup_sample"; + + const String64 ROSMARKERARRAY_SAMPLE_TOPIC = "rapid_rosmarkerarray_sample"; }; }; }; + +#endif // rapid_ext_arc_ExtArcConstants_idl diff --git a/knRapid/src/rapidExtArcDds/Float32Config.idl b/knRapid/src/rapidExtArcDds/Float32Config.idl index 83e9d68..bd3d53d 100644 --- a/knRapid/src/rapidExtArcDds/Float32Config.idl +++ b/knRapid/src/rapidExtArcDds/Float32Config.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_Float32Config_idl +#define rapid_ext_arc_Float32Config_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -42,3 +45,5 @@ module rapid { }; }; }; + +#endif // rapid_ext_arc_Float32Config_idl diff --git a/knRapid/src/rapidExtArcDds/Float32Sample.idl b/knRapid/src/rapidExtArcDds/Float32Sample.idl index 11d515f..abfdcfa 100644 --- a/knRapid/src/rapidExtArcDds/Float32Sample.idl +++ b/knRapid/src/rapidExtArcDds/Float32Sample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_Float32Sample_idl +#define rapid_ext_arc_Float32Sample_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -43,3 +46,5 @@ module rapid { }; }; }; + +#endif // rapid_ext_arc_Float32Sample_idl diff --git a/knRapid/src/rapidExtArcDds/GenericConfig.idl b/knRapid/src/rapidExtArcDds/GenericConfig.idl index 17ee9f8..f09f981 100644 --- a/knRapid/src/rapidExtArcDds/GenericConfig.idl +++ b/knRapid/src/rapidExtArcDds/GenericConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_GenericConfig_idl +#define rapid_ext_arc_GenericConfig_idl + //idl #include "Message.idl" @@ -30,3 +33,5 @@ module rapid }; }; }; + +#endif // rapid_ext_arc_GenericConfig_idl diff --git a/knRapid/src/rapidExtArcDds/GeometryAppearanceState.idl b/knRapid/src/rapidExtArcDds/GeometryAppearanceState.idl index d412d78..d1a836a 100644 --- a/knRapid/src/rapidExtArcDds/GeometryAppearanceState.idl +++ b/knRapid/src/rapidExtArcDds/GeometryAppearanceState.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_GeometryAppearanceState_idl +#define rapid_ext_arc_GeometryAppearanceState_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -50,3 +53,5 @@ module rapid }; }; }; + +#endif // rapid_ext_arc_GeometryAppearanceState_idl diff --git a/knRapid/src/rapidExtArcDds/GeometryConfig.idl b/knRapid/src/rapidExtArcDds/GeometryConfig.idl index 9cc6da9..f1b09bd 100644 --- a/knRapid/src/rapidExtArcDds/GeometryConfig.idl +++ b/knRapid/src/rapidExtArcDds/GeometryConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_GeometryConfig_idl +#define rapid_ext_arc_GeometryConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -46,3 +49,5 @@ module rapid }; }; }; + +#endif // rapid_ext_arc_GeometryConfig_idl diff --git a/knRapid/src/rapidExtArcDds/GeometryMeshSample.idl b/knRapid/src/rapidExtArcDds/GeometryMeshSample.idl index 80ce4e5..675fbf8 100644 --- a/knRapid/src/rapidExtArcDds/GeometryMeshSample.idl +++ b/knRapid/src/rapidExtArcDds/GeometryMeshSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_GeometryMeshSample_idl +#define rapid_ext_arc_GeometryMeshSample_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -81,3 +84,5 @@ module rapid }; }; }; + +#endif // rapid_ext_arc_GeometryMeshSample_idl diff --git a/knRapid/src/rapidExtArcDds/HydraConfig.idl b/knRapid/src/rapidExtArcDds/HydraConfig.idl index a9fcc82..2684eb8 100644 --- a/knRapid/src/rapidExtArcDds/HydraConfig.idl +++ b/knRapid/src/rapidExtArcDds/HydraConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_HydraConfig_idl +#define rapid_ext_arc_HydraConfig_idl + #include "Message.idl" module rapid @@ -29,3 +32,5 @@ module rapid }; }; }; + +#endif // rapid_ext_arc_HydraConfig_idl diff --git a/knRapid/src/rapidExtArcDds/HydraSample.idl b/knRapid/src/rapidExtArcDds/HydraSample.idl index d9eeb2c..5787ce7 100644 --- a/knRapid/src/rapidExtArcDds/HydraSample.idl +++ b/knRapid/src/rapidExtArcDds/HydraSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_HydraSample_idl +#define rapid_ext_arc_HydraSample_idl + // idl #include "Message.idl" @@ -66,3 +69,5 @@ module rapid }; }; }; + +#endif // rapid_ext_arc_HydraSample_idl diff --git a/knRapid/src/rapidExtArcDds/MobilitySample.idl b/knRapid/src/rapidExtArcDds/MobilitySample.idl index c6df1b7..c041aca 100644 --- a/knRapid/src/rapidExtArcDds/MobilitySample.idl +++ b/knRapid/src/rapidExtArcDds/MobilitySample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_MobilitySample_idl +#define rapid_ext_arc_MobilitySample_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -43,6 +46,8 @@ module rapid { public Vec3d xytTolerance; public float hintedSpeed; public String32 navAlgo; + //@copy-declaration /** extension values */ + public KeyTypeValueSequence8 keyedValues; }; // status definitions @@ -58,3 +63,5 @@ module rapid { }; }; }; + +#endif // rapid_ext_arc_MobilitySample_idl diff --git a/knRapid/src/rapidExtArcDds/RosMarkerArraySample.idl b/knRapid/src/rapidExtArcDds/RosMarkerArraySample.idl new file mode 100755 index 0000000..c46e8e5 --- /dev/null +++ b/knRapid/src/rapidExtArcDds/RosMarkerArraySample.idl @@ -0,0 +1,116 @@ +#ifndef rapid_ext_arc_RosMarkerArraySample_idl +#define rapid_ext_arc_RosMarkerArraySample_idl + +/* + * Copyright (c) 2015 United States Government as represented by the + * Administrator of the National Aeronautics and Space Administration. + * All Rights Reserved. + */ + +#include "Message.idl" + +module rapid { + module ext { + module arc { + + enum ShapeType { + ARROW = 0, + CUBE = 1, + SPHERE = 2, + CYLINDER = 3, + LINE_STRIP = 4, + LINE_LIST = 5, + CUBE_LIST = 6, + SPHERE_LIST = 7, + POINTS = 8, + TEXT_VIEW_FACING = 9, + MESH_RESOURCE = 10, + TRIANGLE_LIST = 11 + }; + enum Action { + ADD = 0, + //MODIFY = 0, // (sic) + DELETE = 2, + DELETEALL = 3 + }; + + typedef sequence PointSequence1K; + typedef sequence ColorSequence1K; + + //@copy-declaration /** Direct copy of ROS type */ + struct Marker { + //@copy /** tf frame name because RAPID header does not specify frame name */ + String32 frame_id; + + //@copy /** Namespace to place this object in... used in conjunction with id to create a unique name for the object */ + String32 ns; + + //@copy /** object ID useful in conjunction with the namespace for manipulating and deleting the object later */ + long id; + + //@copy /** Type of object */ + ShapeType type; + + //@copy /** 0 add/modify an object, 1 (deprecated), 2 deletes an object, 3 deletes all objects */ + Action action; + + //@copy /** Pose of the object */ + Transform3D pose; + + //@copy /** Scale of the object 1,1,1 means default (usually 1 meter square) */ + Vec3f scale; + + //@copy /** RGBA color [0.0-1.0] */ + Color4f color; + + //@copy /** NS How long (in nanoseconds) the object should last before being automatically deleted. 0 means forever */ + long long lifetime; + + //@copy /** If this marker should be frame-locked, i.e. retransformed into its frame every timestep */ + boolean frame_locked; + + //@copy /** Only used if the type specified has some use for them (eg. POINTS, LINE_STRIP, ...) */ + PointSequence1K points; + + //@copy + /** Only used if the type specified has some use for them (eg. POINTS, LINE_STRIP, ...) + number of colors must either be 0 or equal to the number of points + NOTE: alpha is not yet used */ + ColorSequence1K colors; + + //@copy /** NOTE: only used for text markers */ + String32 text; + + //@copy /** NOTE: only used for MESH_RESOURCE markers */ + String32 mesh_resource; + boolean mesh_use_embedded_materials; + }; + + typedef sequence MarkerArraySequence; + + //@copy-c-declaration class RosMarkerArraySampleTypeSupport; + //@copy-c-declaration class RosMarkerArraySampleDataWriter; + //@copy-c-declaration class RosMarkerArraySampleDataReader; + //@copy-c-declaration struct RosMarkerArraySampleSeq; + + //@copy-declaration /** + //@copy-declaration * MarkerArraySample + //@copy-declaration */ + valuetype RosMarkerArraySample : Message { + + //@copy-c-declaration #if RTI_DDS_VERSION_MAJOR < 4 || (RTI_DDS_VERSION_MAJOR == 4 && RTI_DDS_VERSION_MINOR < 5) || (RTI_DDS_VERSION_MAJOR == 4 && RTI_DDS_VERSION_MINOR == 5 && RTI_DDS_VERSION_RELEASE != 'f' ) + //@copy-c-declaration typedef RosMarkerArraySampleTypeSupport TypeSupport; + //@copy-c-declaration typedef RosMarkerArraySampleDataWriter DataWriter; + //@copy-c-declaration typedef RosMarkerArraySampleDataReader DataReader; + //@copy-c-declaration typedef RosMarkerArraySampleSeq Seq; + //@copy-c-declaration #endif + //@copy-c-declaration typedef RosMarkerArraySample Type; + + public MarkerArraySequence marker_array; + }; + }; + }; +}; + + +#endif // rapid_ext_arc_RosMarkerArraySample_idl diff --git a/knRapid/src/rapidExtArcDds/SpectrumConfig.idl b/knRapid/src/rapidExtArcDds/SpectrumConfig.idl index a7996b3..a6837c8 100644 --- a/knRapid/src/rapidExtArcDds/SpectrumConfig.idl +++ b/knRapid/src/rapidExtArcDds/SpectrumConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_SpectrumConfig_idl +#define rapid_ext_arc_SpectrumConfig_idl + #include "Message.idl" module rapid @@ -42,3 +45,5 @@ module rapid }; }; + +#endif // rapid_ext_arc_SpectrumConfig_idl diff --git a/knRapid/src/rapidExtArcDds/SpectrumSample.idl b/knRapid/src/rapidExtArcDds/SpectrumSample.idl index 3bfbd0d..1527cee 100644 --- a/knRapid/src/rapidExtArcDds/SpectrumSample.idl +++ b/knRapid/src/rapidExtArcDds/SpectrumSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_SpectrumSample_idl +#define rapid_ext_arc_SpectrumSample_idl + #include "Message.idl" module rapid @@ -33,3 +36,5 @@ module rapid }; + +#endif // rapid_ext_arc_SpectrumSample_idl diff --git a/knRapid/src/rapidExtArcDds/StateMachineConfig.idl b/knRapid/src/rapidExtArcDds/StateMachineConfig.idl index 52bc211..aa9bbf9 100644 --- a/knRapid/src/rapidExtArcDds/StateMachineConfig.idl +++ b/knRapid/src/rapidExtArcDds/StateMachineConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_StateMachineConfig_idl +#define rapid_ext_arc_StateMachineConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -57,3 +60,5 @@ module rapid { }; }; }; + +#endif // rapid_ext_arc_StateMachineConfig_idl diff --git a/knRapid/src/rapidExtArcDds/StateMachineState.idl b/knRapid/src/rapidExtArcDds/StateMachineState.idl index 4485c54..7bfc354 100644 --- a/knRapid/src/rapidExtArcDds/StateMachineState.idl +++ b/knRapid/src/rapidExtArcDds/StateMachineState.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_StateMachineState_idl +#define rapid_ext_arc_StateMachineState_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -51,3 +54,5 @@ module rapid { }; }; }; + +#endif // rapid_ext_arc_StateMachineState_idl diff --git a/knRapid/src/rapidExtArcDds/TrackedObjectConfig.idl b/knRapid/src/rapidExtArcDds/TrackedObjectConfig.idl deleted file mode 100644 index c862b76..0000000 --- a/knRapid/src/rapidExtArcDds/TrackedObjectConfig.idl +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2015 United States Government as represented by the - * Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - */ - -#include "Message.idl" - -/** - * \file - * - * \brief TrackedObjectConfig - * - * \ingroup idlfiles - */ -module rapid { - module ext { - module arc { - - //@copy-c-declaration class TrackedObjectConfigTypeSupport; - //@copy-c-declaration class TrackedObjectConfigDataWriter; - //@copy-c-declaration class TrackedObjectConfigDataReader; - //@copy-c-declaration struct TrackedObjectConfigSeq; - - //@copy-declaration /** TrackedObjectConfig */ - valuetype TrackedObjectConfig : Message { - - //@copy-c-declaration #if RTI_DDS_VERSION_MAJOR < 4 || (RTI_DDS_VERSION_MAJOR == 4 && RTI_DDS_VERSION_MINOR < 5) || (RTI_DDS_VERSION_MAJOR == 4 && RTI_DDS_VERSION_MINOR == 5 && RTI_DDS_VERSION_RELEASE != 'f' ) - //@copy-c-declaration typedef TrackedObjectConfigTypeSupport TypeSupport; - //@copy-c-declaration typedef TrackedObjectConfigDataWriter DataWriter; - //@copy-c-declaration typedef TrackedObjectConfigDataReader DataReader; - //@copy-c-declaration typedef TrackedObjectConfigSeq Seq; - //@copy-c-declaration #endif - //@copy-c-declaration typedef TrackedObjectConfig Type; - - //@copy-declaration /** Specifies the interpretation of the rotation field in TrackedObjectSample.pose - //@copy-declaration * @see RotationEncoding */ - public RotationEncoding poseEncoding; - //@copy-declaration /** Specifies the interpretation of the rotation field in TrackedObjectSample.velocity - //@copy-declaration * @see RotationEncoding */ - public RotationEncoding velocityEncoding; - - //@copy-declaration /** Labels for possible classifications */ - public String16Sequence32 classifications; - - //@copy-declaration /** Holds extra Agent-specific information about object samples. */ - public KeyTypeValueSequence64 valueKeys; - }; - - const long TRACKEDOBJECT_BOUND_BOX = 0; - const long TRACKEDOBJECT_BOUND_CYLINDER = 1; - const long TRACKEDOBJECT_BOUND_SPHERE = 2; - - }; - }; -}; diff --git a/knRapid/src/rapidExtArcDds/TrackedObjectSample.idl b/knRapid/src/rapidExtArcDds/TrackedObjectSample.idl deleted file mode 100644 index a0d9454..0000000 --- a/knRapid/src/rapidExtArcDds/TrackedObjectSample.idl +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2015 United States Government as represented by the - * Administrator of the National Aeronautics and Space Administration. - * All Rights Reserved. - */ - -#include "Message.idl" -#include "PointCloudSample.idl" - -/** - * \file - * - * \brief TrackedObjectSample - * - * \ingroup idlfiles - */ -module rapid { - module ext { - module arc { - - //@copy-c-declaration class TrackedObjectSampleTypeSupport; - //@copy-c-declaration class TrackedObjectSampleDataWriter; - //@copy-c-declaration class TrackedObjectSampleDataReader; - //@copy-c-declaration struct TrackedObjectSampleSeq; - - //@copy-declaration /** - //@copy-declaration * TrackedObjectSample - //@copy-declaration */ - valuetype TrackedObjectSample : Message { - - //@copy-c-declaration #if RTI_DDS_VERSION_MAJOR < 4 || (RTI_DDS_VERSION_MAJOR == 4 && RTI_DDS_VERSION_MINOR < 5) || (RTI_DDS_VERSION_MAJOR == 4 && RTI_DDS_VERSION_MINOR == 5 && RTI_DDS_VERSION_RELEASE != 'f' ) - //@copy-c-declaration typedef TrackedObjectSampleTypeSupport TypeSupport; - //@copy-c-declaration typedef TrackedObjectSampleDataWriter DataWriter; - //@copy-c-declaration typedef TrackedObjectSampleDataReader DataReader; - //@copy-c-declaration typedef TrackedObjectSampleSeq Seq; - //@copy-c-declaration #endif - //@copy-c-declaration typedef TrackedObjectSample Type; - - public long objectId; //@key - - //@copy /** reference frame - must be a valid FrameStore frame name*/ - public String32 refFrame; - //@copy-declaration /** 3D pose of the recognized object. TrackedObjectConfig.poseEncoding specifies how to interpret the rotation. */ - public Transform3D pose; - //@copy-declaration /** 3D velocity of the recognized object. TrackedObjectConfig.velocityEncoding specifies how to interpret the rotation. */ - public Transform3D velocity; - - public long boundShape; - //@copy-declaration /** Interpretation for params: - //@copy-declaration * TRACKEDOBJECT_BOUND_BOX: extents [0]=X [1]=Y [2]=Z - //@copy-declaration * TRACKEDOBJECT_BOUND_CYLINDER: [0]=Radius in xy [1]=height along z-axis - //@copy-declaration * TRACKEDOBJECT_BOUND_SPHERE: [0]=Radius - //@copy-declaration */ - public Vec3d boundParams; - - //@copy-declaration /** time tracking started */ - public long long trackingStart; - //@copy-declaration /** time object got current classification */ - public long long classificationStart; - public long classification; - - //@copy-declaration /** 3d points from sensed object */ - public Vec3d pointsScale; - public PointSampleSequence points; - - //@copy-declaration /** Any Agent-specific information needed. */ - public ValueSequence64 values; - - //TODO: predicted trajectory - }; - }; - }; -}; diff --git a/knRapid/src/rapidExtArcDds/Trajectory3D.idl b/knRapid/src/rapidExtArcDds/Trajectory3D.idl new file mode 100644 index 0000000..f212d74 --- /dev/null +++ b/knRapid/src/rapidExtArcDds/Trajectory3D.idl @@ -0,0 +1,31 @@ +#ifndef rapid_ext_arc_Trajectory3D_idl +#define rapid_ext_arc_Trajectory3D_idl + +#include "BaseTypes.idl" + +module rapid { + module ext { + module arc { + + //@copy-declaration /** + //@copy-declaration * pose rotation is assumed to be quaternion + //@copy-declaration */ + struct TrajPoint3D { + Transform3D pose; + //Transform3D velocity; + }; + + typedef sequence TrajPoint3DSequence; + struct Trajectory3D { + float weight; // weight of trajectory, if applicable + String32 name; // name of trajectory, if applicable + + long long t0; // first sample time in microseconds + long long tsep; // time separation of points, in microseconds + TrajPoint3DSequence points; + }; + }; + }; +}; + +#endif // rapid_ext_arc_Trajectory3D_idl diff --git a/knRapid/src/rapidExtArcDds/WheelGroupSample.idl b/knRapid/src/rapidExtArcDds/WheelGroupSample.idl index 67362f3..cceb95d 100644 --- a/knRapid/src/rapidExtArcDds/WheelGroupSample.idl +++ b/knRapid/src/rapidExtArcDds/WheelGroupSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_arc_WheelGroupSample_idl +#define rapid_ext_arc_WheelGroupSample_idl + #include "BaseTypes.idl" #include "Message.idl" @@ -116,3 +119,5 @@ module rapid }; }; }; + +#endif // rapid_ext_arc_WheelGroupSample_idl diff --git a/knRapid/src/rapidExtArcIo/CMakeLists.txt b/knRapid/src/rapidExtArcIo/CMakeLists.txt index 6b79a89..c0d1d53 100644 --- a/knRapid/src/rapidExtArcIo/CMakeLists.txt +++ b/knRapid/src/rapidExtArcIo/CMakeLists.txt @@ -28,8 +28,6 @@ set( HEADERS SpectrumProvider.h StateMachineIo.h StateMachineProvider.h - TrackedObjectIo.h - TrackedObjectProvider.h ) set( SOURCES @@ -49,20 +47,15 @@ set( SOURCES SpectrumProvider.cpp StateMachineIo.cpp StateMachineProvider.cpp - TrackedObjectIo.cpp - TrackedObjectProvider.cpp ) include_directories( ${ACE_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${KNDDS_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} - ${CMAKE_BINARY_DIR}/src/rapidDds + ${CMAKE_CURRENT_BINARY_DIR}/../rapidDds ) link_libraries( @@ -106,7 +99,6 @@ set( TARGETS stateMachinePrinter systemInfoConfigPrinter systemInfoSamplePrinter - trackedObjectPrinter wheelGroupSamplePrinter ) diff --git a/knRapid/src/rapidExtArcIo/RapidExtArcIoParameters.xml b/knRapid/src/rapidExtArcIo/RapidExtArcIoParameters.xml index d6a18e6..79d8389 100644 --- a/knRapid/src/rapidExtArcIo/RapidExtArcIoParameters.xml +++ b/knRapid/src/rapidExtArcIo/RapidExtArcIoParameters.xml @@ -142,8 +142,8 @@ - - + + diff --git a/knRapid/src/rapidExtArcIo/TrackedObjectIo.cpp b/knRapid/src/rapidExtArcIo/TrackedObjectIo.cpp deleted file mode 100644 index 3bea66c..0000000 --- a/knRapid/src/rapidExtArcIo/TrackedObjectIo.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "TrackedObjectIo.h" -#include "rapidIo/HeaderIo.h" -#include "rapidIo/BaseTypesIo.h" -#include "rapidExtArcDds/TrackedObjectConfig.h" -#include "RapidExtArcIoParameters.h" - -#include -#include - -// copied from PositionIo -namespace -{ - char const * rotationEncodingNames[] = { - "ROT_NONE", - "ROT_M33", - "ROT_QUAT", - "ROT_XYZ", - "ROT_ZYX", - "ROT_ZYZ", - "ROT_VEL" - }; - - rapid::RotationEncoding rotationEncodings[] = { - rapid::RAPID_ROT_NONE, - rapid::RAPID_ROT_M33, - rapid::RAPID_ROT_QUAT, - rapid::RAPID_ROT_XYZ, - rapid::RAPID_ROT_ZYX, - rapid::RAPID_ROT_ZYZ, - rapid::RAPID_ROT_VEL - }; - int const NUM_ROTATION_ENCODINGS = sizeof(rotationEncodings) / sizeof(rapid::RotationEncoding); - -} - -namespace rapid -{ - namespace ext - { - namespace arc - { - std::ostream& operator<< (std::ostream& ostr, TrackedObjectConfig const& rhs) - { - ostr << "TrackedObjectConfig: {" - << rhs.hdr << "," - << rotationEncodingNames[rhs.poseEncoding] << "," - << rotationEncodingNames[rhs.velocityEncoding] << "," - << rhs.valueKeys - << "}"; - - return ostr; - } - - void operator <<= (TrackedObjectConfig& config, TrackedObjectConfigParameters const& params) - { - config.hdr <<= params.hdr; - - config.poseEncoding = rotationEncodings[params.poseEncoding]; - config.velocityEncoding = rotationEncodings[params.velocityEncoding]; - - config.valueKeys <<= params.valueKeys; - } - } - } -} diff --git a/knRapid/src/rapidExtArcIo/TrackedObjectIo.h b/knRapid/src/rapidExtArcIo/TrackedObjectIo.h deleted file mode 100644 index b6e1cc9..0000000 --- a/knRapid/src/rapidExtArcIo/TrackedObjectIo.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef rapid_ext_arc_TrackedObjectIo_h -#define rapid_ext_arc_TrackedObjectIo_h - -#include "rapidExtArcIo_Export.h" -#include - -namespace rapid -{ - namespace ext - { - namespace arc - { - class TrackedObjectConfigParameters; - class TrackedObjectConfig; - - rapidExtArcIo_Export extern std::ostream& operator<< (std::ostream& ostr, TrackedObjectConfig const& rhs); - rapidExtArcIo_Export extern void operator <<= (TrackedObjectConfig& config, TrackedObjectConfigParameters const& params); - } - } -} - -#endif //rapid_ext_arc_TrackedObjectIo_h diff --git a/knRapid/src/rapidExtArcIo/TrackedObjectProvider.cpp b/knRapid/src/rapidExtArcIo/TrackedObjectProvider.cpp deleted file mode 100644 index bd4a8f0..0000000 --- a/knRapid/src/rapidExtArcIo/TrackedObjectProvider.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include "TrackedObjectProvider.h" - -#include "rapidExtArcDds/ExtArcConstants.h" -#include "RapidExtArcIoParameters.h" - -namespace rapid -{ - namespace ext - { - namespace arc - { - TrackedObjectProvider::TrackedObjectProvider(TrackedObjectTopicPairParameters const& params, const std::string& entityName) - : - TrackedObjectProviderBase(TRACKEDOBJECT_CONFIG_TOPIC, - TRACKEDOBJECT_SAMPLE_TOPIC, - params, - entityName) - { - } - } - } -} diff --git a/knRapid/src/rapidExtArcIo/TrackedObjectProvider.h b/knRapid/src/rapidExtArcIo/TrackedObjectProvider.h deleted file mode 100644 index fdbeef9..0000000 --- a/knRapid/src/rapidExtArcIo/TrackedObjectProvider.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef rapid_ext_arc_TrackedObjectProvider_h -#define rapid_ext_arc_TrackedObjectProvider_h - -#include "rapidUtil/Provider_T.h" - -#include "rapidExtArcDds/TrackedObjectConfig.h" -#include "rapidExtArcDds/TrackedObjectConfigSupport.h" -#include "rapidExtArcDds/TrackedObjectSample.h" -#include "rapidExtArcDds/TrackedObjectSampleSupport.h" - -#include "TrackedObjectIo.h" - -#include "rapidExtArcIo_Export.h" - -namespace rapid -{ - namespace ext - { - namespace arc - { - class TrackedObjectTopicPairParameters; - - typedef Provider_T TrackedObjectProviderBase; - - class rapidExtArcIo_Export TrackedObjectProvider : public TrackedObjectProviderBase - { - public: - TrackedObjectProvider(TrackedObjectTopicPairParameters const& params, const std::string& entityName); - }; - } - } -} - - -#endif //rapid_ext_arc_TrackedObjectProvider_h diff --git a/knRapid/src/rapidExtArcIo/trackedObjectPrinter.cpp b/knRapid/src/rapidExtArcIo/trackedObjectPrinter.cpp deleted file mode 100644 index 461ba91..0000000 --- a/knRapid/src/rapidExtArcIo/trackedObjectPrinter.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "RapidExtArcIoParameters.h" -#include "TrackedObjectIo.h" - -#include "rapidUtil/TopicPairApp_T.h" -#include "rapidUtil/RapidHelper.h" - -#include "rapidExtArcDds/TrackedObjectConfig.h" -#include "rapidExtArcDds/TrackedObjectConfigSupport.h" -#include "rapidExtArcDds/TrackedObjectSample.h" -#include "rapidExtArcDds/TrackedObjectSampleSupport.h" -#include "rapidExtArcDds/ExtArcConstants.h" - -#include - -namespace rapid -{ - typedef TopicPairApp_T TopicPairApp; -} - - -using namespace rapid; -int main(int argc, char *argv[]) -{ - ext::arc::TrackedObjectTopicPairParameters params; - TopicPairApp app(argc, argv, params); - - app.run(ext::arc::TRACKEDOBJECT_CONFIG_TOPIC, ext::arc::TRACKEDOBJECT_SAMPLE_TOPIC); - return 0; -} diff --git a/knRapid/src/rapidExtDds/ExtCommandConstants.idl b/knRapid/src/rapidExtDds/ExtCommandConstants.idl index 4431253..edd7620 100644 --- a/knRapid/src/rapidExtDds/ExtCommandConstants.idl +++ b/knRapid/src/rapidExtDds/ExtCommandConstants.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_ExtCommandConstants_idl +#define rapid_ext_ExtCommandConstants_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -81,3 +84,5 @@ module rapid { }; }; + +#endif // rapid_ext_ExtCommandConstants_idl diff --git a/knRapid/src/rapidExtDds/ExtConstants.idl b/knRapid/src/rapidExtDds/ExtConstants.idl index e465c1b..1939d44 100644 --- a/knRapid/src/rapidExtDds/ExtConstants.idl +++ b/knRapid/src/rapidExtDds/ExtConstants.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_ExtConstants_idl +#define rapid_ext_ExtConstants_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -39,3 +42,5 @@ module rapid { const String64 VESTOP_STATE_TOPIC = "rapid_vestop_state"; }; }; + +#endif // rapid_ext_ExtConstants_idl diff --git a/knRapid/src/rapidExtDds/NavMapConfig.idl b/knRapid/src/rapidExtDds/NavMapConfig.idl index 7746f66..aed217e 100644 --- a/knRapid/src/rapidExtDds/NavMapConfig.idl +++ b/knRapid/src/rapidExtDds/NavMapConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_NavMapConfig_idl +#define rapid_ext_NavMapConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -70,3 +73,5 @@ module rapid { }; }; }; + +#endif // rapid_ext_NavMapConfig_idl diff --git a/knRapid/src/rapidExtDds/NavMapSample.idl b/knRapid/src/rapidExtDds/NavMapSample.idl index 3823922..787ab77 100644 --- a/knRapid/src/rapidExtDds/NavMapSample.idl +++ b/knRapid/src/rapidExtDds/NavMapSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_NavMapSample_idl +#define rapid_ext_NavMapSample_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -42,7 +45,7 @@ module rapid { short density; //@copy-declaration /** Vector of 8 bit data samples. */ - OctetSequence64K data; + OctetSequence128K data; }; //@copy-declaration /** @@ -69,7 +72,7 @@ module rapid { short density; //@copy-declaration /** Vector of 16 bit data samples. */ - ShortSequence64K data; + ShortSequence128K data; }; @@ -108,3 +111,5 @@ module rapid { }; }; }; + +#endif // rapid_ext_NavMapSample_idl diff --git a/knRapid/src/rapidExtDds/ProcessManagerConfig.idl b/knRapid/src/rapidExtDds/ProcessManagerConfig.idl index 59fd552..2394f97 100644 --- a/knRapid/src/rapidExtDds/ProcessManagerConfig.idl +++ b/knRapid/src/rapidExtDds/ProcessManagerConfig.idl @@ -56,4 +56,5 @@ module rapid }; }; }; + #endif // rapid_ext_ProcessManagerConfig_idl diff --git a/knRapid/src/rapidExtDds/RangeScanConfig.idl b/knRapid/src/rapidExtDds/RangeScanConfig.idl index 862176f..4263edf 100644 --- a/knRapid/src/rapidExtDds/RangeScanConfig.idl +++ b/knRapid/src/rapidExtDds/RangeScanConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_RangeScanConfig_idl +#define rapid_ext_RangeScanConfig_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -89,3 +92,5 @@ module rapid { }; }; }; + +#endif // rapid_ext_RangeScanConfig_idl diff --git a/knRapid/src/rapidExtDds/RangeScanSample.idl b/knRapid/src/rapidExtDds/RangeScanSample.idl index 8d81f50..b4d007e 100644 --- a/knRapid/src/rapidExtDds/RangeScanSample.idl +++ b/knRapid/src/rapidExtDds/RangeScanSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_RangeScanSample_idl +#define rapid_ext_RangeScanSample_idl + /* * Copyright (c) 2009 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -54,3 +57,5 @@ module rapid { }; }; }; + +#endif // rapid_ext_RangeScanSample_idl diff --git a/knRapid/src/rapidExtDds/SystemInfoSample.idl b/knRapid/src/rapidExtDds/SystemInfoSample.idl index 37f0311..351762e 100644 --- a/knRapid/src/rapidExtDds/SystemInfoSample.idl +++ b/knRapid/src/rapidExtDds/SystemInfoSample.idl @@ -130,4 +130,4 @@ module rapid }; }; -#endif // rapid_SSystemInfo_idl +#endif // rapid_ext_SystemInfoSample_idl diff --git a/knRapid/src/rapidExtDds/Trajectory2DConfig.idl b/knRapid/src/rapidExtDds/Trajectory2DConfig.idl index bcbf880..174ae2a 100644 --- a/knRapid/src/rapidExtDds/Trajectory2DConfig.idl +++ b/knRapid/src/rapidExtDds/Trajectory2DConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_Trajectory2DConfig_idl +#define rapid_ext_Trajectory2DConfig_idl + /* * Copyright (c) 2012 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -58,3 +61,5 @@ module rapid }; }; }; + +#endif // rapid_ext_Trajectory2DConfig_idl diff --git a/knRapid/src/rapidExtDds/Trajectory2DSample.idl b/knRapid/src/rapidExtDds/Trajectory2DSample.idl index 9618820..de4219d 100644 --- a/knRapid/src/rapidExtDds/Trajectory2DSample.idl +++ b/knRapid/src/rapidExtDds/Trajectory2DSample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_Trajectory2DSample_idl +#define rapid_ext_Trajectory2DSample_idl + /* * Copyright (c) 2012 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -56,3 +59,5 @@ module rapid }; }; }; + +#endif // rapid_ext_Trajectory2DSample_idl diff --git a/knRapid/src/rapidExtDds/TrajectoryConfig.idl b/knRapid/src/rapidExtDds/TrajectoryConfig.idl index c5b9813..6efe89e 100644 --- a/knRapid/src/rapidExtDds/TrajectoryConfig.idl +++ b/knRapid/src/rapidExtDds/TrajectoryConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_TrajectoryConfig_idl +#define rapid_ext_TrajectoryConfig_idl + /* * Copyright (c) 2012 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -40,3 +43,5 @@ module rapid{ }; }; }; + +#endif // rapid_ext_TrajectoryConfig_idl diff --git a/knRapid/src/rapidExtDds/TrajectorySample.idl b/knRapid/src/rapidExtDds/TrajectorySample.idl index 66c2ff5..45d753b 100644 --- a/knRapid/src/rapidExtDds/TrajectorySample.idl +++ b/knRapid/src/rapidExtDds/TrajectorySample.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_TrajectorySample_idl +#define rapid_ext_TrajectorySample_idl + /* * Copyright (c) 2012 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -63,3 +66,5 @@ module rapid{ }; }; }; + +#endif // rapid_ext_TrajectorySample_idl diff --git a/knRapid/src/rapidExtDds/VEStopConfig.idl b/knRapid/src/rapidExtDds/VEStopConfig.idl index 4cd3c6d..65679aa 100644 --- a/knRapid/src/rapidExtDds/VEStopConfig.idl +++ b/knRapid/src/rapidExtDds/VEStopConfig.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_VEStopConfig_idl +#define rapid_ext_VEStopConfig_idl + /* * Copyright (c) 2012 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -31,3 +34,5 @@ module rapid }; }; }; + +#endif // rapid_ext_VEStopConfig_idl diff --git a/knRapid/src/rapidExtDds/VEStopState.idl b/knRapid/src/rapidExtDds/VEStopState.idl index 965d41a..e9ecb3b 100644 --- a/knRapid/src/rapidExtDds/VEStopState.idl +++ b/knRapid/src/rapidExtDds/VEStopState.idl @@ -1,3 +1,6 @@ +#ifndef rapid_ext_VEStopState_idl +#define rapid_ext_VEStopState_idl + /* * Copyright (c) 2012 United States Government as represented by the * Administrator of the National Aeronautics and Space Administration. @@ -32,3 +35,5 @@ module rapid }; }; }; + +#endif // rapid_ext_VEStopState_idl diff --git a/knRapid/src/rapidExtIo/CMakeLists.txt b/knRapid/src/rapidExtIo/CMakeLists.txt index 2240a91..22e5805 100644 --- a/knRapid/src/rapidExtIo/CMakeLists.txt +++ b/knRapid/src/rapidExtIo/CMakeLists.txt @@ -50,14 +50,11 @@ set( SOURCES include_directories( ${ACE_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${KNDDS_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} - ${CMAKE_BINARY_DIR}/src/rapidDds + ${CMAKE_CURRENT_BINARY_DIR}/../rapidDds ) link_libraries( diff --git a/knRapid/src/rapidExtTraclabsIo/CMakeLists.txt b/knRapid/src/rapidExtTraclabsIo/CMakeLists.txt index 362f72a..54d1f1e 100644 --- a/knRapid/src/rapidExtTraclabsIo/CMakeLists.txt +++ b/knRapid/src/rapidExtTraclabsIo/CMakeLists.txt @@ -24,14 +24,11 @@ set( SOURCES include_directories( ${ACE_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${KNDDS_INCLUDE_DIR} ${KNDDS_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} - ${CMAKE_BINARY_DIR}/src/rapidDds + ${CMAKE_CURRENT_BINARY_DIR}/../rapidDds ) link_libraries( diff --git a/knRapid/src/rapidFrameStore/CMakeLists.txt b/knRapid/src/rapidFrameStore/CMakeLists.txt index cb69532..ae769b7 100644 --- a/knRapid/src/rapidFrameStore/CMakeLists.txt +++ b/knRapid/src/rapidFrameStore/CMakeLists.txt @@ -25,10 +25,6 @@ set( SOURCES include_directories ( ${MIRO_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${ACE_INCLUDE_DIR} ${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIR} diff --git a/knRapid/src/rapidIo/CMakeLists.txt b/knRapid/src/rapidIo/CMakeLists.txt index 2bc13bb..95cf76c 100644 --- a/knRapid/src/rapidIo/CMakeLists.txt +++ b/knRapid/src/rapidIo/CMakeLists.txt @@ -56,9 +56,6 @@ set( SOURCES include_directories( ${ACE_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${KNDDS_INCLUDE_DIR} @@ -85,44 +82,46 @@ add_srcdir_definitions(${RTIDDS_DEFINES} RTIDDS_FOUND ) # rapid printers #============================= -link_libraries( - ${LIB_NAME} -) - -set( TARGETS - accessControlStatePrinter - ackPrinter - agentPrinter - commandPrinter -# commandAckPrinter - commandConfigPrinter - fileAnnouncePrinter - fileQueueConfigPrinter - fileQueueEntryStatePrinter - fileQueueReceiverEntryStatePrinter - fileQueueReceiverSamplePrinter - fileQueueSamplePrinter - fileQueueStatePrinter - frameStoreConfigPrinter - macroConfigPrinter - macroStatePrinter - positionCovPrinter - positionPrinter - pointCloudPrinter - queueStatePrinter - jointPrinter - imageSensorSamplePrinter - textMessageClient - textMessagePrinter -) +install_library( ${LIB_NAME} ) +install_files ( /include/${DIR_NAME} FILES ${HEADERS} ) -foreach( TARGET ${TARGETS} ) - add_executable( ${TARGET} - ${TARGET}.cpp +if ( KNRAPID_HAS_DDS ) + set( TARGETS + accessControlStatePrinter + ackPrinter + agentPrinter + commandPrinter +# commandAckPrinter + commandConfigPrinter + fileAnnouncePrinter + fileQueueConfigPrinter + fileQueueEntryStatePrinter + fileQueueReceiverEntryStatePrinter + fileQueueReceiverSamplePrinter + fileQueueSamplePrinter + fileQueueStatePrinter + frameStoreConfigPrinter + macroConfigPrinter + macroStatePrinter + positionCovPrinter + positionPrinter + pointCloudPrinter + queueStatePrinter + jointPrinter + imageSensorSamplePrinter + textMessageClient + textMessagePrinter ) -endforeach( TARGET ${TARGETS} ) -target_link_libraries( fileQueueEntryStatePrinter ${Boost_PROGRAM_OPTIONS_LIBRARY}) -install_library( ${LIB_NAME} ) -install_files ( /include/${DIR_NAME} FILES ${HEADERS} ) -install_targets( /bin ${TARGETS} ) + foreach( TARGET ${TARGETS} ) + add_executable( ${TARGET} + ${TARGET}.cpp + ) + target_link_libraries(${TARGET} + ${LIB_NAME} + ) + endforeach( TARGET ${TARGETS} ) + target_link_libraries( fileQueueEntryStatePrinter ${Boost_PROGRAM_OPTIONS_LIBRARY}) + + install_targets( /bin ${TARGETS} ) +endif() diff --git a/knRapid/src/rapidIo/ImageSensorProvider.h b/knRapid/src/rapidIo/ImageSensorProvider.h index d1565c5..c229d48 100644 --- a/knRapid/src/rapidIo/ImageSensorProvider.h +++ b/knRapid/src/rapidIo/ImageSensorProvider.h @@ -23,6 +23,8 @@ #include +#include "rapidDds/ImageSensorSample.h" + #include "knShare/SmartPtr.h" namespace kn @@ -32,12 +34,17 @@ namespace kn } namespace rapid { - class ImageSensorSample; + //class ImageSensorSample; class ImageMetadata; class ImageSensorProviderParameters; class rapidIo_Export ImageSensorProvider { + protected: + typedef kn::DdsTypedSupplier ImageSampleSupplier; + // scoped-ptr would be good enough, but requires full type at declaration + typedef kn::shared_ptr ImageSampleSupplierPtr; + public: ImageSensorProvider(ImageSensorProviderParameters const& params, const std::string& entityName, @@ -50,14 +57,17 @@ namespace rapid char const * mimeType() { return m_mimeType; } void setMimeType(char const * mT); + /** FIXME: this should be dataSupplier() that returns a ImageSampleSupplier& + * but that is generating a cryptic error. Look into the error and make + * this method consistent with the analogous Provider_T method + */ + ImageSampleSupplierPtr dataSupplierPtr() { return m_sampleSupplier; } + //ImageSampleSupplier& dataSupplier() { return *m_sampleSupplier; } + void publishData(unsigned char const * buffer, int len, ACE_Time_Value const& timestamp = ACE_Time_Value::zero); protected: - typedef kn::DdsTypedSupplier ImageSampleSupplier; - // scoped-ptr would be good enough, but requires full type at declaration - typedef kn::shared_ptr ImageSampleSupplierPtr; - ImageSampleSupplierPtr m_sampleSupplier; rapid::ImageMetadata& m_metadata; char * m_mimeType; diff --git a/knRapid/src/rapidIo/PointCloudIo.cpp b/knRapid/src/rapidIo/PointCloudIo.cpp index 4cd9fc0..2b3ebee 100644 --- a/knRapid/src/rapidIo/PointCloudIo.cpp +++ b/knRapid/src/rapidIo/PointCloudIo.cpp @@ -46,12 +46,14 @@ namespace }; AttributeModePair const attributeModesMap[] = { - { rapid::PS_UNUSED, "PS_UNUSED" }, + { rapid::PS_UNUSED, "PS_UNUSED" }, { rapid::PS_INTENSITY, "PS_INTENSITY" }, { rapid::PS_LAYER, "PS_LAYER" }, { rapid::PS_ECHO, "PS_ECHO" }, { rapid::PS_LAYER4_ECHO4, "PS_LAYER4_ECHO4" }, - { rapid::PS_PULSE, "PS_PULSE" } + { rapid::PS_PULSE, "PS_PULSE" }, + { rapid::PS_RGB332, "PS_RGB332" }, + { rapid::PS_RGB565, "PS_RGB565" } }; unsigned int const NUM_ATTRIBUTE_MODES = sizeof(attributeModesMap) / sizeof(AttributeModePair); diff --git a/knRapid/src/rapidIo/PointCloudProvider.cpp b/knRapid/src/rapidIo/PointCloudProvider.cpp index 702b8c3..e3587e1 100644 --- a/knRapid/src/rapidIo/PointCloudProvider.cpp +++ b/knRapid/src/rapidIo/PointCloudProvider.cpp @@ -156,6 +156,7 @@ namespace rapid //! @TODO check on the different attribute formats and do something more smart than this sample.points[sampleIdx].attributes[0] = m_pc->points[m_pcIdx].att.int16s[0]; + sample.points[sampleIdx].attributes[1] = m_pc->points[m_pcIdx].att.int16s[1]; } } // publish with row-length markers @@ -191,6 +192,7 @@ namespace rapid //! @TODO check on the different attribute formats and do something more smart than this sample.points[sampleIdx].attributes[0] = m_pc->points[idx].att.int16s[0]; + sample.points[sampleIdx].attributes[1] = m_pc->points[idx].att.int16s[1]; } ++m_pcRowIndex; } diff --git a/knRapid/src/rapidIo/PointCloudProvider.h b/knRapid/src/rapidIo/PointCloudProvider.h index 1068e1d..223e9bd 100644 --- a/knRapid/src/rapidIo/PointCloudProvider.h +++ b/knRapid/src/rapidIo/PointCloudProvider.h @@ -20,7 +20,7 @@ #define rapid_PointCloudProvider_h #include "rapidIo_Export.h" -#include "RapidIoParameters.h" +#include "rapidIo/RapidIoParameters.h" #include "PointCloudIo.h" #include "rapidUtil/Provider_T.h" diff --git a/knRapid/src/rapidIo/TextMessager.cpp b/knRapid/src/rapidIo/TextMessager.cpp index 278cba5..a1b15a4 100644 --- a/knRapid/src/rapidIo/TextMessager.cpp +++ b/knRapid/src/rapidIo/TextMessager.cpp @@ -62,8 +62,7 @@ TextMessager::sendText(const char* category, m_publisher->sendEvent(); } -#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template kn::Singleton * kn::Singleton::s_instance_; -#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ - } +KN_SINGLETON_TEMPLATE_INSTANTIATION(kn::Singleton); + + diff --git a/knRapid/src/rapidTools/genericCommandGui/CMakeLists.txt b/knRapid/src/rapidTools/genericCommandGui/CMakeLists.txt index 8c508e7..0ade075 100644 --- a/knRapid/src/rapidTools/genericCommandGui/CMakeLists.txt +++ b/knRapid/src/rapidTools/genericCommandGui/CMakeLists.txt @@ -55,11 +55,6 @@ qt4_wrap_cpp(MOC_FILES ${MOC_HEADERS}) include_directories( ${CMAKE_CURRENT_BINARY_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTGUI_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} - ${QT_QTNETWORK_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} ${ACE_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} diff --git a/knRapid/src/rapidTools/genericCommandGui/CommandConfigSubscriber.h b/knRapid/src/rapidTools/genericCommandGui/CommandConfigSubscriber.h index 1c69dad..66c270d 100644 --- a/knRapid/src/rapidTools/genericCommandGui/CommandConfigSubscriber.h +++ b/knRapid/src/rapidTools/genericCommandGui/CommandConfigSubscriber.h @@ -21,7 +21,9 @@ #include +#ifndef Q_MOC_RUN #include "knDds/DdsTypedConnector.h" +#endif #include "rapidDds/CommandConfig.h" #include "rapidDds/CommandConfigSupport.h" diff --git a/knRapid/src/rapidTools/imageSensorSampleGui/CMakeLists.txt b/knRapid/src/rapidTools/imageSensorSampleGui/CMakeLists.txt index 887dfac..da14f4b 100644 --- a/knRapid/src/rapidTools/imageSensorSampleGui/CMakeLists.txt +++ b/knRapid/src/rapidTools/imageSensorSampleGui/CMakeLists.txt @@ -25,10 +25,6 @@ qt4_wrap_cpp(MOC_FILES ${MOC_HEADERS}) include_directories( ${CMAKE_CURRENT_BINARY_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTGUI_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} ${ACE_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} diff --git a/knRapid/src/rapidTools/imageSensorSampleGui/ImageSensorSampleSubscriber.h b/knRapid/src/rapidTools/imageSensorSampleGui/ImageSensorSampleSubscriber.h index e1f3ed6..f39db39 100644 --- a/knRapid/src/rapidTools/imageSensorSampleGui/ImageSensorSampleSubscriber.h +++ b/knRapid/src/rapidTools/imageSensorSampleGui/ImageSensorSampleSubscriber.h @@ -19,7 +19,9 @@ #include #include +#ifndef Q_MOC_RUN #include "knDds/DdsTypedConnector.h" +#endif #include "rapidDds/ImageSensorSample.h" #include "rapidDds/ImageSensorSampleSupport.h" diff --git a/knRapid/src/rapidTools/rapidLogTools/CMakeLists.txt b/knRapid/src/rapidTools/rapidLogTools/CMakeLists.txt index cbc16ff..3b6414c 100644 --- a/knRapid/src/rapidTools/rapidLogTools/CMakeLists.txt +++ b/knRapid/src/rapidTools/rapidLogTools/CMakeLists.txt @@ -9,8 +9,6 @@ set(HEADERS include_directories( ${IRGUTIL_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${KNRAPID_INCLUDE_DIR} ) diff --git a/knRapid/src/rapidTools/rapidLogTools/rapidLogReader/CMakeLists.txt b/knRapid/src/rapidTools/rapidLogTools/rapidLogReader/CMakeLists.txt index f89bac3..f6e14d2 100644 --- a/knRapid/src/rapidTools/rapidLogTools/rapidLogReader/CMakeLists.txt +++ b/knRapid/src/rapidTools/rapidLogTools/rapidLogReader/CMakeLists.txt @@ -26,8 +26,6 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR}/../../../rapidDds ${Boost_INCLUDE_DIR} ${RTIDDS_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ) link_libraries( diff --git a/knRapid/src/rapidUtil/CMakeLists.txt b/knRapid/src/rapidUtil/CMakeLists.txt index 506c85a..d357c49 100644 --- a/knRapid/src/rapidUtil/CMakeLists.txt +++ b/knRapid/src/rapidUtil/CMakeLists.txt @@ -32,9 +32,6 @@ set( SOURCES include_directories( ${ACE_INCLUDE_DIR} ${MIRO_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${QT_QTXML_INCLUDE_DIR} - ${QT_QTCORE_INCLUDE_DIR} ${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ) diff --git a/knRapid/src/rapidUtil/RapidUtilParameters.xml b/knRapid/src/rapidUtil/RapidUtilParameters.xml index a2dcb83..553cd9c 100644 --- a/knRapid/src/rapidUtil/RapidUtilParameters.xml +++ b/knRapid/src/rapidUtil/RapidUtilParameters.xml @@ -11,7 +11,7 @@ - +