diff --git a/src/modules/trajectory_generation/domain/CMakeLists.txt b/src/modules/trajectory_generation/domain/CMakeLists.txt index 83c62ee..a67790c 100644 --- a/src/modules/trajectory_generation/domain/CMakeLists.txt +++ b/src/modules/trajectory_generation/domain/CMakeLists.txt @@ -9,20 +9,25 @@ find_package(Eigen3 REQUIRED) set(SPLINE_GENERATION spline_generation) set(TRAJECTORY_GENERATION trajectory_generation) set(GRAPH_GENERATION graph_generation) +set(COST_CALCULATION cost_calculation) # Store all .cpp and .hpp files in a variable file(GLOB spline_cpp_files "${SPLINE_GENERATION}/*.cpp") file(GLOB trajectory_cpp_files "${TRAJECTORY_GENERATION}/*.cpp") file(GLOB graph_cpp_files "${GRAPH_GENERATION}/*.cpp") +file(GLOB cost_cpp_files "${COST_CALCULATION}/*.cpp") + file(GLOB spline_hpp_files "${SPLINE_GENERATION}/*.hpp") file(GLOB trajectory_hpp_files "${TRAJECTORY_GENERATION}/*.hpp") file(GLOB graph_hpp_files "${GRAPH_GENERATION}/*.hpp") +file(GLOB cost_hpp_files "${COST_CALCULATION}/*.hpp") # Add library add_library(${SPLINE_GENERATION} ${spline_cpp_files}) add_library(${TRAJECTORY_GENERATION} ${trajectory_cpp_files}) add_library(${GRAPH_GENERATION} ${graph_cpp_files}) +add_library(${COST_CALCULATION} ${cost_cpp_files}) # Link Dependencies target_link_libraries(${TRAJECTORY_GENERATION} ${SPLINE_GENERATION}) @@ -33,6 +38,7 @@ target_link_libraries(${GRAPH_GENERATION} ${TRAJECTORY_GENERATION}) ament_target_dependencies(${SPLINE_GENERATION} common_domain) ament_target_dependencies(${TRAJECTORY_GENERATION} common_domain) ament_target_dependencies(${GRAPH_GENERATION} common_domain) +ament_target_dependencies(${COST_CALCULATION} common_domain) # Export target and also its dependencies so that you don't have to call # find_package() for each of the dependencies @@ -42,6 +48,8 @@ ament_export_targets(${TRAJECTORY_GENERATION}Targets HAS_LIBRARY_TARGET) ament_export_dependencies(common_domain) ament_export_targets(${GRAPH_GENERATION}Targets HAS_LIBRARY_TARGET) ament_export_dependencies(common_domain) +ament_export_targets(${COST_CALCULATION}Targets HAS_LIBRARY_TARGET) +ament_export_dependencies(common_domain) # Specify the include directories to enable cmake to build and install target_include_directories(${SPLINE_GENERATION} PUBLIC @@ -56,6 +64,10 @@ target_include_directories(${GRAPH_GENERATION} PUBLIC $ $ # /include/mylib ) +target_include_directories(${COST_CALCULATION} PUBLIC + $ + $ # /include/mylib +) # Install all header files to the desired location install( @@ -70,6 +82,10 @@ install( FILES ${graph_hpp_files} DESTINATION include/${GRAPH_GENERATION} ) +install( + FILES ${cost_hpp_files} + DESTINATION include/${COST_CALCULATION} +) # Install the library install(TARGETS ${SPLINE_GENERATION} @@ -87,5 +103,10 @@ install(TARGETS ${GRAPH_GENERATION} LIBRARY DESTINATION lib/ INCLUDES DESTINATION include/ ) +install(TARGETS ${COST_CALCULATION} + EXPORT ${COST_CALCULATION}Targets + LIBRARY DESTINATION lib/ + INCLUDES DESTINATION include/ +) ament_package() \ No newline at end of file diff --git a/src/modules/trajectory_generation/domain/cost_calculation/i_cost_calculator.hpp b/src/modules/trajectory_generation/domain/cost_calculation/i_cost_calculator.hpp new file mode 100644 index 0000000..0a982e8 --- /dev/null +++ b/src/modules/trajectory_generation/domain/cost_calculation/i_cost_calculator.hpp @@ -0,0 +1,18 @@ +#ifndef TRAJECTORY_GENERATION__COST_CALCULATION__I_COST_CALCULATOR_HPP +#define TRAJECTORY_GENERATION__COST_CALCULATION__I_COST_CALCULATOR_HPP + + +namespace trajectory_generation::cost_calculation { + + class ICostCalculator { + public: + /** + * @brief Get the overall cost for an object + * + * @return double + */ + virtual double get_cost() const = 0; + }; +} + +#endif /*TRAJECTORY_GENERATION__COST_CALCULATION__I_COST_CALCULATOR_HPP*/ \ No newline at end of file