From 6943ad5af33c01757c1f058da3d6994f4cd240a8 Mon Sep 17 00:00:00 2001 From: Daisuke Nishimatsu <42202095+wep21@users.noreply.github.com> Date: Tue, 4 Jan 2022 18:02:01 +0900 Subject: [PATCH] fix: remove warning for compile error (#198) * fix: fix compile error of pointcloud preprocessor Signed-off-by: wep21 * fix: fix compiler warning for had map utils Signed-off-by: wep21 * fix: fix compiler warning for behavior velocity planner Signed-off-by: wep21 * fix: fix compiler warning for compare map segmentation Signed-off-by: wep21 * fix: fix compiler warning for occupancy grid map outlier filter Signed-off-by: wep21 * fix: fix compiler warning for detection by tracker Signed-off-by: wep21 * fix: restore comment Signed-off-by: wep21 --- common/had_map_utils/CMakeLists.txt | 25 +++++++++++-------- .../compare_map_segmentation/CMakeLists.txt | 1 + .../detection_by_tracker/CMakeLists.txt | 1 + .../CMakeLists.txt | 1 + .../behavior_velocity_planner/CMakeLists.txt | 6 +++++ .../pointcloud_preprocessor/CMakeLists.txt | 1 + .../passthrough_filter_uint16_nodelet.cpp | 4 +-- 7 files changed, 27 insertions(+), 12 deletions(-) diff --git a/common/had_map_utils/CMakeLists.txt b/common/had_map_utils/CMakeLists.txt index c80443fec1377..9667a8ceb530b 100644 --- a/common/had_map_utils/CMakeLists.txt +++ b/common/had_map_utils/CMakeLists.txt @@ -5,27 +5,32 @@ cmake_minimum_required(VERSION 3.5) ### Export headers project(had_map_utils) +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic -Werror) +endif() + find_package(ament_cmake_auto REQUIRED) find_package(CGAL REQUIRED COMPONENTS Core) -#find_package(Eigen3 REQUIRED) +find_package(Eigen3 REQUIRED) ament_auto_find_build_dependencies() -# Disable warnings due to external dependencies (Eigen) -#include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR}) - ament_auto_add_library(${PROJECT_NAME} SHARED - include/had_map_utils/had_map_utils.hpp - include/had_map_utils/had_map_computation.hpp - include/had_map_utils/had_map_conversion.hpp - include/had_map_utils/had_map_query.hpp - include/had_map_utils/had_map_visualization.hpp - include/had_map_utils/visibility_control.hpp src/had_map_utils.cpp src/had_map_computation.cpp src/had_map_conversion.cpp src/had_map_query.cpp src/had_map_visualization.cpp) +# Disable warnings due to external dependencies (Eigen) +target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC + ${EIGEN3_INCLUDE_DIR} + ${rclcpp_INCLUDE_DIRS} +) + set(CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE TRUE) target_link_libraries(${PROJECT_NAME} CGAL CGAL::CGAL CGAL::CGAL_Core) autoware_set_compile_options(${PROJECT_NAME}) diff --git a/perception/compare_map_segmentation/CMakeLists.txt b/perception/compare_map_segmentation/CMakeLists.txt index 30b25cb360fd2..c2983c01f236a 100644 --- a/perception/compare_map_segmentation/CMakeLists.txt +++ b/perception/compare_map_segmentation/CMakeLists.txt @@ -32,6 +32,7 @@ ament_auto_find_build_dependencies() include_directories( include + SYSTEM ${Boost_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} diff --git a/perception/detection_by_tracker/CMakeLists.txt b/perception/detection_by_tracker/CMakeLists.txt index 72c74947372f9..fb11bf0a1d317 100644 --- a/perception/detection_by_tracker/CMakeLists.txt +++ b/perception/detection_by_tracker/CMakeLists.txt @@ -31,6 +31,7 @@ ament_auto_find_build_dependencies() include_directories( include + SYSTEM ${PCL_COMMON_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} ) diff --git a/perception/occupancy_grid_map_outlier_filter/CMakeLists.txt b/perception/occupancy_grid_map_outlier_filter/CMakeLists.txt index a9aa90cdb7a90..6a011366092b5 100644 --- a/perception/occupancy_grid_map_outlier_filter/CMakeLists.txt +++ b/perception/occupancy_grid_map_outlier_filter/CMakeLists.txt @@ -32,6 +32,7 @@ ament_auto_find_build_dependencies() include_directories( include + SYSTEM ${Boost_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} diff --git a/planning/behavior_velocity_planner/CMakeLists.txt b/planning/behavior_velocity_planner/CMakeLists.txt index 054fff44d407c..dbece41301ed7 100644 --- a/planning/behavior_velocity_planner/CMakeLists.txt +++ b/planning/behavior_velocity_planner/CMakeLists.txt @@ -56,6 +56,12 @@ ament_auto_add_library(scene_module_lib SHARED src/utilization/interpolate.cpp ) +target_include_directories(scene_module_lib + SYSTEM PUBLIC + ${BOOST_INCLUDE_DIRS} + ${tf2_geometry_msgs_INCLUDE_DIRS} +) + target_include_directories(scene_module_lib PUBLIC $ diff --git a/sensing/pointcloud_preprocessor/CMakeLists.txt b/sensing/pointcloud_preprocessor/CMakeLists.txt index 9f4e18780b53a..5d272e23800ff 100644 --- a/sensing/pointcloud_preprocessor/CMakeLists.txt +++ b/sensing/pointcloud_preprocessor/CMakeLists.txt @@ -32,6 +32,7 @@ ament_auto_find_build_dependencies() include_directories( include + SYSTEM ${Boost_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIRS} diff --git a/sensing/pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_uint16_nodelet.cpp b/sensing/pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_uint16_nodelet.cpp index 0b2602220b28d..9968de2a33022 100644 --- a/sensing/pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_uint16_nodelet.cpp +++ b/sensing/pointcloud_preprocessor/src/passthrough_filter/passthrough_filter_uint16_nodelet.cpp @@ -94,7 +94,7 @@ rcl_interfaces::msg::SetParametersResult PassThroughFilterUInt16Component::param } // Check the current value for keep_organized - bool keep_organized; + bool keep_organized{get_parameter("keep_organized").as_bool()}; get_param(p, "keep_organized", keep_organized); if (impl_.getKeepOrganized() != keep_organized) { RCLCPP_DEBUG( @@ -105,7 +105,7 @@ rcl_interfaces::msg::SetParametersResult PassThroughFilterUInt16Component::param } // Check the current value for the negative flag - bool filter_limit_negative; + bool filter_limit_negative{get_parameter("filter_limit_negative").as_bool()}; get_param(p, "filter_limit_negative", filter_limit_negative); if (impl_.getFilterLimitsNegative() != filter_limit_negative) { RCLCPP_DEBUG(