diff --git a/rosplane/CMakeLists.txt b/rosplane/CMakeLists.txt index c959f7a..612f7a3 100644 --- a/rosplane/CMakeLists.txt +++ b/rosplane/CMakeLists.txt @@ -33,40 +33,56 @@ find_package(Eigen3 3.3 REQUIRED NO_MODULE) find_package(rosflight_msgs REQUIRED) pkg_check_modules(YAML_CPP REQUIRED yaml-cpp) -ament_export_dependencies(rclcpp rclpy) -ament_export_include_directories(include) - -#install(DIRECTORY originalFiles DESTINATION share/${PROJECT_NAME}/) -include_directories( #use this if you need .h files for include statements. The include will need to have the directories where each .h is respectively. +include_directories( include + include/param_manager ${EIGEN3_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS} ${YAML_CPP_INCLUDEDIR} ) +### EXTRA FILES TO INSTALL ### + install(DIRECTORY launch params DESTINATION share/${PROJECT_NAME}/) -### START OF REAL EXECUTABLES ### +### LIBRARIES ### + +# Param Manager +add_library(param_manager + include/param_manager/param_manager.hpp + src/param_manager/param_manager.cpp +) +ament_target_dependencies(param_manager rclcpp) +ament_export_targets(param_manager HAS_LIBRARY_TARGET) +install(DIRECTORY include/param_manager DESTINATION include) +install(TARGETS param_manager + EXPORT param_manager + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + INCLUDES DESTINATION include +) + +### START OF EXECUTABLES ### # Controller add_executable(rosplane_controller src/controller_base.cpp src/controller_state_machine.cpp src/controller_successive_loop.cpp - src/controller_total_energy.cpp - src/param_manager.cpp) + src/controller_total_energy.cpp) ament_target_dependencies(rosplane_controller rosplane_msgs rosflight_msgs rclcpp rclpy Eigen3) +target_link_libraries(rosplane_controller param_manager) install(TARGETS rosplane_controller DESTINATION lib/${PROJECT_NAME}) - # Follower add_executable(rosplane_path_follower src/path_follower_example.cpp - src/path_follower_base.cpp - src/param_manager.cpp) + src/path_follower_base.cpp) ament_target_dependencies(rosplane_path_follower rosplane_msgs rclcpp rclpy Eigen3) +target_link_libraries(rosplane_path_follower param_manager) install(TARGETS rosplane_path_follower DESTINATION lib/${PROJECT_NAME}) @@ -74,18 +90,18 @@ install(TARGETS # Manager add_executable(rosplane_path_manager src/path_manager_base.cpp - src/path_manager_example.cpp - src/param_manager.cpp) + src/path_manager_example.cpp) ament_target_dependencies(rosplane_path_manager rosplane_msgs rclcpp rclpy Eigen3) +target_link_libraries(rosplane_path_manager param_manager) install(TARGETS rosplane_path_manager DESTINATION lib/${PROJECT_NAME}) # Planner add_executable(rosplane_path_planner - src/path_planner.cpp - src/param_manager.cpp) + src/path_planner.cpp) target_link_libraries(rosplane_path_planner + param_manager ${YAML_CPP_LIBRARIES} ) ament_target_dependencies(rosplane_path_planner rosplane_msgs rosflight_msgs std_srvs rclcpp rclpy Eigen3) @@ -96,9 +112,9 @@ install(TARGETS # Estimator add_executable(rosplane_estimator_node src/estimator_base.cpp - src/estimator_example.cpp - src/param_manager.cpp) + src/estimator_example.cpp) ament_target_dependencies(rosplane_estimator_node rosplane_msgs rosflight_msgs rclcpp Eigen3) +target_link_libraries(rosplane_estimator_node param_manager) install(TARGETS rosplane_estimator_node DESTINATION lib/${PROJECT_NAME}) diff --git a/rosplane/include/param_manager.hpp b/rosplane/include/param_manager/param_manager.hpp similarity index 100% rename from rosplane/include/param_manager.hpp rename to rosplane/include/param_manager/param_manager.hpp diff --git a/rosplane/src/param_manager.cpp b/rosplane/src/param_manager/param_manager.cpp similarity index 100% rename from rosplane/src/param_manager.cpp rename to rosplane/src/param_manager/param_manager.cpp diff --git a/rosplane_extra/CMakeLists.txt b/rosplane_extra/CMakeLists.txt index de6dde3..2f5c6ad 100644 --- a/rosplane_extra/CMakeLists.txt +++ b/rosplane_extra/CMakeLists.txt @@ -19,44 +19,23 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") endif() # find dependencies -find_package(rosplane) +find_package(rosplane REQUIRED) find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(std_srvs REQUIRED) find_package(rosplane_msgs REQUIRED) find_package(rosflight_msgs REQUIRED) -ament_export_dependencies(rclcpp) -ament_export_include_directories(include) - include_directories(include) -install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}/) - -### START OF REAL EXECUTABLES ### - # Input Mapper add_executable(input_mapper - src/input_mapper.cpp - src/param_manager.cpp) -ament_target_dependencies(input_mapper rosplane_msgs rosflight_msgs rclcpp std_srvs) -install(TARGETS + src/input_mapper.cpp) +ament_target_dependencies(input_mapper rosplane_msgs rosflight_msgs rclcpp std_srvs rosplane) +install( + TARGETS input_mapper - DESTINATION lib/${PROJECT_NAME}) - -#### END OF EXECUTABLES ### - - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # comment the line when a copyright and license is added to all source files - set(ament_cmake_copyright_FOUND TRUE) - # the following line skips cpplint (only works in a git repo) - # comment the line when this package is in a git repo and when - # a copyright and license is added to all source files - set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() + DESTINATION lib/${PROJECT_NAME} +) ament_package() diff --git a/rosplane_extra/include/input_mapper.hpp b/rosplane_extra/include/input_mapper.hpp index 60f7526..8ee9cc9 100644 --- a/rosplane_extra/include/input_mapper.hpp +++ b/rosplane_extra/include/input_mapper.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include namespace rosplane { diff --git a/rosplane_extra/package.xml b/rosplane_extra/package.xml index c614256..f3b26c9 100644 --- a/rosplane_extra/package.xml +++ b/rosplane_extra/package.xml @@ -12,6 +12,7 @@ rclcpp std_msgs std_srvs + rosplane rosplane_msgs rosflight_msgs