Skip to content

Commit

Permalink
Moved param manager to library in rosplane package
Browse files Browse the repository at this point in the history
  • Loading branch information
bsutherland333 committed Jun 24, 2024
1 parent 3e6cbe3 commit f1a64eb
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 46 deletions.
50 changes: 33 additions & 17 deletions rosplane/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,59 +33,75 @@ 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})

# 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)
Expand All @@ -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})
Expand Down
File renamed without changes.
File renamed without changes.
35 changes: 7 additions & 28 deletions rosplane_extra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion rosplane_extra/include/input_mapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <rosplane_msgs/msg/controller_commands.hpp>
#include <rosplane_msgs/msg/state.hpp>
#include <std_srvs/srv/trigger.hpp>
#include <param_manager.hpp>
#include <param_manager/param_manager.hpp>

namespace rosplane
{
Expand Down
1 change: 1 addition & 0 deletions rosplane_extra/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<depend>rclcpp</depend>
<depend>std_msgs</depend>
<depend>std_srvs</depend>
<depend>rosplane</depend>
<depend>rosplane_msgs</depend>
<depend>rosflight_msgs</depend>

Expand Down

0 comments on commit f1a64eb

Please sign in to comment.