-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
100 lines (83 loc) · 2.63 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
cmake_minimum_required(VERSION 3.14.1)
project(ros_rknn_yolo)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
sensor_msgs
message_generation
cv_bridge
dynamic_reconfigure
vision_msgs
)
find_package(OpenCV REQUIRED)
generate_dynamic_reconfigure_options(
cfg/RknnYolo.cfg
)
add_service_files(
FILES
DoYolo.srv
)
generate_messages(
DEPENDENCIES
std_msgs
sensor_msgs
vision_msgs
)
catkin_package(
CATKIN_DEPENDS roscpp rospy std_msgs sensor_msgs message_generation cv_bridge message_runtime vision_msgs
)
execute_process(COMMAND "git" "submodule" "update" "--init" "--recursive"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE result
ERROR_VARIABLE error_var
OUTPUT_VARIABLE out_var
)
if("${result}" STREQUAL "0")
message("git clone sahi success")
else()
message(FATAL_ERROR "git clone sahi failed")
endif()
# update python dependencies
execute_process(COMMAND "virtualenv" "--system-site-packages" "-p" "/usr/bin/python" "${PROJECT_SOURCE_DIR}/venv")
message("Installing python dependencies of ${PROJECT_NAME}")
execute_process(
COMMAND "${PROJECT_SOURCE_DIR}/venv/bin/pip" "install" "-i" "https://pypi.mirrors.ustc.edu.cn/simple" "--timeout" "120" "-r" "${PROJECT_SOURCE_DIR}/requirements.txt"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE result
ERROR_VARIABLE error_var
OUTPUT_VARIABLE out_var
)
message("${PROJECT_SOURCE_DIR}/venv/bin/pip ${PROJECT_SOURCE_DIR}/requirements.txt")
if("${result}" STREQUAL "0")
message("Install python dependencies success")
else()
message(FATAL_ERROR "Install python dependencies failed")
endif()
message("Installing sahi dependencies of ${PROJECT_NAME}")
execute_process(
COMMAND "${PROJECT_SOURCE_DIR}/venv/bin/pip" "install" "-i" "https://pypi.mirrors.ustc.edu.cn/simple" "--timeout" "120" "-e" ${PROJECT_SOURCE_DIR}/sahi
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE result
ERROR_VARIABLE error_var
OUTPUT_VARIABLE out_var
)
if("${result}" STREQUAL "0")
message("Install sahi success")
else()
message(FATAL_ERROR "Install sahi failed")
endif()
message("Installing rknn_toolkit_lite2 dependencies of ${PROJECT_NAME}")
execute_process(
COMMAND "${PROJECT_SOURCE_DIR}/venv/bin/pip" "install" ${PROJECT_SOURCE_DIR}/rknn2_runtime/rknn_toolkit_lite2-2.0.0b1-cp310-cp310-linux_aarch64.whl
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
RESULT_VARIABLE result
ERROR_VARIABLE error_var
OUTPUT_VARIABLE out_var
)
if("${result}" STREQUAL "0")
message("Install rknn_toolkit_lite2 success")
else()
message(FATAL_ERROR "Install rknn_toolkit_lite2 failed")
endif()