From 7a9ab4a357860f7263769cce9dd45107ec8b2c4a Mon Sep 17 00:00:00 2001 From: Wolfgang Merkt Date: Tue, 9 Feb 2021 20:41:46 +0000 Subject: [PATCH 1/3] Use explicit casting to prevent implicit sign conversion (#322) * Use explicit casting to prevent implicit sign conversion * Add parentheses to fix gcc error * Explicit check against zero --- octomap/include/octomap/OcTreeBaseImpl.hxx | 2 +- octomap/include/octomap/OccupancyOcTreeBase.hxx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/octomap/include/octomap/OcTreeBaseImpl.hxx b/octomap/include/octomap/OcTreeBaseImpl.hxx index dd7c2b21..abcd30b6 100644 --- a/octomap/include/octomap/OcTreeBaseImpl.hxx +++ b/octomap/include/octomap/OcTreeBaseImpl.hxx @@ -1057,7 +1057,7 @@ namespace octomap { float step_size = this->resolution * pow(2, tree_depth-depth); for (int i=0;i<3;++i) { diff[i] = pmax_clamped(i) - pmin_clamped(i); - steps[i] = floor(diff[i] / step_size); + steps[i] = static_cast(floor(diff[i] / step_size)); // std::cout << "bbx " << i << " size: " << diff[i] << " " << steps[i] << " steps\n"; } diff --git a/octomap/include/octomap/OccupancyOcTreeBase.hxx b/octomap/include/octomap/OccupancyOcTreeBase.hxx index 81438973..8e3b312c 100644 --- a/octomap/include/octomap/OccupancyOcTreeBase.hxx +++ b/octomap/include/octomap/OccupancyOcTreeBase.hxx @@ -784,7 +784,7 @@ namespace octomap { // Line dot normal will be zero if they are parallel, in which case no intersection can be the entry one // if there is an intersection does it occur in the bounded plane of the voxel // if yes keep only the closest (smallest distance to sensor origin). - if((lineDotNormal = normalX.dot(direction))){ // Ensure lineDotNormal is non-zero (assign and test) + if((lineDotNormal = normalX.dot(direction)) != 0.0){ // Ensure lineDotNormal is non-zero (assign and test) d = (pointXNeg - origin).dot(normalX) / lineDotNormal; intersect = direction * float(d) + origin; if(!(intersect(1) < (pointYNeg(1) - 1e-6) || intersect(1) > (pointYPos(1) + 1e-6) || @@ -802,7 +802,7 @@ namespace octomap { } } - if((lineDotNormal = normalY.dot(direction))){ // Ensure lineDotNormal is non-zero (assign and test) + if((lineDotNormal = normalY.dot(direction)) != 0.0){ // Ensure lineDotNormal is non-zero (assign and test) d = (pointYNeg - origin).dot(normalY) / lineDotNormal; intersect = direction * float(d) + origin; if(!(intersect(0) < (pointXNeg(0) - 1e-6) || intersect(0) > (pointXPos(0) + 1e-6) || @@ -820,7 +820,7 @@ namespace octomap { } } - if((lineDotNormal = normalZ.dot(direction))){ // Ensure lineDotNormal is non-zero (assign and test) + if((lineDotNormal = normalZ.dot(direction)) != 0.0){ // Ensure lineDotNormal is non-zero (assign and test) d = (pointZNeg - origin).dot(normalZ) / lineDotNormal; intersect = direction * float(d) + origin; if(!(intersect(0) < (pointXNeg(0) - 1e-6) || intersect(0) > (pointXPos(0) + 1e-6) || @@ -839,7 +839,7 @@ namespace octomap { } // Substract (add) a fraction to ensure no ambiguity on the starting voxel - // Don't start on a bondary. + // Don't start on a boundary. if(found) intersection = direction * float(outD + delta) + origin; From 9b04d0a71acc908dd96009f0d88407d492428053 Mon Sep 17 00:00:00 2001 From: Wolfgang Merkt Date: Mon, 3 May 2021 21:28:10 +0100 Subject: [PATCH 2/3] REP-136 compliance and compatibility with ROS1 & ROS2 using single branch (#304) * REP-136 compliance and compatibility with ROS1 & ROS2 using single branch * Remove duplicated unconditional dependency on catkin * Register packages in ament_index This follows https://github.com/ompl/ompl/pull/754 * [CI] Only run PRERELEASE tests for ROS2 --- .github/workflows/industrial_ci_action.yml | 6 ++---- dynamicEDT3D/CMakeLists.txt | 4 ++++ dynamicEDT3D/package.xml | 10 +++++++--- octomap/CMakeLists.txt | 6 +++++- octomap/package.xml | 9 ++++++--- octovis/CMakeLists.txt | 4 ++++ octovis/package.xml | 9 ++++++--- 7 files changed, 34 insertions(+), 14 deletions(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index 1d7b62dd..0b32eca8 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -13,13 +13,11 @@ jobs: env: - {ROS_DISTRO: melodic} - {ROS_DISTRO: noetic} - - {ROS_DISTRO: foxy} - - {ROS_DISTRO: rolling} + - {ROS_DISTRO: foxy, PRERELEASE: true} + - {ROS_DISTRO: rolling, PRERELEASE: true} env: CCACHE_DIR: /github/home/.ccache # Enable ccache - PRERELEASE: true # always run the prerelease tests BUILDER: colcon - # CMAKE_ARGS: '-DCMAKE_BUILD_TYPE=Debug' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/dynamicEDT3D/CMakeLists.txt b/dynamicEDT3D/CMakeLists.txt index 10b1d6d1..6eb9396f 100644 --- a/dynamicEDT3D/CMakeLists.txt +++ b/dynamicEDT3D/CMakeLists.txt @@ -69,6 +69,10 @@ install(FILES ${dynamicEDT3D_HDRS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/dyna # Install catkin package.xml, attention package.xml names the catkin package "dynamic_edt_3d", so this is also the location where it needs to be installed to (and not "dynamicEDT3D") install(FILES package.xml DESTINATION "${CMAKE_INSTALL_DATADIR}/dynamic_edt_3d") +# Allows Colcon to find non-Ament packages when using workspace underlays +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/share/ament_index/resource_index/packages/${PROJECT_NAME} "") +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/ament_index/resource_index/packages/${PROJECT_NAME} DESTINATION share/ament_index/resource_index/packages) + #TODO: this conflicts with the octomap uninstall #it is not only a target name problem, also both will use the same manifest file #in the same binary directory diff --git a/dynamicEDT3D/package.xml b/dynamicEDT3D/package.xml index 7f70c921..e346924e 100644 --- a/dynamicEDT3D/package.xml +++ b/dynamicEDT3D/package.xml @@ -1,19 +1,23 @@ - + dynamic_edt_3d 1.9.6 The dynamicEDT3D library implements an inrementally updatable Euclidean distance transform (EDT) in 3D. It comes with a wrapper to use the OctoMap 3D representation and hooks into the change detection of the OctoMap library to propagate changes to the EDT. Christoph Sprunk Christoph Sprunk - Wolfgang Merkt + Wolfgang Merkt BSD http://octomap.github.io https://github.com/OctoMap/octomap/issues octomap - cmake + + catkin + ament_cmake + + cmake cmake diff --git a/octomap/CMakeLists.txt b/octomap/CMakeLists.txt index e192fcb3..8e79af03 100644 --- a/octomap/CMakeLists.txt +++ b/octomap/CMakeLists.txt @@ -69,9 +69,13 @@ install(FILES ${octomap_HDRS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/octomap") file(GLOB octomap_math_HDRS ${PROJECT_SOURCE_DIR}/include/octomap/math/*.h) install(FILES ${octomap_math_HDRS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/octomap/math") -# Install catkin package.xml +# Install package.xml (catkin/ament/rosdep) install(FILES package.xml DESTINATION "${CMAKE_INSTALL_DATADIR}/octomap") +# Allows Colcon to find non-Ament packages when using workspace underlays +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/share/ament_index/resource_index/packages/${PROJECT_NAME} "") +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/ament_index/resource_index/packages/${PROJECT_NAME} DESTINATION share/ament_index/resource_index/packages) + # uninstall target configure_file( "${PROJECT_SOURCE_DIR}/CMakeModules/CMakeUninstall.cmake.in" diff --git a/octomap/package.xml b/octomap/package.xml index ebdf7639..aee8ddba 100644 --- a/octomap/package.xml +++ b/octomap/package.xml @@ -1,4 +1,4 @@ - + octomap 1.9.6 The OctoMap library implements a 3D occupancy grid mapping approach, providing data structures and mapping algorithms in C++. The map implementation is based on an octree. See @@ -7,14 +7,17 @@ Kai M. Wurm Armin Hornung Armin Hornung - Wolfgang Merkt + Wolfgang Merkt BSD http://octomap.github.io https://github.com/OctoMap/octomap/issues - cmake + + catkin + ament_cmake + cmake cmake diff --git a/octovis/CMakeLists.txt b/octovis/CMakeLists.txt index 0dd4ef54..719184a1 100644 --- a/octovis/CMakeLists.txt +++ b/octovis/CMakeLists.txt @@ -158,6 +158,10 @@ IF(BUILD_VIEWER) # Install catkin package.xml install(FILES package.xml DESTINATION "${CMAKE_INSTALL_DATADIR}/octovis") + + # Allows Colcon to find non-Ament packages when using workspace underlays + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/share/ament_index/resource_index/packages/${PROJECT_NAME} "") + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/share/ament_index/resource_index/packages/${PROJECT_NAME} DESTINATION share/ament_index/resource_index/packages) ELSE() MESSAGE ( "Unfortunately, the viewer (octovis) can not be built because some requirements are missing.") diff --git a/octovis/package.xml b/octovis/package.xml index 125c42d3..648cf66f 100644 --- a/octovis/package.xml +++ b/octovis/package.xml @@ -1,4 +1,4 @@ - + octovis 1.9.6 octovis is visualization tool for the OctoMap library based on Qt and libQGLViewer. See @@ -7,14 +7,17 @@ Kai M. Wurm Armin Hornung Armin Hornung - Wolfgang Merkt + Wolfgang Merkt GPLv2 http://octomap.github.io https://github.com/OctoMap/octomap/issues + + catkin + ament_cmake + cmake - cmake From b5cd2a2b97e7eff56056f33b95a3ab4c8bd09b30 Mon Sep 17 00:00:00 2001 From: Armin Hornung Date: Mon, 3 May 2021 22:35:22 +0200 Subject: [PATCH 3/3] Version 1.9.7 release --- dynamicEDT3D/CMakeLists.txt | 2 +- dynamicEDT3D/package.xml | 2 +- octomap/CHANGELOG.txt | 5 +++++ octomap/CMakeLists.txt | 2 +- octomap/package.xml | 2 +- octovis/CMakeLists.txt | 2 +- octovis/package.xml | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/dynamicEDT3D/CMakeLists.txt b/dynamicEDT3D/CMakeLists.txt index 6eb9396f..759cf5cc 100644 --- a/dynamicEDT3D/CMakeLists.txt +++ b/dynamicEDT3D/CMakeLists.txt @@ -7,7 +7,7 @@ include(GNUInstallDirs) # version (e.g. for packaging) set(DYNAMICEDT3D_MAJOR_VERSION 1) set(DYNAMICEDT3D_MINOR_VERSION 9) -set(DYNAMICEDT3D_PATCH_VERSION 6) +set(DYNAMICEDT3D_PATCH_VERSION 7) set(DYNAMICEDT3D_VERSION ${DYNAMICEDT3D_MAJOR_VERSION}.${DYNAMICEDT3D_MINOR_VERSION}.${DYNAMICEDT3D_PATCH_VERSION}) set(DYNAMICEDT3D_SOVERSION ${DYNAMICEDT3D_MAJOR_VERSION}.${DYNAMICEDT3D_MINOR_VERSION}) diff --git a/dynamicEDT3D/package.xml b/dynamicEDT3D/package.xml index e346924e..e20ef7cd 100644 --- a/dynamicEDT3D/package.xml +++ b/dynamicEDT3D/package.xml @@ -1,6 +1,6 @@ dynamic_edt_3d - 1.9.6 + 1.9.7 The dynamicEDT3D library implements an inrementally updatable Euclidean distance transform (EDT) in 3D. It comes with a wrapper to use the OctoMap 3D representation and hooks into the change detection of the OctoMap library to propagate changes to the EDT. Christoph Sprunk diff --git a/octomap/CHANGELOG.txt b/octomap/CHANGELOG.txt index 1c58e345..4a27adac 100644 --- a/octomap/CHANGELOG.txt +++ b/octomap/CHANGELOG.txt @@ -1,3 +1,8 @@ +v1.9.7: 2021-05-03 +================== +- Use explicit casting to prevent implicit sign conversion +- REP-136 compliance and compatibility with ROS1 & ROS2 using single branch + v1.9.6: 2021-01-23 ================== - Fixed ifstream >> byte with c++17 diff --git a/octomap/CMakeLists.txt b/octomap/CMakeLists.txt index 8e79af03..f091ea13 100644 --- a/octomap/CMakeLists.txt +++ b/octomap/CMakeLists.txt @@ -7,7 +7,7 @@ include(GNUInstallDirs) # version (e.g. for packaging) set(OCTOMAP_MAJOR_VERSION 1) set(OCTOMAP_MINOR_VERSION 9) -set(OCTOMAP_PATCH_VERSION 6) +set(OCTOMAP_PATCH_VERSION 7) set(OCTOMAP_VERSION ${OCTOMAP_MAJOR_VERSION}.${OCTOMAP_MINOR_VERSION}.${OCTOMAP_PATCH_VERSION}) set(OCTOMAP_SOVERSION ${OCTOMAP_MAJOR_VERSION}.${OCTOMAP_MINOR_VERSION}) if(COMMAND cmake_policy) diff --git a/octomap/package.xml b/octomap/package.xml index aee8ddba..9c71c855 100644 --- a/octomap/package.xml +++ b/octomap/package.xml @@ -1,6 +1,6 @@ octomap - 1.9.6 + 1.9.7 The OctoMap library implements a 3D occupancy grid mapping approach, providing data structures and mapping algorithms in C++. The map implementation is based on an octree. See http://octomap.github.io for details. diff --git a/octovis/CMakeLists.txt b/octovis/CMakeLists.txt index 719184a1..52d3a122 100644 --- a/octovis/CMakeLists.txt +++ b/octovis/CMakeLists.txt @@ -7,7 +7,7 @@ include(GNUInstallDirs) # # version (e.g. for packaging) set(OCTOVIS_MAJOR_VERSION 1) set(OCTOVIS_MINOR_VERSION 9) -set(OCTOVIS_PATCH_VERSION 6) +set(OCTOVIS_PATCH_VERSION 7) set(OCTOVIS_VERSION ${OCTOVIS_MAJOR_VERSION}.${OCTOVIS_MINOR_VERSION}.${OCTOVIS_PATCH_VERSION}) set(OCTOVIS_SOVERSION ${OCTOVIS_MAJOR_VERSION}.${OCTOVIS_MINOR_VERSION}) # get rid of a useless warning: diff --git a/octovis/package.xml b/octovis/package.xml index 648cf66f..a1836289 100644 --- a/octovis/package.xml +++ b/octovis/package.xml @@ -1,6 +1,6 @@ octovis - 1.9.6 + 1.9.7 octovis is visualization tool for the OctoMap library based on Qt and libQGLViewer. See http://octomap.github.io for details.