diff --git a/CMakeLists.txt b/CMakeLists.txt index b42af969..0da52adc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,22 +16,24 @@ endif() find_package(ament_cmake REQUIRED) find_package(angles REQUIRED) -find_package(rclcpp REQUIRED) +find_package(Boost REQUIRED) +find_package(builtin_interfaces REQUIRED) find_package(diagnostic_msgs REQUIRED) find_package(diagnostic_updater REQUIRED) +find_package(Eigen3 REQUIRED) find_package(geographic_msgs REQUIRED) find_package(geometry_msgs REQUIRED) find_package(message_filters REQUIRED) find_package(nav_msgs REQUIRED) +find_package(rclcpp REQUIRED) find_package(rosidl_default_generators REQUIRED) find_package(sensor_msgs REQUIRED) +find_package(std_msgs REQUIRED) find_package(std_srvs REQUIRED) find_package(tf2 REQUIRED) find_package(tf2_eigen REQUIRED) find_package(tf2_geometry_msgs REQUIRED) find_package(tf2_ros REQUIRED) -find_package(Eigen3 REQUIRED) -find_package(Boost REQUIRED) find_package(yaml_cpp_vendor REQUIRED) find_package(yaml-cpp REQUIRED) @@ -57,12 +59,7 @@ rosidl_generate_interfaces(${PROJECT_NAME} ADD_LINTER_TESTS ) -include_directories(SYSTEM ${Eigen_INCLUDE_DIRS}) -include_directories( - include - ${EIGEN3_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} -) +rosidl_get_typesupport_target(cpp_typesupport_target "${PROJECT_NAME}" "rosidl_typesupport_cpp") add_library( ${library_name} @@ -75,95 +72,69 @@ add_library( src/ros_filter.cpp src/ros_filter_utilities.cpp src/ros_robot_localization_listener.cpp) - -rosidl_get_typesupport_target(cpp_typesupport_target "${PROJECT_NAME}" "rosidl_typesupport_cpp") -target_link_libraries(${library_name} "${cpp_typesupport_target}") - -add_executable( - ekf_node - src/ekf_node.cpp +target_include_directories(${library_name} PUBLIC + "$" + "$" ) - -add_executable( - ukf_node - src/ukf_node.cpp -) - -add_executable( - navsat_transform_node - src/navsat_transform_node.cpp +target_link_libraries(${library_name} PUBLIC + Boost::boost + "${cpp_typesupport_target}" + Eigen3::Eigen + angles::angles + ${diagnostic_msgs_TARGETS} + diagnostic_updater::diagnostic_updater + ${geographic_msgs_TARGETS} + ${geometry_msgs_TARGETS} + message_filters::message_filters + ${nav_msgs_TARGETS} + rclcpp::rclcpp + ${sensor_msgs_TARGETS} + ${std_msgs_TARGETS} + ${std_srvs_TARGETS} + tf2::tf2 + tf2_eigen::tf2_eigen + tf2_geometry_msgs::tf2_geometry_msgs + tf2_ros::tf2_ros ) - -add_executable( - robot_localization_listener_node - src/robot_localization_listener_node.cpp -) - -target_link_libraries( - ${library_name} +target_link_libraries(${library_name} PRIVATE ${GeographicLib_LIBRARIES} - ${EIGEN3_LIBRARIES} yaml-cpp::yaml-cpp ) -ament_target_dependencies( - ${library_name} - angles - diagnostic_msgs - diagnostic_updater - geographic_msgs - geometry_msgs - message_filters - nav_msgs - rclcpp - sensor_msgs - std_msgs - std_srvs - tf2 - tf2_eigen - tf2_geometry_msgs - tf2_ros - yaml_cpp_vendor -) - -target_link_libraries( - ekf_node - ${library_name} -) - -ament_target_dependencies( +add_executable( ekf_node - rclcpp + src/ekf_node.cpp ) - -target_link_libraries( - ukf_node +target_link_libraries(ekf_node PRIVATE ${library_name} + rclcpp::rclcpp ) -ament_target_dependencies( +add_executable( ukf_node - rclcpp + src/ukf_node.cpp ) - -target_link_libraries( - navsat_transform_node +target_link_libraries(ukf_node PRIVATE ${library_name} + rclcpp::rclcpp ) -ament_target_dependencies( +add_executable( navsat_transform_node - rclcpp + src/navsat_transform_node.cpp ) - -target_link_libraries( - robot_localization_listener_node +target_link_libraries(navsat_transform_node PRIVATE ${library_name} + rclcpp::rclcpp ) -ament_target_dependencies( +add_executable( robot_localization_listener_node - rclcpp + src/robot_localization_listener_node.cpp +) +target_link_libraries(robot_localization_listener_node PRIVATE + ${library_name} + rclcpp::rclcpp ) if(BUILD_TESTING) @@ -174,6 +145,8 @@ if(BUILD_TESTING) find_package(ament_cmake_uncrustify REQUIRED) find_package(launch_testing_ament_cmake REQUIRED) + ament_find_gtest() + #### FILTER BASE TESTS #### ament_add_gtest(filter_base-test test/test_filter_base.cpp) target_link_libraries(filter_base-test ${library_name}) @@ -183,7 +156,6 @@ if(BUILD_TESTING) test/test_filter_base_diagnostics_timestamps.cpp) target_link_libraries(test_filter_base_diagnostics_timestamps ${library_name}) - rosidl_get_typesupport_target(cpp_typesupport_target "${PROJECT_NAME}" "rosidl_typesupport_cpp") target_link_libraries(test_filter_base_diagnostics_timestamps "${cpp_typesupport_target}") add_dependencies(test_filter_base_diagnostics_timestamps ekf_node) @@ -292,7 +264,8 @@ if(BUILD_TESTING) #### NAVSAT CONVERSION TESTS #### ament_add_gtest(test_navsat_conversions test/test_navsat_conversions.cpp) - target_link_libraries(test_navsat_conversions ${library_name}) + target_include_directories(test_navsat_conversions PUBLIC "$") + target_link_libraries(test_navsat_conversions ${library_name} ${GeographicLib_LIBRARIES}) ament_add_gtest_executable(test_ros_robot_localization_listener test/test_ros_robot_localization_listener.cpp) @@ -355,6 +328,7 @@ install( ) install(TARGETS ${library_name} + EXPORT ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin @@ -373,7 +347,27 @@ install(DIRECTORY USE_SOURCE_PERMISSIONS ) -ament_export_include_directories(include) +ament_export_include_directories(include/${PROJECT_NAME}) ament_export_libraries(${library_name}) -ament_export_dependencies(rosidl_default_runtime) +ament_export_dependencies( + angles + Boost + diagnostic_msgs + diagnostic_updater + Eigen3 + geographic_msgs + geometry_msgs + message_filters + nav_msgs + rclcpp + rosidl_default_runtime + sensor_msgs + std_msgs + std_srvs + tf2 + tf2_eigen + tf2_geometry_msgs + tf2_ros +) +ament_export_targets(${PROJECT_NAME}) ament_package() diff --git a/package.xml b/package.xml index 2a21be7c..7a95045f 100644 --- a/package.xml +++ b/package.xml @@ -5,7 +5,7 @@ 3.9.0 Provides nonlinear state estimation through sensor fusion of an abritrary number of sensors. - Tom Moore + Tom Moore Tom Moore Steve Macenski @@ -20,17 +20,17 @@ libboost-dev libboost-dev + angles + builtin_interfaces + diagnostic_msgs + diagnostic_updater eigen geographic_msgs geometry_msgs - diagnostic_msgs - diagnostic_updater geographiclib message_filters nav_msgs - angles - rclcpp - rmw_implementation + rclcpp sensor_msgs std_msgs std_srvs @@ -40,18 +40,14 @@ tf2_ros yaml_cpp_vendor - ament_cmake_gtest - builtin_interfaces rosidl_default_runtime - - rclcpp - rmw_implementation + ament_cmake_gtest ament_lint_auto ament_lint_common launch_ros launch_testing_ament_cmake - + rosidl_interface_packages diff --git a/include/robot_localization/navsat_conversions.hpp b/src/navsat_conversions.hpp similarity index 97% rename from include/robot_localization/navsat_conversions.hpp rename to src/navsat_conversions.hpp index 5253af59..4ede4ca9 100644 --- a/include/robot_localization/navsat_conversions.hpp +++ b/src/navsat_conversions.hpp @@ -36,8 +36,8 @@ * https://github.com/austin-robot/utexas-art-ros-pkg/blob/afd147a1eb944fc3dbd138574c39699813f797bf/stacks/art_vehicle/art_common/include/art/UTM.h * https://github.com/austin-robot/utexas-art-ros-pkg/blob/afd147a1eb944fc3dbd138574c39699813f797bf/stacks/art_vehicle/art_common/include/art/conversions.h */ -#ifndef ROBOT_LOCALIZATION__NAVSAT_CONVERSIONS_HPP_ -#define ROBOT_LOCALIZATION__NAVSAT_CONVERSIONS_HPP_ +#ifndef NAVSAT_CONVERSIONS_HPP_ +#define NAVSAT_CONVERSIONS_HPP_ /** @file @@ -222,4 +222,4 @@ static inline void UTMtoLL( } // namespace navsat_conversions } // namespace robot_localization -#endif // ROBOT_LOCALIZATION__NAVSAT_CONVERSIONS_HPP_ +#endif // NAVSAT_CONVERSIONS_HPP_ diff --git a/src/navsat_transform.cpp b/src/navsat_transform.cpp index c8799266..4272c43b 100644 --- a/src/navsat_transform.cpp +++ b/src/navsat_transform.cpp @@ -43,7 +43,7 @@ #include "rclcpp/qos.hpp" #include "rclcpp/rclcpp.hpp" #include "robot_localization/filter_common.hpp" -#include "robot_localization/navsat_conversions.hpp" +#include "navsat_conversions.hpp" #include "robot_localization/ros_filter_utilities.hpp" #include "robot_localization/srv/from_ll.hpp" #include "robot_localization/srv/set_datum.hpp" diff --git a/test/test_navsat_conversions.cpp b/test/test_navsat_conversions.cpp index 4b386bfe..f1e4123e 100644 --- a/test/test_navsat_conversions.cpp +++ b/test/test_navsat_conversions.cpp @@ -34,7 +34,7 @@ #include -#include "robot_localization/navsat_conversions.hpp" +#include "navsat_conversions.hpp" void NavsatConversionsTest( const double lat, const double lon,