Skip to content

Commit

Permalink
fix(trajectory_follower): modify build error in rolling (#803)
Browse files Browse the repository at this point in the history
Signed-off-by: wep21 <border_goldenmarket@yahoo.co.jp>
  • Loading branch information
wep21 authored Apr 25, 2022
1 parent d1e290e commit 7919b56
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 3 deletions.
18 changes: 16 additions & 2 deletions control/trajectory_follower/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ target_compile_options(${LATERAL_CONTROLLER_LIB} PRIVATE -Wno-error=old-style-ca

# 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(${LATERAL_CONTROLLER_LIB} PUBLIC
target_compile_definitions(${LATERAL_CONTROLLER_LIB} PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()
Expand Down Expand Up @@ -95,7 +95,7 @@ target_compile_options(${LONGITUDINAL_CONTROLLER_LIB} PRIVATE -Wno-error=old-sty

# 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(${LONGITUDINAL_CONTROLLER_LIB} PUBLIC
target_compile_definitions(${LONGITUDINAL_CONTROLLER_LIB} PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()
Expand All @@ -118,6 +118,13 @@ if(BUILD_TESTING)
autoware_set_compile_options(${TEST_LATERAL_CONTROLLER_EXE})
target_link_libraries(${TEST_LATERAL_CONTROLLER_EXE} ${LATERAL_CONTROLLER_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(${TEST_LATERAL_CONTROLLER_EXE} PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()

set(TEST_LON_SOURCES
test/test_debug_values.cpp
test/test_pid.cpp
Expand All @@ -128,6 +135,13 @@ if(BUILD_TESTING)
ament_add_gtest(${TEST_LONGITUDINAL_CONTROLLER_EXE} ${TEST_LON_SOURCES})
autoware_set_compile_options(${TEST_LONGITUDINAL_CONTROLLER_EXE})
target_link_libraries(${TEST_LONGITUDINAL_CONTROLLER_EXE} ${LONGITUDINAL_CONTROLLER_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(${TEST_LONGITUDINAL_CONTROLLER_EXE} PRIVATE
USE_TF2_GEOMETRY_MSGS_DEPRECATED_HEADER
)
endif()
endif()

# ament package generation and installing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
#include "motion_common/motion_common.hpp"
#include "rclcpp/rclcpp.hpp"
#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 "trajectory_follower/interpolate.hpp"
#include "trajectory_follower/mpc_trajectory.hpp"
#include "trajectory_follower/visibility_control.hpp"
Expand All @@ -32,7 +39,6 @@
#include "autoware_auto_planning_msgs/msg/trajectory_point.hpp"
#include "geometry_msgs/msg/pose_stamped.hpp"
#include "geometry_msgs/msg/twist_stamped.hpp"
#include "tf2_geometry_msgs/tf2_geometry_msgs.h"

#include <cmath>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@

#include <experimental/optional> // NOLINT

#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 <limits>
Expand Down
1 change: 1 addition & 0 deletions control/trajectory_follower/src/pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <algorithm>
#include <memory>
#include <stdexcept>
#include <utility>
#include <vector>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
#include "geometry_msgs/msg/point.hpp"
#include "geometry_msgs/msg/pose.hpp"
#include "geometry_msgs/msg/quaternion.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 <limits>

Expand Down
5 changes: 5 additions & 0 deletions control/trajectory_follower/test/test_mpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
#include "autoware_auto_system_msgs/msg/float32_multi_array_diagnostic.hpp"
#include "autoware_auto_vehicle_msgs/msg/steering_report.hpp"
#include "geometry_msgs/msg/pose.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

0 comments on commit 7919b56

Please sign in to comment.