From 401f6e520b9d7e8edd061b62b6f15aa3c138c5a2 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Wed, 12 Jan 2022 14:27:34 -0800 Subject: [PATCH] Fix cpplint errors (#497) * Fix include order for cpplint Relates to https://github.com/ament/ament_lint/pull/324 Signed-off-by: Jacob Perron * Replace C-style cast with static_cast Signed-off-by: Jacob Perron --- tf2_bullet/include/tf2_bullet/tf2_bullet.hpp | 14 +++---- tf2_bullet/test/test_tf2_bullet.cpp | 10 ++--- tf2_eigen/include/tf2_eigen/tf2_eigen.hpp | 19 +++++---- tf2_eigen/test/tf2_eigen-test.cpp | 32 ++++++++------- .../include/tf2_eigen_kdl/tf2_eigen_kdl.hpp | 4 +- .../tf2_geometry_msgs/tf2_geometry_msgs.hpp | 41 ++++++++++--------- .../test/test_tf2_geometry_msgs.cpp | 14 +++---- .../include/tf2_ros/async_buffer_interface.h | 12 +++--- tf2_ros/include/tf2_ros/buffer.h | 22 +++++----- tf2_ros/include/tf2_ros/buffer_client.h | 16 ++++---- tf2_ros/include/tf2_ros/buffer_interface.h | 20 ++++----- tf2_ros/include/tf2_ros/buffer_server.h | 20 ++++----- .../include/tf2_ros/create_timer_interface.h | 11 +++-- tf2_ros/include/tf2_ros/create_timer_ros.h | 12 +++--- tf2_ros/include/tf2_ros/message_filter.h | 22 +++++----- .../tf2_ros/static_transform_broadcaster.h | 14 +++---- .../static_transform_broadcaster_node.hpp | 8 ++-- .../include/tf2_ros/transform_broadcaster.h | 13 +++--- tf2_ros/include/tf2_ros/transform_listener.h | 17 ++++---- tf2_ros/src/buffer_client.cpp | 6 +-- tf2_ros/src/buffer_server_main.cpp | 10 ++--- tf2_ros/src/create_timer_ros.cpp | 11 ++--- tf2_ros/src/static_transform_broadcaster.cpp | 10 ++--- .../static_transform_broadcaster_program.cpp | 13 +++--- tf2_ros/src/tf2_echo.cpp | 10 ++--- tf2_ros/src/tf2_monitor.cpp | 16 ++++---- tf2_ros/src/transform_broadcaster.cpp | 8 ++-- tf2_ros/test/listener_unittest.cpp | 15 +++---- tf2_ros/test/message_filter_test.cpp | 30 +++++++------- tf2_ros/test/node_wrapper.hpp | 6 +-- tf2_ros/test/test_buffer.cpp | 15 +++---- tf2_ros/test/test_buffer_client.cpp | 18 ++++---- tf2_ros/test/test_buffer_server.cpp | 19 ++++----- tf2_ros/test/time_reset_test.cpp | 19 +++++---- .../tf2_sensor_msgs/tf2_sensor_msgs.hpp | 18 ++++---- tf2_sensor_msgs/test/test_tf2_sensor_msgs.cpp | 18 ++++---- 36 files changed, 285 insertions(+), 278 deletions(-) diff --git a/tf2_bullet/include/tf2_bullet/tf2_bullet.hpp b/tf2_bullet/include/tf2_bullet/tf2_bullet.hpp index 0f1408d88..061e076f6 100644 --- a/tf2_bullet/include/tf2_bullet/tf2_bullet.hpp +++ b/tf2_bullet/include/tf2_bullet/tf2_bullet.hpp @@ -31,15 +31,15 @@ #ifndef TF2_BULLET__TF2_BULLET_HPP_ #define TF2_BULLET__TF2_BULLET_HPP_ -#include -#include -#include -#include -#include -#include - #include +#include "tf2/convert.h" +#include "LinearMath/btQuaternion.h" +#include "LinearMath/btScalar.h" +#include "LinearMath/btTransform.h" +#include "geometry_msgs/msg/point_stamped.hpp" +#include "tf2_ros/buffer_interface.h" + #if (BT_BULLET_VERSION <= 282) // Suppress compilation warning on older versions of Bullet. // TODO(mjcarroll): Remove this when all platforms have the fix upstream. diff --git a/tf2_bullet/test/test_tf2_bullet.cpp b/tf2_bullet/test/test_tf2_bullet.cpp index 998f8f2fb..9678d8b2a 100644 --- a/tf2_bullet/test/test_tf2_bullet.cpp +++ b/tf2_bullet/test/test_tf2_bullet.cpp @@ -28,12 +28,10 @@ /** \author Wim Meeussen */ - -#include -#include -#include -#include - +#include "tf2_bullet/tf2_bullet.hpp" +#include "rclcpp/rclcpp.hpp" +#include "gtest/gtest.h" +#include "tf2/convert.h" TEST(TfBullet, ConvertVector) { diff --git a/tf2_eigen/include/tf2_eigen/tf2_eigen.hpp b/tf2_eigen/include/tf2_eigen/tf2_eigen.hpp index aaf85fc85..061c57aaa 100644 --- a/tf2_eigen/include/tf2_eigen/tf2_eigen.hpp +++ b/tf2_eigen/include/tf2_eigen/tf2_eigen.hpp @@ -29,17 +29,18 @@ #ifndef TF2_EIGEN__TF2_EIGEN_HPP_ #define TF2_EIGEN__TF2_EIGEN_HPP_ -#include -#include #include -#include -#include -#include -#include -#include -#include -#include +#include "geometry_msgs/msg/point.hpp" +#include "geometry_msgs/msg/point_stamped.hpp" +#include "geometry_msgs/msg/pose_stamped.hpp" +#include "geometry_msgs/msg/quaternion.hpp" +#include "geometry_msgs/msg/quaternion_stamped.hpp" +#include "geometry_msgs/msg/twist.hpp" + +#include "tf2/convert.h" +#include "tf2_ros/buffer.h" +#include "tf2_ros/buffer_interface.h" namespace tf2 { diff --git a/tf2_eigen/test/tf2_eigen-test.cpp b/tf2_eigen/test/tf2_eigen-test.cpp index aa9de709d..b438227b6 100644 --- a/tf2_eigen/test/tf2_eigen-test.cpp +++ b/tf2_eigen/test/tf2_eigen-test.cpp @@ -34,24 +34,26 @@ #endif #endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - #include #include +#include // NOLINT + +#include "gtest/gtest.h" + +#include "geometry_msgs/msg/point.hpp" +#include "geometry_msgs/msg/point_stamped.hpp" +#include "geometry_msgs/msg/pose.hpp" +#include "geometry_msgs/msg/pose_stamped.hpp" +#include "geometry_msgs/msg/transform_stamped.hpp" +#include "rclcpp/clock.hpp" + +#include "tf2/convert.h" +#include "tf2/transform_datatypes.h" +#include "tf2_eigen/tf2_eigen.hpp" +#include "tf2_ros/buffer.h" +#include "tf2_ros/transform_listener.h" + TEST(TfEigen, ConvertVector3dStamped) { const tf2::Stamped v(Eigen::Vector3d(1, 2, 3), tf2::TimePoint( diff --git a/tf2_eigen_kdl/include/tf2_eigen_kdl/tf2_eigen_kdl.hpp b/tf2_eigen_kdl/include/tf2_eigen_kdl/tf2_eigen_kdl.hpp index 8154c385e..46b23263e 100644 --- a/tf2_eigen_kdl/include/tf2_eigen_kdl/tf2_eigen_kdl.hpp +++ b/tf2_eigen_kdl/include/tf2_eigen_kdl/tf2_eigen_kdl.hpp @@ -40,9 +40,9 @@ #include #include -#include +#include "kdl/frames.hpp" -#include +#include "tf2/impl/convert.h" #include "tf2_eigen_kdl/visibility_control.h" diff --git a/tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.hpp b/tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.hpp index b2482e635..2f0913599 100644 --- a/tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.hpp +++ b/tf2_geometry_msgs/include/tf2_geometry_msgs/tf2_geometry_msgs.hpp @@ -32,29 +32,30 @@ #ifndef TF2_GEOMETRY_MSGS__TF2_GEOMETRY_MSGS_HPP_ #define TF2_GEOMETRY_MSGS__TF2_GEOMETRY_MSGS_HPP_ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include #include +#include "geometry_msgs/msg/point_stamped.hpp" +#include "geometry_msgs/msg/quaternion_stamped.hpp" +#include "geometry_msgs/msg/transform.hpp" +#include "geometry_msgs/msg/transform_stamped.hpp" +#include "geometry_msgs/msg/vector3.hpp" +#include "geometry_msgs/msg/vector3_stamped.hpp" +#include "geometry_msgs/msg/pose.hpp" +#include "geometry_msgs/msg/point.hpp" +#include "geometry_msgs/msg/pose_stamped.hpp" +#include "geometry_msgs/msg/pose_with_covariance.hpp" +#include "geometry_msgs/msg/pose_with_covariance_stamped.hpp" +#include "geometry_msgs/msg/wrench.hpp" +#include "geometry_msgs/msg/wrench_stamped.hpp" +#include "kdl/frames.hpp" + +#include "tf2/convert.h" +#include "tf2/LinearMath/Quaternion.h" +#include "tf2/LinearMath/Transform.h" +#include "tf2/LinearMath/Vector3.h" +#include "tf2_ros/buffer_interface.h" + namespace tf2 { diff --git a/tf2_geometry_msgs/test/test_tf2_geometry_msgs.cpp b/tf2_geometry_msgs/test/test_tf2_geometry_msgs.cpp index 4829d76da..f2f87707d 100644 --- a/tf2_geometry_msgs/test/test_tf2_geometry_msgs.cpp +++ b/tf2_geometry_msgs/test/test_tf2_geometry_msgs.cpp @@ -35,17 +35,17 @@ #endif #endif -#include -#include -#include -#include -#include - -// To get M_PI, especially on Windows. #include #include #include +#include "gtest/gtest.h" + +#include "rclcpp/clock.hpp" +#include "tf2_geometry_msgs/tf2_geometry_msgs.hpp" +#include "tf2_ros/buffer.h" +#include "tf2_ros/transform_listener.h" + std::unique_ptr tf_buffer = nullptr; static const double EPS = 1e-3; diff --git a/tf2_ros/include/tf2_ros/async_buffer_interface.h b/tf2_ros/include/tf2_ros/async_buffer_interface.h index 20ce56d18..bc6e91641 100644 --- a/tf2_ros/include/tf2_ros/async_buffer_interface.h +++ b/tf2_ros/include/tf2_ros/async_buffer_interface.h @@ -30,16 +30,16 @@ #ifndef TF2_ROS__ASYNC_BUFFER_INTERFACE_H_ #define TF2_ROS__ASYNC_BUFFER_INTERFACE_H_ -#include -#include -#include - -#include - #include #include #include +#include "tf2_ros/visibility_control.h" +#include "tf2/time.h" +#include "tf2/transform_datatypes.h" + +#include "geometry_msgs/msg/transform_stamped.hpp" + namespace tf2_ros { diff --git a/tf2_ros/include/tf2_ros/buffer.h b/tf2_ros/include/tf2_ros/buffer.h index be06f2813..f1086c068 100644 --- a/tf2_ros/include/tf2_ros/buffer.h +++ b/tf2_ros/include/tf2_ros/buffer.h @@ -32,23 +32,23 @@ #ifndef TF2_ROS__BUFFER_H_ #define TF2_ROS__BUFFER_H_ -#include -#include -#include -#include -#include -#include - -#include -#include -#include - #include #include #include #include #include +#include "tf2_ros/async_buffer_interface.h" +#include "tf2_ros/buffer_interface.h" +#include "tf2_ros/create_timer_interface.h" +#include "tf2_ros/visibility_control.h" +#include "tf2/buffer_core.h" +#include "tf2/time.h" + +#include "geometry_msgs/msg/transform_stamped.hpp" +#include "tf2_msgs/srv/frame_graph.hpp" +#include "rclcpp/rclcpp.hpp" + namespace tf2_ros { diff --git a/tf2_ros/include/tf2_ros/buffer_client.h b/tf2_ros/include/tf2_ros/buffer_client.h index ceb21a9eb..ba2818115 100644 --- a/tf2_ros/include/tf2_ros/buffer_client.h +++ b/tf2_ros/include/tf2_ros/buffer_client.h @@ -38,17 +38,17 @@ #ifndef TF2_ROS__BUFFER_CLIENT_H_ #define TF2_ROS__BUFFER_CLIENT_H_ -#include -#include -#include - -#include -#include -#include - #include #include +#include "tf2_ros/buffer_interface.h" +#include "tf2_ros/visibility_control.h" +#include "tf2/time.h" + +#include "geometry_msgs/msg/transform_stamped.hpp" +#include "rclcpp_action/rclcpp_action.hpp" +#include "tf2_msgs/action/lookup_transform.hpp" + namespace tf2_ros { /** diff --git a/tf2_ros/include/tf2_ros/buffer_interface.h b/tf2_ros/include/tf2_ros/buffer_interface.h index 80a038886..381fa585d 100644 --- a/tf2_ros/include/tf2_ros/buffer_interface.h +++ b/tf2_ros/include/tf2_ros/buffer_interface.h @@ -32,21 +32,21 @@ #ifndef TF2_ROS__BUFFER_INTERFACE_H_ #define TF2_ROS__BUFFER_INTERFACE_H_ -#include -#include -#include -#include - -#include -#include -#include -#include - #include #include #include #include +#include "tf2_ros/visibility_control.h" +#include "tf2/transform_datatypes.h" +#include "tf2/exceptions.h" +#include "tf2/convert.h" + +#include "builtin_interfaces/msg/duration.hpp" +#include "builtin_interfaces/msg/time.hpp" +#include "geometry_msgs/msg/transform_stamped.hpp" +#include "rclcpp/rclcpp.hpp" + namespace tf2_ros { using TransformStampedFuture = std::shared_future; diff --git a/tf2_ros/include/tf2_ros/buffer_server.h b/tf2_ros/include/tf2_ros/buffer_server.h index 756116053..14466691f 100644 --- a/tf2_ros/include/tf2_ros/buffer_server.h +++ b/tf2_ros/include/tf2_ros/buffer_server.h @@ -38,22 +38,22 @@ #ifndef TF2_ROS__BUFFER_SERVER_H_ #define TF2_ROS__BUFFER_SERVER_H_ -#include -#include -#include - -#include -#include -#include -#include -#include - #include #include #include #include #include +#include "tf2/time.h" +#include "tf2/buffer_core_interface.h" +#include "tf2_ros/visibility_control.h" + +#include "geometry_msgs/msg/transform_stamped.hpp" +#include "rclcpp/create_timer.hpp" +#include "rclcpp/rclcpp.hpp" +#include "rclcpp_action/rclcpp_action.hpp" +#include "tf2_msgs/action/lookup_transform.hpp" + namespace tf2_ros { /** \brief Action server for the action-based implementation of tf2::BufferCoreInterface. diff --git a/tf2_ros/include/tf2_ros/create_timer_interface.h b/tf2_ros/include/tf2_ros/create_timer_interface.h index 4592706a3..0d8d6fef5 100644 --- a/tf2_ros/include/tf2_ros/create_timer_interface.h +++ b/tf2_ros/include/tf2_ros/create_timer_interface.h @@ -30,17 +30,16 @@ #ifndef TF2_ROS__CREATE_TIMER_INTERFACE_H_ #define TF2_ROS__CREATE_TIMER_INTERFACE_H_ -#include - -#include - -#include - #include #include #include #include +#include "tf2/time.h" + +#include "tf2_ros/visibility_control.h" + +#include "rclcpp/rclcpp.hpp" namespace tf2_ros { diff --git a/tf2_ros/include/tf2_ros/create_timer_ros.h b/tf2_ros/include/tf2_ros/create_timer_ros.h index b79cd6648..0590ce30c 100644 --- a/tf2_ros/include/tf2_ros/create_timer_ros.h +++ b/tf2_ros/include/tf2_ros/create_timer_ros.h @@ -30,15 +30,15 @@ #ifndef TF2_ROS__CREATE_TIMER_ROS_H_ #define TF2_ROS__CREATE_TIMER_ROS_H_ -#include -#include -#include - -#include - #include #include +#include "tf2_ros/create_timer_interface.h" +#include "tf2_ros/visibility_control.h" +#include "tf2/time.h" + +#include "rclcpp/rclcpp.hpp" + namespace tf2_ros { diff --git a/tf2_ros/include/tf2_ros/message_filter.h b/tf2_ros/include/tf2_ros/message_filter.h index cb6184308..9267b1f10 100644 --- a/tf2_ros/include/tf2_ros/message_filter.h +++ b/tf2_ros/include/tf2_ros/message_filter.h @@ -32,17 +32,6 @@ #ifndef TF2_ROS__MESSAGE_FILTER_H_ #define TF2_ROS__MESSAGE_FILTER_H_ -#include -#include -#include -#include -#include -#include -#include - -#include -#include - #include #include #include @@ -56,6 +45,17 @@ #include #include +#include "message_filters/connection.h" +#include "message_filters/message_traits.h" +#include "message_filters/simple_filter.h" +#include "tf2/buffer_core_interface.h" +#include "tf2/time.h" +#include "tf2_ros/async_buffer_interface.h" +#include "tf2_ros/buffer.h" + +#include "builtin_interfaces/msg/time.hpp" +#include "rclcpp/rclcpp.hpp" + #define TF2_ROS_MESSAGEFILTER_DEBUG(fmt, ...) \ RCUTILS_LOG_DEBUG_NAMED( \ "tf2_ros_message_filter", \ diff --git a/tf2_ros/include/tf2_ros/static_transform_broadcaster.h b/tf2_ros/include/tf2_ros/static_transform_broadcaster.h index 558ab55a2..db2cc2f69 100644 --- a/tf2_ros/include/tf2_ros/static_transform_broadcaster.h +++ b/tf2_ros/include/tf2_ros/static_transform_broadcaster.h @@ -33,16 +33,16 @@ #ifndef TF2_ROS__STATIC_TRANSFORM_BROADCASTER_H_ #define TF2_ROS__STATIC_TRANSFORM_BROADCASTER_H_ -#include - -#include -#include -#include -#include - #include #include +#include "tf2_ros/visibility_control.h" + +#include "rclcpp/rclcpp.hpp" +#include "geometry_msgs/msg/transform_stamped.hpp" +#include "tf2_msgs/msg/tf_message.hpp" +#include "tf2_ros/qos.hpp" + namespace tf2_ros { diff --git a/tf2_ros/include/tf2_ros/static_transform_broadcaster_node.hpp b/tf2_ros/include/tf2_ros/static_transform_broadcaster_node.hpp index de382a6aa..070d7de6b 100644 --- a/tf2_ros/include/tf2_ros/static_transform_broadcaster_node.hpp +++ b/tf2_ros/include/tf2_ros/static_transform_broadcaster_node.hpp @@ -30,12 +30,12 @@ #ifndef TF2_ROS__STATIC_TRANSFORM_BROADCASTER_NODE_HPP_ #define TF2_ROS__STATIC_TRANSFORM_BROADCASTER_NODE_HPP_ -#include -#include +#include -#include +#include "tf2_ros/static_transform_broadcaster.h" +#include "tf2_ros/static_transform_broadcaster_visibility_control.h" -#include +#include "rclcpp/rclcpp.hpp" namespace tf2_ros { diff --git a/tf2_ros/include/tf2_ros/transform_broadcaster.h b/tf2_ros/include/tf2_ros/transform_broadcaster.h index 6d59c4132..b84af48e0 100644 --- a/tf2_ros/include/tf2_ros/transform_broadcaster.h +++ b/tf2_ros/include/tf2_ros/transform_broadcaster.h @@ -33,16 +33,15 @@ #ifndef TF2_ROS__TRANSFORM_BROADCASTER_H_ #define TF2_ROS__TRANSFORM_BROADCASTER_H_ -#include - -#include -#include -#include -#include - #include #include +#include "tf2_ros/visibility_control.h" + +#include "rclcpp/rclcpp.hpp" +#include "geometry_msgs/msg/transform_stamped.hpp" +#include "tf2_msgs/msg/tf_message.hpp" +#include "tf2_ros/qos.hpp" namespace tf2_ros { diff --git a/tf2_ros/include/tf2_ros/transform_listener.h b/tf2_ros/include/tf2_ros/transform_listener.h index 6ff1e9359..01620a8f4 100644 --- a/tf2_ros/include/tf2_ros/transform_listener.h +++ b/tf2_ros/include/tf2_ros/transform_listener.h @@ -32,20 +32,19 @@ #ifndef TF2_ROS__TRANSFORM_LISTENER_H_ #define TF2_ROS__TRANSFORM_LISTENER_H_ -#include -#include -#include - -#include -#include - -#include - #include #include #include #include +#include "tf2/buffer_core.h" +#include "tf2/time.h" +#include "tf2_ros/visibility_control.h" + +#include "tf2_msgs/msg/tf_message.hpp" +#include "rclcpp/rclcpp.hpp" + +#include "tf2_ros/qos.hpp" namespace tf2_ros { diff --git a/tf2_ros/src/buffer_client.cpp b/tf2_ros/src/buffer_client.cpp index 2abc9b643..32702ab32 100644 --- a/tf2_ros/src/buffer_client.cpp +++ b/tf2_ros/src/buffer_client.cpp @@ -35,14 +35,14 @@ * Author: Eitan Marder-Eppstein *********************************************************************/ -#include - -#include +#include "tf2_ros/buffer_client.h" #include #include #include +#include "geometry_msgs/msg/transform_stamped.hpp" + namespace tf2_ros { geometry_msgs::msg::TransformStamped BufferClient::lookupTransform( diff --git a/tf2_ros/src/buffer_server_main.cpp b/tf2_ros/src/buffer_server_main.cpp index 7416a6c8c..7b931b08e 100644 --- a/tf2_ros/src/buffer_server_main.cpp +++ b/tf2_ros/src/buffer_server_main.cpp @@ -35,13 +35,13 @@ * Author: Wim Meeussen *********************************************************************/ -#include -#include -#include +#include -#include +#include "tf2_ros/buffer.h" +#include "tf2_ros/buffer_server.h" +#include "tf2_ros/transform_listener.h" -#include +#include "rclcpp/rclcpp.hpp" int main(int argc, char ** argv) { diff --git a/tf2_ros/src/create_timer_ros.cpp b/tf2_ros/src/create_timer_ros.cpp index 7bf244865..652d82308 100644 --- a/tf2_ros/src/create_timer_ros.cpp +++ b/tf2_ros/src/create_timer_ros.cpp @@ -27,16 +27,17 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include - -#include -#include +#include "tf2_ros/create_timer_ros.h" #include #include #include +#include "tf2/time.h" + +#include "rclcpp/create_timer.hpp" +#include "rclcpp/rclcpp.hpp" + namespace tf2_ros { diff --git a/tf2_ros/src/static_transform_broadcaster.cpp b/tf2_ros/src/static_transform_broadcaster.cpp index cbbb009db..6ea8add20 100644 --- a/tf2_ros/src/static_transform_broadcaster.cpp +++ b/tf2_ros/src/static_transform_broadcaster.cpp @@ -30,14 +30,14 @@ /** \author Tully Foote */ -#include - -#include -#include -#include +#include "tf2_ros/static_transform_broadcaster.h" #include +#include "geometry_msgs/msg/transform_stamped.hpp" +#include "rclcpp/rclcpp.hpp" +#include "tf2_msgs/msg/tf_message.hpp" + namespace tf2_ros { diff --git a/tf2_ros/src/static_transform_broadcaster_program.cpp b/tf2_ros/src/static_transform_broadcaster_program.cpp index e3f523686..3d0dcddf5 100644 --- a/tf2_ros/src/static_transform_broadcaster_program.cpp +++ b/tf2_ros/src/static_transform_broadcaster_program.cpp @@ -27,12 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include - -#include -#include - #include #include #include @@ -41,6 +35,13 @@ #include #include +#include "tf2_ros/static_transform_broadcaster_node.hpp" + +#include "tf2/LinearMath/Quaternion.h" +#include "tf2/LinearMath/Vector3.h" + +#include "rclcpp/rclcpp.hpp" + struct Option { explicit Option(bool has_arg) diff --git a/tf2_ros/src/tf2_echo.cpp b/tf2_ros/src/tf2_echo.cpp index 457424dee..39a5582de 100644 --- a/tf2_ros/src/tf2_echo.cpp +++ b/tf2_ros/src/tf2_echo.cpp @@ -28,11 +28,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include - -#include - #include #include #include @@ -40,6 +35,11 @@ #include #include +#include "tf2_ros/buffer.h" +#include "tf2_ros/transform_listener.h" + +#include "rclcpp/rclcpp.hpp" + #define _USE_MATH_DEFINES class echoListener diff --git a/tf2_ros/src/tf2_monitor.cpp b/tf2_ros/src/tf2_monitor.cpp index 03f7d3105..936527fac 100644 --- a/tf2_ros/src/tf2_monitor.cpp +++ b/tf2_ros/src/tf2_monitor.cpp @@ -30,13 +30,6 @@ /** \author Wim Meeussen */ -#include -#include - -#include -#include -#include - #include #include #include @@ -44,6 +37,13 @@ #include #include +#include "tf2_ros/buffer.h" +#include "tf2_ros/transform_listener.h" +#include "tf2_ros/qos.hpp" + +#include "rclcpp/rclcpp.hpp" +#include "tf2_msgs/msg/tf_message.hpp" + class TFMonitor { public: @@ -92,7 +92,7 @@ class TFMonitor } } - average_offset /= std::max((size_t) 1, message.transforms.size()); + average_offset /= std::max(static_cast(1), message.transforms.size()); // create the authority log std::map>::iterator it2 = authority_map.find(authority); diff --git a/tf2_ros/src/transform_broadcaster.cpp b/tf2_ros/src/transform_broadcaster.cpp index e9a8c7ba2..ee37b558b 100644 --- a/tf2_ros/src/transform_broadcaster.cpp +++ b/tf2_ros/src/transform_broadcaster.cpp @@ -32,12 +32,12 @@ #include "tf2_ros/transform_broadcaster.h" -#include -#include -#include - #include +#include "geometry_msgs/msg/transform_stamped.hpp" +#include "rclcpp/rclcpp.hpp" +#include "tf2_msgs/msg/tf_message.hpp" + namespace tf2_ros { diff --git a/tf2_ros/test/listener_unittest.cpp b/tf2_ros/test/listener_unittest.cpp index d3440fa39..cea029764 100644 --- a/tf2_ros/test/listener_unittest.cpp +++ b/tf2_ros/test/listener_unittest.cpp @@ -27,18 +27,19 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include - -#include -#include - #include #include #include #include +#include "gtest/gtest.h" + +#include "tf2_ros/buffer.h" +#include "tf2_ros/transform_listener.h" + +#include "rclcpp/rclcpp.hpp" +#include "builtin_interfaces/msg/time.hpp" + TEST(tf2_ros_test_listener, transform_listener) { auto node = rclcpp::Node::make_shared("tf2_ros_test_listener_transform_listener"); diff --git a/tf2_ros/test/message_filter_test.cpp b/tf2_ros/test/message_filter_test.cpp index 62e668a57..051656287 100644 --- a/tf2_ros/test/message_filter_test.cpp +++ b/tf2_ros/test/message_filter_test.cpp @@ -27,24 +27,26 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - #include #include #include +#include "gtest/gtest.h" + +#include "message_filters/subscriber.h" +#include "message_filters/simple_filter.h" +#include "message_filters/message_traits.h" + +#include "tf2_ros/buffer.h" +#include "tf2_ros/create_timer_ros.h" +#include "tf2_ros/message_filter.h" +#include "tf2_ros/static_transform_broadcaster.h" +#include "tf2_ros/transform_listener.h" + +#include "rclcpp/rclcpp.hpp" +#include "geometry_msgs/msg/point_stamped.hpp" +#include "geometry_msgs/msg/transform_stamped.hpp" + uint8_t filter_callback_fired = 0; void filter_callback(const geometry_msgs::msg::PointStamped & msg) { diff --git a/tf2_ros/test/node_wrapper.hpp b/tf2_ros/test/node_wrapper.hpp index ff250264d..2534f99fe 100644 --- a/tf2_ros/test/node_wrapper.hpp +++ b/tf2_ros/test/node_wrapper.hpp @@ -30,12 +30,12 @@ #ifndef NODE_WRAPPER_HPP_ #define NODE_WRAPPER_HPP_ -#include -#include - #include #include +#include "gtest/gtest.h" +#include "rclcpp/rclcpp.hpp" + class NodeWrapper { public: diff --git a/tf2_ros/test/test_buffer.cpp b/tf2_ros/test/test_buffer.cpp index ca0543c2a..6b5588485 100644 --- a/tf2_ros/test/test_buffer.cpp +++ b/tf2_ros/test/test_buffer.cpp @@ -27,19 +27,20 @@ * POSSIBILITY OF SUCH DAMAGE. */ - -#include -#include -#include -#include -#include - #include #include #include #include #include +#include "gtest/gtest.h" + +#include "rclcpp/rclcpp.hpp" + +#include "tf2_ros/buffer.h" +#include "tf2_ros/create_timer_interface.h" +#include "tf2_ros/transform_listener.h" + class MockCreateTimer final : public tf2_ros::CreateTimerInterface { public: diff --git a/tf2_ros/test/test_buffer_client.cpp b/tf2_ros/test/test_buffer_client.cpp index 82c3e5537..15fe95e4b 100644 --- a/tf2_ros/test/test_buffer_client.cpp +++ b/tf2_ros/test/test_buffer_client.cpp @@ -27,21 +27,21 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include - -#include -#include -#include - -#include -#include - #include #include #include #include #include +#include "gtest/gtest.h" + +#include "tf2_msgs/action/lookup_transform.hpp" +#include "rclcpp/rclcpp.hpp" +#include "rclcpp_action/rclcpp_action.hpp" + +#include "tf2_ros/buffer.h" +#include "tf2_ros/buffer_client.h" + static const char ACTION_NAME[] = "test_tf2_buffer_action"; class MockBufferServer : public rclcpp::Node diff --git a/tf2_ros/test/test_buffer_server.cpp b/tf2_ros/test/test_buffer_server.cpp index 965aa33cb..77daae936 100644 --- a/tf2_ros/test/test_buffer_server.cpp +++ b/tf2_ros/test/test_buffer_server.cpp @@ -27,21 +27,20 @@ * POSSIBILITY OF SUCH DAMAGE. */ - -#include - -#include -#include -#include - -#include -#include - #include #include #include #include +#include "gtest/gtest.h" + +#include "tf2_msgs/action/lookup_transform.hpp" +#include "rclcpp/rclcpp.hpp" +#include "rclcpp_action/rclcpp_action.hpp" + +#include "tf2_ros/buffer.h" +#include "tf2_ros/buffer_server.h" + static const char ACTION_NAME[] = "test_tf2_buffer_action"; class MockBufferClient : public rclcpp::Node diff --git a/tf2_ros/test/time_reset_test.cpp b/tf2_ros/test/time_reset_test.cpp index 799545451..44cbd249c 100644 --- a/tf2_ros/test/time_reset_test.cpp +++ b/tf2_ros/test/time_reset_test.cpp @@ -27,18 +27,19 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include - -#include -#include -#include - #include #include +#include "gtest/gtest.h" + +#include "tf2_ros/buffer.h" +#include "tf2_ros/transform_broadcaster.h" +#include "tf2_ros/transform_listener.h" + +#include "builtin_interfaces/msg/time.hpp" +#include "rclcpp/rclcpp.hpp" +#include "rosgraph_msgs/msg/clock.hpp" + void spin_for_a_second(std::shared_ptr & node) { rclcpp::Rate r(10); diff --git a/tf2_sensor_msgs/include/tf2_sensor_msgs/tf2_sensor_msgs.hpp b/tf2_sensor_msgs/include/tf2_sensor_msgs/tf2_sensor_msgs.hpp index de64c4008..4fce65627 100644 --- a/tf2_sensor_msgs/include/tf2_sensor_msgs/tf2_sensor_msgs.hpp +++ b/tf2_sensor_msgs/include/tf2_sensor_msgs/tf2_sensor_msgs.hpp @@ -29,16 +29,18 @@ #ifndef TF2_SENSOR_MSGS__TF2_SENSOR_MSGS_HPP_ #define TF2_SENSOR_MSGS__TF2_SENSOR_MSGS_HPP_ -#include -#include -#include -#include -#include -#include -#include - #include +#include // NOLINT +#include // NOLINT + +#include "tf2_ros/buffer_interface.h" + +#include "tf2/convert.h" +#include "tf2/time.h" +#include "sensor_msgs/msg/point_cloud2.hpp" +#include "sensor_msgs/point_cloud2_iterator.hpp" + namespace tf2 { diff --git a/tf2_sensor_msgs/test/test_tf2_sensor_msgs.cpp b/tf2_sensor_msgs/test/test_tf2_sensor_msgs.cpp index e9adb6203..dd3985fdb 100644 --- a/tf2_sensor_msgs/test/test_tf2_sensor_msgs.cpp +++ b/tf2_sensor_msgs/test/test_tf2_sensor_msgs.cpp @@ -26,18 +26,18 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. -#include +#include -#include -#include +#include "gtest/gtest.h" -#include -#include -#include -#include -#include +#include "tf2_ros/buffer.h" +#include "tf2_ros/transform_listener.h" -#include +#include "builtin_interfaces/msg/time.hpp" +#include "geometry_msgs/msg/pose_stamped.hpp" +#include "rclcpp/rclcpp.hpp" +#include "sensor_msgs/point_cloud2_iterator.hpp" +#include "tf2_sensor_msgs/tf2_sensor_msgs.hpp" std::unique_ptr tf_buffer = nullptr; static const double EPS = 1e-3;