-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathCMakeLists.txt
103 lines (91 loc) · 4.39 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
cmake_minimum_required(VERSION 2.8.3)
project(steer_drive_controller)
find_package(catkin REQUIRED COMPONENTS
controller_interface
urdf
realtime_tools
tf
nav_msgs
roscpp
angles
control_toolbox
gazebo_ros_control
hardware_interface
joint_limits_interface
)
find_package(gazebo REQUIRED)
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS
roscpp
angles
control_toolbox
gazebo_ros_control
hardware_interface
joint_limits_interface
)
include_directories(
include ${catkin_INCLUDE_DIRS} ${GAZEBO_INCLUDE_DIRS}
)
link_directories(${GAZEBO_LIBRARY_DIRS})
list(APPEND CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")
add_library(${PROJECT_NAME} src/steer_drive_controller.cpp src/odometry.cpp src/speed_limiter.cpp)
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(FILES steer_drive_controller_plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
if (CATKIN_ENABLE_TESTING)
find_package(catkin REQUIRED COMPONENTS
rostest
std_srvs
controller_manager
tf
)
include_directories(include ${catkin_INCLUDE_DIRS})
add_executable(${PROJECT_NAME}_steerbot test/common/src/steerbot.cpp)
target_link_libraries(${PROJECT_NAME}_steerbot ${catkin_LIBRARIES})
add_dependencies(tests ${PROJECT_NAME}_steerbot)
add_rostest_gtest(${PROJECT_NAME}_test
test/steer_drive_controller_test/steer_drive_controller.test
test/steer_drive_controller_test/steer_drive_controller_test.cpp)
target_link_libraries(${PROJECT_NAME}_test ${catkin_LIBRARIES})
add_rostest_gtest(${PROJECT_NAME}_nan_test
test/steer_drive_controller_nan_test/steer_drive_controller_nan.test
test/steer_drive_controller_nan_test/steer_drive_controller_nan_test.cpp)
target_link_libraries(${PROJECT_NAME}_nan_test ${catkin_LIBRARIES})
add_rostest_gtest(${PROJECT_NAME}_limits_test
test/steer_drive_controller_limits_test/steer_drive_controller_limits.test
test/steer_drive_controller_limits_test/steer_drive_controller_limits_test.cpp)
target_link_libraries(${PROJECT_NAME}_limits_test ${catkin_LIBRARIES})
add_rostest_gtest(${PROJECT_NAME}_timeout_test
test/steer_drive_controller_timeout_test/steer_drive_controller_timeout.test
test/steer_drive_controller_timeout_test/steer_drive_controller_timeout_test.cpp)
target_link_libraries(${PROJECT_NAME}_timeout_test ${catkin_LIBRARIES})
add_rostest_gtest(steer_drive_controller_fail_test
test/steer_drive_controller_fail_test/steer_drive_controller_wrong.test
test/steer_drive_controller_fail_test/steer_drive_controller_fail_test.cpp)
target_link_libraries(steer_drive_controller_fail_test ${catkin_LIBRARIES})
add_rostest_gtest(${PROJECT_NAME}_odom_tf_test
test/steer_drive_controller_odom_tf_test/steer_drive_controller_odom_tf.test
test/steer_drive_controller_odom_tf_test/steer_drive_controller_odom_tf_test.cpp)
target_link_libraries(${PROJECT_NAME}_odom_tf_test ${catkin_LIBRARIES})
add_rostest_gtest(${PROJECT_NAME}_default_odom_frame_test
test/steer_drive_controller_default_odom_frame_test/steer_drive_controller_default_odom_frame.test
test/steer_drive_controller_default_odom_frame_test/steer_drive_controller_default_odom_frame_test.cpp)
target_link_libraries(${PROJECT_NAME}_default_odom_frame_test ${catkin_LIBRARIES})
add_rostest_gtest(steer_drive_controller_odom_frame_test
test/steer_drive_controller_odom_frame_test/steer_drive_controller_odom_frame.test
test/steer_drive_controller_odom_frame_test/steer_drive_controller_odom_frame_test.cpp)
target_link_libraries(${PROJECT_NAME}_odom_frame_test ${catkin_LIBRARIES})
add_rostest(test/steer_drive_controller_open_loop_test/steer_drive_controller_open_loop.test)
add_rostest(test/steer_drive_controller_no_wheel_test/steer_drive_controller_no_wheel.test)
add_rostest(test/steer_drive_controller_no_steer_test/steer_drive_controller_no_steer.test)
add_rostest(test/steer_drive_controller_radius_param_test/steer_drive_controller_radius_param.test)
add_rostest(test/steer_drive_controller_radius_param_fail_test/steer_drive_controller_radius_param_fail.test)
add_rostest(test/steer_drive_controller_separation_param_test/steer_drive_controller_separation_param.test)
endif()