-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
266 lines (205 loc) · 8.72 KB
/
Copy pathMakefile
File metadata and controls
266 lines (205 loc) · 8.72 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# ============================================================================ #
# _____________________________ Strategy settings ____________________________ #
# ============================================================================ #
TEAM_COLOR = blue
STRATEGY_PREFIX =
# STRATEGY_PREFIX = SemiAggressive
# STRATEGY_PREFIX = Aggressive
# STRATEGY_PREFIX = Aggressive2
# STRATEGY_PREFIX = Greedy
# STRATEGY_PREFIX = Ultra (only blue)
# STRATEGY_PREFIX = Aggressive2SemiGreedy
ARUCO_CUBE = False
# ============================================================================ #
# _____________________________ COMMON VARIABLES _____________________________ #
# ============================================================================ #
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MKFILE_DIR := $(dir $(MKFILE_PATH))
ROOT_DIR := $(MKFILE_DIR)
DISPLAY ?= 0
ROS_DOMAIN_ID := 0
BASE_ARCHIVE ?= $(MKFILE_DIR)/data/docker_images/base_offline_image
CAMERA_ARCHIVE ?= $(MKFILE_DIR)/data/docker_images/offline_camera_image
RMW_IMPLEMENTATION := rmw_cyclonedds_cpp
CYCLONEDDS_URI := /dds/cyclonedds.xml
BASE_PARAMETERS := \
ROOT_DIR=$(ROOT_DIR) \
RMW_IMPLEMENTATION=$(RMW_IMPLEMENTATION) \
CYCLONEDDS_URI=$(CYCLONEDDS_URI) \
ROS_DOMAIN_ID=$(ROS_DOMAIN_ID) \
TEAM_COLOR=$(TEAM_COLOR) \
ARUCO_CUBE=$(ARUCO_CUBE) \
STRATEGY_PREFIX=$(STRATEGY_PREFIX)
# ============================================================================ #
# ______________________________ ONLINE SERVICES _____________________________ #
# ============================================================================ #
# ---------------------------------------------------------------------------- #
# Services groups
# ---------------------------------------------------------------------------- #
description_services := \
model \
map_publisher
perception_services := \
opponent_tracker \
ekf_node \
lidar_localization
logic_services := \
behavior_tree \
navigation_monitor \
nut_poses_publisher
camera_services := \
camera_stream \
our_camera_tracking \
enemy_camera_tracking
navigation_services := \
controller \
planner \
aruco_center \
command_safety
test_services := \
controller \
planner
visualization_services := \
rviz2
monitoring_services := \
foxglove-bridge \
foxglove
# ---------------------------------------------------------------------------- #
body_services := $(description_services) $(camera_services) $(perception_services)
brain_services := $(logic_services) $(navigation_services)
all_services := $(body_services) $(brain_services)
# ============================================================================ #
# _____________________________ OFFLINE SERVICES _____________________________ #
# ============================================================================ #
# ---------------------------------------------------------------------------- #
# Services groups
# ---------------------------------------------------------------------------- #
description_offline_services := \
model_offline \
map_publisher_offline
perception_offline_services := \
ekf_node_offline \
lidar_localization_offline \
opponent_tracker_offline
logic_offline_services := \
behavior_tree_offline \
navigation_monitor_offline \
nut_poses_publisher_offline
camera_offline_services := \
camera_stream_offline \
our_camera_tracking_offline \
enemy_camera_tracking_offline
navigation_offline_services := \
controller_offline \
planner_offline \
aruco_center_offline \
command_safety_offline
test_offline_services := \
controller_offline \
planner_offline
visualization_offline_services := \
rviz2_offline
# ---------------------------------------------------------------------------- #
body_offline_services := $(description_offline_services) $(camera_offline_services) $(perception_offline_services)
brain_offline_services := $(logic_offline_services) $(navigation_offline_services)
all_offline_services := $(brain_offline_services) $(body_offline_services)
# ============================================================================ #
# _________________________________ COMMANDS _________________________________ #
# ============================================================================ #
docker_build := $(BASE_PARAMETERS) docker compose build
docker_down := docker compose down
docker_up := $(BASE_PARAMETERS) docker compose up
# ============================================================================ #
# _______________________________ BASIC RECIPES ______________________________ #
# ============================================================================ #
prepare-terminal-for-visualization:
DISPLAY=$(DISPLAY) xhost +local:
DISPLAY=$(DISPLAY) xhost +
RCUTILS_COLORIZED_OUTPUT=1
# ============================================================================ #
# ______________________________ PARTS OF STACK ______________________________ #
# ============================================================================ #
build-body: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_build) $(body_services)
build-brain: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_build) $(brain_services)
build-camera: prepare-terminal-for-visualization
@echo "Running camera"
@cd $(ROOT_DIR) && $(docker_build) $(camera_services)
build-rviz: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_build) $(visualization_services)
build-test: prepare-terminal-for-visualization
@echo "Running camera"
@cd $(ROOT_DIR) && $(docker_build) $(test_services)
run-body: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_up) $(body_services)
run-brain: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_up) $(brain_services)
run-camera: prepare-terminal-for-visualization
@echo "Running camera"
@cd $(ROOT_DIR) && $(docker_up) $(camera_services)
run-test: prepare-terminal-for-visualization
@echo "Running test"
@cd $(ROOT_DIR) && $(docker_up) $(test_services)
run-foxglove: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_up) $(monitoring_services)
run-rviz: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_up) $(visualization_services)
# ============================================================================ #
# __________________________ PARTS OF OFFLINE STACK __________________________ #
# ============================================================================ #
load-images:
@echo "Loading offline Docker images..."
@bash $(ROOT_DIR)/scripts/bash/load_and_build_offline.sh $(BASE_ARCHIVE) $(CAMERA_ARCHIVE)
build-body-offline: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_build) $(body_offline_services)
build-brain-offline: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_build) $(brain_offline_services)
build-camera-offline: prepare-terminal-for-visualization
@echo "Running camera"
@cd $(ROOT_DIR) && $(docker_build) $(camera_offline_services)
build-rviz-offline: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_build) $(visualization_offline_services)
build-test-offline: prepare-terminal-for-visualization
@echo "Running camera"
@cd $(ROOT_DIR) && $(docker_build) $(test_offline_services)
run-body-offline: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_up) $(body_offline_services)
run-brain-offline: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_up) $(brain_offline_services)
run-camera-offline: prepare-terminal-for-visualization
@echo "Running camera"
@cd $(ROOT_DIR) && $(docker_up) $(camera_offline_services)
run-test-offline: prepare-terminal-for-visualization
@echo "Running test"
@cd $(ROOT_DIR) && $(docker_up) $(test_offline_services)
run-rviz-offline: prepare-terminal-for-visualization
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_up) $(visualization_offline_services)
# ============================================================================ #
# ______________________________ MAIN PIPELINE ______________________________ #
# ============================================================================ #
run:
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_up) $(all_services)
build:
@echo "Building services"
@cd $(ROOT_DIR) && $(docker_build) $(all_services)
run-offline:
@echo "Running body services"
@cd $(ROOT_DIR) && $(docker_up) $(all_offline_services)
build-offline:
@echo "Building services"
@cd $(ROOT_DIR) && $(docker_build) $(all_offline_services)