From c2885d74a70787ac3a818dd03ace34806b8b7e22 Mon Sep 17 00:00:00 2001 From: Alberto Tudela Date: Tue, 17 Sep 2024 12:47:12 +0200 Subject: [PATCH] Update CMakeLists.txt to use modern idioms. Signed-off-by: Alberto Tudela --- scitos2_behavior_tree/CHANGELOG.rst | 1 + scitos2_behavior_tree/CMakeLists.txt | 96 +++++++---- scitos2_behavior_tree/package.xml | 4 +- scitos2_behavior_tree/test/CMakeLists.txt | 7 +- .../test/action/CMakeLists.txt | 12 +- .../test/condition/CMakeLists.txt | 13 +- scitos2_charging_dock/CHANGELOG.rst | 1 + scitos2_charging_dock/CMakeLists.txt | 161 +++++++++++++----- .../scitos2_charging_dock/charging_dock.hpp | 9 +- .../scitos2_charging_dock/dock_saver.hpp | 4 +- .../scitos2_charging_dock/perception.hpp | 10 +- .../scitos2_charging_dock/segmentation.hpp | 6 +- scitos2_charging_dock/package.xml | 17 +- scitos2_charging_dock/src/charging_dock.cpp | 4 +- scitos2_charging_dock/src/perception.cpp | 3 +- scitos2_charging_dock/test/CMakeLists.txt | 27 ++- .../test/test_charging_dock.cpp | 4 +- scitos2_common/cmake/mira_package.cmake | 2 +- scitos2_core/CHANGELOG.rst | 1 + scitos2_core/CMakeLists.txt | 40 +++-- scitos2_core/include/scitos2_core/module.hpp | 23 ++- .../include/scitos2_core/sink_logger.hpp | 2 +- scitos2_core/package.xml | 1 - scitos2_mira/CHANGELOG.rst | 1 + scitos2_mira/CMakeLists.txt | 63 ++++--- .../include/scitos2_mira/mira_framework.hpp | 2 +- scitos2_mira/package.xml | 8 +- scitos2_mira/test/CMakeLists.txt | 4 +- scitos2_modules/CHANGELOG.rst | 1 + scitos2_modules/CMakeLists.txt | 143 +++++++++++----- .../include/scitos2_modules/charger.hpp | 2 - .../include/scitos2_modules/display.hpp | 2 - .../include/scitos2_modules/drive.hpp | 2 - .../include/scitos2_modules/ebc.hpp | 2 - .../include/scitos2_modules/imu.hpp | 2 - scitos2_modules/package.xml | 11 +- scitos2_modules/src/charger.cpp | 4 +- scitos2_modules/src/display.cpp | 14 +- scitos2_modules/src/drive.cpp | 22 ++- scitos2_modules/src/ebc.cpp | 40 +++-- scitos2_modules/src/imu.cpp | 7 +- scitos2_modules/test/CMakeLists.txt | 12 -- scitos2_modules/test/test_display.cpp | 2 +- scitos2_msgs/CMakeLists.txt | 4 +- scitos2_msgs/package.xml | 2 +- 45 files changed, 507 insertions(+), 291 deletions(-) diff --git a/scitos2_behavior_tree/CHANGELOG.rst b/scitos2_behavior_tree/CHANGELOG.rst index a0915cc..1587c80 100644 --- a/scitos2_behavior_tree/CHANGELOG.rst +++ b/scitos2_behavior_tree/CHANGELOG.rst @@ -9,6 +9,7 @@ Changelog for package scitos2_behavior_tree * Add generate_scitos2_tree_nodes_xml. * Add unit testing. * The utils folder in test is just a copy of nav2_behavior_tree/test/utils because Rolling CI is currently broken. This will be removed once Rolling CI is fixed. +* Update CMakeLists.txt to use modern idioms. 0.3.0 (26-04-2023) ------------------ diff --git a/scitos2_behavior_tree/CMakeLists.txt b/scitos2_behavior_tree/CMakeLists.txt index 5d94735..57bc9c7 100644 --- a/scitos2_behavior_tree/CMakeLists.txt +++ b/scitos2_behavior_tree/CMakeLists.txt @@ -21,8 +21,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - # add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wdeprecated -fPIC -Wshadow -Wnull-dereference) - add_compile_options(-Wall -Wextra -Wpedantic -Wdeprecated -fPIC -Wshadow -Wnull-dereference) + add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wdeprecated -fPIC -Wnull-dereference) add_compile_options("$<$:-Wnon-virtual-dtor>") endif() @@ -51,49 +50,70 @@ endif() # ############################################### # # Find ament macros and libraries find_package(ament_cmake REQUIRED) +find_package(behaviortree_cpp_v3 REQUIRED) +find_package(nav2_behavior_tree REQUIRED) find_package(rclcpp REQUIRED) find_package(rclcpp_action REQUIRED) find_package(rclcpp_lifecycle REQUIRED) find_package(scitos2_msgs REQUIRED) -find_package(behaviortree_cpp_v3 REQUIRED) -find_package(nav2_behavior_tree REQUIRED) # ########## # # Build ## # ########## -# # Specify additional locations of header files -# # Your package locations should be listed before other locations -include_directories( - include +add_library(scitos2_is_bumper_activated_condition_bt_node SHARED src/condition/is_bumper_activated_condition.cpp) +target_include_directories(scitos2_is_bumper_activated_condition_bt_node PUBLIC + "$" + "$" ) - -set(dependencies - rclcpp - rclcpp_action - rclcpp_lifecycle - scitos2_msgs - behaviortree_cpp_v3 - nav2_behavior_tree +target_link_libraries(scitos2_is_bumper_activated_condition_bt_node + PUBLIC + rclcpp::rclcpp + ${scitos2_msgs_TARGETS} ) - -add_library(scitos2_is_bumper_activated_condition_bt_node SHARED src/condition/is_bumper_activated_condition.cpp) -list(APPEND plugin_libs scitos2_is_bumper_activated_condition_bt_node) +ament_target_dependencies(scitos2_is_bumper_activated_condition_bt_node + PUBLIC + behaviortree_cpp_v3 +) # TODO(ajtudela): Fix this in jazzy +target_compile_definitions(scitos2_is_bumper_activated_condition_bt_node PRIVATE BT_PLUGIN_EXPORT) add_library(scitos2_emergency_stop_service_bt_node SHARED src/action/emergency_stop_service.cpp) -list(APPEND plugin_libs scitos2_emergency_stop_service_bt_node) +target_include_directories(scitos2_emergency_stop_service_bt_node PUBLIC + "$" + "$" +) +target_link_libraries(scitos2_emergency_stop_service_bt_node + PUBLIC + ${scitos2_msgs_TARGETS} +) +ament_target_dependencies(scitos2_emergency_stop_service_bt_node + PUBLIC + nav2_behavior_tree +) # TODO(ajtudela): Fix this in jazzy +target_compile_definitions(scitos2_emergency_stop_service_bt_node PRIVATE BT_PLUGIN_EXPORT) add_library(scitos2_reset_motor_stop_service_bt_node SHARED src/action/reset_motor_stop_service.cpp) -list(APPEND plugin_libs scitos2_reset_motor_stop_service_bt_node) - -foreach(bt_plugin ${plugin_libs}) - ament_target_dependencies(${bt_plugin} ${dependencies}) - target_compile_definitions(${bt_plugin} PRIVATE BT_PLUGIN_EXPORT) -endforeach() +target_include_directories(scitos2_reset_motor_stop_service_bt_node PUBLIC + "$" + "$" +) +target_link_libraries(scitos2_reset_motor_stop_service_bt_node + PUBLIC + ${scitos2_msgs_TARGETS} +) +ament_target_dependencies(scitos2_reset_motor_stop_service_bt_node + PUBLIC + nav2_behavior_tree +) # TODO(ajtudela): Fix this in jazzy +target_compile_definitions(scitos2_reset_motor_stop_service_bt_node PRIVATE BT_PLUGIN_EXPORT) # ############ # # Install ## # ############ -install(TARGETS ${plugin_libs} +install(TARGETS + scitos2_is_bumper_activated_condition_bt_node + scitos2_emergency_stop_service_bt_node + scitos2_reset_motor_stop_service_bt_node + EXPORT ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin @@ -104,14 +124,14 @@ set(GENERATED_DIR ${CMAKE_CURRENT_BINARY_DIR}/gen) configure_file(plugins_list.hpp.in ${GENERATED_DIR}/plugins_list.hpp) add_executable(generate_scitos2_tree_nodes_xml src/generate_scitos2_tree_nodes_xml.cpp) -ament_target_dependencies(generate_scitos2_tree_nodes_xml ${dependencies}) +ament_target_dependencies(generate_scitos2_tree_nodes_xml PUBLIC behaviortree_cpp_v3) # TODO(ajtudela): Fix this in jazzy # allow generate_scitos2_tree_nodes_xml to find plugins_list.hpp target_include_directories(generate_scitos2_tree_nodes_xml PRIVATE ${GENERATED_DIR}) install(TARGETS generate_scitos2_tree_nodes_xml DESTINATION lib/${PROJECT_NAME}) install(DIRECTORY include/ - DESTINATION include/ + DESTINATION include/${PROJECT_NAME} ) install(DIRECTORY test/utils/ @@ -137,7 +157,19 @@ endif() # ################################## # # ament specific configuration ## # ################################## -ament_export_include_directories(include) -ament_export_libraries(${plugin_libs}) -ament_export_dependencies(${dependencies}) +ament_export_include_directories(include/${PROJECT_NAME}) +ament_export_libraries( + scitos2_is_bumper_activated_condition_bt_node + scitos2_emergency_stop_service_bt_node + scitos2_reset_motor_stop_service_bt_node +) +ament_export_dependencies( + behaviortree_cpp_v3 + nav2_behavior_tree + rclcpp + rclcpp_action + rclcpp_lifecycle + scitos2_msgs +) +ament_export_targets(${PROJECT_NAME}) ament_package() diff --git a/scitos2_behavior_tree/package.xml b/scitos2_behavior_tree/package.xml index 5cb28f0..d3520b5 100644 --- a/scitos2_behavior_tree/package.xml +++ b/scitos2_behavior_tree/package.xml @@ -8,12 +8,12 @@ Apache-2.0 Alberto Tudela ament_cmake + behaviortree_cpp_v3 + nav2_behavior_tree rclcpp rclcpp_action rclcpp_lifecycle scitos2_msgs - behaviortree_cpp_v3 - nav2_behavior_tree ament_lint_auto ament_lint_common diff --git a/scitos2_behavior_tree/test/CMakeLists.txt b/scitos2_behavior_tree/test/CMakeLists.txt index c763e12..6974626 100644 --- a/scitos2_behavior_tree/test/CMakeLists.txt +++ b/scitos2_behavior_tree/test/CMakeLists.txt @@ -5,8 +5,11 @@ add_subdirectory(condition) # Test register ament_add_gtest(test_register -test_register.cpp + test_register.cpp +) +target_link_libraries(test_register + rclcpp::rclcpp ) ament_target_dependencies(test_register - ${dependencies} + behaviortree_cpp_v3 ) diff --git a/scitos2_behavior_tree/test/action/CMakeLists.txt b/scitos2_behavior_tree/test/action/CMakeLists.txt index 6d3e1f6..531501d 100644 --- a/scitos2_behavior_tree/test/action/CMakeLists.txt +++ b/scitos2_behavior_tree/test/action/CMakeLists.txt @@ -2,20 +2,20 @@ ament_add_gtest(test_scitos2_action_emergency_stop_service test_emergency_stop_service.cpp ) -ament_target_dependencies(test_scitos2_action_emergency_stop_service - ${dependencies} -) target_link_libraries(test_scitos2_action_emergency_stop_service scitos2_emergency_stop_service_bt_node ) +ament_target_dependencies(test_scitos2_action_emergency_stop_service + behaviortree_cpp_v3 +) # Test for the reset motor stop service ament_add_gtest(test_scitos2_action_reset_motor_stop_service test_reset_motor_stop_service.cpp ) -ament_target_dependencies(test_scitos2_action_reset_motor_stop_service - ${dependencies} -) target_link_libraries(test_scitos2_action_reset_motor_stop_service scitos2_reset_motor_stop_service_bt_node +) +ament_target_dependencies(test_scitos2_action_reset_motor_stop_service + behaviortree_cpp_v3 ) \ No newline at end of file diff --git a/scitos2_behavior_tree/test/condition/CMakeLists.txt b/scitos2_behavior_tree/test/condition/CMakeLists.txt index ba09d5d..5d9f99e 100644 --- a/scitos2_behavior_tree/test/condition/CMakeLists.txt +++ b/scitos2_behavior_tree/test/condition/CMakeLists.txt @@ -1,10 +1,17 @@ +find_package(geometry_msgs REQUIRED) +find_package(rclcpp_action REQUIRED) +find_package(tf2_msgs REQUIRED) +find_package(tf2_ros REQUIRED) + # Test for is bumper activated condition ament_add_gtest(test_scitos2_condition_is_bumper_activated test_is_bumper_activated_condition.cpp ) -ament_target_dependencies(test_scitos2_condition_is_bumper_activated - ${dependencies} -) target_link_libraries(test_scitos2_condition_is_bumper_activated + ${geometry_msgs_TARGETS} scitos2_is_bumper_activated_condition_bt_node + ${scitos2_msgs_TARGETS} + rclcpp_action::rclcpp_action + ${tf2_msgs_TARGETS} + tf2_ros::tf2_ros ) \ No newline at end of file diff --git a/scitos2_charging_dock/CHANGELOG.rst b/scitos2_charging_dock/CHANGELOG.rst index 1692f09..d0ec2df 100644 --- a/scitos2_charging_dock/CHANGELOG.rst +++ b/scitos2_charging_dock/CHANGELOG.rst @@ -7,4 +7,5 @@ Changelog for package scitos2_charging_dock * Initial release. * Create README.md. * Redo the package to use the new docking system. +* Update CMakeLists.txt to use modern idioms. * Contributors: Alberto Tudela diff --git a/scitos2_charging_dock/CMakeLists.txt b/scitos2_charging_dock/CMakeLists.txt index f3f25c8..211f45a 100644 --- a/scitos2_charging_dock/CMakeLists.txt +++ b/scitos2_charging_dock/CMakeLists.txt @@ -50,63 +50,121 @@ endif() # ############################################### # # Find ament macros and libraries find_package(ament_cmake REQUIRED) -find_package(rclcpp REQUIRED) -find_package(rclcpp_components REQUIRED) -find_package(pluginlib REQUIRED) -find_package(geometry_msgs REQUIRED) -find_package(sensor_msgs REQUIRED) find_package(angles REQUIRED) +find_package(geometry_msgs REQUIRED) find_package(nav2_util REQUIRED) +find_package(opennav_docking_core REQUIRED) +find_package(opennav_docking REQUIRED) find_package(pcl_ros REQUIRED) find_package(pcl_conversions REQUIRED) -find_package(tf2_ros REQUIRED) +find_package(pluginlib REQUIRED) +find_package(rclcpp REQUIRED) +find_package(rclcpp_lifecycle REQUIRED) +find_package(rclcpp_components REQUIRED) find_package(scitos2_msgs REQUIRED) -find_package(opennav_docking_core REQUIRED) -find_package(opennav_docking REQUIRED) +find_package(sensor_msgs REQUIRED) +find_package(tf2_ros REQUIRED) # ########## # # Build ## # ########## # # Specify additional locations of header files # # Your package locations should be listed before other locations -include_directories( - include +set(library_name ${PROJECT_NAME}_core) +set(dock_saver_executable dock_saver) + +# Add segmentation library +add_library(segmentation SHARED src/segmentation.cpp) +target_include_directories(segmentation PUBLIC + "$" + "$" ) +target_link_libraries(segmentation + PUBLIC + ${geometry_msgs_TARGETS} + rclcpp::rclcpp + rclcpp_lifecycle::rclcpp_lifecycle + ${sensor_msgs_TARGETS} + PRIVATE + pcl_ros::pcl_ros_tf +) +ament_target_dependencies(segmentation PUBLIC nav2_util) # TODO(ajtudela): Fix this in jazzy -set(dependencies - rclcpp - rclcpp_components - pluginlib - geometry_msgs - sensor_msgs - angles +# Add perception library +add_library(perception SHARED src/perception.cpp) +target_include_directories(perception PUBLIC + "$" + "$" +) +target_link_libraries(perception + PUBLIC + ${geometry_msgs_TARGETS} + rclcpp::rclcpp + segmentation + ${sensor_msgs_TARGETS} + tf2_ros::tf2_ros + PRIVATE + pcl_ros::pcl_ros_tf + ${tf2_geometry_msgs_TARGETS} +) +ament_target_dependencies(perception + PUBLIC nav2_util - pcl_ros pcl_conversions - tf2_ros - scitos2_msgs - opennav_docking_core - opennav_docking -) +) # TODO(ajtudela): Fix this in jazzy -set(library_name ${PROJECT_NAME}_core) -set(dock_saver_executable dock_saver) - -# Add library -add_library(${library_name} SHARED - src/segmentation.cpp - src/perception.cpp - src/charging_dock.cpp - src/dock_saver.cpp +# Add charging dock library +add_library(${library_name} SHARED src/charging_dock.cpp) +target_include_directories(${library_name} PUBLIC + "$" + "$" +) +target_link_libraries(${library_name} + PUBLIC + ${geometry_msgs_TARGETS} + perception + rclcpp_lifecycle::rclcpp_lifecycle + ${scitos2_msgs_TARGETS} + ${sensor_msgs_TARGETS} + tf2_ros::tf2_ros + PRIVATE + pluginlib::pluginlib + ${tf2_geometry_msgs_TARGETS} ) -ament_target_dependencies(${library_name} ${dependencies}) +ament_target_dependencies(${library_name} + PUBLIC + nav2_util + opennav_docking_core + opennav_docking # Pose filter +) # TODO(ajtudela): Fix this in jazzy pluginlib_export_plugin_description_file(opennav_docking_core plugins.xml) +# Add dock saver library +add_library(dock_saver_core SHARED src/dock_saver.cpp) +target_include_directories(dock_saver_core PUBLIC + "$" + "$" +) +target_link_libraries(dock_saver_core + PUBLIC + perception + rclcpp::rclcpp + ${scitos2_msgs_TARGETS} + tf2_ros::tf2_ros + PRIVATE + angles::angles + ${sensor_msgs_TARGETS} + rclcpp_components::component +) +ament_target_dependencies(dock_saver_core PUBLIC nav2_util) # TODO(ajtudela): Fix this in jazzy + # Add dock saver executable add_executable(${dock_saver_executable} src/main_saver.cpp) -ament_target_dependencies(${dock_saver_executable} ${dependencies}) -target_link_libraries(${dock_saver_executable} ${library_name}) +target_link_libraries(${dock_saver_executable} + PRIVATE + dock_saver_core +) rclcpp_components_register_nodes(${library_name} "scitos2_charging_dock::DockSaver") @@ -114,6 +172,10 @@ rclcpp_components_register_nodes(${library_name} "scitos2_charging_dock::DockSav # # Install ## # ############ install(TARGETS ${library_name} + segmentation + perception + dock_saver_core + EXPORT ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin @@ -124,7 +186,7 @@ install(TARGETS ${dock_saver_executable} ) install(DIRECTORY include/ - DESTINATION include/ + DESTINATION include/${PROJECT_NAME} ) install(DIRECTORY launch params @@ -150,7 +212,28 @@ endif() # ################################## # # ament specific configuration ## # ################################## -ament_export_include_directories(include) -ament_export_libraries(${PROJECT_NAME} ${library_name}) -ament_export_dependencies(${dependencies}) +ament_export_include_directories(include/${PROJECT_NAME}) +ament_export_libraries( + ${library_name} + segmentation + perception + dock_saver_core +) +ament_export_dependencies( + angles + geometry_msgs + nav2_util + opennav_docking_core + opennav_docking + pcl_ros + pcl_conversions + pluginlib + rclcpp + rclcpp_components + rclcpp_lifecycle + scitos2_msgs + sensor_msgs + tf2_ros +) +ament_export_targets(${PROJECT_NAME}) ament_package() diff --git a/scitos2_charging_dock/include/scitos2_charging_dock/charging_dock.hpp b/scitos2_charging_dock/include/scitos2_charging_dock/charging_dock.hpp index 224445c..a3701a8 100644 --- a/scitos2_charging_dock/include/scitos2_charging_dock/charging_dock.hpp +++ b/scitos2_charging_dock/include/scitos2_charging_dock/charging_dock.hpp @@ -22,13 +22,12 @@ #include #include "geometry_msgs/msg/pose_stamped.hpp" -#include "sensor_msgs/msg/battery_state.hpp" -#include "sensor_msgs/msg/laser_scan.hpp" -#include "tf2_geometry_msgs/tf2_geometry_msgs.hpp" -#include "tf2/utils.h" #include "opennav_docking_core/charging_dock.hpp" #include "opennav_docking/pose_filter.hpp" #include "scitos2_charging_dock/perception.hpp" +#include "sensor_msgs/msg/battery_state.hpp" +#include "sensor_msgs/msg/laser_scan.hpp" +#include "tf2_ros/buffer.h" namespace scitos2_charging_dock { @@ -83,7 +82,7 @@ class ChargingDock : public opennav_docking_core::ChargingDock * @param pose The initial estimate of the dock pose. * @param frame The frame of the initial estimate. */ - virtual bool getRefinedPose(geometry_msgs::msg::PoseStamped & pose); + virtual bool getRefinedPose(geometry_msgs::msg::PoseStamped & pose, std::string id); /** * @copydoc opennav_docking_core::ChargingDock::isCharging diff --git a/scitos2_charging_dock/include/scitos2_charging_dock/dock_saver.hpp b/scitos2_charging_dock/include/scitos2_charging_dock/dock_saver.hpp index bc112e5..c145470 100644 --- a/scitos2_charging_dock/include/scitos2_charging_dock/dock_saver.hpp +++ b/scitos2_charging_dock/include/scitos2_charging_dock/dock_saver.hpp @@ -19,11 +19,11 @@ #include #include -#include "rclcpp/rclcpp.hpp" #include "nav2_util/lifecycle_node.hpp" -#include "tf2_ros/buffer.h" +#include "rclcpp/rclcpp.hpp" #include "scitos2_msgs/srv/save_dock.hpp" #include "scitos2_charging_dock/perception.hpp" +#include "tf2_ros/buffer.h" namespace scitos2_charging_dock { diff --git a/scitos2_charging_dock/include/scitos2_charging_dock/perception.hpp b/scitos2_charging_dock/include/scitos2_charging_dock/perception.hpp index 4b7a32a..7a4f76a 100644 --- a/scitos2_charging_dock/include/scitos2_charging_dock/perception.hpp +++ b/scitos2_charging_dock/include/scitos2_charging_dock/perception.hpp @@ -26,15 +26,15 @@ #include // ROS +#include "geometry_msgs/msg/pose_stamped.hpp" #include "rclcpp/rclcpp.hpp" #include "rcl_interfaces/msg/set_parameters_result.hpp" -#include "tf2/LinearMath/Transform.h" -#include "tf2_ros/buffer.h" -#include "geometry_msgs/msg/pose_stamped.hpp" -#include "sensor_msgs/msg/laser_scan.hpp" -#include "sensor_msgs/msg/point_cloud2.hpp" #include "scitos2_charging_dock/cluster.hpp" #include "scitos2_charging_dock/segmentation.hpp" +#include "sensor_msgs/msg/laser_scan.hpp" +#include "sensor_msgs/msg/point_cloud2.hpp" +#include "tf2/LinearMath/Transform.h" +#include "tf2_ros/buffer.h" namespace scitos2_charging_dock { diff --git a/scitos2_charging_dock/include/scitos2_charging_dock/segmentation.hpp b/scitos2_charging_dock/include/scitos2_charging_dock/segmentation.hpp index fb71480..17c9c15 100644 --- a/scitos2_charging_dock/include/scitos2_charging_dock/segmentation.hpp +++ b/scitos2_charging_dock/include/scitos2_charging_dock/segmentation.hpp @@ -20,11 +20,11 @@ #include // ROS -#include "rclcpp/rclcpp.hpp" -#include "rclcpp_lifecycle/lifecycle_node.hpp" #include "geometry_msgs/msg/point.hpp" -#include "sensor_msgs/msg/laser_scan.hpp" #include "scitos2_charging_dock/cluster.hpp" +#include "sensor_msgs/msg/laser_scan.hpp" +#include "rclcpp/rclcpp.hpp" +#include "rclcpp_lifecycle/lifecycle_node.hpp" namespace scitos2_charging_dock { diff --git a/scitos2_charging_dock/package.xml b/scitos2_charging_dock/package.xml index 54916ec..7ddcd2a 100644 --- a/scitos2_charging_dock/package.xml +++ b/scitos2_charging_dock/package.xml @@ -8,19 +8,20 @@ Apache-2.0 Alberto Tudela ament_cmake - rclcpp - rclcpp_components - pluginlib - geometry_msgs - sensor_msgs angles + geometry_msgs nav2_util + opennav_docking_core + opennav_docking pcl_ros pcl_conversions - tf2_ros + pluginlib + rclcpp + rclcpp_components + rclcpp_lifecycle scitos2_msgs - opennav_docking_core - opennav_docking + sensor_msgs + tf2_ros ament_lint_auto ament_lint_common diff --git a/scitos2_charging_dock/src/charging_dock.cpp b/scitos2_charging_dock/src/charging_dock.cpp index 000acf8..64643b4 100644 --- a/scitos2_charging_dock/src/charging_dock.cpp +++ b/scitos2_charging_dock/src/charging_dock.cpp @@ -19,6 +19,8 @@ #include "nav2_util/node_utils.hpp" #include "scitos2_charging_dock/charging_dock.hpp" #include "scitos2_charging_dock/segmentation.hpp" +#include "tf2_geometry_msgs/tf2_geometry_msgs.hpp" +#include "tf2/utils.h" namespace scitos2_charging_dock { @@ -127,7 +129,7 @@ geometry_msgs::msg::PoseStamped ChargingDock::getStagingPose( return staging_pose; } -bool ChargingDock::getRefinedPose(geometry_msgs::msg::PoseStamped & pose) +bool ChargingDock::getRefinedPose(geometry_msgs::msg::PoseStamped & pose, std::string /*id*/) { // Get current detections, transform to frame, and apply offsets geometry_msgs::msg::PoseStamped detected = perception_->getDockPose(scan_); diff --git a/scitos2_charging_dock/src/perception.cpp b/scitos2_charging_dock/src/perception.cpp index 6b82c90..0e62ecf 100644 --- a/scitos2_charging_dock/src/perception.cpp +++ b/scitos2_charging_dock/src/perception.cpp @@ -23,11 +23,12 @@ #include "tf2_geometry_msgs/tf2_geometry_msgs.hpp" // ROS -#include "rclcpp/rclcpp.hpp" + #include "geometry_msgs/msg/transform_stamped.hpp" #include "nav2_util/node_utils.hpp" #include "pcl_conversions/pcl_conversions.h" #include "pcl_ros/transforms.hpp" +#include "rclcpp/rclcpp.hpp" #include "scitos2_charging_dock/perception.hpp" namespace scitos2_charging_dock diff --git a/scitos2_charging_dock/test/CMakeLists.txt b/scitos2_charging_dock/test/CMakeLists.txt index 1daf3bc..ec31cc5 100644 --- a/scitos2_charging_dock/test/CMakeLists.txt +++ b/scitos2_charging_dock/test/CMakeLists.txt @@ -1,24 +1,33 @@ # Test cluster ament_add_gtest(test_scitos2_cluster test_cluster.cpp) -ament_target_dependencies(test_scitos2_cluster ${dependencies}) -target_link_libraries(test_scitos2_cluster ${library_name}) +target_include_directories(test_scitos2_cluster PUBLIC + "$" + "$" +) +target_link_libraries(test_scitos2_cluster + pcl_ros::pcl_ros_tf +) # Test segmentation ament_add_gtest(test_scitos2_segmentation test_segmentation.cpp) -ament_target_dependencies(test_scitos2_segmentation ${dependencies}) -target_link_libraries(test_scitos2_segmentation ${library_name}) +target_link_libraries(test_scitos2_segmentation + pcl_ros::pcl_ros_tf + rclcpp_lifecycle::rclcpp_lifecycle + segmentation +) # Test perception ament_add_gtest(test_scitos2_perception test_perception.cpp) -ament_target_dependencies(test_scitos2_perception ${dependencies}) -target_link_libraries(test_scitos2_perception ${library_name}) +target_link_libraries(test_scitos2_perception + perception + rclcpp::rclcpp + tf2_ros::tf2_ros +) # Test charging dock ament_add_gtest(test_scitos2_charging_dock test_charging_dock.cpp) -ament_target_dependencies(test_scitos2_charging_dock ${dependencies}) target_link_libraries(test_scitos2_charging_dock ${library_name}) # Test dock saver ament_add_gtest(test_dock_saver test_dock_saver.cpp) -ament_target_dependencies(test_dock_saver ${dependencies}) -target_link_libraries(test_dock_saver ${library_name}) \ No newline at end of file +target_link_libraries(test_dock_saver dock_saver_core) \ No newline at end of file diff --git a/scitos2_charging_dock/test/test_charging_dock.cpp b/scitos2_charging_dock/test/test_charging_dock.cpp index bc66c4f..f6918d4 100644 --- a/scitos2_charging_dock/test/test_charging_dock.cpp +++ b/scitos2_charging_dock/test/test_charging_dock.cpp @@ -164,7 +164,7 @@ TEST(ScitosChargingDock, refinedPoseTest) // Timestamps are outdated; this is after timeout EXPECT_FALSE(dock->isDocked()); - EXPECT_FALSE(dock->getRefinedPose(pose)); + EXPECT_FALSE(dock->getRefinedPose(pose, std::string(""))); // Just call the function to set the staging pose in the perception module // befor the callback is called @@ -190,7 +190,7 @@ TEST(ScitosChargingDock, refinedPoseTest) // The actual values are not important for this test // as they depend on the perception module and its already tested pose.header.frame_id = "my_frame"; - EXPECT_TRUE(dock->getRefinedPose(pose)); + EXPECT_TRUE(dock->getRefinedPose(pose, std::string(""))); EXPECT_FALSE(dock->isDocked()); dock->deactivate(); diff --git a/scitos2_common/cmake/mira_package.cmake b/scitos2_common/cmake/mira_package.cmake index 8a17b0a..cebc47c 100644 --- a/scitos2_common/cmake/mira_package.cmake +++ b/scitos2_common/cmake/mira_package.cmake @@ -76,7 +76,7 @@ endmacro() # macro(target_link_mira_libraries target) # For transitive linking link against all auto liked libraries - target_link_libraries(${target} ${MIRAAutoLinkLibraries} MIRAFramework) + target_link_libraries(${target} PUBLIC ${MIRAAutoLinkLibraries} MIRAFramework) # use, i.e. don't skip the full RPATH for the build tree SET(CMAKE_SKIP_BUILD_RPATH FALSE) diff --git a/scitos2_core/CHANGELOG.rst b/scitos2_core/CHANGELOG.rst index 029b572..da64ef4 100644 --- a/scitos2_core/CHANGELOG.rst +++ b/scitos2_core/CHANGELOG.rst @@ -10,4 +10,5 @@ Changelog for package scitos2_core * Added SinkLogger class (.hpp file). * Added dependency to scitos2_common. * Inserted all RPC calls inside try-catching blocks. +* Update CMakeLists.txt to use modern idioms. * Contributors: Alberto Tudela diff --git a/scitos2_core/CMakeLists.txt b/scitos2_core/CMakeLists.txt index bdfd8b1..0976538 100644 --- a/scitos2_core/CMakeLists.txt +++ b/scitos2_core/CMakeLists.txt @@ -27,6 +27,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() option(COVERAGE_ENABLED "Enable code coverage" FALSE) + if(COVERAGE_ENABLED) add_compile_options(--coverage) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") @@ -52,7 +53,6 @@ endif() find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(rclcpp_lifecycle REQUIRED) -find_package(std_msgs REQUIRED) find_package(scitos2_common REQUIRED) find_mira_path() @@ -60,25 +60,32 @@ find_mira_path() # ########## # # Build ## # ########## -# # Specify additional locations of header files -# # Your package locations should be listed before other locations -include_directories( - include -) - include_mira_packages() -set(dependencies - rclcpp - rclcpp_components - std_msgs +add_library(scitos2_core INTERFACE) +target_include_directories(scitos2_core + INTERFACE + "$" + "$" +) +target_link_libraries(scitos2_core INTERFACE + ${std_msgs_TARGETS} + rclcpp::rclcpp + rclcpp_lifecycle::rclcpp_lifecycle ) # ############ # # Install ## # ############ +install(TARGETS scitos2_core + EXPORT scitos2_core + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + install(DIRECTORY include/ - DESTINATION include/ + DESTINATION include/${PROJECT_NAME} ) # ########### @@ -95,6 +102,11 @@ endif() # ################################## # # ament specific configuration ## # ################################## -ament_export_include_directories(include) -ament_export_dependencies(${dependencies}) +ament_export_include_directories(include/${PROJECT_NAME}) +ament_export_dependencies( + rclcpp + rclcpp_lifecycle + scitos2_common +) +ament_export_targets(scitos2_core) ament_package() diff --git a/scitos2_core/include/scitos2_core/module.hpp b/scitos2_core/include/scitos2_core/module.hpp index 517d1fa..2602c5c 100644 --- a/scitos2_core/include/scitos2_core/module.hpp +++ b/scitos2_core/include/scitos2_core/module.hpp @@ -23,7 +23,7 @@ #include #include -#include "rclcpp/rclcpp.hpp" +#include "rclcpp/logger.hpp" #include "rclcpp_lifecycle/lifecycle_node.hpp" namespace scitos2_core @@ -220,6 +220,27 @@ class Module } } // LCOV_EXCL_STOP + +/** + * @brief Declares static ROS2 parameter and sets it to a given value if it was not already declared. + * + * @param node A node in which given parameter to be declared + * @param param_name The name of parameter + * @param default_value Parameter value to initialize with + * @param parameter_descriptor Parameter descriptor (optional) +*/ + template + void declare_parameter_if_not_declared( + NodeT node, + const std::string & param_name, + const rclcpp::ParameterValue & default_value, + const rcl_interfaces::msg::ParameterDescriptor & parameter_descriptor = + rcl_interfaces::msg::ParameterDescriptor()) + { + if (!node->has_parameter(param_name)) { + node->declare_parameter(param_name, default_value, parameter_descriptor); + } + } }; } // namespace scitos2_core diff --git a/scitos2_core/include/scitos2_core/sink_logger.hpp b/scitos2_core/include/scitos2_core/sink_logger.hpp index 451ac8e..0544fc4 100644 --- a/scitos2_core/include/scitos2_core/sink_logger.hpp +++ b/scitos2_core/include/scitos2_core/sink_logger.hpp @@ -18,7 +18,7 @@ #include -#include "rclcpp/rclcpp.hpp" +#include "rclcpp/logger.hpp" // LCOV_EXCL_START namespace scitos2_core diff --git a/scitos2_core/package.xml b/scitos2_core/package.xml index 219626c..ef23d7c 100644 --- a/scitos2_core/package.xml +++ b/scitos2_core/package.xml @@ -10,7 +10,6 @@ ament_cmake rclcpp rclcpp_lifecycle - std_msgs scitos2_common ament_lint_auto diff --git a/scitos2_mira/CHANGELOG.rst b/scitos2_mira/CHANGELOG.rst index 1a2b0ea..3945534 100644 --- a/scitos2_mira/CHANGELOG.rst +++ b/scitos2_mira/CHANGELOG.rst @@ -17,6 +17,7 @@ Changelog for package scitos2_mira * Added unit testing. * Added composable nodes in launch file. * Added default diagnostics. +* Update CMakeLists.txt to use modern idioms. 1.1.3 (10-10-2023) ------------------ diff --git a/scitos2_mira/CMakeLists.txt b/scitos2_mira/CMakeLists.txt index 896c39c..ec98f11 100644 --- a/scitos2_mira/CMakeLists.txt +++ b/scitos2_mira/CMakeLists.txt @@ -27,6 +27,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() option(COVERAGE_ENABLED "Enable code coverage" FALSE) + if(COVERAGE_ENABLED) add_compile_options(--coverage) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") @@ -50,50 +51,49 @@ endif() # ############################################### # # Find ament macros and libraries find_package(ament_cmake REQUIRED) +find_package(diagnostic_msgs REQUIRED) +find_package(nav2_util REQUIRED) +find_package(pluginlib REQUIRED) find_package(rclcpp REQUIRED) find_package(rclcpp_components REQUIRED) -find_package(nav2_util REQUIRED) -find_package(scitos2_msgs REQUIRED) find_package(scitos2_core REQUIRED) find_package(scitos2_common REQUIRED) -find_package(pluginlib REQUIRED) -find_package(diagnostic_msgs REQUIRED) find_mira_path() # ########## # # Build ## # ########## -# # Specify additional locations of header files -# # Your package locations should be listed before other locations -include_directories( - include -) - include_mira_packages() -set(dependencies - rclcpp - rclcpp_components - nav2_util - scitos2_msgs - scitos2_core - pluginlib - diagnostic_msgs -) - -set(library_name ${PROJECT_NAME}_core) +set(library_name mira_core) set(executable_name mira_framework) # Add library add_library(${library_name} SHARED src/mira_framework.cpp) -ament_target_dependencies(${library_name} ${dependencies}) +target_include_directories(${library_name} PUBLIC + "$" + "$" +) +target_link_libraries(${library_name} + PUBLIC + ${diagnostic_msgs_TARGETS} + pluginlib::pluginlib + rclcpp::rclcpp + scitos2_core::scitos2_core + PRIVATE + rclcpp_components::component +) + +ament_target_dependencies(${library_name} PUBLIC nav2_util) # TODO(ajtudela): Fix this in jazzy target_link_mira_libraries(${library_name}) # Add executable add_executable(${executable_name} src/main.cpp) -ament_target_dependencies(${executable_name} ${dependencies}) -target_link_libraries(${executable_name} ${library_name}) +target_link_libraries(${executable_name} PRIVATE + ${library_name} + rclcpp::rclcpp +) rclcpp_components_register_nodes(${library_name} "scitos2_mira::MiraFramework") @@ -101,6 +101,7 @@ rclcpp_components_register_nodes(${library_name} "scitos2_mira::MiraFramework") # # Install ## # ############ install(TARGETS ${library_name} + EXPORT ${library_name} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin @@ -111,7 +112,7 @@ install(TARGETS ${executable_name} ) install(DIRECTORY include/ - DESTINATION include/ + DESTINATION include/${PROJECT_NAME} ) install(DIRECTORY launch params @@ -138,7 +139,15 @@ endif() # ################################## # # ament specific configuration ## # ################################## -ament_export_include_directories(include) +ament_export_include_directories(include/${PROJECT_NAME}) ament_export_libraries(${library_name}) -ament_export_dependencies(${dependencies}) +ament_export_dependencies( + diagnostic_msgs + nav2_util + pluginlib + rclcpp + rclcpp_components + scitos2_core +) +ament_export_targets(${library_name}) ament_package() \ No newline at end of file diff --git a/scitos2_mira/include/scitos2_mira/mira_framework.hpp b/scitos2_mira/include/scitos2_mira/mira_framework.hpp index 00107e4..7e3989d 100644 --- a/scitos2_mira/include/scitos2_mira/mira_framework.hpp +++ b/scitos2_mira/include/scitos2_mira/mira_framework.hpp @@ -28,8 +28,8 @@ // ROS #include "diagnostic_msgs/msg/diagnostic_array.hpp" #include "nav2_util/lifecycle_node.hpp" +#include "rclcpp/rclcpp.hpp" #include "pluginlib/class_loader.hpp" -#include "pluginlib/class_list_macros.hpp" // Scitos2 #include "scitos2_core/module.hpp" diff --git a/scitos2_mira/package.xml b/scitos2_mira/package.xml index d5f7951..ef1f151 100644 --- a/scitos2_mira/package.xml +++ b/scitos2_mira/package.xml @@ -8,13 +8,13 @@ Apache-2.0 Alberto Tudela ament_cmake - rclcpp + diagnostic_msgs nav2_util - scitos2_msgs + pluginlib + rclcpp + rclcpp_components scitos2_core scitos2_common - pluginlib - diagnostic_msgs ament_lint_auto ament_lint_common diff --git a/scitos2_mira/test/CMakeLists.txt b/scitos2_mira/test/CMakeLists.txt index 6c36978..377c0e4 100644 --- a/scitos2_mira/test/CMakeLists.txt +++ b/scitos2_mira/test/CMakeLists.txt @@ -2,9 +2,7 @@ ament_add_gtest(test_mira_framework test_mira_framework.cpp ) -ament_target_dependencies(test_mira_framework - ${dependencies} -) target_link_libraries(test_mira_framework ${library_name} + rclcpp::rclcpp ) \ No newline at end of file diff --git a/scitos2_modules/CHANGELOG.rst b/scitos2_modules/CHANGELOG.rst index 84fa5a0..4a7c385 100644 --- a/scitos2_modules/CHANGELOG.rst +++ b/scitos2_modules/CHANGELOG.rst @@ -10,4 +10,5 @@ Changelog for package scitos2_modules * Added unit testing. * Added footprint to Drive module for visualization. * Added IMU module. +* Update CMakeLists.txt to use modern idioms. * Contributors: Alberto Tudela. diff --git a/scitos2_modules/CMakeLists.txt b/scitos2_modules/CMakeLists.txt index d44055d..a34a146 100644 --- a/scitos2_modules/CMakeLists.txt +++ b/scitos2_modules/CMakeLists.txt @@ -27,6 +27,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() option(COVERAGE_ENABLED "Enable code coverage" FALSE) + if(COVERAGE_ENABLED) add_compile_options(--coverage) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") @@ -51,7 +52,6 @@ endif() # # Find ament macros and libraries find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) -find_package(nav2_util REQUIRED) find_package(nav2_costmap_2d REQUIRED) find_package(geometry_msgs REQUIRED) find_package(nav_msgs REQUIRED) @@ -70,61 +70,107 @@ find_mira_path() # ########## # # Build ## # ########## -# # Specify additional locations of header files -# # Your package locations should be listed before other locations -include_directories( - include -) - include_mira_packages() -set(dependencies - rclcpp - nav2_util - nav2_costmap_2d - geometry_msgs - nav_msgs - sensor_msgs - tf2 - tf2_geometry_msgs - tf2_ros - visualization_msgs - scitos2_msgs - scitos2_core - pluginlib -) - add_library(scitos2_charger SHARED src/charger.cpp) -list(APPEND plugin_libs scitos2_charger) +target_include_directories(scitos2_charger PUBLIC + "$" + "$" +) +target_link_libraries(scitos2_charger + PUBLIC + rclcpp::rclcpp + scitos2_core::scitos2_core + ${scitos2_msgs_TARGETS} + ${sensor_msgs_TARGETS} + PRIVATE + pluginlib::pluginlib +) +target_link_mira_libraries(scitos2_charger) add_library(scitos2_display SHARED src/display.cpp) -list(APPEND plugin_libs scitos2_display) +target_include_directories(scitos2_display PUBLIC + "$" + "$" +) +target_link_libraries(scitos2_display + PUBLIC + rclcpp::rclcpp + scitos2_core::scitos2_core + ${scitos2_msgs_TARGETS} + PRIVATE + pluginlib::pluginlib +) +target_link_mira_libraries(scitos2_display) add_library(scitos2_drive SHARED src/drive.cpp) -list(APPEND plugin_libs scitos2_drive) +target_include_directories(scitos2_drive PUBLIC + "$" + "$" +) +target_link_libraries(scitos2_drive + PUBLIC + ${geometry_msgs_TARGETS} + ${nav_msgs_TARGETS} + rclcpp::rclcpp + scitos2_core::scitos2_core + ${scitos2_msgs_TARGETS} + ${sensor_msgs_TARGETS} + tf2_ros::tf2_ros + ${visualization_msgs_TARGETS} + PRIVATE + pluginlib::pluginlib + tf2_geometry_msgs::tf2_geometry_msgs +) +ament_target_dependencies(scitos2_drive PUBLIC nav2_costmap_2d) # TODO(ajtudela): Fix this in jazzy +target_link_mira_libraries(scitos2_drive) add_library(scitos2_ebc SHARED src/ebc.cpp) -list(APPEND plugin_libs scitos2_ebc) +target_include_directories(scitos2_ebc PUBLIC + "$" + "$" +) +target_link_libraries(scitos2_ebc + PUBLIC + rclcpp::rclcpp + scitos2_core::scitos2_core + PRIVATE + pluginlib::pluginlib +) +target_link_mira_libraries(scitos2_ebc) add_library(scitos2_imu SHARED src/imu.cpp) -list(APPEND plugin_libs scitos2_imu) - -foreach(module_plugin ${plugin_libs}) - ament_target_dependencies(${module_plugin} ${dependencies}) - target_link_mira_libraries(${module_plugin}) -endforeach() +target_include_directories(scitos2_imu PUBLIC + "$" + "$" +) +target_link_libraries(scitos2_imu + PUBLIC + rclcpp::rclcpp + scitos2_core::scitos2_core + ${sensor_msgs_TARGETS} + PRIVATE + pluginlib::pluginlib +) +target_link_mira_libraries(scitos2_imu) # ############ # # Install ## # ############ -install(TARGETS ${plugin_libs} +install(TARGETS + scitos2_charger + scitos2_display + scitos2_drive + scitos2_ebc + scitos2_imu + EXPORT ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) install(DIRECTORY include/ - DESTINATION include/ + DESTINATION include/${PROJECT_NAME} ) # ########### @@ -132,6 +178,7 @@ install(DIRECTORY include/ # ########### if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) + # the following line skips the linter which checks for copyrights set(ament_cmake_copyright_FOUND TRUE) ament_lint_auto_find_test_dependencies() @@ -141,10 +188,30 @@ endif() # ################################## # # ament specific configuration ## # ################################## -ament_export_include_directories(include) -ament_export_libraries(${plugin_libs}) -ament_export_dependencies(${dependencies}) +ament_export_include_directories(include/${PROJECT_NAME}) +ament_export_libraries( + scitos2_charger + scitos2_display + scitos2_drive + scitos2_ebc + scitos2_imu +) +ament_export_dependencies( + geometry_msgs + nav2_costmap_2d + nav_msgs + pluginlib + rclcpp + scitos2_core + scitos2_msgs + sensor_msgs + tf2 + tf2_geometry_msgs + tf2_ros + visualization_msgs +) pluginlib_export_plugin_description_file(scitos2_core modules_plugin.xml) +ament_export_targets(${PROJECT_NAME}) ament_package() \ No newline at end of file diff --git a/scitos2_modules/include/scitos2_modules/charger.hpp b/scitos2_modules/include/scitos2_modules/charger.hpp index c60f7c3..1c182b9 100644 --- a/scitos2_modules/include/scitos2_modules/charger.hpp +++ b/scitos2_modules/include/scitos2_modules/charger.hpp @@ -27,8 +27,6 @@ // ROS #include "rclcpp/rclcpp.hpp" -#include "pluginlib/class_loader.hpp" -#include "pluginlib/class_list_macros.hpp" #include "sensor_msgs/msg/battery_state.hpp" // SCITOS2 diff --git a/scitos2_modules/include/scitos2_modules/display.hpp b/scitos2_modules/include/scitos2_modules/display.hpp index bcaaf26..bf598d3 100644 --- a/scitos2_modules/include/scitos2_modules/display.hpp +++ b/scitos2_modules/include/scitos2_modules/display.hpp @@ -27,8 +27,6 @@ // ROS #include "rclcpp/rclcpp.hpp" -#include "pluginlib/class_loader.hpp" -#include "pluginlib/class_list_macros.hpp" #include "rcl_interfaces/msg/set_parameters_result.hpp" // SCITOS2 diff --git a/scitos2_modules/include/scitos2_modules/drive.hpp b/scitos2_modules/include/scitos2_modules/drive.hpp index 6e75b6e..38e5d18 100644 --- a/scitos2_modules/include/scitos2_modules/drive.hpp +++ b/scitos2_modules/include/scitos2_modules/drive.hpp @@ -28,8 +28,6 @@ // ROS #include "rclcpp/rclcpp.hpp" -#include "pluginlib/class_loader.hpp" -#include "pluginlib/class_list_macros.hpp" #include "rcl_interfaces/msg/set_parameters_result.hpp" #include "geometry_msgs/msg/twist.hpp" #include "nav_msgs/msg/odometry.hpp" diff --git a/scitos2_modules/include/scitos2_modules/ebc.hpp b/scitos2_modules/include/scitos2_modules/ebc.hpp index 5154c60..fda7135 100644 --- a/scitos2_modules/include/scitos2_modules/ebc.hpp +++ b/scitos2_modules/include/scitos2_modules/ebc.hpp @@ -27,8 +27,6 @@ // ROS #include "rclcpp/rclcpp.hpp" -#include "pluginlib/class_loader.hpp" -#include "pluginlib/class_list_macros.hpp" #include "rcl_interfaces/msg/set_parameters_result.hpp" #include "scitos2_core/module.hpp" diff --git a/scitos2_modules/include/scitos2_modules/imu.hpp b/scitos2_modules/include/scitos2_modules/imu.hpp index 7be3ca6..4989e79 100644 --- a/scitos2_modules/include/scitos2_modules/imu.hpp +++ b/scitos2_modules/include/scitos2_modules/imu.hpp @@ -27,8 +27,6 @@ // ROS #include "rclcpp/rclcpp.hpp" -#include "pluginlib/class_loader.hpp" -#include "pluginlib/class_list_macros.hpp" #include "sensor_msgs/msg/imu.hpp" // SCITOS2 diff --git a/scitos2_modules/package.xml b/scitos2_modules/package.xml index 9faf5ea..054eafa 100644 --- a/scitos2_modules/package.xml +++ b/scitos2_modules/package.xml @@ -8,20 +8,19 @@ Apache-2.0 Alberto Tudela ament_cmake + geometry_msgs rclcpp - nav2_util nav2_costmap_2d - geometry_msgs nav_msgs + pluginlib + scitos2_msgs + scitos2_core + scitos2_common sensor_msgs tf2 tf2_geometry_msgs tf2_ros visualization_msgs - scitos2_msgs - scitos2_core - scitos2_common - pluginlib ament_lint_auto ament_lint_common diff --git a/scitos2_modules/src/charger.cpp b/scitos2_modules/src/charger.cpp index 28cae5c..aa7aba1 100644 --- a/scitos2_modules/src/charger.cpp +++ b/scitos2_modules/src/charger.cpp @@ -16,9 +16,6 @@ // C++ #include -#include "nav2_util/node_utils.hpp" -#include "pluginlib/class_list_macros.hpp" - #include "scitos2_modules/charger.hpp" namespace scitos2_modules @@ -173,4 +170,5 @@ scitos2_msgs::msg::ChargerStatus Charger::miraToRosChargerStatus( } // namespace scitos2_modules +#include "pluginlib/class_list_macros.hpp" // NOLINT PLUGINLIB_EXPORT_CLASS(scitos2_modules::Charger, scitos2_core::Module) diff --git a/scitos2_modules/src/display.cpp b/scitos2_modules/src/display.cpp index a56ebd6..6d4ec14 100644 --- a/scitos2_modules/src/display.cpp +++ b/scitos2_modules/src/display.cpp @@ -13,9 +13,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "nav2_util/node_utils.hpp" -#include "pluginlib/class_list_macros.hpp" - #include "scitos2_modules/display.hpp" namespace scitos2_modules @@ -50,7 +47,7 @@ void Display::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std::bind(&Display::menuDataCallback, this, std::placeholders::_1)); // Declare and read parameters - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".user_menu_enabled", rclcpp::ParameterValue(false), rcl_interfaces::msg::ParameterDescriptor() .set__description("Enable / disable the user menu entry")); @@ -59,14 +56,14 @@ void Display::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, logger_, "The parameter user_menu_enabled is set to: [%s]", user_menu_enabled_ ? "true" : "false"); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".menu_name", rclcpp::ParameterValue("User Menu"), rcl_interfaces::msg::ParameterDescriptor() .set__description("The name of the user menu entry in the main menu of the status display")); node->get_parameter(plugin_name_ + ".menu_name", menu_name_); RCLCPP_INFO(logger_, "The parameter menu_name is set to: [%s]", menu_name_.c_str()); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".menu_entry_name_1", rclcpp::ParameterValue("Entry 1"), rcl_interfaces::msg::ParameterDescriptor() .set__description( @@ -75,7 +72,7 @@ void Display::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, RCLCPP_INFO( logger_, "The parameter menu_entry_name_1 is set to: [%s]", menu_entry_name_1_.c_str()); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".menu_entry_name_2", rclcpp::ParameterValue("Entry 2"), rcl_interfaces::msg::ParameterDescriptor() .set__description( @@ -84,7 +81,7 @@ void Display::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, RCLCPP_INFO( logger_, "The parameter menu_entry_name_2 is set to: [%s]", menu_entry_name_2_.c_str()); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".menu_entry_name_3", rclcpp::ParameterValue("Entry 3"), rcl_interfaces::msg::ParameterDescriptor() .set__description( @@ -187,4 +184,5 @@ void Display::changeMenuEntries() } // namespace scitos2_modules +#include "pluginlib/class_list_macros.hpp" // NOLINT PLUGINLIB_EXPORT_CLASS(scitos2_modules::Display, scitos2_core::Module) diff --git a/scitos2_modules/src/drive.cpp b/scitos2_modules/src/drive.cpp index 47acae2..57e7947 100644 --- a/scitos2_modules/src/drive.cpp +++ b/scitos2_modules/src/drive.cpp @@ -18,12 +18,9 @@ #include // ROS -#include "nav2_util/node_utils.hpp" -#include "nav2_costmap_2d/footprint.hpp" -#include "pluginlib/class_list_macros.hpp" #include "geometry_msgs/msg/quaternion.hpp" #include "geometry_msgs/msg/transform_stamped.hpp" - +#include "nav2_costmap_2d/footprint.hpp" #include "scitos2_modules/drive.hpp" namespace scitos2_modules @@ -49,21 +46,21 @@ void Drive::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, s authority_->checkin("/", plugin_name_); // Declare and read parameters - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".robot_base_frame", rclcpp::ParameterValue("base_link"), rcl_interfaces::msg::ParameterDescriptor() .set__description("The name of the base frame of the robot")); node->get_parameter(plugin_name_ + ".robot_base_frame", robot_base_frame_); RCLCPP_INFO(logger_, "The parameter robot_base_frame is set to: [%s]", robot_base_frame_.c_str()); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".odom_frame", rclcpp::ParameterValue("odom"), rcl_interfaces::msg::ParameterDescriptor() .set__description("The name of the odometry frame")); node->get_parameter(plugin_name_ + ".odom_frame", odom_frame_); RCLCPP_INFO(logger_, "The parameter odom_frame is set to: [%s]", odom_frame_.c_str()); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".odom_topic", rclcpp::ParameterValue("odom"), rcl_interfaces::msg::ParameterDescriptor() .set__description("The name of the odometry topic")); @@ -71,7 +68,7 @@ void Drive::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, s RCLCPP_INFO(logger_, "The parameter odom_topic is set to: [%s]", odom_topic_.c_str()); bool magnetic_barrier_enabled; - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".magnetic_barrier_enabled", rclcpp::ParameterValue(false), rcl_interfaces::msg::ParameterDescriptor() .set__description("Enable the magnetic strip detector to cut out the motors")); @@ -80,7 +77,7 @@ void Drive::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, s logger_, "The parameter magnetic_barrier_enabled is set to: [%s]", magnetic_barrier_enabled ? "true" : "false"); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".publish_tf", rclcpp::ParameterValue(true), rcl_interfaces::msg::ParameterDescriptor() .set__description("Publish the odometry as a tf2 transform")); @@ -89,7 +86,7 @@ void Drive::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, s logger_, "The parameter publish_tf_ is set to: [%s]", publish_tf_ ? "true" : "false"); int rbi = 0; - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".reset_bumper_interval", rclcpp::ParameterValue(0), rcl_interfaces::msg::ParameterDescriptor() .set__description("The interval in milliseconds to reset the bumper")); @@ -100,14 +97,14 @@ void Drive::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, s set_mira_param( authority_, "MainControlUnit.RearLaser.Enabled", magnetic_barrier_enabled ? "true" : "false"); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".footprint", rclcpp::ParameterValue(""), rcl_interfaces::msg::ParameterDescriptor() .set__description("The footprint of the robot")); node->get_parameter(plugin_name_ + ".footprint", footprint_); RCLCPP_INFO(logger_, "The parameter footprint is set to: [%s]", footprint_.c_str()); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".robot_radius", rclcpp::ParameterValue(0.5), rcl_interfaces::msg::ParameterDescriptor() .set__description("The radius of the robot")); @@ -572,4 +569,5 @@ scitos2_msgs::msg::BarrierStatus Drive::miraToRosBarrierStatus( } // namespace scitos2_modules +#include "pluginlib/class_list_macros.hpp" // NOLINT PLUGINLIB_EXPORT_CLASS(scitos2_modules::Drive, scitos2_core::Module) diff --git a/scitos2_modules/src/ebc.cpp b/scitos2_modules/src/ebc.cpp index 0ccc06e..a5a0c4a 100644 --- a/scitos2_modules/src/ebc.cpp +++ b/scitos2_modules/src/ebc.cpp @@ -13,9 +13,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "nav2_util/node_utils.hpp" -#include "pluginlib/class_list_macros.hpp" - #include "scitos2_modules/ebc.hpp" namespace scitos2_modules @@ -37,7 +34,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std authority_->checkin("/", plugin_name_); bool port_enabled; - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".mcu_5v_enabled", rclcpp::ParameterValue(true), rcl_interfaces::msg::ParameterDescriptor() .set__description("Enable / disable 5V enabled at MCU")); @@ -47,7 +44,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std logger_, "The parameter mcu_5v_enabled is set to: [%s]", port_enabled ? "true" : "false"); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".mcu_12v_enabled", rclcpp::ParameterValue(true), rcl_interfaces::msg::ParameterDescriptor() .set__description("Enable / disable 12V enabled at MCU")); @@ -57,7 +54,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std logger_, "The parameter mcu_12v_enabled is set to: [%s]", port_enabled ? "true" : "false"); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".mcu_24v_enabled", rclcpp::ParameterValue(true), rcl_interfaces::msg::ParameterDescriptor() .set__description("Enable / disable 24V enabled at MCU")); @@ -67,7 +64,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std logger_, "The parameter mcu_24v_enabled is set to: [%s]", port_enabled ? "true" : "false"); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".port0_5v_enabled", rclcpp::ParameterValue(true), rcl_interfaces::msg::ParameterDescriptor() @@ -78,7 +75,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std logger_, "The parameter port0_5v_enabled is set to: [%s]", port_enabled ? "true" : "false"); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".port0_12v_enabled", rclcpp::ParameterValue(true), rcl_interfaces::msg::ParameterDescriptor() .set__description("Enable / disable 12V enabled at port 0")); @@ -88,7 +85,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std logger_, "The parameter port0_12v_enabled is set to: [%s]", port_enabled ? "true" : "false"); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".port0_24v_enabled", rclcpp::ParameterValue(true), rcl_interfaces::msg::ParameterDescriptor() .set__description("Enable / disable 24V enabled at port 0")); @@ -98,7 +95,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std logger_, "The parameter port0_24v_enabled is set to: [%s]", port_enabled ? "true" : "false"); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".port1_5v_enabled", rclcpp::ParameterValue(true), rcl_interfaces::msg::ParameterDescriptor() .set__description("Enable / disable 5V enabled at port 1")); @@ -108,7 +105,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std logger_, "The parameter port1_5v_enabled is set to: [%s]", port_enabled ? "true" : "false"); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".port1_12v_enabled", rclcpp::ParameterValue(true), rcl_interfaces::msg::ParameterDescriptor() .set__description("Enable / disable 12V enabled at port 1")); @@ -118,7 +115,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std logger_, "The parameter port1_12v_enabled is set to: [%s]", port_enabled ? "true" : "false"); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".port1_24v_enabled", rclcpp::ParameterValue(true), rcl_interfaces::msg::ParameterDescriptor() .set__description("Enable / disable 24V enabled at port 1")); @@ -129,7 +126,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std port_enabled ? "true" : "false"); float port_max_current; - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".mcu_5v_max_current", rclcpp::ParameterValue(2.5), rcl_interfaces::msg::ParameterDescriptor() .set__description("Maximum current for MCU 5V in A") @@ -143,7 +140,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std set_mira_param(authority_, "MainControlUnit.EBC_5V.MaxCurrent", std::to_string(port_max_current)); RCLCPP_INFO(logger_, "The parameter mcu_5v_max_current is set to: [%f]", port_max_current); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".mcu_12v_max_current", rclcpp::ParameterValue(2.5), rcl_interfaces::msg::ParameterDescriptor() .set__description("Maximum current for MCU 12V in A") @@ -159,7 +156,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std std::to_string(port_max_current)); RCLCPP_INFO(logger_, "The parameter mcu_12v_max_current is set to: [%f]", port_max_current); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".mcu_24v_max_current", rclcpp::ParameterValue(2.5), rcl_interfaces::msg::ParameterDescriptor() .set__description("Maximum current for MCU 24V in A") @@ -175,7 +172,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std std::to_string(port_max_current)); RCLCPP_INFO(logger_, "The parameter mcu_24v_max_current is set to: [%f]", port_max_current); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".port0_5v_max_current", rclcpp::ParameterValue(2.5), rcl_interfaces::msg::ParameterDescriptor() .set__description("Maximum current for port 0 5V in A") @@ -189,7 +186,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std set_mira_param(authority_, "EBC7.Port0_5V.MaxCurrent", std::to_string(port_max_current)); RCLCPP_INFO(logger_, "The parameter port0_5v_max_current is set to: [%f]", port_max_current); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".port0_12v_max_current", rclcpp::ParameterValue(2.5), rcl_interfaces::msg::ParameterDescriptor() .set__description("Maximum current for port 0 12V in A") @@ -203,7 +200,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std set_mira_param(authority_, "EBC7.Port0_12V.MaxCurrent", std::to_string(port_max_current)); RCLCPP_INFO(logger_, "The parameter port0_12v_max_current is set to: [%f]", port_max_current); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".port0_24v_max_current", rclcpp::ParameterValue(2.5), rcl_interfaces::msg::ParameterDescriptor() .set__description("Maximum current for port 0 24V in A") @@ -217,7 +214,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std set_mira_param(authority_, "EBC7.Port0_24V.MaxCurrent", std::to_string(port_max_current)); RCLCPP_INFO(logger_, "The parameter port0_24v_max_current is set to: [%f]", port_max_current); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".port1_5v_max_current", rclcpp::ParameterValue(2.5), rcl_interfaces::msg::ParameterDescriptor() .set__description("Maximum current for port 1 5V in A") @@ -231,7 +228,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std set_mira_param(authority_, "EBC7.Port1_5V.MaxCurrent", std::to_string(port_max_current)); RCLCPP_INFO(logger_, "The parameter port1_5v_max_current is set to: [%f]", port_max_current); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".port1_12v_max_current", rclcpp::ParameterValue(2.5), rcl_interfaces::msg::ParameterDescriptor() .set__description("Maximum current for port 1 12V in A") @@ -245,7 +242,7 @@ void EBC::configure(const rclcpp_lifecycle::LifecycleNode::WeakPtr & parent, std set_mira_param(authority_, "EBC7.Port1_12V.MaxCurrent", std::to_string(port_max_current)); RCLCPP_INFO(logger_, "The parameter port1_12v_max_current is set to: [%f]", port_max_current); - nav2_util::declare_parameter_if_not_declared( + declare_parameter_if_not_declared( node, plugin_name_ + ".port1_24v_max_current", rclcpp::ParameterValue(4.0), rcl_interfaces::msg::ParameterDescriptor() .set__description("Maximum current for port 1 24V in A") @@ -456,4 +453,5 @@ rcl_interfaces::msg::SetParametersResult EBC::dynamicParametersCallback( } // namespace scitos2_modules +#include "pluginlib/class_list_macros.hpp" // NOLINT PLUGINLIB_EXPORT_CLASS(scitos2_modules::EBC, scitos2_core::Module) diff --git a/scitos2_modules/src/imu.cpp b/scitos2_modules/src/imu.cpp index 79bf091..2f4d9a5 100644 --- a/scitos2_modules/src/imu.cpp +++ b/scitos2_modules/src/imu.cpp @@ -16,9 +16,6 @@ // C++ #include -#include "nav2_util/node_utils.hpp" -#include "pluginlib/class_list_macros.hpp" - #include "scitos2_modules/imu.hpp" namespace scitos2_modules @@ -42,7 +39,8 @@ void IMU::configure( authority_->checkin("/", plugin_name_); // Declare and read parameters - nav2_util::declare_parameter_if_not_declared( + + declare_parameter_if_not_declared( node, plugin_name_ + ".robot_base_frame", rclcpp::ParameterValue("base_link"), rcl_interfaces::msg::ParameterDescriptor() .set__description("The name of the base frame of the robot")); @@ -120,4 +118,5 @@ void IMU::gyroscopeDataCallback(mira::ChannelRead data) } // namespace scitos2_modules +#include "pluginlib/class_list_macros.hpp" // NOLINT PLUGINLIB_EXPORT_CLASS(scitos2_modules::IMU, scitos2_core::Module) diff --git a/scitos2_modules/test/CMakeLists.txt b/scitos2_modules/test/CMakeLists.txt index 23fcdca..0ba5069 100644 --- a/scitos2_modules/test/CMakeLists.txt +++ b/scitos2_modules/test/CMakeLists.txt @@ -2,9 +2,6 @@ ament_add_gtest(test_charger test_charger.cpp ) -ament_target_dependencies(test_charger - ${dependencies} -) target_link_libraries(test_charger scitos2_charger ) @@ -13,9 +10,6 @@ target_link_libraries(test_charger ament_add_gtest(test_display test_display.cpp ) -ament_target_dependencies(test_display - ${dependencies} -) target_link_libraries(test_display scitos2_display ) @@ -24,9 +18,6 @@ target_link_libraries(test_display ament_add_gtest(test_drive test_drive.cpp ) -ament_target_dependencies(test_drive - ${dependencies} -) target_link_libraries(test_drive scitos2_drive ) @@ -35,9 +26,6 @@ target_link_libraries(test_drive ament_add_gtest(test_ebc test_ebc.cpp ) -ament_target_dependencies(test_ebc - ${dependencies} -) target_link_libraries(test_ebc scitos2_ebc ) diff --git a/scitos2_modules/test/test_display.cpp b/scitos2_modules/test/test_display.cpp index 9a54aa4..9b3a75f 100644 --- a/scitos2_modules/test/test_display.cpp +++ b/scitos2_modules/test/test_display.cpp @@ -17,7 +17,7 @@ #include "rclcpp/rclcpp.hpp" #include "scitos2_modules/display.hpp" -#include "nav2_util/lifecycle_node.hpp" +#include "rclcpp_lifecycle/lifecycle_node.hpp" #include "std_msgs/msg/string.hpp" diff --git a/scitos2_msgs/CMakeLists.txt b/scitos2_msgs/CMakeLists.txt index fcd5fbb..f16dd9d 100644 --- a/scitos2_msgs/CMakeLists.txt +++ b/scitos2_msgs/CMakeLists.txt @@ -20,8 +20,8 @@ endif() # ############################################### # # Find ament macros and libraries find_package(ament_cmake REQUIRED) -find_package(std_msgs REQUIRED) find_package(builtin_interfaces REQUIRED) +find_package(std_msgs REQUIRED) find_package(rosidl_default_generators REQUIRED) # ############################################### @@ -54,7 +54,7 @@ set(srv_files rosidl_generate_interfaces(${PROJECT_NAME} ${msg_files} ${srv_files} - DEPENDENCIES std_msgs builtin_interfaces + DEPENDENCIES builtin_interfaces std_msgs ) # ################################## diff --git a/scitos2_msgs/package.xml b/scitos2_msgs/package.xml index 2b28aa1..b23ae68 100644 --- a/scitos2_msgs/package.xml +++ b/scitos2_msgs/package.xml @@ -10,8 +10,8 @@ ament_cmake - std_msgs builtin_interfaces + std_msgs rosidl_default_generators rosidl_interface_packages