From 60d8748d4c8848c80b5c22bf30cfb8048e0e7a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Kurtulu=C5=9F=20Alt=C4=B1parmak?= Date: Sat, 14 Dec 2024 00:44:38 +0000 Subject: [PATCH] Compile benchmarks as separate modules and fix broken compilations of executable files (#44) * Compile benchmarks as separate modules * Decrease diff * Fix Prefix --- CMakeLists.txt | 42 +------------------ .../scenario_basic_service_client.hpp | 0 .../scenario_perception_pipeline.hpp | 0 .../CMakeLists.txt | 24 +++++++++++ .../scenario_basic_service_client.cpp | 2 +- ...io_basic_service_client_benchmark_main.cpp | 2 +- .../CMakeLists.txt | 26 ++++++++++++ .../scenario_perception_pipeline.cpp | 2 +- ...rio_perception_pipeline_benchmark_main.cpp | 2 +- 9 files changed, 56 insertions(+), 44 deletions(-) rename include/moveit_middleware_benchmark/{scenarios => scenario_basic_service_client}/scenario_basic_service_client.hpp (100%) rename include/moveit_middleware_benchmark/{scenarios => scenario_perception_pipeline}/scenario_perception_pipeline.hpp (100%) create mode 100644 src/scenario_basic_service_client/CMakeLists.txt rename src/{scenarios => scenario_basic_service_client}/scenario_basic_service_client.cpp (97%) rename src/{ => scenario_basic_service_client}/scenario_basic_service_client_benchmark_main.cpp (95%) create mode 100644 src/scenario_perception_pipeline/CMakeLists.txt rename src/{scenarios => scenario_perception_pipeline}/scenario_perception_pipeline.cpp (98%) rename src/{ => scenario_perception_pipeline}/scenario_perception_pipeline_benchmark_main.cpp (95%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b08971..ca2ff06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,46 +17,8 @@ find_package(yaml-cpp REQUIRED) find_package(std_msgs REQUIRED) find_package(example_interfaces REQUIRED) -add_library( - moveit_middleware_benchmark_lib SHARED - src/scenarios/scenario_perception_pipeline.cpp - src/scenarios/scenario_basic_service_client.cpp) - -ament_target_dependencies( - moveit_middleware_benchmark_lib - PUBLIC - moveit_ros_planning_interface - rclcpp - benchmark - dynmsg - nav_msgs - std_msgs - yaml-cpp - example_interfaces) - -target_include_directories( - moveit_middleware_benchmark_lib - PUBLIC $ - $) - -target_link_libraries(moveit_middleware_benchmark_lib - PUBLIC benchmark::benchmark ${YAML_CPP_LIBRARIES}) - -add_executable(scenario_perception_pipeline_benchmark_main - src/scenario_perception_pipeline_benchmark_main.cpp) - -target_link_libraries(scenario_perception_pipeline_benchmark_main - PUBLIC moveit_middleware_benchmark_lib) - -add_executable(scenario_basic_service_client_benchmark_main - src/scenario_basic_service_client_benchmark_main.cpp) - -target_link_libraries(scenario_basic_service_client_benchmark_main - PUBLIC moveit_middleware_benchmark_lib) - -install(TARGETS scenario_perception_pipeline_benchmark_main - scenario_basic_service_client_benchmark_main - DESTINATION lib/moveit_middleware_benchmark) +add_subdirectory(src/scenario_basic_service_client) +add_subdirectory(src/scenario_perception_pipeline) install(DIRECTORY launch config DESTINATION share/moveit_middleware_benchmark) diff --git a/include/moveit_middleware_benchmark/scenarios/scenario_basic_service_client.hpp b/include/moveit_middleware_benchmark/scenario_basic_service_client/scenario_basic_service_client.hpp similarity index 100% rename from include/moveit_middleware_benchmark/scenarios/scenario_basic_service_client.hpp rename to include/moveit_middleware_benchmark/scenario_basic_service_client/scenario_basic_service_client.hpp diff --git a/include/moveit_middleware_benchmark/scenarios/scenario_perception_pipeline.hpp b/include/moveit_middleware_benchmark/scenario_perception_pipeline/scenario_perception_pipeline.hpp similarity index 100% rename from include/moveit_middleware_benchmark/scenarios/scenario_perception_pipeline.hpp rename to include/moveit_middleware_benchmark/scenario_perception_pipeline/scenario_perception_pipeline.hpp diff --git a/src/scenario_basic_service_client/CMakeLists.txt b/src/scenario_basic_service_client/CMakeLists.txt new file mode 100644 index 0000000..e3f084c --- /dev/null +++ b/src/scenario_basic_service_client/CMakeLists.txt @@ -0,0 +1,24 @@ +add_executable( + scenario_basic_service_client_benchmark_main + scenario_basic_service_client_benchmark_main.cpp + scenario_basic_service_client.cpp) + +ament_target_dependencies( + scenario_basic_service_client_benchmark_main + PUBLIC + rclcpp + benchmark + std_msgs + example_interfaces + ament_index_cpp) + +target_include_directories( + scenario_basic_service_client_benchmark_main + PUBLIC $ + $) + +target_link_libraries(scenario_basic_service_client_benchmark_main + PUBLIC benchmark::benchmark ${YAML_CPP_LIBRARIES}) + +install(TARGETS scenario_basic_service_client_benchmark_main + DESTINATION lib/moveit_middleware_benchmark) diff --git a/src/scenarios/scenario_basic_service_client.cpp b/src/scenario_basic_service_client/scenario_basic_service_client.cpp similarity index 97% rename from src/scenarios/scenario_basic_service_client.cpp rename to src/scenario_basic_service_client/scenario_basic_service_client.cpp index 5141b0c..f43587e 100644 --- a/src/scenarios/scenario_basic_service_client.cpp +++ b/src/scenario_basic_service_client/scenario_basic_service_client.cpp @@ -37,7 +37,7 @@ against basic service client works */ -#include "moveit_middleware_benchmark/scenarios/scenario_basic_service_client.hpp" +#include "moveit_middleware_benchmark/scenario_basic_service_client/scenario_basic_service_client.hpp" namespace moveit { diff --git a/src/scenario_basic_service_client_benchmark_main.cpp b/src/scenario_basic_service_client/scenario_basic_service_client_benchmark_main.cpp similarity index 95% rename from src/scenario_basic_service_client_benchmark_main.cpp rename to src/scenario_basic_service_client/scenario_basic_service_client_benchmark_main.cpp index 6653d55..2e53526 100644 --- a/src/scenario_basic_service_client_benchmark_main.cpp +++ b/src/scenario_basic_service_client/scenario_basic_service_client_benchmark_main.cpp @@ -37,7 +37,7 @@ against basic service client works */ -#include "moveit_middleware_benchmark/scenarios/scenario_basic_service_client.hpp" +#include "moveit_middleware_benchmark/scenario_basic_service_client/scenario_basic_service_client.hpp" int main(int argc, char** argv) { diff --git a/src/scenario_perception_pipeline/CMakeLists.txt b/src/scenario_perception_pipeline/CMakeLists.txt new file mode 100644 index 0000000..5069b9b --- /dev/null +++ b/src/scenario_perception_pipeline/CMakeLists.txt @@ -0,0 +1,26 @@ +add_executable( + scenario_perception_pipeline_benchmark_main + scenario_perception_pipeline_benchmark_main.cpp + scenario_perception_pipeline.cpp) + +ament_target_dependencies( + scenario_perception_pipeline_benchmark_main + PUBLIC + moveit_ros_planning_interface + rclcpp + benchmark + dynmsg + nav_msgs + yaml-cpp + example_interfaces) + +target_include_directories( + scenario_perception_pipeline_benchmark_main + PUBLIC $ + $) + +target_link_libraries(scenario_perception_pipeline_benchmark_main + PUBLIC benchmark::benchmark ${YAML_CPP_LIBRARIES}) + +install(TARGETS scenario_perception_pipeline_benchmark_main + DESTINATION lib/moveit_middleware_benchmark) diff --git a/src/scenarios/scenario_perception_pipeline.cpp b/src/scenario_perception_pipeline/scenario_perception_pipeline.cpp similarity index 98% rename from src/scenarios/scenario_perception_pipeline.cpp rename to src/scenario_perception_pipeline/scenario_perception_pipeline.cpp index d4ca7da..2d51503 100644 --- a/src/scenarios/scenario_perception_pipeline.cpp +++ b/src/scenario_perception_pipeline/scenario_perception_pipeline.cpp @@ -37,7 +37,7 @@ against perception pipeline */ -#include "moveit_middleware_benchmark/scenarios/scenario_perception_pipeline.hpp" +#include "moveit_middleware_benchmark/scenario_perception_pipeline/scenario_perception_pipeline.hpp" namespace moveit { diff --git a/src/scenario_perception_pipeline_benchmark_main.cpp b/src/scenario_perception_pipeline/scenario_perception_pipeline_benchmark_main.cpp similarity index 95% rename from src/scenario_perception_pipeline_benchmark_main.cpp rename to src/scenario_perception_pipeline/scenario_perception_pipeline_benchmark_main.cpp index 1327ef6..cf85f95 100644 --- a/src/scenario_perception_pipeline_benchmark_main.cpp +++ b/src/scenario_perception_pipeline/scenario_perception_pipeline_benchmark_main.cpp @@ -37,7 +37,7 @@ against perception pipeline */ -#include "moveit_middleware_benchmark/scenarios/scenario_perception_pipeline.hpp" +#include "moveit_middleware_benchmark/scenario_perception_pipeline/scenario_perception_pipeline.hpp" int main(int argc, char** argv) {