cmake_minimum_required(VERSION 2.8.3) project(mtt) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) ## is used, also find other catkin packages find_package(catkin REQUIRED COMPONENTS roscpp std_msgs sensor_msgs geometry_msgs message_generation pcl_ros atlascar_base kfilter colormap pcl_conversions laser_geometry roslib ) set(CMAKE_CXX_FLAGS "-std=c++0x") find_package(Eigen3 REQUIRED) find_package(GTK2 REQUIRED) find_package(PkgConfig REQUIRED) find_package(OpenCV REQUIRED) pkg_check_modules(GVC libgvc) #sudo apt-get install libgraphviz-dev #V. Santos, 22-Mar-2014 if(GVC_FOUND) else() message(WARNING "libgvc not found. Please do: sudo apt-get install libgraphviz-dev.") endif() add_definitions(-DHAVE_STRING_H) ## System dependencies are found with CMake's conventions # find_package(Boost REQUIRED COMPONENTS system) ## Uncomment this if the package has a setup.py. This macro ensures ## modules and global scripts declared therein get installed ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html # catkin_python_setup() ################################################ ## Declare ROS messages, services and actions ## ################################################ ## To declare and build messages, services or actions from within this ## package, follow these steps: ## * Let MSG_DEP_SET be the set of packages whose message types you use in ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). ## * In the file package.xml: ## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET ## * If MSG_DEP_SET isn't empty the following dependencies might have been ## pulled in transitively but can be declared for certainty nonetheless: ## * add a build_depend tag for "message_generation" ## * add a run_depend tag for "message_runtime" ## * In this file (CMakeLists.txt): ## * add "message_generation" and every package in MSG_DEP_SET to ## find_package(catkin REQUIRED COMPONENTS ...) ## * add "message_runtime" and every package in MSG_DEP_SET to ## catkin_package(CATKIN_DEPENDS ...) ## * uncomment the add_*_files sections below as needed ## and list every .msg/.srv/.action file to be processed ## * uncomment the generate_messages entry below ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) ## Generate messages in the 'msg' folder add_message_files( FILES Target.msg TargetList.msg TargetListPC.msg ) ## Generate services in the 'srv' folder # add_service_files( # FILES # Service1.srv # Service2.srv # ) ## Generate actions in the 'action' folder # add_action_files( # FILES # Action1.action # Action2.action # ) ## Generate added messages and services with any dependencies listed here generate_messages( DEPENDENCIES std_msgs sensor_msgs geometry_msgs ) ################################### ## catkin specific configuration ## ################################### ## The catkin_package macro generates cmake config files for your package ## Declare things to be passed to dependent projects ## INCLUDE_DIRS: uncomment this if you package contains header files ## LIBRARIES: libraries you create in this project that dependent projects also need ## CATKIN_DEPENDS: catkin_packages dependent projects also need ## DEPENDS: system dependencies of this project that dependent projects also need catkin_package( INCLUDE_DIRS include # LIBRARIES mtt # CATKIN_DEPENDS roscpp std_msgs message_runtime sensor_msgs geometry_msgs pcl_ros atlascar_base kfilter colormap pcl_conversions laser_geometry DEPENDS Eigen kfilter colormap pcl_ros ) ########### ## Build ## ########### ## Specify additional locations of header files ## Your package locations should be listed before other locations # include_directories(include) include_directories(${catkin_INCLUDE_DIRS} include) include_directories(${EIGEN3_INCLUDE_DIR}) include_directories(${OpenCV_INCLUDE_DIRS}) add_executable(mtt src/mtt.cpp src/mtt_clustering.cpp src/mtt_auxiliar.cpp src/mtt_association.cpp src/mtt_kalman.cpp) add_executable(mtt_new_msg src/mtt_new_msg.cpp src/mtt_clustering.cpp src/mtt_auxiliar.cpp src/mtt_association.cpp src/mtt_kalman.cpp) add_executable(line_fitting src/line_fitting.cpp) add_executable(log_recorder src/log_recorder.cpp) add_executable(planar_pc_generator src/planar_pc_generator.cpp) add_executable(simple_planar_pc_generator_atlasmv src/simple_planar_pc_generator_atlasmv.cpp) add_executable(simple_planar_pc_generator src/simple_planar_pc_generator.cpp) add_executable(mtt_pedect src/mtt_new_msg.cpp src/mtt_clustering.cpp src/mtt_auxiliar_pedect.cpp src/mtt_association.cpp src/mtt_kalman.cpp) add_executable(gnn src/gnn.cpp src/munkres.cpp src/k_best.cpp) # add_executable(demo src/demo.cpp) add_dependencies(mtt mtt_generate_messages_cpp) add_dependencies(mtt_new_msg mtt_generate_messages_cpp) add_dependencies(line_fitting mtt_generate_messages_cpp) add_dependencies(log_recorder mtt_generate_messages_cpp) add_dependencies(planar_pc_generator mtt_generate_messages_cpp) add_dependencies(simple_planar_pc_generator_atlasmv mtt_generate_messages_cpp) add_dependencies(simple_planar_pc_generator mtt_generate_messages_cpp) add_dependencies(mtt_pedect mtt_generate_messages_cpp) add_dependencies(gnn mtt_generate_messages_cpp) target_link_libraries(mtt ${catkin_LIBRARIES} ${OpenCV_LIBRARIES}) target_link_libraries(mtt_new_msg ${catkin_LIBRARIES} ${OpenCV_LIBRARIES}) target_link_libraries(line_fitting ${catkin_LIBRARIES}) target_link_libraries(log_recorder ${catkin_LIBRARIES}) target_link_libraries(simple_planar_pc_generator_atlasmv ${catkin_LIBRARIES}) target_link_libraries(simple_planar_pc_generator ${catkin_LIBRARIES}) target_link_libraries(planar_pc_generator ${catkin_LIBRARIES} ${Eigen3_LIBRARIES}) target_link_libraries(mtt_pedect ${catkin_LIBRARIES} ${OpenCV_LIBRARIES}) target_link_libraries(gnn ${catkin_LIBRARIES} ${OpenCV_LIBRARIES}) # target_link_libraries(demo ${catkin_LIBRARIES}) set(COMPILE_MHT false) if(COMPILE_MHT) include_directories(${GTK2_INCLUDE_DIRS}) include_directories(${GVC_INCLUDE_DIRS}) include_directories(${catkin_INCLUDE_DIRS} include) add_library(gvplugin_xgtk src/gvplugin_xgtk.cpp src/callbacks_mht.cpp src/graph_wrapper.cpp src/hypothesisTree.cpp) target_link_libraries(gvplugin_xgtk ${GVC_LIBRARIES} ${GTK2_LIBRARIES} ${catkin_LIBRARIES} ${Eigen3_LIBRARIES}) add_library(munkres src/munkres.cpp src/matrix.cpp src/k_best.cpp) add_executable(mht src/mht.cpp src/point.cpp src/measurement.cpp src/target.cpp src/metrics.cpp src/motionModel.cpp src/hypothesis.cpp src/cluster.cpp src/hypothesisTree.cpp src/mht_implementation.cpp) add_dependencies(mht mtt_generate_messages_cpp) target_link_libraries(mht gvplugin_xgtk munkres ${catkin_LIBRARIES} ${Eigen_LIBRARIES} ${GVC_LIBRARIES}) target_link_libraries(gnn munkres ${catkin_LIBRARIES} ${Eigen3_LIBRARIES} ${OpenCV_LIBRARIES}) else() message(WARNING "Will not complile the advanced mht module, there where changes to the graphviz library rendering the graph_wrapper unusable") endif() ############# ## Install ## ############# # all install targets should use catkin DESTINATION variables # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html ## Mark executable scripts (Python etc.) for installation ## in contrast to setup.py, you can choose the destination # install(PROGRAMS # scripts/my_python_script # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} # ) ## Mark executables and/or libraries for installation # install(TARGETS mtt mtt_node # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} # ) ## Mark cpp header files for installation # install(DIRECTORY include/${PROJECT_NAME}/ # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} # FILES_MATCHING PATTERN "*.h" # PATTERN ".svn" EXCLUDE # ) ## Mark other files for installation (e.g. launch and bag files, etc.) # install(FILES # # myfile1 # # myfile2 # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} # ) ############# ## Testing ## ############# ## Add gtest based cpp test target and link libraries # catkin_add_gtest(${PROJECT_NAME}-test test/test_mtt.cpp) # if(TARGET ${PROJECT_NAME}-test) # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) # endif() ## Add folders to be run by python nosetests # catkin_add_nosetests(test)