From b68df3b250fef432a83991ec8dc2b6e20a53ab05 Mon Sep 17 00:00:00 2001 From: "Jorge J. Perez" Date: Tue, 20 Aug 2024 09:39:25 -0300 Subject: [PATCH] Backporting warning and linter fixes to iron (#55) * Change log message to STATUS (#54) * Fix cpplint build/include_order errors (#53) * Fix cpplint build/include_order errors * Fix uncrustify parenthesis Signed-off-by: Jorge J. Perez --- .../connext_dds_micro_communicator.hpp | 6 ++++-- .../communication_abstractions/resource_manager.hpp | 7 ++++--- .../ros2_callback_communicator.hpp | 4 ++-- .../communication_abstractions/ros2_communicator.hpp | 5 ++--- .../ros2_waitset_communicator.hpp | 4 ++-- performance_test/src/data_running/data_runner_base.hpp | 3 ++- .../src/data_running/data_runner_factory.cpp | 4 ++-- .../experiment_configuration.cpp | 10 +++++----- .../experiment_configuration.hpp | 9 +++++---- .../experiment_configuration/external_info_storage.hpp | 5 +++-- .../src/experiment_execution/analyze_runner.cpp | 7 ++++--- performance_test/src/idlgen/fast_rtps/CMakeLists.txt | 2 +- performance_test/src/utilities/cpu_usage_tracker.hpp | 4 +++- .../performance_test_ros1_publisher/msg_types.hpp | 4 ++-- performance_test_ros1_publisher/src/publisher.cpp | 4 +++- 15 files changed, 44 insertions(+), 34 deletions(-) diff --git a/performance_test/src/communication_abstractions/connext_dds_micro_communicator.hpp b/performance_test/src/communication_abstractions/connext_dds_micro_communicator.hpp index 13704163..fa3d202b 100644 --- a/performance_test/src/communication_abstractions/connext_dds_micro_communicator.hpp +++ b/performance_test/src/communication_abstractions/connext_dds_micro_communicator.hpp @@ -292,7 +292,8 @@ class RTIMicroDDSCommunicator : public Communicator * \param data The data to publish. */ template - static auto init_data(T & data)->decltype (data.header_.frame_id_, void ()) { + static auto init_data(T & data)->decltype (data.header_.frame_id_, void ()) + { data.header_.frame_id_ = DDS_String_dup("frame_id"); init_fields(data); } @@ -314,7 +315,8 @@ class RTIMicroDDSCommunicator : public Communicator * \param data The data to publish. */ template - static auto init_fields(T & data)->decltype (data.fields_, void ()) { + static auto init_fields(T & data)->decltype (data.fields_, void ()) + { auto fields_size = size(data.fields_); for (uint8_t i = 0; i < fields_size; i++) { data.fields_[i].name_ = DDS_String_dup("name"); diff --git a/performance_test/src/communication_abstractions/resource_manager.hpp b/performance_test/src/communication_abstractions/resource_manager.hpp index 8d6b2419..c82fc056 100644 --- a/performance_test/src/communication_abstractions/resource_manager.hpp +++ b/performance_test/src/communication_abstractions/resource_manager.hpp @@ -15,6 +15,10 @@ #ifndef COMMUNICATION_ABSTRACTIONS__RESOURCE_MANAGER_HPP_ #define COMMUNICATION_ABSTRACTIONS__RESOURCE_MANAGER_HPP_ +#include +#include +#include + #ifdef PERFORMANCE_TEST_FASTRTPS_ENABLED #include #include @@ -45,9 +49,6 @@ #endif #include -#include -#include -#include #include "../experiment_configuration/experiment_configuration.hpp" diff --git a/performance_test/src/communication_abstractions/ros2_callback_communicator.hpp b/performance_test/src/communication_abstractions/ros2_callback_communicator.hpp index 7974489d..74f07f10 100644 --- a/performance_test/src/communication_abstractions/ros2_callback_communicator.hpp +++ b/performance_test/src/communication_abstractions/ros2_callback_communicator.hpp @@ -15,11 +15,11 @@ #ifndef COMMUNICATION_ABSTRACTIONS__ROS2_CALLBACK_COMMUNICATOR_HPP_ #define COMMUNICATION_ABSTRACTIONS__ROS2_CALLBACK_COMMUNICATOR_HPP_ -#include - #include #include +#include + #include "../experiment_configuration/topics.hpp" #include "ros2_communicator.hpp" diff --git a/performance_test/src/communication_abstractions/ros2_communicator.hpp b/performance_test/src/communication_abstractions/ros2_communicator.hpp index fd60b764..ad64d184 100644 --- a/performance_test/src/communication_abstractions/ros2_communicator.hpp +++ b/performance_test/src/communication_abstractions/ros2_communicator.hpp @@ -15,12 +15,11 @@ #ifndef COMMUNICATION_ABSTRACTIONS__ROS2_COMMUNICATOR_HPP_ #define COMMUNICATION_ABSTRACTIONS__ROS2_COMMUNICATOR_HPP_ - -#include - #include #include +#include + #include "../experiment_configuration/topics.hpp" #include "../experiment_configuration/qos_abstraction.hpp" diff --git a/performance_test/src/communication_abstractions/ros2_waitset_communicator.hpp b/performance_test/src/communication_abstractions/ros2_waitset_communicator.hpp index 5d4914a4..4fde6843 100644 --- a/performance_test/src/communication_abstractions/ros2_waitset_communicator.hpp +++ b/performance_test/src/communication_abstractions/ros2_waitset_communicator.hpp @@ -15,13 +15,13 @@ #ifndef COMMUNICATION_ABSTRACTIONS__ROS2_WAITSET_COMMUNICATOR_HPP_ #define COMMUNICATION_ABSTRACTIONS__ROS2_WAITSET_COMMUNICATOR_HPP_ -#include - #include #include #include #include +#include + #include "../experiment_configuration/topics.hpp" #include "../experiment_configuration/qos_abstraction.hpp" diff --git a/performance_test/src/data_running/data_runner_base.hpp b/performance_test/src/data_running/data_runner_base.hpp index 989020e2..75ec3835 100644 --- a/performance_test/src/data_running/data_runner_base.hpp +++ b/performance_test/src/data_running/data_runner_base.hpp @@ -15,9 +15,10 @@ #ifndef DATA_RUNNING__DATA_RUNNER_BASE_HPP_ #define DATA_RUNNING__DATA_RUNNER_BASE_HPP_ -#include #include +#include + #ifdef PERFORMANCE_TEST_MEMORYTOOLS_ENABLED #include #include diff --git a/performance_test/src/data_running/data_runner_factory.cpp b/performance_test/src/data_running/data_runner_factory.cpp index 0adf1139..464a8196 100644 --- a/performance_test/src/data_running/data_runner_factory.cpp +++ b/performance_test/src/data_running/data_runner_factory.cpp @@ -14,11 +14,11 @@ #include "data_runner_factory.hpp" -#include - #include #include +#include + #ifdef PERFORMANCE_TEST_CALLBACK_EXECUTOR_ENABLED #include "../communication_abstractions/ros2_callback_communicator.hpp" #endif diff --git a/performance_test/src/experiment_configuration/experiment_configuration.cpp b/performance_test/src/experiment_configuration/experiment_configuration.cpp index 451d5c10..d7bda47d 100644 --- a/performance_test/src/experiment_configuration/experiment_configuration.cpp +++ b/performance_test/src/experiment_configuration/experiment_configuration.cpp @@ -14,13 +14,13 @@ #include "experiment_configuration.hpp" -#include #include - -#include -#include -#include #include +#include +#include +#include + +#include #include "topics.hpp" diff --git a/performance_test/src/experiment_configuration/experiment_configuration.hpp b/performance_test/src/experiment_configuration/experiment_configuration.hpp index 50155261..a1b73c05 100644 --- a/performance_test/src/experiment_configuration/experiment_configuration.hpp +++ b/performance_test/src/experiment_configuration/experiment_configuration.hpp @@ -15,13 +15,15 @@ #ifndef EXPERIMENT_CONFIGURATION__EXPERIMENT_CONFIGURATION_HPP_ #define EXPERIMENT_CONFIGURATION__EXPERIMENT_CONFIGURATION_HPP_ -#include -#include - #include #include #include #include +#include + +#include +#include + #include "qos_abstraction.hpp" #include "communication_mean.hpp" @@ -33,7 +35,6 @@ #ifdef PERFORMANCE_TEST_ODB_FOR_SQL_ENABLED #include #endif -#include namespace performance_test { diff --git a/performance_test/src/experiment_configuration/external_info_storage.hpp b/performance_test/src/experiment_configuration/external_info_storage.hpp index 5e571eba..dc755eae 100644 --- a/performance_test/src/experiment_configuration/external_info_storage.hpp +++ b/performance_test/src/experiment_configuration/external_info_storage.hpp @@ -15,11 +15,12 @@ #ifndef EXPERIMENT_CONFIGURATION__EXTERNAL_INFO_STORAGE_HPP_ #define EXPERIMENT_CONFIGURATION__EXTERNAL_INFO_STORAGE_HPP_ +#include +#include + #include #include #include -#include -#include #ifdef PERFORMANCE_TEST_ODB_FOR_SQL_ENABLED #include diff --git a/performance_test/src/experiment_execution/analyze_runner.cpp b/performance_test/src/experiment_execution/analyze_runner.cpp index a117c889..ae25f0b8 100644 --- a/performance_test/src/experiment_execution/analyze_runner.cpp +++ b/performance_test/src/experiment_execution/analyze_runner.cpp @@ -11,23 +11,24 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include #include #include #include #include +#include +#include #include #include #include +#include + #include "analyze_runner.hpp" #include "analysis_result.hpp" #ifdef PERFORMANCE_TEST_ODB_FOR_SQL_ENABLED #include - #include - #include #ifdef DATABASE_SQLITE #include #endif diff --git a/performance_test/src/idlgen/fast_rtps/CMakeLists.txt b/performance_test/src/idlgen/fast_rtps/CMakeLists.txt index 2317f278..927213ce 100644 --- a/performance_test/src/idlgen/fast_rtps/CMakeLists.txt +++ b/performance_test/src/idlgen/fast_rtps/CMakeLists.txt @@ -67,7 +67,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/objs/${RTIME_TARG find_program(FASTRTPS_BIN "fastrtpsgen") if(NOT FASTRTPS_BIN) - message(WARNING "Could not find program 'fastrtpsgen' in path. Trying to use bundled version") + message(STATUS "Could not find program 'fastrtpsgen' in path. Trying to use bundled version") find_program(FASTRTPS_BIN "fastrtpsgen" PATHS "${PROJECT_SOURCE_DIR}/bin") if(NOT FASTRTPS_BIN) message(FATAL_ERROR "Could not find program 'fastrtpsgen'") diff --git a/performance_test/src/utilities/cpu_usage_tracker.hpp b/performance_test/src/utilities/cpu_usage_tracker.hpp index 4fde2737..a88b3ab0 100644 --- a/performance_test/src/utilities/cpu_usage_tracker.hpp +++ b/performance_test/src/utilities/cpu_usage_tracker.hpp @@ -15,9 +15,11 @@ #ifndef UTILITIES__CPU_USAGE_TRACKER_HPP_ #define UTILITIES__CPU_USAGE_TRACKER_HPP_ -#include #include +#include + + #if defined(QNX) #include #include diff --git a/performance_test_ros1_publisher/include/performance_test_ros1_publisher/msg_types.hpp b/performance_test_ros1_publisher/include/performance_test_ros1_publisher/msg_types.hpp index f2f9ecd5..8775380e 100644 --- a/performance_test_ros1_publisher/include/performance_test_ros1_publisher/msg_types.hpp +++ b/performance_test_ros1_publisher/include/performance_test_ros1_publisher/msg_types.hpp @@ -1,11 +1,11 @@ #ifndef PERFORMANCE_TEST_ROS1_PUBLISHER_MSG_TYPES_HPP_INCLUDED #define PERFORMANCE_TEST_ROS1_PUBLISHER_MSG_TYPES_HPP_INCLUDED -#include - #include #include +#include + #include "performance_test_ros1_msgs/Array16k.h" #include "performance_test_ros1_msgs/Array1k.h" #include "performance_test_ros1_msgs/Array1m.h" diff --git a/performance_test_ros1_publisher/src/publisher.cpp b/performance_test_ros1_publisher/src/publisher.cpp index d5e2fb91..10b26e35 100644 --- a/performance_test_ros1_publisher/src/publisher.cpp +++ b/performance_test_ros1_publisher/src/publisher.cpp @@ -1,3 +1,5 @@ +#include + #include "ros/ros.h" #include "performance_test_ros1_publisher/msg_types.hpp" @@ -6,7 +8,7 @@ #include #include -#include + std::shared_ptr msg_publisher_factory(ros::NodeHandle& nh, std::string topic_name) {