-
Johannes Mey authoredJohannes Mey authored
CMakeLists.txt 3.27 KiB
cmake_minimum_required(VERSION 3.0.2)
project(panda_grasping)
add_compile_options(-std=c++14)
set(GCC_COVERAGE_COMPILE_FLAGS "-fpermissive")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} ${GAZEBO_CXX_FLAGS}")
# 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
tf2
moveit_core
moveit_ros_planning_interface
franka_gripper
message_generation
)
## Generate services in the 'srv' folder
add_service_files(
FILES
PickObject.srv
PlaceObject.srv
)
## Generate added messages and services with any dependencies listed here
generate_messages(
DEPENDENCIES
std_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
catkin_package(CATKIN_DEPENDS
moveit_core
moveit_visual_tools
moveit_ros_planning_interface
pluginlib
INCLUDE_DIRS include
LIBRARIES EnvironmentUtil GraspUtil FrankaGripperUtil
)
# ################################################################################################################################
# Build ##
# ################################################################################################################################
# Specify additional locations of header files Your package locations should be listed before other locations
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
${catkin_INCLUDE_DIRS}
)
add_library(EnvironmentUtil src/grasping/environment_util.cpp)
add_library(GraspUtil src/grasping/grasp_util.cpp)
add_library(FrankaGripperUtil src/grasping/franka_gripper_util.cpp)
add_executable(grasp_service src/grasping/grasp_service.cpp)
target_link_libraries(EnvironmentUtil ${catkin_LIBRARIES})
target_link_libraries(GraspUtil ${catkin_LIBRARIES})
target_link_libraries(FrankaGripperUtil ${catkin_LIBRARIES})
target_link_libraries(grasp_service ${catkin_LIBRARIES} EnvironmentUtil GraspUtil)
add_dependencies(grasp_service panda_grasping_generate_messages_cpp)
#############
## Testing ##
#############
## Add gtest based cpp test target and link libraries
if(CATKIN_ENABLE_TESTING)
find_package(rostest REQUIRED)
add_rostest_gtest(tests_grasping test/grasping.test test/test.cpp)
# add_executable(tests_grasping test/test.cpp)
target_link_libraries(tests_grasping ${catkin_LIBRARIES})
add_dependencies(tests_grasping panda_grasping_generate_messages_cpp)
add_rostest_gtest(tests_side_grasping test/side_grasping.test test/grasp_from_side_test.cpp)
target_link_libraries(tests_side_grasping ${catkin_LIBRARIES} GraspUtil)
add_dependencies(tests_side_grasping panda_grasping_generate_messages_cpp)
endif()