Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: suppress compiler warnings #852

Merged
merged 4 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
namespace goal_distance_calculator
{
GoalDistanceCalculatorNode::GoalDistanceCalculatorNode(const rclcpp::NodeOptions & options)
: Node("goal_distance_calculator"),
: Node("goal_distance_calculator", options),
self_pose_listener_(this),
debug_publisher_(this, "goal_distance_calculator")
{
Expand Down
7 changes: 7 additions & 0 deletions common/tier4_planning_rviz_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ target_link_libraries(tier4_planning_rviz_plugin
${QT_LIBRARIES}
)

# workaround to allow deprecated header to build on both galactic and rolling
if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
target_compile_definitions(tier4_planning_rviz_plugin PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()

# Export the plugin to be imported by rviz2
pluginlib_export_plugin_description_file(rviz_common plugins/plugin_description.xml)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@

#include <mission_checkpoint/mission_checkpoint.hpp>

#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif
#include <tf2_ros/transform_listener.h>

#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void SteeringAngleDisplay::update(float wall_dt, float ros_dt)
// ((property_handle_angle_scale_->getFloat() * (msg_ptr->data / M_PI) * -180.0));
int handle_image_width = handle_image_.width(), handle_image_height = handle_image_.height();
QPixmap rotate_handle_image;
rotate_handle_image = handle_image_.transformed(rotation_matrix);
rotate_handle_image = handle_image_.transformed(QTransform(rotation_matrix));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transformed(QMatrix) is deprecated.

rotate_handle_image = rotate_handle_image.copy(
(rotate_handle_image.width() - handle_image_width) / 2,
(rotate_handle_image.height() - handle_image_height) / 2, handle_image_width,
Expand Down
7 changes: 7 additions & 0 deletions localization/gyro_odometer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ ament_auto_add_executable(${PROJECT_NAME}
${GYRO_ODOMETER_HEADERS}
)

# workaround to allow deprecated header to build on both galactic and rolling
if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
target_compile_definitions(${PROJECT_NAME} PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
#include <sensor_msgs/msg/imu.hpp>

#include <tf2/transform_datatypes.h>
#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif
#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>

Expand Down
4 changes: 4 additions & 0 deletions localization/gyro_odometer/src/gyro_odometer_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

#include "gyro_odometer/gyro_odometer_core.hpp"

#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif

#include <cmath>
#include <memory>
Expand Down
7 changes: 7 additions & 0 deletions localization/localization_error_monitor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ ament_auto_add_executable(localization_error_monitor
src/node.cpp
)

# workaround to allow deprecated header to build on both galactic and rolling
if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
target_compile_definitions(localization_error_monitor PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
Expand Down
4 changes: 4 additions & 0 deletions localization/localization_error_monitor/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
#include <Eigen/Dense>

#include <tf2/utils.h>
#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif

#include <algorithm>
#include <cmath>
Expand Down
7 changes: 7 additions & 0 deletions localization/pose2twist/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ ament_auto_add_executable(pose2twist
src/pose2twist_core.cpp
)

# workaround to allow deprecated header to build on both galactic and rolling
if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
target_compile_definitions(pose2twist PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
Expand Down
4 changes: 4 additions & 0 deletions localization/pose2twist/src/pose2twist_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

#include "pose2twist/pose2twist_core.hpp"

#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif

#include <cmath>
#include <cstddef>
Expand Down
7 changes: 7 additions & 0 deletions localization/pose_initializer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ ament_auto_add_executable(pose_initializer
)
target_link_libraries(pose_initializer ${PCL_LIBRARIES})

# workaround to allow deprecated header to build on both galactic and rolling
if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
target_compile_definitions(pose_initializer PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
Expand Down
6 changes: 5 additions & 1 deletion localization/pose_initializer/src/pose_initializer_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
#include "pose_initializer/pose_initializer_core.hpp"

#include <pcl_conversions/pcl_conversions.h>
#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif

#include <algorithm>
#include <chrono>
Expand Down Expand Up @@ -188,7 +192,7 @@ bool PoseInitializer::getHeight(
input_pose_msg.pose.pose.position.z);

if (map_ptr_) {
tf2::Transform transform;
tf2::Transform transform{tf2::Quaternion{}, tf2::Vector3{}};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error: 'transform.tf2::Transform::m_origin.tf2::Vector3::m_floats[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized]

try {
const auto stamped = tf2_buffer_.lookupTransform(map_frame_, fixed_frame, tf2::TimePointZero);
tf2::fromMsg(stamped.transform, transform);
Expand Down
7 changes: 7 additions & 0 deletions perception/image_projection_based_fusion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ target_link_libraries(${PROJECT_NAME}
${EIGEN3_LIBRARIES}
)

# workaround to allow deprecated header to build on both galactic and rolling
if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
target_compile_definitions(${PROJECT_NAME} PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()

rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "image_projection_based_fusion::RoiClusterFusionNode"
EXECUTABLE roi_cluster_fusion_node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@
#include <Eigen/Geometry>
#include <rclcpp/rclcpp.hpp>

#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_eigen/tf2_eigen.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_sensor_msgs/tf2_sensor_msgs.h>
#else
#include <tf2_eigen/tf2_eigen.hpp>

#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#include <tf2_sensor_msgs/tf2_sensor_msgs.hpp>
#endif

#include <optional>
#include <string>
Expand Down
6 changes: 6 additions & 0 deletions perception/image_projection_based_fusion/src/fusion_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@

#include <boost/optional.hpp>

#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_eigen/tf2_eigen.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#else
#include <tf2_eigen/tf2_eigen.hpp>

#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif

namespace image_projection_based_fusion
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@
#include <sensor_msgs/msg/point_cloud2.hpp>
#include <sensor_msgs/point_cloud2_iterator.hpp>

#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_sensor_msgs/tf2_sensor_msgs.h>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#include <tf2_sensor_msgs/tf2_sensor_msgs.hpp>
#endif

namespace image_projection_based_fusion
{
Expand Down
3 changes: 3 additions & 0 deletions perception/lidar_apollo_instance_segmentation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.5)
project(lidar_apollo_instance_segmentation)

# TODO: remove (https://github.com/autowarefoundation/autoware.universe/issues/850)
add_compile_options(-Wno-deprecated-declarations)

option(CUDA_VERBOSE "Verbose output of CUDA modules" OFF)

# set flags for CUDA availability
Expand Down
12 changes: 11 additions & 1 deletion perception/lidar_centerpoint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

set(CUDA_VERBOSE OFF)
# TODO: remove (https://github.com/autowarefoundation/autoware.universe/issues/850)
add_compile_options(-Wno-deprecated-declarations -Wno-unknown-pragmas)

option(CUDA_VERBOSE "Verbose output of CUDA modules" OFF)

# set flags for CUDA availability
option(CUDA_AVAIL "CUDA available" OFF)
Expand Down Expand Up @@ -147,6 +150,13 @@ if(TRT_AVAIL AND CUDA_AVAIL AND CUDNN_AVAIL)
centerpoint_cuda_libraries
)

# workaround to allow deprecated header to build on both galactic and rolling
if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
target_compile_definitions(centerpoint PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()

## node ##
ament_auto_add_library(lidar_centerpoint_component SHARED
src/node.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@

#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>
#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_sensor_msgs/tf2_sensor_msgs.h>
#else
#include <tf2_sensor_msgs/tf2_sensor_msgs.hpp>
#endif

#include <list>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#include <boost/optional.hpp>

#include <pcl_conversions/pcl_conversions.h>
#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_eigen/tf2_eigen.h>
#else
#include <tf2_eigen/tf2_eigen.hpp>
#endif

#include <string>
#include <utility>
Expand Down
4 changes: 4 additions & 0 deletions perception/lidar_centerpoint/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
#include <tier4_autoware_utils/math/constants.hpp>
#include <utils.hpp>

#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif

#include <memory>
#include <string>
Expand Down
3 changes: 3 additions & 0 deletions perception/tensorrt_yolo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Wno-deprecated-declarations -Werror)
endif()

# TODO: remove (https://github.com/autowarefoundation/autoware.universe/issues/850)
add_compile_options(-Wno-deprecated-declarations)

option(CUDA_VERBOSE "Verbose output of CUDA modules" OFF)

find_package(ament_cmake_auto REQUIRED)
Expand Down
3 changes: 3 additions & 0 deletions perception/traffic_light_classifier/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Wno-deprecated-declarations -Werror)
endif()

# TODO: remove (https://github.com/autowarefoundation/autoware.universe/issues/850)
add_compile_options(-Wno-deprecated-declarations)

option(CUDA_VERBOSE "Verbose output of CUDA modules" OFF)
# set flags for CUDA availability
option(CUDA_AVAIL "CUDA available" OFF)
Expand Down
3 changes: 3 additions & 0 deletions perception/traffic_light_ssd_fine_detector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ endif()

project(traffic_light_ssd_fine_detector)

# TODO: remove (https://github.com/autowarefoundation/autoware.universe/issues/850)
add_compile_options(-Wno-deprecated-declarations)

option(CUDA_VERBOSE "Verbose output of CUDA modules" OFF)

find_package(ament_cmake_auto REQUIRED)
Expand Down
15 changes: 15 additions & 0 deletions planning/costmap_generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ament_auto_find_build_dependencies()

include_directories(
include
SYSTEM
${GRID_MAP_INCLUDE_DIR}
${PCL_COMMON_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
Expand All @@ -40,6 +41,13 @@ if(${PCL_VERSION} GREATER_EQUAL 1.12.1)
)
endif()

# workaround to allow deprecated header to build on both galactic and rolling
if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
target_compile_definitions(costmap_generator_lib PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()

ament_auto_add_library(costmap_generator_node SHARED
nodes/costmap_generator/costmap_generator_node.cpp
)
Expand All @@ -48,6 +56,13 @@ target_link_libraries(costmap_generator_node
costmap_generator_lib
)

# workaround to allow deprecated header to build on both galactic and rolling
if(${tf2_geometry_msgs_VERSION} VERSION_LESS 0.18.0)
target_compile_definitions(costmap_generator_node PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()

rclcpp_components_register_node(costmap_generator_node
PLUGIN "CostmapGenerator"
EXECUTABLE costmap_generator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@
#include <grid_map_msgs/msg/grid_map.h>
#include <message_filters/subscriber.h>
#include <message_filters/time_synchronizer.h>
#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif
#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@

#include <grid_map_msgs/msg/grid_map.hpp>

#ifdef USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#else
#include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
#endif
#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>

Expand Down
Loading