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: update dependencies and deprecated code for ROS 2 jazzy release #6656

Closed
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<license>BSD-3-Clause</license>

<depend>ament_index_cpp</depend>
<depend>autoware_auto_vehicle_msgs</depend>
<depend>autoware_perception_msgs</depend>
<depend>boost</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include "tier4_autoware_utils/geometry/geometry.hpp"
#include "tier4_autoware_utils/math/unit_conversion.hpp"

#include <boost/optional/optional_io.hpp>

#include <gtest/gtest.h>

using tier4_autoware_utils::Point2d;
Expand Down Expand Up @@ -75,7 +77,7 @@ TEST(predicted_path_utils, testCalcInterpolatedPose)
for (double t = 0.0; t < 9.0 + 1e-6; t += 1.0) {
const auto p = calcInterpolatedPose(path, t);

EXPECT_NE(p, boost::none);
EXPECT_TRUE(p);
EXPECT_NEAR(p->position.x, t * 1.0, epsilon);
EXPECT_NEAR(p->position.y, 0.0, epsilon);
EXPECT_NEAR(p->position.z, 0.0, epsilon);
Expand All @@ -92,7 +94,7 @@ TEST(predicted_path_utils, testCalcInterpolatedPose)
for (double t = 0.0; t < 9.0; t += 0.3) {
const auto p = calcInterpolatedPose(path, t);

EXPECT_NE(p, boost::none);
EXPECT_TRUE(p);
EXPECT_NEAR(p->position.x, t * 1.0, epsilon);
EXPECT_NEAR(p->position.y, 0.0, epsilon);
EXPECT_NEAR(p->position.z, 0.0, epsilon);
Expand All @@ -108,20 +110,20 @@ TEST(predicted_path_utils, testCalcInterpolatedPose)
// Negative time
{
const auto p = calcInterpolatedPose(path, -1.0);
EXPECT_EQ(p, boost::none);
EXPECT_FALSE(p);
}

// Over the time horizon
{
const auto p = calcInterpolatedPose(path, 11.0);
EXPECT_EQ(p, boost::none);
EXPECT_FALSE(p);
}

// Empty Path
{
PredictedPath empty_path;
const auto p = calcInterpolatedPose(empty_path, 5.0);
EXPECT_EQ(p, boost::none);
EXPECT_FALSE(p);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions common/signal_processing/test/src/lowpass_filter_1d_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "signal_processing/lowpass_filter_1d.hpp"

#include <boost/optional/optional_io.hpp>

#include <gtest/gtest.h>

constexpr double epsilon = 1e-6;
Expand All @@ -23,7 +25,7 @@ TEST(lowpass_filter_1d, filter)
LowpassFilter1d lowpass_filter_1d(0.1);

// initial state
EXPECT_EQ(lowpass_filter_1d.getValue(), boost::none);
EXPECT_FALSE(lowpass_filter_1d.getValue());

// random filter
EXPECT_NEAR(lowpass_filter_1d.filter(0.0), 0.0, epsilon);
Expand All @@ -33,7 +35,7 @@ TEST(lowpass_filter_1d, filter)

// reset without value
lowpass_filter_1d.reset();
EXPECT_EQ(lowpass_filter_1d.getValue(), boost::none);
EXPECT_FALSE(lowpass_filter_1d.getValue());

// reset with value
lowpass_filter_1d.reset(-1.1);
Expand Down
6 changes: 4 additions & 2 deletions common/signal_processing/test/src/lowpass_filter_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "signal_processing/lowpass_filter.hpp"

#include <boost/optional/optional_io.hpp>

#include <gtest/gtest.h>

constexpr double epsilon = 1e-6;
Expand All @@ -39,7 +41,7 @@ TEST(lowpass_filter_twist, filter)
LowpassFilterTwist lowpass_filter_(0.1);

{ // initial state
EXPECT_EQ(lowpass_filter_.getValue(), boost::none);
EXPECT_FALSE(lowpass_filter_.getValue());
}

{ // random filter
Expand All @@ -56,7 +58,7 @@ TEST(lowpass_filter_twist, filter)

{ // reset without value
lowpass_filter_.reset();
EXPECT_EQ(lowpass_filter_.getValue(), boost::none);
EXPECT_FALSE(lowpass_filter_.getValue());
}

{ // reset with value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <OgreQuaternion.h>
#include <OgreSceneManager.h>
#include <OgreSceneNode.h>
#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreViewport.h>

namespace tier4_camera_view_rviz_plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#include "rviz_common/frame_position_tracking_view_controller.hpp"

#include <OgreQuaternion.h>
#include <OgreVector3.h>
#include <OgreVector.h>

namespace rviz_common
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include <OgreQuaternion.h>
#include <OgreRay.h>
#include <OgreSceneNode.h>
#include <OgreVector3.h>
#include <OgreVector.h>
#include <OgreViewport.h>
#include <stdint.h>

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

#include "rviz_default_plugins/view_controllers/orbit/orbit_view_controller.hpp"

#include <OgreVector3.h>
#include <OgreVector.h>

#include <utility>

Expand Down
2 changes: 1 addition & 1 deletion common/tier4_perception_rviz_plugin/src/tools/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <rviz_common/viewport_mouse_event.hpp>

#include <OgreVector3.h>
#include <OgreVector.h>

#include <optional>

Expand Down
1 change: 1 addition & 0 deletions common/tier4_vehicle_rviz_plugin/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>autoware_auto_vehicle_msgs</depend>
<depend>libqt5-core</depend>
<depend>libqt5-gui</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <OgreColourValue.h>
#include <OgreManualObject.h>
#include <OgreVector3.h>
#include <OgreVector.h>

#include <deque>
#include <memory>
Expand Down
1 change: 1 addition & 0 deletions control/trajectory_follower_node/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>autoware_adapi_v1_msgs</depend>
<depend>autoware_auto_control_msgs</depend>
<depend>autoware_auto_planning_msgs</depend>
Expand Down
1 change: 1 addition & 0 deletions control/vehicle_cmd_gate/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<build_depend>rosidl_default_generators</build_depend>

<depend>ament_index_cpp</depend>
<depend>autoware_adapi_v1_msgs</depend>
<depend>autoware_auto_control_msgs</depend>
<depend>autoware_auto_system_msgs</depend>
Expand Down
1 change: 1 addition & 0 deletions evaluator/kinematic_evaluator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>autoware_auto_perception_msgs</depend>
<depend>autoware_auto_planning_msgs</depend>
<depend>diagnostic_msgs</depend>
Expand Down
1 change: 1 addition & 0 deletions evaluator/localization_evaluator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>autoware_auto_perception_msgs</depend>
<depend>autoware_auto_planning_msgs</depend>
<depend>diagnostic_msgs</depend>
Expand Down
1 change: 1 addition & 0 deletions evaluator/perception_online_evaluator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>autoware_perception_msgs</depend>
<depend>diagnostic_msgs</depend>
<depend>eigen</depend>
Expand Down
1 change: 1 addition & 0 deletions evaluator/planning_evaluator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>autoware_auto_perception_msgs</depend>
<depend>autoware_auto_planning_msgs</depend>
<depend>autoware_planning_msgs</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@
#include <opencv4/opencv2/calib3d.hpp>
#include <opencv4/opencv2/core/quaternion.hpp>

#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp>
#else
#include <cv_bridge/cv_bridge.h>
#endif
#include <tf2/LinearMath/Transform.h>

#include <algorithm>
Expand Down
1 change: 1 addition & 0 deletions localization/localization_util/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>fmt</depend>
<depend>geometry_msgs</depend>
<depend>nav_msgs</depend>
Expand Down
4 changes: 4 additions & 0 deletions localization/yabloc/yabloc_common/src/cv_decompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
#include <opencv4/opencv2/imgcodecs.hpp>
#include <opencv4/opencv2/imgproc.hpp>

#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp>
#else
#include <cv_bridge/cv_bridge.h>
#endif

#include <iostream>

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

#include "yabloc_common/pub_sub.hpp"

#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp>
#else
#include <cv_bridge/cv_bridge.h>
#endif
#include <pcl_conversions/pcl_conversions.h>

namespace yabloc::common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
#include <yabloc_common/cv_decompress.hpp>
#include <yabloc_common/pub_sub.hpp>

#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp>
#else
#include <cv_bridge/cv_bridge.h>
#endif
Copy link
Member

Choose a reason for hiding this comment

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

We might want to leave comments so that we know why we need this when we look back to this code in the future.

Suggested change
#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp>
#else
#include <cv_bridge/cv_bridge.h>
#endif
#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp> // for ROS 2 Jazzy
#else
#include <cv_bridge/cv_bridge.h> // for ROS 2 Humble
#endif

Copy link
Member

Choose a reason for hiding this comment

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

We should also fix other __has_include codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. This comment will help devs later. Thanks!

Similar usage of __has_include can be found some files that is not included in this PR.
(These codes seem to have been added to support ROS 2 Iron.)
Should I add some comment to these files?

Copy link
Member

@mitsudome-r mitsudome-r Jun 2, 2024

Choose a reason for hiding this comment

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

Yes, I think that would help. (If they are really for Jazzy or Iron)

#include <pcl_conversions/pcl_conversions.h>

namespace yabloc::line_segments_overlay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
#include <sensor_msgs/msg/compressed_image.hpp>
#include <sensor_msgs/msg/image.hpp>

#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp>
#else
#include <cv_bridge/cv_bridge.h>
#endif

#include <optional>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>

#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp>
#else
#include <cv_bridge/cv_bridge.h>
#endif

#include <filesystem>

Expand Down
1 change: 1 addition & 0 deletions map/map_loader/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>autoware_auto_mapping_msgs</depend>
<depend>autoware_map_msgs</depend>
<depend>component_interface_specs</depend>
Expand Down
1 change: 1 addition & 0 deletions perception/bytetrack/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<buildtool_export_depend>cudnn_cmake_module</buildtool_export_depend>
<buildtool_export_depend>tensorrt_cmake_module</buildtool_export_depend>

<depend>ament_index_cpp</depend>
<depend>autoware_auto_perception_msgs</depend>
<depend>cuda_utils</depend>
<depend>cv_bridge</depend>
Expand Down
1 change: 1 addition & 0 deletions perception/ground_segmentation/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<buildtool_depend>ament_cmake_auto</buildtool_depend>
<buildtool_depend>autoware_cmake</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>libopencv-dev</depend>
<depend>pcl_conversions</depend>
<depend>pcl_ros</depend>
Expand Down
1 change: 1 addition & 0 deletions perception/radar_object_tracker/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<buildtool_depend>autoware_cmake</buildtool_depend>
<buildtool_depend>eigen3_cmake_module</buildtool_depend>

<depend>ament_index_cpp</depend>
<depend>autoware_auto_perception_msgs</depend>
<depend>eigen</depend>
<depend>glog</depend>
Expand Down
1 change: 1 addition & 0 deletions perception/traffic_light_classifier/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

<build_depend>autoware_cmake</build_depend>

<depend>ament_index_cpp</depend>
<depend>cuda_utils</depend>
<depend>cv_bridge</depend>
<depend>image_transport</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
#include <tier4_perception_msgs/msg/traffic_light_roi_array.hpp>
#include <visualization_msgs/msg/marker_array.hpp>

#if __has_include(<image_geometry/pinhole_camera_model.hpp>)
#include <image_geometry/pinhole_camera_model.hpp>
#else
#include <image_geometry/pinhole_camera_model.h>
#endif

#include <lanelet2_core/LaneletMap.h>
#include <lanelet2_routing/RoutingGraph.h>
#include <lanelet2_traffic_rules/TrafficRulesFactory.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
#include <tier4_perception_msgs/msg/traffic_light_array.hpp>
#include <tier4_perception_msgs/msg/traffic_light_roi_array.hpp>

#if __has_include(<image_geometry/pinhole_camera_model.hpp>)
#include <image_geometry/pinhole_camera_model.hpp>
#else
#include <image_geometry/pinhole_camera_model.h>
#endif

#include <message_filters/subscriber.h>
#include <message_filters/synchronizer.h>
#include <message_filters/time_synchronizer.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@
#include <sensor_msgs/msg/point_cloud2.hpp>
#include <tier4_perception_msgs/msg/traffic_light_roi_array.hpp>

#if __has_include(<image_geometry/pinhole_camera_model.hpp>)
#include <image_geometry/pinhole_camera_model.hpp>
#else
#include <image_geometry/pinhole_camera_model.h>
#endif

#include <lanelet2_core/Forward.h>
#include <pcl/common/transforms.h>
#include <pcl/point_cloud.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@
#include <tier4_perception_msgs/msg/traffic_light_array.hpp>
#include <tier4_perception_msgs/msg/traffic_light_roi_array.hpp>

#if __has_include(<cv_bridge/cv_bridge.hpp>)
#include <cv_bridge/cv_bridge.hpp>
#else
#include <cv_bridge/cv_bridge.h>
#endif
#include <message_filters/subscriber.h>
#include <message_filters/sync_policies/approximate_time.h>
#include <message_filters/synchronizer.h>
Expand Down
Loading
Loading