SHARE
TWEET

Untitled

a guest Jun 17th, 2015 419 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. cmake_minimum_required(VERSION 2.8.3)
  2. project(robot_localization)
  3.  
  4. find_package(catkin REQUIRED COMPONENTS
  5.   roscpp
  6.   tf2
  7.   tf2_ros
  8.   tf2_geometry_msgs
  9.   message_filters
  10.   std_msgs
  11.   geographic_msgs
  12.   geometry_msgs
  13.   nav_msgs
  14.   sensor_msgs
  15.   diagnostic_msgs
  16.   diagnostic_updater
  17.   cmake_modules
  18.   message_generation)
  19. find_package(Eigen REQUIRED)
  20.  
  21. add_definitions(-DEIGEN_NO_DEBUG)
  22.  
  23. ###################################
  24. ## catkin specific configuration ##
  25. ###################################
  26. add_service_files(
  27.   FILES
  28.   SetPose.srv
  29.   SetDatum.srv
  30. )
  31.  
  32. generate_messages(
  33.   DEPENDENCIES
  34.   geographic_msgs
  35.   geometry_msgs
  36.   std_msgs
  37. )
  38.  
  39. catkin_package(
  40.   INCLUDE_DIRS include
  41.   LIBRARIES filter_base ekf
  42.   CATKIN_DEPENDS
  43.     roscpp
  44.     tf2
  45.     tf2_ros
  46.     message_filters
  47.     std_msgs
  48.     geometry_msgs
  49.     nav_msgs
  50.     sensor_msgs
  51.     diagnostic_msgs
  52.     diagnostic_updater
  53.     cmake_modules
  54.     message_runtime
  55.   DEPENDS Eigen
  56. )
  57.  
  58. ###########
  59. ## Build ##
  60. ###########
  61.  
  62. include_directories(include ${catkin_INCLUDE_DIRS} ${Eigen_INCLUDE_DIRS})
  63.  
  64. # Library definition
  65. add_library(filter_utilities src/filter_utilities.cpp)
  66. add_library(filter_base src/filter_base.cpp)
  67. add_library(ekf src/ekf.cpp)
  68. add_library(ukf src/ukf.cpp)
  69. add_library(ros_filter_utilities src/ros_filter_utilities.cpp)
  70. add_library(ros_filter src/ros_filter.cpp)
  71. add_library(navsat_transform src/navsat_transform.cpp)
  72.  
  73. # Dependencies
  74. add_dependencies(filter_base robot_localization_gencpp)
  75. add_dependencies(navsat_transform robot_localization_gencpp)
  76.  
  77. # Executables
  78. add_executable(ekf_localization_node src/ekf_localization_node.cpp)
  79. add_executable(ukf_localization_node src/ukf_localization_node.cpp)
  80. add_executable(navsat_transform_node src/navsat_transform_node.cpp)
  81.  
  82. # Linking
  83. target_link_libraries(ros_filter_utilities ${catkin_INCLUDE_DIRS} ${catkin_LIBRARIES})
  84. target_link_libraries(filter_utilities ${catkin_LIBRARIES})
  85. target_link_libraries(filter_base filter_utilities ${catkin_LIBRARIES})
  86. target_link_libraries(ekf filter_base ${catkin_LIBRARIES})
  87. target_link_libraries(ukf filter_base ${catkin_LIBRARIES})
  88. target_link_libraries(ros_filter ekf ukf ros_filter_utilities ${catkin_LIBRARIES})
  89. target_link_libraries(ekf_localization_node ros_filter ${catkin_LIBRARIES})
  90. target_link_libraries(ukf_localization_node ros_filter ${catkin_LIBRARIES})
  91. target_link_libraries(navsat_transform filter_utilities ros_filter_utilities ${catkin_LIBRARIES})
  92. target_link_libraries(navsat_transform_node navsat_transform ${catkin_LIBRARIES})
  93.  
  94. #############
  95. ## Install ##
  96. #############
  97.  
  98. ## Mark executables and/or libraries for installation
  99. install(TARGETS
  100.   filter_utilities
  101.   filter_base
  102.   ekf
  103.   ukf
  104.   ros_filter_utilities
  105.   ros_filter
  106.   ekf_localization_node
  107.   ukf_localization_node
  108.   navsat_transform
  109.   navsat_transform_node
  110.   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  111.   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  112.   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
  113.  
  114. ## Mark cpp header files for installation
  115. install(DIRECTORY include/${PROJECT_NAME}/
  116.   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  117.   FILES_MATCHING PATTERN "*.h"
  118.   PATTERN ".svn" EXCLUDE)
  119.  
  120. install(DIRECTORY launch/
  121.   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
  122.   FILES_MATCHING PATTERN "*.launch"
  123.   PATTERN ".svn" EXCLUDE)
  124.  
  125. install(FILES
  126.   LICENSE
  127.   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
  128. )
  129.  
  130. #############
  131. ## Testing ##
  132. #############
  133.  
  134. target_link_libraries(filter_base ${catkin_LIBRARIES})
  135.  
  136. if (CATKIN_ENABLE_TESTING)
  137.  
  138. # Filter base unit tests
  139. catkin_add_gtest(filter_base-test test/test_filter_base.cpp)
  140. target_link_libraries(filter_base-test filter_base ${catkin_LIBRARIES})
  141.   # Not really necessary, but it will cause the build to fail if it's
  142.   # missing, rather than failing once the tests are being executed
  143.   find_package(rosbag REQUIRED)
  144.   find_package(rostest REQUIRED)
  145.  
  146.   #### EKF TESTS #####
  147.   add_rostest_gtest(test_ekf
  148.                     test/test_ekf.test
  149.                     test/test_ekf.cpp)
  150.   target_link_libraries(test_ekf ros_filter ekf ${catkin_LIBRARIES} ${rostest_LIBRARIES})
  151.  
  152.   add_rostest_gtest(test_ekf_localization_node_interfaces
  153.                     test/test_ekf_localization_node_interfaces.test
  154.                     test/test_ekf_localization_node_interfaces.cpp)
  155.   target_link_libraries(test_ekf_localization_node_interfaces ${catkin_LIBRARIES} ${rostest_LIBRARIES})
  156.  
  157.   add_rostest_gtest(test_ekf_localization_node_bag1
  158.                     test/test_ekf_localization_node_bag1.test
  159.                     test/test_localization_node_bag_pose_tester.cpp)
  160.   target_link_libraries(test_ekf_localization_node_bag1 ${catkin_LIBRARIES} ${rostest_LIBRARIES})
  161.  
  162.   add_rostest_gtest(test_ekf_localization_node_bag2
  163.                     test/test_ekf_localization_node_bag2.test
  164.                     test/test_localization_node_bag_pose_tester.cpp)
  165.   target_link_libraries(test_ekf_localization_node_bag2 ${catkin_LIBRARIES} ${rostest_LIBRARIES})
  166.  
  167.   add_rostest_gtest(test_ekf_localization_node_bag3
  168.                     test/test_ekf_localization_node_bag3.test
  169.                     test/test_localization_node_bag_pose_tester.cpp)
  170.   target_link_libraries(test_ekf_localization_node_bag3 ${catkin_LIBRARIES} ${rostest_LIBRARIES})
  171.  
  172.   #### UKF TESTS #####
  173.   add_rostest_gtest(test_ukf
  174.                     test/test_ukf.test
  175.                     test/test_ukf.cpp)
  176.   target_link_libraries(test_ukf ros_filter ukf ${catkin_LIBRARIES} ${rostest_LIBRARIES})
  177.  
  178.   add_rostest_gtest(test_ukf_localization_node_interfaces
  179.                     test/test_ukf_localization_node_interfaces.test
  180.                     test/test_ukf_localization_node_interfaces.cpp)
  181.   target_link_libraries(test_ukf_localization_node_interfaces ${catkin_LIBRARIES} ${rostest_LIBRARIES})
  182.  
  183.   add_rostest_gtest(test_ukf_localization_node_bag1
  184.                     test/test_ukf_localization_node_bag1.test
  185.                     test/test_localization_node_bag_pose_tester.cpp)
  186.   target_link_libraries(test_ukf_localization_node_bag1 ${catkin_LIBRARIES} ${rostest_LIBRARIES})
  187.  
  188.   add_rostest_gtest(test_ukf_localization_node_bag2
  189.                     test/test_ukf_localization_node_bag2.test
  190.                     test/test_localization_node_bag_pose_tester.cpp)
  191.   target_link_libraries(test_ukf_localization_node_bag2 ${catkin_LIBRARIES} ${rostest_LIBRARIES})
  192.  
  193.   add_rostest_gtest(test_ukf_localization_node_bag3
  194.                     test/test_ukf_localization_node_bag3.test
  195.                     test/test_localization_node_bag_pose_tester.cpp)
  196.   target_link_libraries(test_ukf_localization_node_bag3 ${catkin_LIBRARIES} ${rostest_LIBRARIES})
  197.  
  198. endif()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top