diff --git a/hector_mapping/CMakeLists.txt b/hector_mapping/CMakeLists.txt index 7b5a3c95..0e7a5810 100644 --- a/hector_mapping/CMakeLists.txt +++ b/hector_mapping/CMakeLists.txt @@ -155,3 +155,5 @@ install(DIRECTORY launch/ ## Add folders to be run by python nosetests # catkin_add_nosetests(test) + +#add_subdirectory(swig) diff --git a/hector_mapping/swig/CMakeLists.txt b/hector_mapping/swig/CMakeLists.txt new file mode 100644 index 00000000..846f291a --- /dev/null +++ b/hector_mapping/swig/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 2.8) +find_package(SWIG REQUIRED) +find_package(Eigen3) + +if(SWIG_FOUND) + include(${SWIG_USE_FILE}) + include_directories(${CMAKE_SOURCE_DIR} ${EIGEN3_INCLUDE_DIR}) + + # assuming you have installed https://svn.code.sf.net/p/swig/code/branches/gsoc2008-maciekd/ + set(SWIG_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/gsoc2008-maciekd/swig) + set(ENV{PATH} ${CMAKE_CURRENT_SOURCE_DIR}/gsoc2008-maciekd/:$ENV{PATH}) + set(ENV{SWIG_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/gsoc2008-maciekd/Lib) + message(WARNING "-- If you have trouble on using swig, try export SWIG_LIB=$ENV{SWIG_LIB}") + + set(INTERFACE_FILES + hector_mapping.i) + + set_source_files_properties(${INTERFACE_FILES} PROPERTIES + CPLUSPLUS ON + COMPILE_FLAGS "-fpermissive" # http://stackoverflow.com/questions/22411514/no-match-for-operator-error-in-c + ) + set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_SOURCE_DIR}) + set(CMAKE_CURRENT_BINARY_DIR_TMP ${CMAKE_CURRENT_BINARY_DIR}) ## to output wrap file + set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + swig_add_module(swig_library c ${INTERFACE_FILES}) + set(CMAKE_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR_TMP}) + + swig_link_libraries(swig_library) + set_target_properties(swig_library PROPERTIES OUTPUT_NAME hector_mapping) + add_dependencies(swig_library + ${CMAKE_CURRENT_BINARY_DIR}/hector_mappingC_wrap.cxx + ${CMAKE_CURRENT_SOURCE_DIR}/HectorSlam_proxy.c + ${CMAKE_CURRENT_SOURCE_DIR}/HectorSlam_proxy.h + ) +else() + include_directories(${CMAKE_SOURCE_DIR} ${EIGEN3_INCLUDE_DIR}) + add_library(swig_library hector_mappingC_wrap.cxx HectorSlam_proxy.c) + set_target_properties(swig_library PROPERTIES OUTPUT_NAME hector_mapping) +endif() + +# example code +include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${catkin_INCLUDE_DIRS}) +link_directories(${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_LIB_DESTINATION}) +add_executable(standalone standalone.cpp HectorSlam_proxy.c) +target_link_libraries(standalone libhector_mapping.so ${catkin_LIBRARIES}) +add_dependencies(standalone swig_library) + diff --git a/hector_mapping/swig/HectorSlam_proxy.c b/hector_mapping/swig/HectorSlam_proxy.c new file mode 100644 index 00000000..808bd50e --- /dev/null +++ b/hector_mapping/swig/HectorSlam_proxy.c @@ -0,0 +1,437 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.6 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ +#include "HectorSlam_proxy.h" + +/*aaaaaa*/SwigObj * _wrap_Eigen_Vector2f(float carg1, float carg2); +float _wrap_Eigen_Vector2f_x(SwigObj * carg1); +float _wrap_Eigen_Vector2f_y(SwigObj * carg1); +float _wrap_Eigen_Vector3f_x(SwigObj * carg1); +float _wrap_Eigen_Vector3f_y(SwigObj * carg1); +float _wrap_Eigen_Vector3f_z(SwigObj * carg1); +const char * _wrap_SimdInstructionSetsInUse(); +void _wrap_LogOddsCell_set(SwigObj * carg1, float carg2); +float _wrap_LogOddsCell_getValue(SwigObj * carg1); +bool _wrap_LogOddsCell_isOccupied(SwigObj * carg1); +bool _wrap_LogOddsCell_isFree(SwigObj * carg1); +void _wrap_LogOddsCell_resetGridCell(SwigObj * carg1); +void _wrap_LogOddsCell_logOddsVal_set(SwigObj * carg1, float carg2); +float _wrap_LogOddsCell_logOddsVal_get(SwigObj * carg1); +void _wrap_LogOddsCell_updateIndex_set(SwigObj * carg1, int carg2); +int _wrap_LogOddsCell_updateIndex_get(SwigObj * carg1); +LogOddsCell * _wrap_new_LogOddsCell(); +void _wrap_delete_LogOddsCell(LogOddsCell * carg1); +GridMapLogOddsFunctions * _wrap_new_GridMapLogOddsFunctions(); +void _wrap_GridMapLogOddsFunctions_updateSetOccupied(SwigObj * carg1, SwigObj * carg2); +void _wrap_GridMapLogOddsFunctions_updateSetFree(SwigObj * carg1, SwigObj * carg2); +void _wrap_GridMapLogOddsFunctions_updateUnsetFree(SwigObj * carg1, SwigObj * carg2); +float _wrap_GridMapLogOddsFunctions_getGridProbability(SwigObj * carg1, SwigObj * carg2); +void _wrap_GridMapLogOddsFunctions_setUpdateFreeFactor(SwigObj * carg1, float carg2); +void _wrap_GridMapLogOddsFunctions_setUpdateOccupiedFactor(SwigObj * carg1, float carg2); +void _wrap_delete_GridMapLogOddsFunctions(GridMapLogOddsFunctions * carg1); +HectorSlamProcessor * _wrap_new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i_pDrawInterface_pHectorDebugInfoInterface(float carg1, int carg2, int carg3, SwigObj * carg4, int carg5, SwigObj * carg6, SwigObj * carg7); +HectorSlamProcessor * _wrap_new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i_pDrawInterface(float carg1, int carg2, int carg3, SwigObj * carg4, int carg5, SwigObj * carg6); +HectorSlamProcessor * _wrap_new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i(float carg1, int carg2, int carg3, SwigObj * carg4, int carg5); +void _wrap_delete_HectorSlamProcessor(HectorSlamProcessor * carg1); +void _wrap_HectorSlamProcessor_update_phectorslam_HectorSlamProcessor_rchectorslam_DataPointContainer_Sl_Eigen_Vector2f_Sg__rcEigen_Vector3f_b(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3, bool carg4); +void _wrap_HectorSlamProcessor_update_phectorslam_HectorSlamProcessor_rchectorslam_DataPointContainer_Sl_Eigen_Vector2f_Sg__rcEigen_Vector3f(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3); +void _wrap_HectorSlamProcessor_reset(SwigObj * carg1); +SwigObj * _wrap_HectorSlamProcessor_getLastScanMatchPose(SwigObj * carg1); +SwigObj * _wrap_HectorSlamProcessor_getLastScanMatchCovariance(SwigObj * carg1); +float _wrap_HectorSlamProcessor_getScaleToMap(SwigObj * carg1); +int _wrap_HectorSlamProcessor_getMapLevels(SwigObj * carg1); +SwigObj * _wrap_HectorSlamProcessor_getGridMap_pchectorslam_HectorSlamProcessor_i(SwigObj * carg1, int carg2); +SwigObj * _wrap_HectorSlamProcessor_getGridMap_pchectorslam_HectorSlamProcessor(SwigObj * carg1); +void _wrap_HectorSlamProcessor_addMapMutex(SwigObj * carg1, int carg2, SwigObj * carg3); +/*aaaaaa*/SwigObj * _wrap_HectorSlamProcessor_getMapMutex(SwigObj * carg1, int carg2); +void _wrap_HectorSlamProcessor_setUpdateFactorFree(SwigObj * carg1, float carg2); +void _wrap_HectorSlamProcessor_setUpdateFactorOccupied(SwigObj * carg1, float carg2); +void _wrap_HectorSlamProcessor_setMapUpdateMinDistDiff(SwigObj * carg1, float carg2); +void _wrap_HectorSlamProcessor_setMapUpdateMinAngleDiff(SwigObj * carg1, float carg2); +DataPointContainer_Eigen_Vector2f * _wrap_new_DataPointContainer_Eigen_Vector2f_i(int carg1); +DataPointContainer_Eigen_Vector2f * _wrap_new_DataPointContainer_Eigen_Vector2f(); +void _wrap_DataPointContainer_Eigen_Vector2f_setFrom(SwigObj * carg1, SwigObj * carg2, float carg3); +void _wrap_DataPointContainer_Eigen_Vector2f_add(SwigObj * carg1, SwigObj * carg2); +void _wrap_DataPointContainer_Eigen_Vector2f_clear(SwigObj * carg1); +int _wrap_DataPointContainer_Eigen_Vector2f_getSize(SwigObj * carg1); +SwigObj * _wrap_DataPointContainer_Eigen_Vector2f_getVecEntry(SwigObj * carg1, int carg2); +SwigObj * _wrap_DataPointContainer_Eigen_Vector2f_getOrigo(SwigObj * carg1); +void _wrap_DataPointContainer_Eigen_Vector2f_setOrigo(SwigObj * carg1, SwigObj * carg2); +void _wrap_delete_DataPointContainer_Eigen_Vector2f(DataPointContainer_Eigen_Vector2f * carg1); +GridMap * _wrap_new_GridMap(float carg1, SwigObj * carg2, SwigObj * carg3); +void _wrap_delete_GridMap(GridMap * carg1); +void _wrap_GridMap_updateSetOccupied(SwigObj * carg1, int carg2); +void _wrap_GridMap_updateSetFree(SwigObj * carg1, int carg2); +void _wrap_GridMap_updateUnsetFree(SwigObj * carg1, int carg2); +float _wrap_GridMap_getGridProbabilityMap(SwigObj * carg1, int carg2); +bool _wrap_GridMap_isOccupied_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i_i(SwigObj * carg1, int carg2, int carg3); +bool _wrap_GridMap_isFree_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i_i(SwigObj * carg1, int carg2, int carg3); +bool _wrap_GridMap_isOccupied_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i(SwigObj * carg1, int carg2); +bool _wrap_GridMap_isFree_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i(SwigObj * carg1, int carg2); +float _wrap_GridMap_getObstacleThreshold(SwigObj * carg1); +void _wrap_GridMap_setUpdateFreeFactor(SwigObj * carg1, float carg2); +void _wrap_GridMap_setUpdateOccupiedFactor(SwigObj * carg1, float carg2); +void _wrap_GridMap_updateByScan(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3); +void _wrap_GridMap_updateLineBresenhami_phectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__rcEigen_Vector2i_rcEigen_Vector2i_unsigned_SS_int(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3, unsigned int carg4); +void _wrap_GridMap_updateLineBresenhami_phectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__rcEigen_Vector2i_rcEigen_Vector2i(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3); +void _wrap_GridMap_bresenhamCellFree(SwigObj * carg1, unsigned int carg2); +void _wrap_GridMap_bresenhamCellOcc(SwigObj * carg1, unsigned int carg2); +void _wrap_GridMap_bresenham2D(SwigObj * carg1, unsigned int carg2, unsigned int carg3, int carg4, int carg5, int carg6, unsigned int carg7); +bool _wrap_GridMapBase_LogOddsCell_hasGridValue(SwigObj * carg1, int carg2, int carg3); +SwigObj * _wrap_GridMapBase_LogOddsCell_getMapDimensions(SwigObj * carg1); +int _wrap_GridMapBase_LogOddsCell_getSizeX(SwigObj * carg1); +int _wrap_GridMapBase_LogOddsCell_getSizeY(SwigObj * carg1); +bool _wrap_GridMapBase_LogOddsCell_pointOutOfMapBounds(SwigObj * carg1, SwigObj * carg2); +void _wrap_GridMapBase_LogOddsCell_reset(GridMapBase_LogOddsCell * carg1); +void _wrap_GridMapBase_LogOddsCell_clear(SwigObj * carg1); +SwigObj * _wrap_GridMapBase_LogOddsCell_getMapDimProperties(SwigObj * carg1); +GridMapBase_LogOddsCell * _wrap_new_GridMapBase_LogOddsCell_f_rcEigen_Vector2i_rcEigen_Vector2f(float carg1, SwigObj * carg2, SwigObj * carg3); +void _wrap_delete_GridMapBase_LogOddsCell(GridMapBase_LogOddsCell * carg1); +void _wrap_GridMapBase_LogOddsCell_allocateArray(SwigObj * carg1, SwigObj * carg2); +void _wrap_GridMapBase_LogOddsCell_deleteArray(SwigObj * carg1); +SwigObj * _wrap_GridMapBase_LogOddsCell_getCell_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__i_i(SwigObj * carg1, int carg2, int carg3); +SwigObj * _wrap_GridMapBase_LogOddsCell_getCell_pchectorslam_GridMapBase_Sl_LogOddsCell_Sg__i_i(SwigObj * carg1, int carg2, int carg3); +SwigObj * _wrap_GridMapBase_LogOddsCell_getCell_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__i(SwigObj * carg1, int carg2); +SwigObj * _wrap_GridMapBase_LogOddsCell_getCell_pchectorslam_GridMapBase_Sl_LogOddsCell_Sg__i(SwigObj * carg1, int carg2); +void _wrap_GridMapBase_LogOddsCell_setMapGridSize(SwigObj * carg1, SwigObj * carg2); +GridMapBase_LogOddsCell * _wrap_copy_GridMapBase_LogOddsCell(SwigObj * carg1); +SwigObj * _wrap_GridMapBase_LogOddsCell_getWorldCoords(SwigObj * carg1, SwigObj * carg2); +SwigObj * _wrap_GridMapBase_LogOddsCell_getMapCoords(SwigObj * carg1, SwigObj * carg2); +SwigObj * _wrap_GridMapBase_LogOddsCell_getWorldCoordsPose(SwigObj * carg1, SwigObj * carg2); +SwigObj * _wrap_GridMapBase_LogOddsCell_getMapCoordsPose(SwigObj * carg1, SwigObj * carg2); +void _wrap_GridMapBase_LogOddsCell_setDimensionProperties_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__rcEigen_Vector2f_rcEigen_Vector2i_f(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3, float carg4); +void _wrap_GridMapBase_LogOddsCell_setDimensionProperties_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__rcMapDimensionProperties(SwigObj * carg1, SwigObj * carg2); +void _wrap_GridMapBase_LogOddsCell_setMapTransformation(SwigObj * carg1, SwigObj * carg2, float carg3); +float _wrap_GridMapBase_LogOddsCell_getScaleToMap(SwigObj * carg1); +float _wrap_GridMapBase_LogOddsCell_getCellLength(SwigObj * carg1); +SwigObj * _wrap_GridMapBase_LogOddsCell_getWorldTmap(SwigObj * carg1); +SwigObj * _wrap_GridMapBase_LogOddsCell_getWorldTmap3D(SwigObj * carg1); +SwigObj * _wrap_GridMapBase_LogOddsCell_getMapTworld(SwigObj * carg1); +void _wrap_GridMapBase_LogOddsCell_setUpdated(SwigObj * carg1); +int _wrap_GridMapBase_LogOddsCell_getUpdateIndex(SwigObj * carg1); + +/*aaaaaa*/SwigObj * Eigen_Vector2f(float carg1, float carg2) { + return _wrap_Eigen_Vector2f(carg1, carg2); +} +float Eigen_Vector2f_x(SwigObj * carg1) { + return _wrap_Eigen_Vector2f_x(carg1); +} +float Eigen_Vector2f_y(SwigObj * carg1) { + return _wrap_Eigen_Vector2f_y(carg1); +} +float Eigen_Vector3f_x(SwigObj * carg1) { + return _wrap_Eigen_Vector3f_x(carg1); +} +float Eigen_Vector3f_y(SwigObj * carg1) { + return _wrap_Eigen_Vector3f_y(carg1); +} +float Eigen_Vector3f_z(SwigObj * carg1) { + return _wrap_Eigen_Vector3f_z(carg1); +} +const char * SimdInstructionSetsInUse() { + return _wrap_SimdInstructionSetsInUse(); +} +void LogOddsCell_set(SwigObj * carg1, float carg2) { + return _wrap_LogOddsCell_set(carg1, carg2); +} +float LogOddsCell_getValue(SwigObj * carg1) { + return _wrap_LogOddsCell_getValue(carg1); +} +bool LogOddsCell_isOccupied(SwigObj * carg1) { + return _wrap_LogOddsCell_isOccupied(carg1); +} +bool LogOddsCell_isFree(SwigObj * carg1) { + return _wrap_LogOddsCell_isFree(carg1); +} +void LogOddsCell_resetGridCell(SwigObj * carg1) { + return _wrap_LogOddsCell_resetGridCell(carg1); +} +void LogOddsCell_logOddsVal_set(SwigObj * carg1, float carg2) { + return _wrap_LogOddsCell_logOddsVal_set(carg1, carg2); +} +float LogOddsCell_logOddsVal_get(SwigObj * carg1) { + return _wrap_LogOddsCell_logOddsVal_get(carg1); +} +void LogOddsCell_updateIndex_set(SwigObj * carg1, int carg2) { + return _wrap_LogOddsCell_updateIndex_set(carg1, carg2); +} +int LogOddsCell_updateIndex_get(SwigObj * carg1) { + return _wrap_LogOddsCell_updateIndex_get(carg1); +} +LogOddsCell * new_LogOddsCell() { + return _wrap_new_LogOddsCell(); +} +void delete_LogOddsCell(LogOddsCell * carg1) { + return _wrap_delete_LogOddsCell(carg1); +} +GridMapLogOddsFunctions * new_GridMapLogOddsFunctions() { + return _wrap_new_GridMapLogOddsFunctions(); +} +void GridMapLogOddsFunctions_updateSetOccupied(SwigObj * carg1, SwigObj * carg2) { + return _wrap_GridMapLogOddsFunctions_updateSetOccupied(carg1, carg2); +} +void GridMapLogOddsFunctions_updateSetFree(SwigObj * carg1, SwigObj * carg2) { + return _wrap_GridMapLogOddsFunctions_updateSetFree(carg1, carg2); +} +void GridMapLogOddsFunctions_updateUnsetFree(SwigObj * carg1, SwigObj * carg2) { + return _wrap_GridMapLogOddsFunctions_updateUnsetFree(carg1, carg2); +} +float GridMapLogOddsFunctions_getGridProbability(SwigObj * carg1, SwigObj * carg2) { + return _wrap_GridMapLogOddsFunctions_getGridProbability(carg1, carg2); +} +void GridMapLogOddsFunctions_setUpdateFreeFactor(SwigObj * carg1, float carg2) { + return _wrap_GridMapLogOddsFunctions_setUpdateFreeFactor(carg1, carg2); +} +void GridMapLogOddsFunctions_setUpdateOccupiedFactor(SwigObj * carg1, float carg2) { + return _wrap_GridMapLogOddsFunctions_setUpdateOccupiedFactor(carg1, carg2); +} +void delete_GridMapLogOddsFunctions(GridMapLogOddsFunctions * carg1) { + return _wrap_delete_GridMapLogOddsFunctions(carg1); +} +HectorSlamProcessor * new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i_pDrawInterface_pHectorDebugInfoInterface(float carg1, int carg2, int carg3, SwigObj * carg4, int carg5, SwigObj * carg6, SwigObj * carg7) { + return _wrap_new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i_pDrawInterface_pHectorDebugInfoInterface(carg1, carg2, carg3, carg4, carg5, carg6, carg7); +} +HectorSlamProcessor * new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i_pDrawInterface(float carg1, int carg2, int carg3, SwigObj * carg4, int carg5, SwigObj * carg6) { + return _wrap_new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i_pDrawInterface(carg1, carg2, carg3, carg4, carg5, carg6); +} +HectorSlamProcessor * new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i(float carg1, int carg2, int carg3, SwigObj * carg4, int carg5) { + return _wrap_new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i(carg1, carg2, carg3, carg4, carg5); +} +void delete_HectorSlamProcessor(HectorSlamProcessor * carg1) { + return _wrap_delete_HectorSlamProcessor(carg1); +} +void HectorSlamProcessor_update_phectorslam_HectorSlamProcessor_rchectorslam_DataPointContainer_Sl_Eigen_Vector2f_Sg__rcEigen_Vector3f_b(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3, bool carg4) { + return _wrap_HectorSlamProcessor_update_phectorslam_HectorSlamProcessor_rchectorslam_DataPointContainer_Sl_Eigen_Vector2f_Sg__rcEigen_Vector3f_b(carg1, carg2, carg3, carg4); +} +void HectorSlamProcessor_update_phectorslam_HectorSlamProcessor_rchectorslam_DataPointContainer_Sl_Eigen_Vector2f_Sg__rcEigen_Vector3f(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3) { + return _wrap_HectorSlamProcessor_update_phectorslam_HectorSlamProcessor_rchectorslam_DataPointContainer_Sl_Eigen_Vector2f_Sg__rcEigen_Vector3f(carg1, carg2, carg3); +} +void HectorSlamProcessor_reset(SwigObj * carg1) { + return _wrap_HectorSlamProcessor_reset(carg1); +} +SwigObj * HectorSlamProcessor_getLastScanMatchPose(SwigObj * carg1) { + return _wrap_HectorSlamProcessor_getLastScanMatchPose(carg1); +} +SwigObj * HectorSlamProcessor_getLastScanMatchCovariance(SwigObj * carg1) { + return _wrap_HectorSlamProcessor_getLastScanMatchCovariance(carg1); +} +float HectorSlamProcessor_getScaleToMap(SwigObj * carg1) { + return _wrap_HectorSlamProcessor_getScaleToMap(carg1); +} +int HectorSlamProcessor_getMapLevels(SwigObj * carg1) { + return _wrap_HectorSlamProcessor_getMapLevels(carg1); +} +SwigObj * HectorSlamProcessor_getGridMap_pchectorslam_HectorSlamProcessor_i(SwigObj * carg1, int carg2) { + return _wrap_HectorSlamProcessor_getGridMap_pchectorslam_HectorSlamProcessor_i(carg1, carg2); +} +SwigObj * HectorSlamProcessor_getGridMap_pchectorslam_HectorSlamProcessor(SwigObj * carg1) { + return _wrap_HectorSlamProcessor_getGridMap_pchectorslam_HectorSlamProcessor(carg1); +} +void HectorSlamProcessor_addMapMutex(SwigObj * carg1, int carg2, SwigObj * carg3) { + return _wrap_HectorSlamProcessor_addMapMutex(carg1, carg2, carg3); +} +/*aaaaaa*/SwigObj * HectorSlamProcessor_getMapMutex(SwigObj * carg1, int carg2) { + return _wrap_HectorSlamProcessor_getMapMutex(carg1, carg2); +} +void HectorSlamProcessor_setUpdateFactorFree(SwigObj * carg1, float carg2) { + return _wrap_HectorSlamProcessor_setUpdateFactorFree(carg1, carg2); +} +void HectorSlamProcessor_setUpdateFactorOccupied(SwigObj * carg1, float carg2) { + return _wrap_HectorSlamProcessor_setUpdateFactorOccupied(carg1, carg2); +} +void HectorSlamProcessor_setMapUpdateMinDistDiff(SwigObj * carg1, float carg2) { + return _wrap_HectorSlamProcessor_setMapUpdateMinDistDiff(carg1, carg2); +} +void HectorSlamProcessor_setMapUpdateMinAngleDiff(SwigObj * carg1, float carg2) { + return _wrap_HectorSlamProcessor_setMapUpdateMinAngleDiff(carg1, carg2); +} +DataPointContainer_Eigen_Vector2f * new_DataPointContainer_Eigen_Vector2f_i(int carg1) { + return _wrap_new_DataPointContainer_Eigen_Vector2f_i(carg1); +} +DataPointContainer_Eigen_Vector2f * new_DataPointContainer_Eigen_Vector2f() { + return _wrap_new_DataPointContainer_Eigen_Vector2f(); +} +void DataPointContainer_Eigen_Vector2f_setFrom(SwigObj * carg1, SwigObj * carg2, float carg3) { + return _wrap_DataPointContainer_Eigen_Vector2f_setFrom(carg1, carg2, carg3); +} +void DataPointContainer_Eigen_Vector2f_add(SwigObj * carg1, SwigObj * carg2) { + return _wrap_DataPointContainer_Eigen_Vector2f_add(carg1, carg2); +} +void DataPointContainer_Eigen_Vector2f_clear(SwigObj * carg1) { + return _wrap_DataPointContainer_Eigen_Vector2f_clear(carg1); +} +int DataPointContainer_Eigen_Vector2f_getSize(SwigObj * carg1) { + return _wrap_DataPointContainer_Eigen_Vector2f_getSize(carg1); +} +SwigObj * DataPointContainer_Eigen_Vector2f_getVecEntry(SwigObj * carg1, int carg2) { + return _wrap_DataPointContainer_Eigen_Vector2f_getVecEntry(carg1, carg2); +} +SwigObj * DataPointContainer_Eigen_Vector2f_getOrigo(SwigObj * carg1) { + return _wrap_DataPointContainer_Eigen_Vector2f_getOrigo(carg1); +} +void DataPointContainer_Eigen_Vector2f_setOrigo(SwigObj * carg1, SwigObj * carg2) { + return _wrap_DataPointContainer_Eigen_Vector2f_setOrigo(carg1, carg2); +} +void delete_DataPointContainer_Eigen_Vector2f(DataPointContainer_Eigen_Vector2f * carg1) { + return _wrap_delete_DataPointContainer_Eigen_Vector2f(carg1); +} +GridMap * new_GridMap(float carg1, SwigObj * carg2, SwigObj * carg3) { + return _wrap_new_GridMap(carg1, carg2, carg3); +} +void delete_GridMap(GridMap * carg1) { + return _wrap_delete_GridMap(carg1); +} +void GridMap_updateSetOccupied(SwigObj * carg1, int carg2) { + return _wrap_GridMap_updateSetOccupied(carg1, carg2); +} +void GridMap_updateSetFree(SwigObj * carg1, int carg2) { + return _wrap_GridMap_updateSetFree(carg1, carg2); +} +void GridMap_updateUnsetFree(SwigObj * carg1, int carg2) { + return _wrap_GridMap_updateUnsetFree(carg1, carg2); +} +float GridMap_getGridProbabilityMap(SwigObj * carg1, int carg2) { + return _wrap_GridMap_getGridProbabilityMap(carg1, carg2); +} +bool GridMap_isOccupied_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i_i(SwigObj * carg1, int carg2, int carg3) { + return _wrap_GridMap_isOccupied_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i_i(carg1, carg2, carg3); +} +bool GridMap_isFree_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i_i(SwigObj * carg1, int carg2, int carg3) { + return _wrap_GridMap_isFree_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i_i(carg1, carg2, carg3); +} +bool GridMap_isOccupied_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i(SwigObj * carg1, int carg2) { + return _wrap_GridMap_isOccupied_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i(carg1, carg2); +} +bool GridMap_isFree_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i(SwigObj * carg1, int carg2) { + return _wrap_GridMap_isFree_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i(carg1, carg2); +} +float GridMap_getObstacleThreshold(SwigObj * carg1) { + return _wrap_GridMap_getObstacleThreshold(carg1); +} +void GridMap_setUpdateFreeFactor(SwigObj * carg1, float carg2) { + return _wrap_GridMap_setUpdateFreeFactor(carg1, carg2); +} +void GridMap_setUpdateOccupiedFactor(SwigObj * carg1, float carg2) { + return _wrap_GridMap_setUpdateOccupiedFactor(carg1, carg2); +} +void GridMap_updateByScan(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3) { + return _wrap_GridMap_updateByScan(carg1, carg2, carg3); +} +void GridMap_updateLineBresenhami_phectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__rcEigen_Vector2i_rcEigen_Vector2i_unsigned_SS_int(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3, unsigned int carg4) { + return _wrap_GridMap_updateLineBresenhami_phectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__rcEigen_Vector2i_rcEigen_Vector2i_unsigned_SS_int(carg1, carg2, carg3, carg4); +} +void GridMap_updateLineBresenhami_phectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__rcEigen_Vector2i_rcEigen_Vector2i(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3) { + return _wrap_GridMap_updateLineBresenhami_phectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__rcEigen_Vector2i_rcEigen_Vector2i(carg1, carg2, carg3); +} +void GridMap_bresenhamCellFree(SwigObj * carg1, unsigned int carg2) { + return _wrap_GridMap_bresenhamCellFree(carg1, carg2); +} +void GridMap_bresenhamCellOcc(SwigObj * carg1, unsigned int carg2) { + return _wrap_GridMap_bresenhamCellOcc(carg1, carg2); +} +void GridMap_bresenham2D(SwigObj * carg1, unsigned int carg2, unsigned int carg3, int carg4, int carg5, int carg6, unsigned int carg7) { + return _wrap_GridMap_bresenham2D(carg1, carg2, carg3, carg4, carg5, carg6, carg7); +} +bool GridMapBase_LogOddsCell_hasGridValue(SwigObj * carg1, int carg2, int carg3) { + return _wrap_GridMapBase_LogOddsCell_hasGridValue(carg1, carg2, carg3); +} +SwigObj * GridMapBase_LogOddsCell_getMapDimensions(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_getMapDimensions(carg1); +} +int GridMapBase_LogOddsCell_getSizeX(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_getSizeX(carg1); +} +int GridMapBase_LogOddsCell_getSizeY(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_getSizeY(carg1); +} +bool GridMapBase_LogOddsCell_pointOutOfMapBounds(SwigObj * carg1, SwigObj * carg2) { + return _wrap_GridMapBase_LogOddsCell_pointOutOfMapBounds(carg1, carg2); +} +void GridMapBase_LogOddsCell_reset(GridMapBase_LogOddsCell * carg1) { + return _wrap_GridMapBase_LogOddsCell_reset(carg1); +} +void GridMapBase_LogOddsCell_clear(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_clear(carg1); +} +SwigObj * GridMapBase_LogOddsCell_getMapDimProperties(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_getMapDimProperties(carg1); +} +GridMapBase_LogOddsCell * new_GridMapBase_LogOddsCell_f_rcEigen_Vector2i_rcEigen_Vector2f(float carg1, SwigObj * carg2, SwigObj * carg3) { + return _wrap_new_GridMapBase_LogOddsCell_f_rcEigen_Vector2i_rcEigen_Vector2f(carg1, carg2, carg3); +} +void delete_GridMapBase_LogOddsCell(GridMapBase_LogOddsCell * carg1) { + return _wrap_delete_GridMapBase_LogOddsCell(carg1); +} +void GridMapBase_LogOddsCell_allocateArray(SwigObj * carg1, SwigObj * carg2) { + return _wrap_GridMapBase_LogOddsCell_allocateArray(carg1, carg2); +} +void GridMapBase_LogOddsCell_deleteArray(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_deleteArray(carg1); +} +SwigObj * GridMapBase_LogOddsCell_getCell_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__i_i(SwigObj * carg1, int carg2, int carg3) { + return _wrap_GridMapBase_LogOddsCell_getCell_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__i_i(carg1, carg2, carg3); +} +SwigObj * GridMapBase_LogOddsCell_getCell_pchectorslam_GridMapBase_Sl_LogOddsCell_Sg__i_i(SwigObj * carg1, int carg2, int carg3) { + return _wrap_GridMapBase_LogOddsCell_getCell_pchectorslam_GridMapBase_Sl_LogOddsCell_Sg__i_i(carg1, carg2, carg3); +} +SwigObj * GridMapBase_LogOddsCell_getCell_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__i(SwigObj * carg1, int carg2) { + return _wrap_GridMapBase_LogOddsCell_getCell_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__i(carg1, carg2); +} +SwigObj * GridMapBase_LogOddsCell_getCell_pchectorslam_GridMapBase_Sl_LogOddsCell_Sg__i(SwigObj * carg1, int carg2) { + return _wrap_GridMapBase_LogOddsCell_getCell_pchectorslam_GridMapBase_Sl_LogOddsCell_Sg__i(carg1, carg2); +} +void GridMapBase_LogOddsCell_setMapGridSize(SwigObj * carg1, SwigObj * carg2) { + return _wrap_GridMapBase_LogOddsCell_setMapGridSize(carg1, carg2); +} +GridMapBase_LogOddsCell * copy_GridMapBase_LogOddsCell(SwigObj * carg1) { + return _wrap_copy_GridMapBase_LogOddsCell(carg1); +} +SwigObj * GridMapBase_LogOddsCell_getWorldCoords(SwigObj * carg1, SwigObj * carg2) { + return _wrap_GridMapBase_LogOddsCell_getWorldCoords(carg1, carg2); +} +SwigObj * GridMapBase_LogOddsCell_getMapCoords(SwigObj * carg1, SwigObj * carg2) { + return _wrap_GridMapBase_LogOddsCell_getMapCoords(carg1, carg2); +} +SwigObj * GridMapBase_LogOddsCell_getWorldCoordsPose(SwigObj * carg1, SwigObj * carg2) { + return _wrap_GridMapBase_LogOddsCell_getWorldCoordsPose(carg1, carg2); +} +SwigObj * GridMapBase_LogOddsCell_getMapCoordsPose(SwigObj * carg1, SwigObj * carg2) { + return _wrap_GridMapBase_LogOddsCell_getMapCoordsPose(carg1, carg2); +} +void GridMapBase_LogOddsCell_setDimensionProperties_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__rcEigen_Vector2f_rcEigen_Vector2i_f(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3, float carg4) { + return _wrap_GridMapBase_LogOddsCell_setDimensionProperties_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__rcEigen_Vector2f_rcEigen_Vector2i_f(carg1, carg2, carg3, carg4); +} +void GridMapBase_LogOddsCell_setDimensionProperties_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__rcMapDimensionProperties(SwigObj * carg1, SwigObj * carg2) { + return _wrap_GridMapBase_LogOddsCell_setDimensionProperties_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__rcMapDimensionProperties(carg1, carg2); +} +void GridMapBase_LogOddsCell_setMapTransformation(SwigObj * carg1, SwigObj * carg2, float carg3) { + return _wrap_GridMapBase_LogOddsCell_setMapTransformation(carg1, carg2, carg3); +} +float GridMapBase_LogOddsCell_getScaleToMap(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_getScaleToMap(carg1); +} +float GridMapBase_LogOddsCell_getCellLength(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_getCellLength(carg1); +} +SwigObj * GridMapBase_LogOddsCell_getWorldTmap(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_getWorldTmap(carg1); +} +SwigObj * GridMapBase_LogOddsCell_getWorldTmap3D(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_getWorldTmap3D(carg1); +} +SwigObj * GridMapBase_LogOddsCell_getMapTworld(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_getMapTworld(carg1); +} +void GridMapBase_LogOddsCell_setUpdated(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_setUpdated(carg1); +} +int GridMapBase_LogOddsCell_getUpdateIndex(SwigObj * carg1) { + return _wrap_GridMapBase_LogOddsCell_getUpdateIndex(carg1); +} + diff --git a/hector_mapping/swig/HectorSlam_proxy.h b/hector_mapping/swig/HectorSlam_proxy.h new file mode 100644 index 00000000..0fbba3cf --- /dev/null +++ b/hector_mapping/swig/HectorSlam_proxy.h @@ -0,0 +1,215 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.6 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ +#ifndef _HectorSlam_proxy_H_ +#define _HectorSlam_proxy_H_ + +/* ----------------------------------------------------------------------------- + * cproxy.swg + * + * Definitions of C specific preprocessor symbols for proxies. + * ----------------------------------------------------------------------------- */ + +#ifndef SWIGIMPORT +# ifndef __GNUC__ +# define __DLL_IMPORT __declspec(dllimport) +# else +# define __DLL_IMPORT __attribute__((dllimport)) extern +# endif +# if !defined (__WIN32__) +# define SWIGIMPORT extern +# else +# define SWIGIMPORT __DLL_IMPORT +# endif +#endif + +#include + +typedef struct { + void *obj; + const char **typenames; +} SwigObj; + + +// special value indicating any type of exception like 'catch(...)' +#define SWIG_AnyException "SWIG_AnyException" + +#include + +SWIGIMPORT jmp_buf SWIG_rt_env; + +SWIGIMPORT struct SWIG_exc_struct { + int code; + char *msg; + SwigObj *klass; +} SWIG_exc; + +SWIGIMPORT void SWIG_rt_try(); +SWIGIMPORT int SWIG_rt_catch(const char *type); +SWIGIMPORT void SWIG_rt_throw(SwigObj *klass, const char * msg); +SWIGIMPORT int SWIG_rt_unhandled(); +SWIGIMPORT void SWIG_rt_endtry(); +SWIGIMPORT int SWIG_exit(int code); + +#define SWIG_try \ + SWIG_rt_try(); \ + if ((SWIG_exc.code = setjmp(SWIG_rt_env)) == 0) +#define SWIG_catch(type) else if (SWIG_rt_catch(#type)) +#define SWIG_throw(klass) SWIG_rt_throw((SwigObj *) klass, 0); +#define SWIG_throw_msg(klass, msg) SWIG_rt_throw((SwigObj *) klass, msg); +#define SWIG_endtry else SWIG_rt_unhandled(); SWIG_rt_endtry(); + + + +#include + +#define SWIG_MAKE_DELETE(Name,Obj) void Name(Obj *op1, ...) {\ + Obj *obj;\ + va_list vl;\ + va_start(vl, op1);\ + do {\ + obj = va_arg(vl, Obj *);\ + delete_##Obj(obj);\ + } while (obj);\ + va_end(vl);\ +} + +/*aaaaaa*/SwigObj * Eigen_Vector2f(float carg1, float carg2); +float Eigen_Vector2f_x(SwigObj * carg1); +float Eigen_Vector2f_y(SwigObj * carg1); +float Eigen_Vector3f_x(SwigObj * carg1); +float Eigen_Vector3f_y(SwigObj * carg1); +float Eigen_Vector3f_z(SwigObj * carg1); +const char * SimdInstructionSetsInUse(); +#define STAGE10_FULL_EIGEN2_API 10 +#define STAGE20_RESOLVE_API_CONFLICTS 20 +#define STAGE30_FULL_EIGEN3_API 30 +#define STAGE40_FULL_EIGEN3_STRICTNESS 40 +#define STAGE99_NO_EIGEN2_SUPPORT 99 +#define EIGEN2_SUPPORT_STAGE 99 + +typedef SwigObj LogOddsCell; + +void LogOddsCell_set(SwigObj * carg1, float carg2); +float LogOddsCell_getValue(SwigObj * carg1); +#include +bool LogOddsCell_isOccupied(SwigObj * carg1); +bool LogOddsCell_isFree(SwigObj * carg1); +void LogOddsCell_resetGridCell(SwigObj * carg1); +void LogOddsCell_logOddsVal_set(SwigObj * carg1, float carg2); +float LogOddsCell_logOddsVal_get(SwigObj * carg1); +void LogOddsCell_updateIndex_set(SwigObj * carg1, int carg2); +int LogOddsCell_updateIndex_get(SwigObj * carg1); +LogOddsCell * new_LogOddsCell(); +void delete_LogOddsCell(LogOddsCell * carg1); + +typedef SwigObj GridMapLogOddsFunctions; + +GridMapLogOddsFunctions * new_GridMapLogOddsFunctions(); +void GridMapLogOddsFunctions_updateSetOccupied(SwigObj * carg1, SwigObj * carg2); +void GridMapLogOddsFunctions_updateSetFree(SwigObj * carg1, SwigObj * carg2); +void GridMapLogOddsFunctions_updateUnsetFree(SwigObj * carg1, SwigObj * carg2); +float GridMapLogOddsFunctions_getGridProbability(SwigObj * carg1, SwigObj * carg2); +void GridMapLogOddsFunctions_setUpdateFreeFactor(SwigObj * carg1, float carg2); +void GridMapLogOddsFunctions_setUpdateOccupiedFactor(SwigObj * carg1, float carg2); +void delete_GridMapLogOddsFunctions(GridMapLogOddsFunctions * carg1); + +typedef SwigObj HectorSlamProcessor; + +HectorSlamProcessor * new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i_pDrawInterface_pHectorDebugInfoInterface(float carg1, int carg2, int carg3, SwigObj * carg4, int carg5, SwigObj * carg6, SwigObj * carg7); +HectorSlamProcessor * new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i_pDrawInterface(float carg1, int carg2, int carg3, SwigObj * carg4, int carg5, SwigObj * carg6); +HectorSlamProcessor * new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i(float carg1, int carg2, int carg3, SwigObj * carg4, int carg5); +void delete_HectorSlamProcessor(HectorSlamProcessor * carg1); +void HectorSlamProcessor_update_phectorslam_HectorSlamProcessor_rchectorslam_DataPointContainer_Sl_Eigen_Vector2f_Sg__rcEigen_Vector3f_b(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3, bool carg4); +void HectorSlamProcessor_update_phectorslam_HectorSlamProcessor_rchectorslam_DataPointContainer_Sl_Eigen_Vector2f_Sg__rcEigen_Vector3f(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3); +void HectorSlamProcessor_reset(SwigObj * carg1); +SwigObj * HectorSlamProcessor_getLastScanMatchPose(SwigObj * carg1); +SwigObj * HectorSlamProcessor_getLastScanMatchCovariance(SwigObj * carg1); +float HectorSlamProcessor_getScaleToMap(SwigObj * carg1); +int HectorSlamProcessor_getMapLevels(SwigObj * carg1); +SwigObj * HectorSlamProcessor_getGridMap_pchectorslam_HectorSlamProcessor_i(SwigObj * carg1, int carg2); +SwigObj * HectorSlamProcessor_getGridMap_pchectorslam_HectorSlamProcessor(SwigObj * carg1); +void HectorSlamProcessor_addMapMutex(SwigObj * carg1, int carg2, SwigObj * carg3); +/*aaaaaa*/SwigObj * HectorSlamProcessor_getMapMutex(SwigObj * carg1, int carg2); +void HectorSlamProcessor_setUpdateFactorFree(SwigObj * carg1, float carg2); +void HectorSlamProcessor_setUpdateFactorOccupied(SwigObj * carg1, float carg2); +void HectorSlamProcessor_setMapUpdateMinDistDiff(SwigObj * carg1, float carg2); +void HectorSlamProcessor_setMapUpdateMinAngleDiff(SwigObj * carg1, float carg2); + +typedef SwigObj DataPointContainer_Eigen_Vector2f; + +DataPointContainer_Eigen_Vector2f * new_DataPointContainer_Eigen_Vector2f_i(int carg1); +DataPointContainer_Eigen_Vector2f * new_DataPointContainer_Eigen_Vector2f(); +void DataPointContainer_Eigen_Vector2f_setFrom(SwigObj * carg1, SwigObj * carg2, float carg3); +void DataPointContainer_Eigen_Vector2f_add(SwigObj * carg1, SwigObj * carg2); +void DataPointContainer_Eigen_Vector2f_clear(SwigObj * carg1); +int DataPointContainer_Eigen_Vector2f_getSize(SwigObj * carg1); +SwigObj * DataPointContainer_Eigen_Vector2f_getVecEntry(SwigObj * carg1, int carg2); +SwigObj * DataPointContainer_Eigen_Vector2f_getOrigo(SwigObj * carg1); +void DataPointContainer_Eigen_Vector2f_setOrigo(SwigObj * carg1, SwigObj * carg2); +void delete_DataPointContainer_Eigen_Vector2f(DataPointContainer_Eigen_Vector2f * carg1); + +typedef SwigObj GridMap; + +GridMap * new_GridMap(float carg1, SwigObj * carg2, SwigObj * carg3); +void delete_GridMap(GridMap * carg1); +void GridMap_updateSetOccupied(SwigObj * carg1, int carg2); +void GridMap_updateSetFree(SwigObj * carg1, int carg2); +void GridMap_updateUnsetFree(SwigObj * carg1, int carg2); +float GridMap_getGridProbabilityMap(SwigObj * carg1, int carg2); +bool GridMap_isOccupied_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i_i(SwigObj * carg1, int carg2, int carg3); +bool GridMap_isFree_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i_i(SwigObj * carg1, int carg2, int carg3); +bool GridMap_isOccupied_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i(SwigObj * carg1, int carg2); +bool GridMap_isFree_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i(SwigObj * carg1, int carg2); +float GridMap_getObstacleThreshold(SwigObj * carg1); +void GridMap_setUpdateFreeFactor(SwigObj * carg1, float carg2); +void GridMap_setUpdateOccupiedFactor(SwigObj * carg1, float carg2); +void GridMap_updateByScan(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3); +void GridMap_updateLineBresenhami_phectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__rcEigen_Vector2i_rcEigen_Vector2i_unsigned_SS_int(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3, unsigned int carg4); +void GridMap_updateLineBresenhami_phectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__rcEigen_Vector2i_rcEigen_Vector2i(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3); +void GridMap_bresenhamCellFree(SwigObj * carg1, unsigned int carg2); +void GridMap_bresenhamCellOcc(SwigObj * carg1, unsigned int carg2); +void GridMap_bresenham2D(SwigObj * carg1, unsigned int carg2, unsigned int carg3, int carg4, int carg5, int carg6, unsigned int carg7); + +typedef SwigObj GridMapBase_LogOddsCell; + +bool GridMapBase_LogOddsCell_hasGridValue(SwigObj * carg1, int carg2, int carg3); +SwigObj * GridMapBase_LogOddsCell_getMapDimensions(SwigObj * carg1); +int GridMapBase_LogOddsCell_getSizeX(SwigObj * carg1); +int GridMapBase_LogOddsCell_getSizeY(SwigObj * carg1); +bool GridMapBase_LogOddsCell_pointOutOfMapBounds(SwigObj * carg1, SwigObj * carg2); +void GridMapBase_LogOddsCell_reset(GridMapBase_LogOddsCell * carg1); +void GridMapBase_LogOddsCell_clear(SwigObj * carg1); +SwigObj * GridMapBase_LogOddsCell_getMapDimProperties(SwigObj * carg1); +GridMapBase_LogOddsCell * new_GridMapBase_LogOddsCell_f_rcEigen_Vector2i_rcEigen_Vector2f(float carg1, SwigObj * carg2, SwigObj * carg3); +void delete_GridMapBase_LogOddsCell(GridMapBase_LogOddsCell * carg1); +void GridMapBase_LogOddsCell_allocateArray(SwigObj * carg1, SwigObj * carg2); +void GridMapBase_LogOddsCell_deleteArray(SwigObj * carg1); +SwigObj * GridMapBase_LogOddsCell_getCell_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__i_i(SwigObj * carg1, int carg2, int carg3); +SwigObj * GridMapBase_LogOddsCell_getCell_pchectorslam_GridMapBase_Sl_LogOddsCell_Sg__i_i(SwigObj * carg1, int carg2, int carg3); +SwigObj * GridMapBase_LogOddsCell_getCell_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__i(SwigObj * carg1, int carg2); +SwigObj * GridMapBase_LogOddsCell_getCell_pchectorslam_GridMapBase_Sl_LogOddsCell_Sg__i(SwigObj * carg1, int carg2); +void GridMapBase_LogOddsCell_setMapGridSize(SwigObj * carg1, SwigObj * carg2); +GridMapBase_LogOddsCell * copy_GridMapBase_LogOddsCell(SwigObj * carg1); +SwigObj * GridMapBase_LogOddsCell_getWorldCoords(SwigObj * carg1, SwigObj * carg2); +SwigObj * GridMapBase_LogOddsCell_getMapCoords(SwigObj * carg1, SwigObj * carg2); +SwigObj * GridMapBase_LogOddsCell_getWorldCoordsPose(SwigObj * carg1, SwigObj * carg2); +SwigObj * GridMapBase_LogOddsCell_getMapCoordsPose(SwigObj * carg1, SwigObj * carg2); +void GridMapBase_LogOddsCell_setDimensionProperties_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__rcEigen_Vector2f_rcEigen_Vector2i_f(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3, float carg4); +void GridMapBase_LogOddsCell_setDimensionProperties_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__rcMapDimensionProperties(SwigObj * carg1, SwigObj * carg2); +void GridMapBase_LogOddsCell_setMapTransformation(SwigObj * carg1, SwigObj * carg2, float carg3); +float GridMapBase_LogOddsCell_getScaleToMap(SwigObj * carg1); +float GridMapBase_LogOddsCell_getCellLength(SwigObj * carg1); +SwigObj * GridMapBase_LogOddsCell_getWorldTmap(SwigObj * carg1); +SwigObj * GridMapBase_LogOddsCell_getWorldTmap3D(SwigObj * carg1); +SwigObj * GridMapBase_LogOddsCell_getMapTworld(SwigObj * carg1); +void GridMapBase_LogOddsCell_setUpdated(SwigObj * carg1); +int GridMapBase_LogOddsCell_getUpdateIndex(SwigObj * carg1); + +#endif /* _HectorSlam_proxy_H_ */ diff --git a/hector_mapping/swig/hector_mapping.i b/hector_mapping/swig/hector_mapping.i new file mode 100644 index 00000000..8ab40cea --- /dev/null +++ b/hector_mapping/swig/hector_mapping.i @@ -0,0 +1,55 @@ +%module HectorSlam +%{ +#define SWIG_FILE_WITH_INIT +%} +%{ +#include +#include + +Eigen::Vector2f * Eigen_Vector2f(float x, float y){ + return new Eigen::Vector2f(x, y); +} +float Eigen_Vector2f_x(Eigen::Vector2f * v){ return v->x(); } +float Eigen_Vector2f_y(Eigen::Vector2f * v){ return v->y(); } + +float Eigen_Vector3f_x(Eigen::Vector3f * v){ return v->x(); } +float Eigen_Vector3f_y(Eigen::Vector3f * v){ return v->y(); } +float Eigen_Vector3f_z(Eigen::Vector3f * v){ return v->z(); } + +#include "include/hector_slam_lib/slam_main/HectorSlamProcessor.h" +#include "include/hector_slam_lib/scan/DataPointContainer.h" +#include "include/hector_slam_lib/map/GridMap.h" +%} + +Eigen::Vector2f * Eigen_Vector2f(float x, float y); +float Eigen_Vector2f_x(Eigen::Vector2f * v); +float Eigen_Vector2f_y(Eigen::Vector2f * v); + +float Eigen_Vector3f_x(Eigen::Vector3f * v); +float Eigen_Vector3f_y(Eigen::Vector3f * v); +float Eigen_Vector3f_z(Eigen::Vector3f * v); + + +/*************************************************************/ +%include +#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW // dummy defined to pass swig +// IGNORE : GridMapBase.h:349:30: error: no match for ‘operator[]’ (operand types are ‘LogOddsCell’ and ‘int’) +%ignore hectorslam::GridMapBase::getMapExtends(int& xMax, int& yMax, int& xMin, int& yMin) const; +%include "include/hector_slam_lib/map/GridMapLogOdds.h" +%include "include/hector_slam_lib/map/GridMapBase.h" +%include "include/hector_slam_lib/map/OccGridMapBase.h" +%include "include/hector_slam_lib/scan/DataPointContainer.h" +%include "include/hector_slam_lib/slam_main/HectorSlamProcessor.h" + +%template(DataPointContainer_Eigen_Vector2f) hectorslam::DataPointContainer; +namespace hectorslam { + %template(GridMap) OccGridMapBase; + %template(GridMapBase_LogOddsCell) GridMapBase; + +} + + + + + + diff --git a/hector_mapping/swig/hector_mappingC_wrap.cxx b/hector_mapping/swig/hector_mappingC_wrap.cxx new file mode 100644 index 00000000..4ee313a0 --- /dev/null +++ b/hector_mapping/swig/hector_mappingC_wrap.cxx @@ -0,0 +1,2303 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.6 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ +template class SwigValueWrapper { + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); + SwigValueWrapper(const SwigValueWrapper& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } +}; + +template T SwigValueInit() { + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + +/* ----------------------------------------------------------------------------- + * clabels.swg + * + * Definitions of C specific preprocessor symbols. + * ----------------------------------------------------------------------------- */ + +// this is used instead of default SWIGEXPORT symbol + +#ifndef SWIGEXPORTC +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) || defined(__APPLE__) +# define SWIGEXPORTC +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORTC __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORTC +# endif +# endif +#endif + +#ifndef SWIGPROTECT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) || defined(__APPLE__) +# define SWIGPROTECT(x) +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGPROTECT(x) __attribute__ ((visibility("protected"))) x +# else +# define SWIGPROTECT(x) +# endif +# endif +#endif + + + +#include +#include +#include +#include + +#define SWIG_STR(x) #x +#define SWIG_contract_assert(expr, msg) if(!(expr)) { printf("%s\n", msg); SWIG_exit(0); } else + + +typedef struct { + void *obj; + const char **typenames; +} SwigObj; + + +#define SWIG_MAX_RT_STACK 256 +#define SWIG_REGISTRY_INIT 256 + +SWIGINTERN SwigObj **SWIG_registry_base = 0; +SWIGINTERN SwigObj **SWIG_registry = 0; +SWIGINTERN int SWIG_registry_size = SWIG_REGISTRY_INIT; + +SWIGINTERN SwigObj *SWIG_create_object(const char *classname); +SWIGINTERN void SWIG_destroy_object(SwigObj *object); +SWIGINTERN void SWIG_free_SwigObj(SwigObj *object); + +SWIGEXPORTC struct SWIG_exc_struct { + int code; + char *msg; + SwigObj *klass; + int handled; +} SWIG_exc = { 0, 0, 0, 0 }; + +SWIGEXPORTC jmp_buf SWIG_rt_env; +SWIGEXPORTC int SWIG_rt_init = 0; +SWIGINTERN jmp_buf SWIG_cpp_back_env; +SWIGINTERN jmp_buf *SWIG_rt_stack_base = 0; +SWIGINTERN jmp_buf *SWIG_rt_stack_ptr = 0; + +SWIGINTERN void SWIG_rt_stack_push() { + // TODO: check for stack overflow + memcpy(SWIG_rt_stack_ptr, SWIG_rt_env, sizeof(SWIG_rt_env)); + SWIG_rt_stack_ptr++; +} + +SWIGINTERN void SWIG_rt_stack_pop() { + if (SWIG_rt_stack_ptr == SWIG_rt_stack_base) + return; + SWIG_rt_stack_ptr--; + memcpy(SWIG_rt_env, SWIG_rt_stack_ptr, sizeof(SWIG_rt_env)); +} + +SWIGINTERN void SWIG_add_registry_entry(SwigObj *entry) { + if (SWIG_registry_base == 0) { + SWIG_registry_base = SWIG_registry = (SwigObj **) malloc(SWIG_registry_size * sizeof(SwigObj *)); + memset(SWIG_registry_base, 0, SWIG_registry_size * sizeof(SwigObj *)); + } + *SWIG_registry = entry; + SWIG_registry++; + if ((SWIG_registry - SWIG_registry_base) == SWIG_registry_size) { + SWIG_registry = SWIG_registry_base; + SWIG_registry_size += SWIG_REGISTRY_INIT; + int new_size = SWIG_registry_size * sizeof(SwigObj *); + SWIG_registry_base = (SwigObj **) malloc(new_size); + memset(SWIG_registry_base, 0, new_size); + memcpy(SWIG_registry_base, SWIG_registry, (SWIG_registry_size - SWIG_REGISTRY_INIT) * sizeof(SwigObj *)); + free(SWIG_registry); + SWIG_registry = SWIG_registry_base + (SWIG_registry_size - SWIG_REGISTRY_INIT); + } +} + +SWIGINTERN void SWIG_remove_registry_entry(SwigObj *entry) { + int i; + for (i = 0; i < SWIG_registry_size; ++i) { + if (*(SWIG_registry_base + i) == entry) { + *(SWIG_registry_base + i) = 0; + break; + } + } +} + +SWIGINTERN void SWIG_free_SwigObj(SwigObj *object) { + if (object) { + if (object->typenames) + free(object->typenames); + free(object); + object = (SwigObj *) 0; + } +} + +SWIGINTERN void SWIG_cleanup() { + if (SWIG_rt_stack_base) + free(SWIG_rt_stack_base); + if (SWIG_exc.msg) + free(SWIG_exc.msg); + if (SWIG_exc.klass) { + if (SWIG_exc.klass->typenames) + free(SWIG_exc.klass->typenames); + free(SWIG_exc.klass); + } + int i; + if (SWIG_registry_base) { + for (i = 0; i < SWIG_registry_size; ++i) { + if (*(SWIG_registry_base + i)) { + SWIG_free_SwigObj(*(SWIG_registry_base + i)); + *(SWIG_registry_base + i) = 0; + } + } + } + free(SWIG_registry_base); + SWIG_registry_base = 0; +} + +#ifdef __cplusplus +extern "C" { +#endif + +SWIGEXPORTC void SWIG_rt_try() { + SWIG_rt_stack_push(); +} + +SWIGEXPORTC int SWIG_rt_catch(const char *type) { + int result = 0; + if (!type || (strcmp("SWIG_AnyException", type) == 0)) { + result = 1; + } + else if (SWIG_exc.klass) { + int i = 0; + while (SWIG_exc.klass->typenames[i]) { + if (strcmp(SWIG_exc.klass->typenames[i++], type) == 0) { + result = 1; + break; + } + } + } + if (result) { + SWIG_rt_stack_pop(); + SWIG_exc.handled = 1; + } + return result; +} + +SWIGEXPORTC void SWIG_rt_throw(SwigObj *klass, const char *msg) { + if (SWIG_exc.msg) { + free(SWIG_exc.msg); + SWIG_exc.msg = (char *) 0; + } + if (msg) { + SWIG_exc.msg = (char *) malloc(strlen(msg) + 1); + strcpy(SWIG_exc.msg, msg); + } + SWIG_exc.klass = klass; + SWIG_exc.handled = 0; + longjmp(SWIG_rt_env, 1); +} + +SWIGEXPORTC void SWIG_rt_unhandled() { + if (SWIG_exc.msg) { + free(SWIG_exc.msg); + SWIG_exc.msg = 0; + } + SWIG_rt_stack_pop(); + longjmp(SWIG_rt_env, SWIG_exc.code); +} + +SWIGEXPORTC void SWIG_rt_endtry() { + if (SWIG_exc.handled) { + if (setjmp(SWIG_rt_env) == 0) { + SWIG_rt_stack_push(); + longjmp(SWIG_cpp_back_env, 1); + } + } + else { + SWIG_rt_stack_pop(); // pop the SWIG_try context + } +} + +SWIGEXPORTC int SWIG_exit(int code) { + SWIG_cleanup(); + exit(code); +} + +#ifdef __cplusplus +} +#endif + +SWIGINTERN void SWIG_terminate() { + fprintf(stderr, "Unhandled exception: %s\n%s\nExitting...\n", + SWIG_exc.klass->typenames[0], + SWIG_exc.msg ? SWIG_exc.msg : ""); + SWIG_exit(SWIG_exc.code); +} + +SWIGINTERN void SWIG_runtime_init() { + int i, code; + if (!SWIG_rt_init) { + SWIG_rt_init = 1; + SWIG_rt_stack_base = SWIG_rt_stack_ptr = (jmp_buf *) malloc(sizeof(jmp_buf) * SWIG_MAX_RT_STACK); + if (SWIG_exc.code = setjmp(SWIG_rt_env)) { + // deallocate C++ exception + if (setjmp(SWIG_rt_env) == 0) { + SWIG_rt_stack_push(); + SWIG_exc.handled = 1; + longjmp(SWIG_cpp_back_env, 1); + } + SWIG_terminate(); + } + } +} + +#define SWIG_CThrowException(klass, msg) \ + if (setjmp(SWIG_cpp_back_env) == 0) \ + SWIG_rt_throw((SwigObj *) klass, msg); + + + SwigObj *SWIG_temporary = (SwigObj *) malloc(sizeof(SwigObj)); + + +#define SWIG_FILE_WITH_INIT + + +#include +#include + +Eigen::Vector2f * Eigen_Vector2f(float x, float y){ + return new Eigen::Vector2f(x, y); +} +float Eigen_Vector2f_x(Eigen::Vector2f * v){ return v->x(); } +float Eigen_Vector2f_y(Eigen::Vector2f * v){ return v->y(); } + +float Eigen_Vector3f_x(Eigen::Vector3f * v){ return v->x(); } +float Eigen_Vector3f_y(Eigen::Vector3f * v){ return v->y(); } +float Eigen_Vector3f_z(Eigen::Vector3f * v){ return v->z(); } + +#include "include/hector_slam_lib/slam_main/HectorSlamProcessor.h" +#include "include/hector_slam_lib/scan/DataPointContainer.h" +#include "include/hector_slam_lib/map/GridMap.h" + +SWIGPROTECT(Eigen::Vector2f * Eigen_Vector2f(float x,float y);) + +SWIGPROTECT(float Eigen_Vector2f_x(Eigen::Vector2f *v);) + +SWIGPROTECT(float Eigen_Vector2f_y(Eigen::Vector2f *v);) + +SWIGPROTECT(float Eigen_Vector3f_x(Eigen::Vector3f *v);) + +SWIGPROTECT(float Eigen_Vector3f_y(Eigen::Vector3f *v);) + +SWIGPROTECT(float Eigen_Vector3f_z(Eigen::Vector3f *v);) + +SWIGPROTECT(char const * SimdInstructionSetsInUse(void);) + +const char* Swig_typename_LogOddsCell = "LogOddsCell"; + +const char* Swig_typename_GridMapLogOddsFunctions = "GridMapLogOddsFunctions"; + +const char* Swig_typename_HectorSlamProcessor = "hectorslam::HectorSlamProcessor"; + +const char* Swig_typename_DataPointContainer_Eigen_Vector2f = "hectorslam::DataPointContainer<(Eigen::Vector2f)>"; + +const char* Swig_typename_GridMap = "hectorslam::OccGridMapBase<(LogOddsCell,GridMapLogOddsFunctions)>"; + +const char* Swig_typename_GridMapBase_LogOddsCell = "hectorslam::GridMapBase<(LogOddsCell)>"; + + +SWIGINTERN SwigObj *SWIG_create_object(const char *classname) { +SWIG_runtime_init(); +SwigObj *result; +result = (SwigObj *) malloc(sizeof(SwigObj)); +result->obj = 0; +if (strcmp(classname, "LogOddsCell") == 0) { +result->typenames = (const char **) malloc(2*sizeof(const char*)); +result->typenames[0] = Swig_typename_LogOddsCell; +result->typenames[1] = 0; +} +if (strcmp(classname, "GridMapLogOddsFunctions") == 0) { +result->typenames = (const char **) malloc(2*sizeof(const char*)); +result->typenames[0] = Swig_typename_GridMapLogOddsFunctions; +result->typenames[1] = 0; +} +if (strcmp(classname, "hectorslam::HectorSlamProcessor") == 0) { +result->typenames = (const char **) malloc(2*sizeof(const char*)); +result->typenames[0] = Swig_typename_HectorSlamProcessor; +result->typenames[1] = 0; +} +if (strcmp(classname, "hectorslam::DataPointContainer<(Eigen::Vector2f)>") == 0) { +result->typenames = (const char **) malloc(2*sizeof(const char*)); +result->typenames[0] = Swig_typename_DataPointContainer_Eigen_Vector2f; +result->typenames[1] = 0; +} +if (strcmp(classname, "hectorslam::OccGridMapBase<(LogOddsCell,GridMapLogOddsFunctions)>") == 0) { +result->typenames = (const char **) malloc(2*sizeof(const char*)); +result->typenames[0] = Swig_typename_GridMap; +result->typenames[1] = 0; +} +if (strcmp(classname, "hectorslam::GridMapBase<(LogOddsCell)>") == 0) { +result->typenames = (const char **) malloc(2*sizeof(const char*)); +result->typenames[0] = Swig_typename_GridMapBase_LogOddsCell; +result->typenames[1] = 0; +} +SWIG_add_registry_entry(result); +return result; +} + + +SWIGINTERN void SWIG_destroy_object(SwigObj *object) { +if (object) { +if (object->typenames) { +if (strcmp(object->typenames[0], "LogOddsCell") == 0) { +if (object->obj) +delete (LogOddsCell *) (object->obj); +} +if (strcmp(object->typenames[0], "GridMapLogOddsFunctions") == 0) { +if (object->obj) +delete (GridMapLogOddsFunctions *) (object->obj); +} +if (strcmp(object->typenames[0], "hectorslam::HectorSlamProcessor") == 0) { +if (object->obj) +delete (hectorslam::HectorSlamProcessor *) (object->obj); +} +if (strcmp(object->typenames[0], "hectorslam::DataPointContainer<(Eigen::Vector2f)>") == 0) { +if (object->obj) +delete (hectorslam::DataPointContainer< Eigen::Vector2f > *) (object->obj); +} +if (strcmp(object->typenames[0], "hectorslam::OccGridMapBase<(LogOddsCell,GridMapLogOddsFunctions)>") == 0) { +if (object->obj) +delete (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) (object->obj); +} +if (strcmp(object->typenames[0], "hectorslam::GridMapBase<(LogOddsCell)>") == 0) { +if (object->obj) +delete (hectorslam::GridMapBase< LogOddsCell > *) (object->obj); +} +SWIG_free_SwigObj(object); +} +} +} +#ifdef __cplusplus +extern "C" { +#endif + + SWIGEXPORTC /*aaaaaa*/SwigObj * _wrap_Eigen_Vector2f(float carg1, float carg2) { + Eigen::Vector2f * cppresult; + float arg1 ; + float arg2 ; + /*aaaaaa*/SwigObj * result; + + arg1 = (float) carg1; + arg2 = (float) carg2; + cppresult = (Eigen::Vector2f *)Eigen_Vector2f(arg1,arg2); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Vector2f)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC float _wrap_Eigen_Vector2f_x(SwigObj * carg1) { + float cppresult; + Eigen::Vector2f *arg1 = (Eigen::Vector2f *) 0 ; + float result; + + { + if (carg1) + arg1 = (Eigen::Vector2f *) carg1->obj; + } + cppresult = (float)Eigen_Vector2f_x(arg1); + result = cppresult; + return result; + } + + + SWIGEXPORTC float _wrap_Eigen_Vector2f_y(SwigObj * carg1) { + float cppresult; + Eigen::Vector2f *arg1 = (Eigen::Vector2f *) 0 ; + float result; + + { + if (carg1) + arg1 = (Eigen::Vector2f *) carg1->obj; + } + cppresult = (float)Eigen_Vector2f_y(arg1); + result = cppresult; + return result; + } + + + SWIGEXPORTC float _wrap_Eigen_Vector3f_x(SwigObj * carg1) { + float cppresult; + Eigen::Vector3f *arg1 = (Eigen::Vector3f *) 0 ; + float result; + + { + if (carg1) + arg1 = (Eigen::Vector3f *) carg1->obj; + } + cppresult = (float)Eigen_Vector3f_x(arg1); + result = cppresult; + return result; + } + + + SWIGEXPORTC float _wrap_Eigen_Vector3f_y(SwigObj * carg1) { + float cppresult; + Eigen::Vector3f *arg1 = (Eigen::Vector3f *) 0 ; + float result; + + { + if (carg1) + arg1 = (Eigen::Vector3f *) carg1->obj; + } + cppresult = (float)Eigen_Vector3f_y(arg1); + result = cppresult; + return result; + } + + + SWIGEXPORTC float _wrap_Eigen_Vector3f_z(SwigObj * carg1) { + float cppresult; + Eigen::Vector3f *arg1 = (Eigen::Vector3f *) 0 ; + float result; + + { + if (carg1) + arg1 = (Eigen::Vector3f *) carg1->obj; + } + cppresult = (float)Eigen_Vector3f_z(arg1); + result = cppresult; + return result; + } + + + SWIGEXPORTC const char * _wrap_SimdInstructionSetsInUse() { + const char * cppresult; + const char * result; + + cppresult = (char *)Eigen::SimdInstructionSetsInUse(); + result = (char *) cppresult; + return result; + } + + + SWIGEXPORTC void _wrap_LogOddsCell_set(SwigObj * carg1, float carg2) { + LogOddsCell *arg1 = (LogOddsCell *) 0 ; + float arg2 ; + + { + if (carg1) + arg1 = (LogOddsCell *) carg1->obj; + } + arg2 = (float) carg2; + (arg1)->set(arg2); + } + + + SWIGEXPORTC float _wrap_LogOddsCell_getValue(SwigObj * carg1) { + float cppresult; + LogOddsCell *arg1 = (LogOddsCell *) 0 ; + float result; + + { + if (carg1) + arg1 = (LogOddsCell *) carg1->obj; + } + cppresult = (float)((LogOddsCell const *)arg1)->getValue(); + result = cppresult; + return result; + } + + + SWIGEXPORTC bool _wrap_LogOddsCell_isOccupied(SwigObj * carg1) { + bool cppresult; + LogOddsCell *arg1 = (LogOddsCell *) 0 ; + bool result; + + { + if (carg1) + arg1 = (LogOddsCell *) carg1->obj; + } + cppresult = (bool)((LogOddsCell const *)arg1)->isOccupied(); + result = (bool) cppresult; + return result; + } + + + SWIGEXPORTC bool _wrap_LogOddsCell_isFree(SwigObj * carg1) { + bool cppresult; + LogOddsCell *arg1 = (LogOddsCell *) 0 ; + bool result; + + { + if (carg1) + arg1 = (LogOddsCell *) carg1->obj; + } + cppresult = (bool)((LogOddsCell const *)arg1)->isFree(); + result = (bool) cppresult; + return result; + } + + + SWIGEXPORTC void _wrap_LogOddsCell_resetGridCell(SwigObj * carg1) { + LogOddsCell *arg1 = (LogOddsCell *) 0 ; + + { + if (carg1) + arg1 = (LogOddsCell *) carg1->obj; + } + (arg1)->resetGridCell(); + } + + + SWIGEXPORTC void _wrap_LogOddsCell_logOddsVal_set(SwigObj * carg1, float carg2) { + LogOddsCell *arg1 = (LogOddsCell *) 0 ; + float arg2 ; + + { + if (carg1) + arg1 = (LogOddsCell *) carg1->obj; + } + arg2 = (float) carg2; + if (arg1) (arg1)->logOddsVal = arg2; + } + + + SWIGEXPORTC float _wrap_LogOddsCell_logOddsVal_get(SwigObj * carg1) { + float cppresult; + LogOddsCell *arg1 = (LogOddsCell *) 0 ; + float result; + + { + if (carg1) + arg1 = (LogOddsCell *) carg1->obj; + } + cppresult = (float) ((arg1)->logOddsVal); + result = cppresult; + return result; + } + + + SWIGEXPORTC void _wrap_LogOddsCell_updateIndex_set(SwigObj * carg1, int carg2) { + LogOddsCell *arg1 = (LogOddsCell *) 0 ; + int arg2 ; + + { + if (carg1) + arg1 = (LogOddsCell *) carg1->obj; + } + arg2 = (int) carg2; + if (arg1) (arg1)->updateIndex = arg2; + } + + + SWIGEXPORTC int _wrap_LogOddsCell_updateIndex_get(SwigObj * carg1) { + int cppresult; + LogOddsCell *arg1 = (LogOddsCell *) 0 ; + int result; + + { + if (carg1) + arg1 = (LogOddsCell *) carg1->obj; + } + cppresult = (int) ((arg1)->updateIndex); + result = cppresult; + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_new_LogOddsCell() { + SwigObj * result; + + result = SWIG_create_object("LogOddsCell"); + result->obj = (void*) new LogOddsCell(); + + return result; + } + + + SWIGEXPORTC void _wrap_delete_LogOddsCell(SwigObj * carg1) { + SWIG_remove_registry_entry(carg1); + SWIG_destroy_object(carg1); + } + + + SWIGEXPORTC SwigObj * _wrap_new_GridMapLogOddsFunctions() { + SwigObj * result; + + result = SWIG_create_object("GridMapLogOddsFunctions"); + result->obj = (void*) new GridMapLogOddsFunctions(); + + return result; + } + + + SWIGEXPORTC void _wrap_GridMapLogOddsFunctions_updateSetOccupied(SwigObj * carg1, SwigObj * carg2) { + GridMapLogOddsFunctions *arg1 = (GridMapLogOddsFunctions *) 0 ; + LogOddsCell *arg2 = 0 ; + + { + if (carg1) + arg1 = (GridMapLogOddsFunctions *) carg1->obj; + } + { + if (carg2) + arg2 = (LogOddsCell *) carg2->obj; + else + arg2 = (LogOddsCell *) 0; + } + ((GridMapLogOddsFunctions const *)arg1)->updateSetOccupied(*arg2); + } + + + SWIGEXPORTC void _wrap_GridMapLogOddsFunctions_updateSetFree(SwigObj * carg1, SwigObj * carg2) { + GridMapLogOddsFunctions *arg1 = (GridMapLogOddsFunctions *) 0 ; + LogOddsCell *arg2 = 0 ; + + { + if (carg1) + arg1 = (GridMapLogOddsFunctions *) carg1->obj; + } + { + if (carg2) + arg2 = (LogOddsCell *) carg2->obj; + else + arg2 = (LogOddsCell *) 0; + } + ((GridMapLogOddsFunctions const *)arg1)->updateSetFree(*arg2); + } + + + SWIGEXPORTC void _wrap_GridMapLogOddsFunctions_updateUnsetFree(SwigObj * carg1, SwigObj * carg2) { + GridMapLogOddsFunctions *arg1 = (GridMapLogOddsFunctions *) 0 ; + LogOddsCell *arg2 = 0 ; + + { + if (carg1) + arg1 = (GridMapLogOddsFunctions *) carg1->obj; + } + { + if (carg2) + arg2 = (LogOddsCell *) carg2->obj; + else + arg2 = (LogOddsCell *) 0; + } + ((GridMapLogOddsFunctions const *)arg1)->updateUnsetFree(*arg2); + } + + + SWIGEXPORTC float _wrap_GridMapLogOddsFunctions_getGridProbability(SwigObj * carg1, SwigObj * carg2) { + float cppresult; + GridMapLogOddsFunctions *arg1 = (GridMapLogOddsFunctions *) 0 ; + LogOddsCell *arg2 = 0 ; + float result; + + { + if (carg1) + arg1 = (GridMapLogOddsFunctions *) carg1->obj; + } + { + if (carg2) + arg2 = (LogOddsCell *) carg2->obj; + else + arg2 = (LogOddsCell *) 0; + } + cppresult = (float)((GridMapLogOddsFunctions const *)arg1)->getGridProbability((LogOddsCell const &)*arg2); + result = cppresult; + return result; + } + + + SWIGEXPORTC void _wrap_GridMapLogOddsFunctions_setUpdateFreeFactor(SwigObj * carg1, float carg2) { + GridMapLogOddsFunctions *arg1 = (GridMapLogOddsFunctions *) 0 ; + float arg2 ; + + { + if (carg1) + arg1 = (GridMapLogOddsFunctions *) carg1->obj; + } + arg2 = (float) carg2; + (arg1)->setUpdateFreeFactor(arg2); + } + + + SWIGEXPORTC void _wrap_GridMapLogOddsFunctions_setUpdateOccupiedFactor(SwigObj * carg1, float carg2) { + GridMapLogOddsFunctions *arg1 = (GridMapLogOddsFunctions *) 0 ; + float arg2 ; + + { + if (carg1) + arg1 = (GridMapLogOddsFunctions *) carg1->obj; + } + arg2 = (float) carg2; + (arg1)->setUpdateOccupiedFactor(arg2); + } + + + SWIGEXPORTC void _wrap_delete_GridMapLogOddsFunctions(SwigObj * carg1) { + SWIG_remove_registry_entry(carg1); + SWIG_destroy_object(carg1); + } + + + SWIGEXPORTC SwigObj * _wrap_new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i_pDrawInterface_pHectorDebugInfoInterface(float carg1, int carg2, int carg3, SwigObj * carg4, int carg5, SwigObj * carg6, SwigObj * carg7) { + float arg1 ; + int arg2 ; + int arg3 ; + Eigen::Vector2f *arg4 = 0 ; + int arg5 ; + DrawInterface *arg6 = (DrawInterface *) 0 ; + HectorDebugInfoInterface *arg7 = (HectorDebugInfoInterface *) 0 ; + SwigObj * result; + + arg1 = (float) carg1; + arg2 = (int) carg2; + arg3 = (int) carg3; + { + if (carg4) + arg4 = (Eigen::Vector2f *) carg4->obj; + else + arg4 = (Eigen::Vector2f *) 0; + } + arg5 = (int) carg5; + { + if (carg6) + arg6 = (DrawInterface *) carg6->obj; + } + { + if (carg7) + arg7 = (HectorDebugInfoInterface *) carg7->obj; + } + result = SWIG_create_object("hectorslam::HectorSlamProcessor"); + result->obj = (void*) new hectorslam::HectorSlamProcessor(arg1,arg2,arg3,(Eigen::Vector2f const &)*arg4,arg5,arg6,arg7); + + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i_pDrawInterface(float carg1, int carg2, int carg3, SwigObj * carg4, int carg5, SwigObj * carg6) { + float arg1 ; + int arg2 ; + int arg3 ; + Eigen::Vector2f *arg4 = 0 ; + int arg5 ; + DrawInterface *arg6 = (DrawInterface *) 0 ; + SwigObj * result; + + arg1 = (float) carg1; + arg2 = (int) carg2; + arg3 = (int) carg3; + { + if (carg4) + arg4 = (Eigen::Vector2f *) carg4->obj; + else + arg4 = (Eigen::Vector2f *) 0; + } + arg5 = (int) carg5; + { + if (carg6) + arg6 = (DrawInterface *) carg6->obj; + } + result = SWIG_create_object("hectorslam::HectorSlamProcessor"); + result->obj = (void*) new hectorslam::HectorSlamProcessor(arg1,arg2,arg3,(Eigen::Vector2f const &)*arg4,arg5,arg6); + + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i(float carg1, int carg2, int carg3, SwigObj * carg4, int carg5) { + float arg1 ; + int arg2 ; + int arg3 ; + Eigen::Vector2f *arg4 = 0 ; + int arg5 ; + SwigObj * result; + + arg1 = (float) carg1; + arg2 = (int) carg2; + arg3 = (int) carg3; + { + if (carg4) + arg4 = (Eigen::Vector2f *) carg4->obj; + else + arg4 = (Eigen::Vector2f *) 0; + } + arg5 = (int) carg5; + result = SWIG_create_object("hectorslam::HectorSlamProcessor"); + result->obj = (void*) new hectorslam::HectorSlamProcessor(arg1,arg2,arg3,(Eigen::Vector2f const &)*arg4,arg5); + + return result; + } + + + SWIGEXPORTC void _wrap_delete_HectorSlamProcessor(SwigObj * carg1) { + SWIG_remove_registry_entry(carg1); + SWIG_destroy_object(carg1); + } + + + SWIGEXPORTC void _wrap_HectorSlamProcessor_update_phectorslam_HectorSlamProcessor_rchectorslam_DataPointContainer_Sl_Eigen_Vector2f_Sg__rcEigen_Vector3f_b(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3, bool carg4) { + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + hectorslam::DataContainer *arg2 = 0 ; + Eigen::Vector3f *arg3 = 0 ; + bool arg4 ; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + { + if (carg2) + arg2 = (hectorslam::DataContainer *) carg2->obj; + else + arg2 = (hectorslam::DataContainer *) 0; + } + { + if (carg3) + arg3 = (Eigen::Vector3f *) carg3->obj; + else + arg3 = (Eigen::Vector3f *) 0; + } + arg4 = (bool) carg4; + (arg1)->update((hectorslam::DataContainer const &)*arg2,(Eigen::Vector3f const &)*arg3,arg4); + } + + + SWIGEXPORTC void _wrap_HectorSlamProcessor_update_phectorslam_HectorSlamProcessor_rchectorslam_DataPointContainer_Sl_Eigen_Vector2f_Sg__rcEigen_Vector3f(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3) { + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + hectorslam::DataContainer *arg2 = 0 ; + Eigen::Vector3f *arg3 = 0 ; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + { + if (carg2) + arg2 = (hectorslam::DataContainer *) carg2->obj; + else + arg2 = (hectorslam::DataContainer *) 0; + } + { + if (carg3) + arg3 = (Eigen::Vector3f *) carg3->obj; + else + arg3 = (Eigen::Vector3f *) 0; + } + (arg1)->update((hectorslam::DataContainer const &)*arg2,(Eigen::Vector3f const &)*arg3); + } + + + SWIGEXPORTC void _wrap_HectorSlamProcessor_reset(SwigObj * carg1) { + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + (arg1)->reset(); + } + + + SWIGEXPORTC SwigObj * _wrap_HectorSlamProcessor_getLastScanMatchPose(SwigObj * carg1) { + Eigen::Vector3f * cppresult; + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + cppresult = (Eigen::Vector3f *) &((hectorslam::HectorSlamProcessor const *)arg1)->getLastScanMatchPose(); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Vector3f)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_HectorSlamProcessor_getLastScanMatchCovariance(SwigObj * carg1) { + Eigen::Matrix3f * cppresult; + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + cppresult = (Eigen::Matrix3f *) &((hectorslam::HectorSlamProcessor const *)arg1)->getLastScanMatchCovariance(); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Matrix3f)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC float _wrap_HectorSlamProcessor_getScaleToMap(SwigObj * carg1) { + float cppresult; + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + float result; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + cppresult = (float)((hectorslam::HectorSlamProcessor const *)arg1)->getScaleToMap(); + result = cppresult; + return result; + } + + + SWIGEXPORTC int _wrap_HectorSlamProcessor_getMapLevels(SwigObj * carg1) { + int cppresult; + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + int result; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + cppresult = (int)((hectorslam::HectorSlamProcessor const *)arg1)->getMapLevels(); + result = cppresult; + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_HectorSlamProcessor_getGridMap_pchectorslam_HectorSlamProcessor_i(SwigObj * carg1, int carg2) { + GridMap * cppresult; + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + int arg2 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + arg2 = (int) carg2; + cppresult = (GridMap *) &((hectorslam::HectorSlamProcessor const *)arg1)->getGridMap(arg2); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(GridMap)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_HectorSlamProcessor_getGridMap_pchectorslam_HectorSlamProcessor(SwigObj * carg1) { + GridMap * cppresult; + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + cppresult = (GridMap *) &((hectorslam::HectorSlamProcessor const *)arg1)->getGridMap(); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(GridMap)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC void _wrap_HectorSlamProcessor_addMapMutex(SwigObj * carg1, int carg2, SwigObj * carg3) { + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + int arg2 ; + MapLockerInterface *arg3 = (MapLockerInterface *) 0 ; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + arg2 = (int) carg2; + { + if (carg3) + arg3 = (MapLockerInterface *) carg3->obj; + } + (arg1)->addMapMutex(arg2,arg3); + } + + + SWIGEXPORTC /*aaaaaa*/SwigObj * _wrap_HectorSlamProcessor_getMapMutex(SwigObj * carg1, int carg2) { + MapLockerInterface * cppresult; + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + int arg2 ; + /*aaaaaa*/SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + arg2 = (int) carg2; + cppresult = (MapLockerInterface *)(arg1)->getMapMutex(arg2); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(MapLockerInterface)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC void _wrap_HectorSlamProcessor_setUpdateFactorFree(SwigObj * carg1, float carg2) { + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + float arg2 ; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + arg2 = (float) carg2; + (arg1)->setUpdateFactorFree(arg2); + } + + + SWIGEXPORTC void _wrap_HectorSlamProcessor_setUpdateFactorOccupied(SwigObj * carg1, float carg2) { + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + float arg2 ; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + arg2 = (float) carg2; + (arg1)->setUpdateFactorOccupied(arg2); + } + + + SWIGEXPORTC void _wrap_HectorSlamProcessor_setMapUpdateMinDistDiff(SwigObj * carg1, float carg2) { + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + float arg2 ; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + arg2 = (float) carg2; + (arg1)->setMapUpdateMinDistDiff(arg2); + } + + + SWIGEXPORTC void _wrap_HectorSlamProcessor_setMapUpdateMinAngleDiff(SwigObj * carg1, float carg2) { + hectorslam::HectorSlamProcessor *arg1 = (hectorslam::HectorSlamProcessor *) 0 ; + float arg2 ; + + { + if (carg1) + arg1 = (hectorslam::HectorSlamProcessor *) carg1->obj; + } + arg2 = (float) carg2; + (arg1)->setMapUpdateMinAngleDiff(arg2); + } + + + SWIGEXPORTC SwigObj * _wrap_new_DataPointContainer_Eigen_Vector2f_i(int carg1) { + int arg1 ; + SwigObj * result; + + arg1 = (int) carg1; + result = SWIG_create_object("hectorslam::DataPointContainer<(Eigen::Vector2f)>"); + result->obj = (void*) new hectorslam::DataPointContainer< Eigen::Vector2f >(arg1); + + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_new_DataPointContainer_Eigen_Vector2f() { + SwigObj * result; + + result = SWIG_create_object("hectorslam::DataPointContainer<(Eigen::Vector2f)>"); + result->obj = (void*) new hectorslam::DataPointContainer< Eigen::Vector2f >(); + + return result; + } + + + SWIGEXPORTC void _wrap_DataPointContainer_Eigen_Vector2f_setFrom(SwigObj * carg1, SwigObj * carg2, float carg3) { + hectorslam::DataPointContainer< Eigen::Vector2f > *arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) 0 ; + hectorslam::DataPointContainer< Eigen::Vector2f > *arg2 = 0 ; + float arg3 ; + + { + if (carg1) + arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) carg1->obj; + } + { + if (carg2) + arg2 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) carg2->obj; + else + arg2 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) 0; + } + arg3 = (float) carg3; + (arg1)->setFrom((hectorslam::DataPointContainer< Eigen::Vector2f > const &)*arg2,arg3); + } + + + SWIGEXPORTC void _wrap_DataPointContainer_Eigen_Vector2f_add(SwigObj * carg1, SwigObj * carg2) { + hectorslam::DataPointContainer< Eigen::Vector2f > *arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) 0 ; + Eigen::Vector2f *arg2 = 0 ; + + { + if (carg1) + arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector2f *) carg2->obj; + else + arg2 = (Eigen::Vector2f *) 0; + } + (arg1)->add((Eigen::Vector2f const &)*arg2); + } + + + SWIGEXPORTC void _wrap_DataPointContainer_Eigen_Vector2f_clear(SwigObj * carg1) { + hectorslam::DataPointContainer< Eigen::Vector2f > *arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) 0 ; + + { + if (carg1) + arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) carg1->obj; + } + (arg1)->clear(); + } + + + SWIGEXPORTC int _wrap_DataPointContainer_Eigen_Vector2f_getSize(SwigObj * carg1) { + int cppresult; + hectorslam::DataPointContainer< Eigen::Vector2f > *arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) 0 ; + int result; + + { + if (carg1) + arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) carg1->obj; + } + cppresult = (int)((hectorslam::DataPointContainer< Eigen::Vector2f > const *)arg1)->getSize(); + result = cppresult; + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_DataPointContainer_Eigen_Vector2f_getVecEntry(SwigObj * carg1, int carg2) { + Eigen::Vector2f * cppresult; + hectorslam::DataPointContainer< Eigen::Vector2f > *arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) 0 ; + int arg2 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) carg1->obj; + } + arg2 = (int) carg2; + cppresult = (Eigen::Vector2f *) &((hectorslam::DataPointContainer< Eigen::Vector2f > const *)arg1)->getVecEntry(arg2); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Vector2f)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_DataPointContainer_Eigen_Vector2f_getOrigo(SwigObj * carg1) { + Eigen::Vector2f * cppresult; + hectorslam::DataPointContainer< Eigen::Vector2f > *arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) carg1->obj; + } + { + const Eigen::Vector2f &_result_ref = ((hectorslam::DataPointContainer< Eigen::Vector2f > const *)arg1)->getOrigo();cppresult = (Eigen::Vector2f*) &_result_ref; + } + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Vector2f)); + result->obj = (void*) &cppresult; + } + return result; + } + + + SWIGEXPORTC void _wrap_DataPointContainer_Eigen_Vector2f_setOrigo(SwigObj * carg1, SwigObj * carg2) { + hectorslam::DataPointContainer< Eigen::Vector2f > *arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) 0 ; + Eigen::Vector2f *arg2 = 0 ; + + { + if (carg1) + arg1 = (hectorslam::DataPointContainer< Eigen::Vector2f > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector2f *) carg2->obj; + else + arg2 = (Eigen::Vector2f *) 0; + } + (arg1)->setOrigo((Eigen::Vector2f const &)*arg2); + } + + + SWIGEXPORTC void _wrap_delete_DataPointContainer_Eigen_Vector2f(SwigObj * carg1) { + SWIG_remove_registry_entry(carg1); + SWIG_destroy_object(carg1); + } + + + SWIGEXPORTC SwigObj * _wrap_new_GridMap(float carg1, SwigObj * carg2, SwigObj * carg3) { + float arg1 ; + Eigen::Vector2i *arg2 = 0 ; + Eigen::Vector2f *arg3 = 0 ; + SwigObj * result; + + arg1 = (float) carg1; + { + if (carg2) + arg2 = (Eigen::Vector2i *) carg2->obj; + else + arg2 = (Eigen::Vector2i *) 0; + } + { + if (carg3) + arg3 = (Eigen::Vector2f *) carg3->obj; + else + arg3 = (Eigen::Vector2f *) 0; + } + result = SWIG_create_object("hectorslam::OccGridMapBase<(LogOddsCell,GridMapLogOddsFunctions)>"); + result->obj = (void*) new hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions >(arg1,(Eigen::Vector2i const &)*arg2,(Eigen::Vector2f const &)*arg3); + + return result; + } + + + SWIGEXPORTC void _wrap_delete_GridMap(SwigObj * carg1) { + SWIG_remove_registry_entry(carg1); + SWIG_destroy_object(carg1); + } + + + SWIGEXPORTC void _wrap_GridMap_updateSetOccupied(SwigObj * carg1, int carg2) { + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + int arg2 ; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (int) carg2; + (arg1)->updateSetOccupied(arg2); + } + + + SWIGEXPORTC void _wrap_GridMap_updateSetFree(SwigObj * carg1, int carg2) { + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + int arg2 ; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (int) carg2; + (arg1)->updateSetFree(arg2); + } + + + SWIGEXPORTC void _wrap_GridMap_updateUnsetFree(SwigObj * carg1, int carg2) { + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + int arg2 ; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (int) carg2; + (arg1)->updateUnsetFree(arg2); + } + + + SWIGEXPORTC float _wrap_GridMap_getGridProbabilityMap(SwigObj * carg1, int carg2) { + float cppresult; + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + int arg2 ; + float result; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (int) carg2; + cppresult = (float)((hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > const *)arg1)->getGridProbabilityMap(arg2); + result = cppresult; + return result; + } + + + SWIGEXPORTC bool _wrap_GridMap_isOccupied_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i_i(SwigObj * carg1, int carg2, int carg3) { + bool cppresult; + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + int arg2 ; + int arg3 ; + bool result; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (int) carg2; + arg3 = (int) carg3; + cppresult = (bool)((hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > const *)arg1)->isOccupied(arg2,arg3); + result = (bool) cppresult; + return result; + } + + + SWIGEXPORTC bool _wrap_GridMap_isFree_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i_i(SwigObj * carg1, int carg2, int carg3) { + bool cppresult; + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + int arg2 ; + int arg3 ; + bool result; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (int) carg2; + arg3 = (int) carg3; + cppresult = (bool)((hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > const *)arg1)->isFree(arg2,arg3); + result = (bool) cppresult; + return result; + } + + + SWIGEXPORTC bool _wrap_GridMap_isOccupied_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i(SwigObj * carg1, int carg2) { + bool cppresult; + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + int arg2 ; + bool result; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (int) carg2; + cppresult = (bool)((hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > const *)arg1)->isOccupied(arg2); + result = (bool) cppresult; + return result; + } + + + SWIGEXPORTC bool _wrap_GridMap_isFree_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i(SwigObj * carg1, int carg2) { + bool cppresult; + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + int arg2 ; + bool result; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (int) carg2; + cppresult = (bool)((hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > const *)arg1)->isFree(arg2); + result = (bool) cppresult; + return result; + } + + + SWIGEXPORTC float _wrap_GridMap_getObstacleThreshold(SwigObj * carg1) { + float cppresult; + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + float result; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + cppresult = (float)((hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > const *)arg1)->getObstacleThreshold(); + result = cppresult; + return result; + } + + + SWIGEXPORTC void _wrap_GridMap_setUpdateFreeFactor(SwigObj * carg1, float carg2) { + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + float arg2 ; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (float) carg2; + (arg1)->setUpdateFreeFactor(arg2); + } + + + SWIGEXPORTC void _wrap_GridMap_setUpdateOccupiedFactor(SwigObj * carg1, float carg2) { + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + float arg2 ; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (float) carg2; + (arg1)->setUpdateOccupiedFactor(arg2); + } + + + SWIGEXPORTC void _wrap_GridMap_updateByScan(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3) { + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + hectorslam::DataContainer *arg2 = 0 ; + Eigen::Vector3f *arg3 = 0 ; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + { + if (carg2) + arg2 = (hectorslam::DataContainer *) carg2->obj; + else + arg2 = (hectorslam::DataContainer *) 0; + } + { + if (carg3) + arg3 = (Eigen::Vector3f *) carg3->obj; + else + arg3 = (Eigen::Vector3f *) 0; + } + (arg1)->updateByScan((hectorslam::DataContainer const &)*arg2,(Eigen::Vector3f const &)*arg3); + } + + + SWIGEXPORTC void _wrap_GridMap_updateLineBresenhami_phectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__rcEigen_Vector2i_rcEigen_Vector2i_unsigned_SS_int(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3, unsigned int carg4) { + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + Eigen::Vector2i *arg2 = 0 ; + Eigen::Vector2i *arg3 = 0 ; + unsigned int arg4 ; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector2i *) carg2->obj; + else + arg2 = (Eigen::Vector2i *) 0; + } + { + if (carg3) + arg3 = (Eigen::Vector2i *) carg3->obj; + else + arg3 = (Eigen::Vector2i *) 0; + } + arg4 = (unsigned int) carg4; + (arg1)->updateLineBresenhami((Eigen::Vector2i const &)*arg2,(Eigen::Vector2i const &)*arg3,arg4); + } + + + SWIGEXPORTC void _wrap_GridMap_updateLineBresenhami_phectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__rcEigen_Vector2i_rcEigen_Vector2i(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3) { + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + Eigen::Vector2i *arg2 = 0 ; + Eigen::Vector2i *arg3 = 0 ; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector2i *) carg2->obj; + else + arg2 = (Eigen::Vector2i *) 0; + } + { + if (carg3) + arg3 = (Eigen::Vector2i *) carg3->obj; + else + arg3 = (Eigen::Vector2i *) 0; + } + (arg1)->updateLineBresenhami((Eigen::Vector2i const &)*arg2,(Eigen::Vector2i const &)*arg3); + } + + + SWIGEXPORTC void _wrap_GridMap_bresenhamCellFree(SwigObj * carg1, unsigned int carg2) { + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + unsigned int arg2 ; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (unsigned int) carg2; + (arg1)->bresenhamCellFree(arg2); + } + + + SWIGEXPORTC void _wrap_GridMap_bresenhamCellOcc(SwigObj * carg1, unsigned int carg2) { + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + unsigned int arg2 ; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (unsigned int) carg2; + (arg1)->bresenhamCellOcc(arg2); + } + + + SWIGEXPORTC void _wrap_GridMap_bresenham2D(SwigObj * carg1, unsigned int carg2, unsigned int carg3, int carg4, int carg5, int carg6, unsigned int carg7) { + hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) 0 ; + unsigned int arg2 ; + unsigned int arg3 ; + int arg4 ; + int arg5 ; + int arg6 ; + unsigned int arg7 ; + + { + if (carg1) + arg1 = (hectorslam::OccGridMapBase< LogOddsCell,GridMapLogOddsFunctions > *) carg1->obj; + } + arg2 = (unsigned int) carg2; + arg3 = (unsigned int) carg3; + arg4 = (int) carg4; + arg5 = (int) carg5; + arg6 = (int) carg6; + arg7 = (unsigned int) carg7; + (arg1)->bresenham2D(arg2,arg3,arg4,arg5,arg6,arg7); + } + + + SWIGEXPORTC bool _wrap_GridMapBase_LogOddsCell_hasGridValue(SwigObj * carg1, int carg2, int carg3) { + bool cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + int arg2 ; + int arg3 ; + bool result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + arg2 = (int) carg2; + arg3 = (int) carg3; + cppresult = (bool)((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->hasGridValue(arg2,arg3); + result = (bool) cppresult; + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getMapDimensions(SwigObj * carg1) { + Eigen::Vector2i * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + cppresult = (Eigen::Vector2i *) &((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getMapDimensions(); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Vector2i)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC int _wrap_GridMapBase_LogOddsCell_getSizeX(SwigObj * carg1) { + int cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + int result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + cppresult = (int)((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getSizeX(); + result = cppresult; + return result; + } + + + SWIGEXPORTC int _wrap_GridMapBase_LogOddsCell_getSizeY(SwigObj * carg1) { + int cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + int result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + cppresult = (int)((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getSizeY(); + result = cppresult; + return result; + } + + + SWIGEXPORTC bool _wrap_GridMapBase_LogOddsCell_pointOutOfMapBounds(SwigObj * carg1, SwigObj * carg2) { + bool cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + Eigen::Vector2f *arg2 = 0 ; + bool result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector2f *) carg2->obj; + else + arg2 = (Eigen::Vector2f *) 0; + } + cppresult = (bool)((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->pointOutOfMapBounds((Eigen::Vector2f const &)*arg2); + result = (bool) cppresult; + return result; + } + + + SWIGEXPORTC void _wrap_GridMapBase_LogOddsCell_reset(SwigObj * carg1) { + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + (arg1)->reset(); + } + + + SWIGEXPORTC void _wrap_GridMapBase_LogOddsCell_clear(SwigObj * carg1) { + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + (arg1)->clear(); + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getMapDimProperties(SwigObj * carg1) { + MapDimensionProperties * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + cppresult = (MapDimensionProperties *) &((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getMapDimProperties(); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(MapDimensionProperties)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_new_GridMapBase_LogOddsCell_f_rcEigen_Vector2i_rcEigen_Vector2f(float carg1, SwigObj * carg2, SwigObj * carg3) { + float arg1 ; + Eigen::Vector2i *arg2 = 0 ; + Eigen::Vector2f *arg3 = 0 ; + SwigObj * result; + + arg1 = (float) carg1; + { + if (carg2) + arg2 = (Eigen::Vector2i *) carg2->obj; + else + arg2 = (Eigen::Vector2i *) 0; + } + { + if (carg3) + arg3 = (Eigen::Vector2f *) carg3->obj; + else + arg3 = (Eigen::Vector2f *) 0; + } + result = SWIG_create_object("hectorslam::GridMapBase<(LogOddsCell)>"); + result->obj = (void*) new hectorslam::GridMapBase< LogOddsCell >(arg1,(Eigen::Vector2i const &)*arg2,(Eigen::Vector2f const &)*arg3); + + return result; + } + + + SWIGEXPORTC void _wrap_delete_GridMapBase_LogOddsCell(SwigObj * carg1) { + SWIG_remove_registry_entry(carg1); + SWIG_destroy_object(carg1); + } + + + SWIGEXPORTC void _wrap_GridMapBase_LogOddsCell_allocateArray(SwigObj * carg1, SwigObj * carg2) { + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + Eigen::Vector2i *arg2 = 0 ; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector2i *) carg2->obj; + else + arg2 = (Eigen::Vector2i *) 0; + } + (arg1)->allocateArray((Eigen::Vector2i const &)*arg2); + } + + + SWIGEXPORTC void _wrap_GridMapBase_LogOddsCell_deleteArray(SwigObj * carg1) { + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + (arg1)->deleteArray(); + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getCell_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__i_i(SwigObj * carg1, int carg2, int carg3) { + LogOddsCell * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + int arg2 ; + int arg3 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + arg2 = (int) carg2; + arg3 = (int) carg3; + cppresult = (LogOddsCell *) &(arg1)->getCell(arg2,arg3); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(LogOddsCell)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getCell_pchectorslam_GridMapBase_Sl_LogOddsCell_Sg__i_i(SwigObj * carg1, int carg2, int carg3) { + LogOddsCell * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + int arg2 ; + int arg3 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + arg2 = (int) carg2; + arg3 = (int) carg3; + cppresult = (LogOddsCell *) &((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getCell(arg2,arg3); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(LogOddsCell)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getCell_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__i(SwigObj * carg1, int carg2) { + LogOddsCell * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + int arg2 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + arg2 = (int) carg2; + cppresult = (LogOddsCell *) &(arg1)->getCell(arg2); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(LogOddsCell)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getCell_pchectorslam_GridMapBase_Sl_LogOddsCell_Sg__i(SwigObj * carg1, int carg2) { + LogOddsCell * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + int arg2 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + arg2 = (int) carg2; + cppresult = (LogOddsCell *) &((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getCell(arg2); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(LogOddsCell)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC void _wrap_GridMapBase_LogOddsCell_setMapGridSize(SwigObj * carg1, SwigObj * carg2) { + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + Eigen::Vector2i *arg2 = 0 ; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector2i *) carg2->obj; + else + arg2 = (Eigen::Vector2i *) 0; + } + (arg1)->setMapGridSize((Eigen::Vector2i const &)*arg2); + } + + + SWIGEXPORTC SwigObj * _wrap_copy_GridMapBase_LogOddsCell(SwigObj * carg1) { + hectorslam::GridMapBase< LogOddsCell > *arg1 = 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + else + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0; + } + result = SWIG_create_object("hectorslam::GridMapBase< LogOddsCell >"); + result->obj = (void*) new hectorslam::GridMapBase< LogOddsCell >((hectorslam::GridMapBase< LogOddsCell > const &)*arg1); + + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getWorldCoords(SwigObj * carg1, SwigObj * carg2) { + Eigen::Vector2f * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + Eigen::Vector2f *arg2 = 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector2f *) carg2->obj; + else + arg2 = (Eigen::Vector2f *) 0; + } + { + const Eigen::Vector2f &_result_ref = ((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getWorldCoords((Eigen::Vector2f const &)*arg2);cppresult = (Eigen::Vector2f*) &_result_ref; + } + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Vector2f)); + result->obj = (void*) &cppresult; + } + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getMapCoords(SwigObj * carg1, SwigObj * carg2) { + Eigen::Vector2f * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + Eigen::Vector2f *arg2 = 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector2f *) carg2->obj; + else + arg2 = (Eigen::Vector2f *) 0; + } + { + const Eigen::Vector2f &_result_ref = ((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getMapCoords((Eigen::Vector2f const &)*arg2);cppresult = (Eigen::Vector2f*) &_result_ref; + } + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Vector2f)); + result->obj = (void*) &cppresult; + } + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getWorldCoordsPose(SwigObj * carg1, SwigObj * carg2) { + Eigen::Vector3f * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + Eigen::Vector3f *arg2 = 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector3f *) carg2->obj; + else + arg2 = (Eigen::Vector3f *) 0; + } + { + const Eigen::Vector3f &_result_ref = ((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getWorldCoordsPose((Eigen::Vector3f const &)*arg2);cppresult = (Eigen::Vector3f*) &_result_ref; + } + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Vector3f)); + result->obj = (void*) &cppresult; + } + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getMapCoordsPose(SwigObj * carg1, SwigObj * carg2) { + Eigen::Vector3f * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + Eigen::Vector3f *arg2 = 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector3f *) carg2->obj; + else + arg2 = (Eigen::Vector3f *) 0; + } + { + const Eigen::Vector3f &_result_ref = ((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getMapCoordsPose((Eigen::Vector3f const &)*arg2);cppresult = (Eigen::Vector3f*) &_result_ref; + } + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Vector3f)); + result->obj = (void*) &cppresult; + } + return result; + } + + + SWIGEXPORTC void _wrap_GridMapBase_LogOddsCell_setDimensionProperties_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__rcEigen_Vector2f_rcEigen_Vector2i_f(SwigObj * carg1, SwigObj * carg2, SwigObj * carg3, float carg4) { + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + Eigen::Vector2f *arg2 = 0 ; + Eigen::Vector2i *arg3 = 0 ; + float arg4 ; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector2f *) carg2->obj; + else + arg2 = (Eigen::Vector2f *) 0; + } + { + if (carg3) + arg3 = (Eigen::Vector2i *) carg3->obj; + else + arg3 = (Eigen::Vector2i *) 0; + } + arg4 = (float) carg4; + (arg1)->setDimensionProperties((Eigen::Vector2f const &)*arg2,(Eigen::Vector2i const &)*arg3,arg4); + } + + + SWIGEXPORTC void _wrap_GridMapBase_LogOddsCell_setDimensionProperties_phectorslam_GridMapBase_Sl_LogOddsCell_Sg__rcMapDimensionProperties(SwigObj * carg1, SwigObj * carg2) { + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + MapDimensionProperties *arg2 = 0 ; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + { + if (carg2) + arg2 = (MapDimensionProperties *) carg2->obj; + else + arg2 = (MapDimensionProperties *) 0; + } + (arg1)->setDimensionProperties((MapDimensionProperties const &)*arg2); + } + + + SWIGEXPORTC void _wrap_GridMapBase_LogOddsCell_setMapTransformation(SwigObj * carg1, SwigObj * carg2, float carg3) { + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + Eigen::Vector2f *arg2 = 0 ; + float arg3 ; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + { + if (carg2) + arg2 = (Eigen::Vector2f *) carg2->obj; + else + arg2 = (Eigen::Vector2f *) 0; + } + arg3 = (float) carg3; + (arg1)->setMapTransformation((Eigen::Vector2f const &)*arg2,arg3); + } + + + SWIGEXPORTC float _wrap_GridMapBase_LogOddsCell_getScaleToMap(SwigObj * carg1) { + float cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + float result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + cppresult = (float)((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getScaleToMap(); + result = cppresult; + return result; + } + + + SWIGEXPORTC float _wrap_GridMapBase_LogOddsCell_getCellLength(SwigObj * carg1) { + float cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + float result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + cppresult = (float)((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getCellLength(); + result = cppresult; + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getWorldTmap(SwigObj * carg1) { + Eigen::Affine2f * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + cppresult = (Eigen::Affine2f *) &((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getWorldTmap(); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Affine2f)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getWorldTmap3D(SwigObj * carg1) { + Eigen::Affine3f * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + cppresult = (Eigen::Affine3f *) &((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getWorldTmap3D(); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Affine3f)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC SwigObj * _wrap_GridMapBase_LogOddsCell_getMapTworld(SwigObj * carg1) { + Eigen::Affine2f * cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + SwigObj * result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + cppresult = (Eigen::Affine2f *) &((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getMapTworld(); + { + result = (SwigObj*) SWIG_create_object(SWIG_STR(Eigen::Affine2f)); + result->obj = (void*) cppresult; + } + return result; + } + + + SWIGEXPORTC void _wrap_GridMapBase_LogOddsCell_setUpdated(SwigObj * carg1) { + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + (arg1)->setUpdated(); + } + + + SWIGEXPORTC int _wrap_GridMapBase_LogOddsCell_getUpdateIndex(SwigObj * carg1) { + int cppresult; + hectorslam::GridMapBase< LogOddsCell > *arg1 = (hectorslam::GridMapBase< LogOddsCell > *) 0 ; + int result; + + { + if (carg1) + arg1 = (hectorslam::GridMapBase< LogOddsCell > *) carg1->obj; + } + cppresult = (int)((hectorslam::GridMapBase< LogOddsCell > const *)arg1)->getUpdateIndex(); + result = cppresult; + return result; + } + + +#ifdef __cplusplus +} +#endif + diff --git a/hector_mapping/swig/standalone.cpp b/hector_mapping/swig/standalone.cpp new file mode 100644 index 00000000..0f8755ac --- /dev/null +++ b/hector_mapping/swig/standalone.cpp @@ -0,0 +1,147 @@ +#include +#include + +sensor_msgs::LaserScan scan; +bool update_scan = false; +void scanCallback(const sensor_msgs::LaserScan& _scan) +{ + static int prev_seq = 0; + scan = _scan; + if ( _scan.header.seq != ( prev_seq + 1) ) { + std::cerr << "warn !! skipping /scan " << prev_seq << " -> "<< _scan.header.seq << std::endl; + } + prev_seq = _scan.header.seq; + update_scan = true; +} + +extern "C" { +#include +} + +HectorSlamProcessor * slamProcessor; +int lastGetMapUpdateIndex = -100; + +#include +void saveMapLoop(double _period) +{ + GridMap * gridMap = HectorSlamProcessor_getGridMap_pchectorslam_HectorSlamProcessor_i(slamProcessor, 0); + + ros::Rate r(1.0 / _period); + while(ros::ok()) + { + //only update map if it changed + if (lastGetMapUpdateIndex != GridMapBase_LogOddsCell_getUpdateIndex(gridMap)) + { + + int sizeX = GridMapBase_LogOddsCell_getSizeX(gridMap); + int sizeY = GridMapBase_LogOddsCell_getSizeY(gridMap); + + int size = sizeX * sizeY; + + // FIX ME, do not have to allocate every loop + std::vector data; + data.resize(GridMapBase_LogOddsCell_getSizeX(gridMap) * GridMapBase_LogOddsCell_getSizeY(gridMap)); + + //std::vector contents are guaranteed to be contiguous, use memset to set all to unknown to save time in loop + memset(&data[0], 100, sizeof(int8_t) * size); + + for(int i=0; i < size; ++i) + { + if(GridMap_isFree_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i(gridMap, i)) + { + data[i] = 200; // changed from original variable for better visualization + } + else if (GridMap_isOccupied_pchectorslam_OccGridMapBase_Sl_LogOddsCell_Sc_GridMapLogOddsFunctions_Sg__i(gridMap, i)) + { + data[i] = 0; + } + } + + lastGetMapUpdateIndex = GridMapBase_LogOddsCell_getUpdateIndex(gridMap); + + FILE *fp; + printf("update map.pgm\n"); + fp = fopen("map.pgm", "wb"); + fprintf(fp, "P5\n#\n%d %d\n255\n", GridMapBase_LogOddsCell_getSizeX(gridMap), GridMapBase_LogOddsCell_getSizeY(gridMap)); + fwrite(&data[0], sizeof(int8_t), data.size(), fp); + fclose(fp); + } + + r.sleep(); + } +} + +#include +int main(int argc, char* argv[]) { + // invoke ros to subsscribe /scan + ros::init(argc, argv, "hector_slam_lib_test"); + ros::NodeHandle n; + ros::Subscriber sub = n.subscribe("/scan", 5, &scanCallback); + + // initialize slamProcessor + double p_map_resolution_ = 0.050; + int p_map_size_ = 2048; + double p_map_start_x_ = 0.5; + double p_map_start_y_ = 0.5; + int p_map_multi_res_levels_ = 2; + double p_update_factor_free_ = 0.4; + double p_update_factor_occupied_ = 0.9; + double p_map_update_distance_threshold_ = 0.4; + double p_map_update_angle_threshold_ = 0.06; + + slamProcessor = new_HectorSlamProcessor_f_i_i_rcEigen_Vector2f_i(p_map_resolution_, p_map_size_, p_map_size_, Eigen_Vector2f(p_map_start_x_, p_map_start_y_), p_map_multi_res_levels_); + HectorSlamProcessor_setUpdateFactorFree(slamProcessor, p_update_factor_free_); + HectorSlamProcessor_setUpdateFactorOccupied(slamProcessor, p_update_factor_occupied_); + HectorSlamProcessor_setMapUpdateMinDistDiff(slamProcessor, p_map_update_distance_threshold_); + HectorSlamProcessor_setMapUpdateMinAngleDiff(slamProcessor, p_map_update_angle_threshold_); + + // initialize lasersacn Container + DataPointContainer_Eigen_Vector2f * laserScanContainer; + laserScanContainer = new_DataPointContainer_Eigen_Vector2f(); + + // saveMapLoop runs different thread, to keep main loop (update) runs periodically + boost::thread* map_save_thread_ = new boost::thread(boost::bind(&saveMapLoop, 0.5)); + + while (ros::ok()){ + // when scan is updated + if ( update_scan ) { + // update loop + size_t size = scan.ranges.size(); + float angle = scan.angle_min; + float angle_increment = scan.angle_increment; + float range_min = scan.range_min; + float range_max = scan.range_max; + + // + float scaleToMap = HectorSlamProcessor_getScaleToMap(slamProcessor); + DataPointContainer_Eigen_Vector2f_clear(laserScanContainer); + DataPointContainer_Eigen_Vector2f_setOrigo(laserScanContainer, Eigen_Vector2f(0, 0)); + + float maxRangeForContainer = range_max - 0.1f; + for (size_t i = 0; i < size; ++i) + { + float dist = scan.ranges[i]; + + if ( (dist > range_min) && (dist < maxRangeForContainer)) + { + dist *= scaleToMap; + DataPointContainer_Eigen_Vector2f_add(laserScanContainer, Eigen_Vector2f(cos(angle) * dist, sin(angle) * dist)); + } + + angle += angle_increment; + } + + HectorSlamProcessor_update_phectorslam_HectorSlamProcessor_rchectorslam_DataPointContainer_Sl_Eigen_Vector2f_Sg__rcEigen_Vector3f(slamProcessor, laserScanContainer, HectorSlamProcessor_getLastScanMatchPose(slamProcessor)); + + // show pose + SwigObj* pose = HectorSlamProcessor_getLastScanMatchPose(slamProcessor); + std::cerr << "x : " << Eigen_Vector3f_x(pose) << ", y : " << Eigen_Vector3f_y(pose) << ", t : " << Eigen_Vector3f_z(pose) << std::endl; + + // + update_scan = false; + + } + ros::spinOnce(); + } + +}