-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment.yaml
More file actions
329 lines (323 loc) · 10.6 KB
/
deployment.yaml
File metadata and controls
329 lines (323 loc) · 10.6 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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
apiVersion: v1
kind: ServiceAccount
metadata:
name: spot-node-label-reader
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: spot-node-label-reader
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: spot-node-label-reader
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: spot-node-label-reader
subjects:
- kind: ServiceAccount
name: spot-node-label-reader
namespace: spot-system
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: ros2-smoke
labels:
app.kubernetes.io/name: ros2-smoke
app.kubernetes.io/part-of: spot
spec:
selector:
matchLabels:
app.kubernetes.io/name: ros2-smoke
template:
metadata:
labels:
app.kubernetes.io/name: ros2-smoke
app.kubernetes.io/part-of: spot
spec:
serviceAccountName: spot-node-label-reader
nodeSelector:
kubernetes.io/arch: arm64
gorizond.io/robot: "true"
containers:
- name: node-label-config
image: ghcr.io/gorizond/spot-node-label-config-cpp:latest
imagePullPolicy: Always
env:
- name: RMW_IMPLEMENTATION
value: "rmw_fastrtps_cpp"
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: LABEL_PREFIX
value: "gorizond.io/spot-pca9685-"
- name: TOPIC
value: "/spot/config/servo_map"
- name: K8S_BASE
value: "https://kubernetes.default.svc"
- name: WATCH_TIMEOUT_SECONDS
value: "30"
- name: REQUEST_TIMEOUT_SECONDS
value: "35"
- name: BACKOFF_MAX_SECONDS
value: "30"
command: ["bash", "-lc"]
args:
- |
set -eo pipefail
source /opt/ros/kilted/setup.bash
source /opt/spot_node_label_config_cpp/share/spot_node_label_config_cpp/local_setup.bash
exec ros2 run spot_node_label_config_cpp spot_node_label_config_cpp_node
resources:
requests:
cpu: "50m"
memory: "96Mi"
limits:
cpu: "200m"
memory: "192Mi"
volumeMounts: []
- name: servo-driver
image: ghcr.io/gorizond/spot-servo-driver-cpp:latest
imagePullPolicy: Always
securityContext:
privileged: true
runAsUser: 0
runAsGroup: 0
allowPrivilegeEscalation: true
env:
- name: SERVO_MAP_TOPIC
value: "/spot/config/servo_map"
- name: CMD_TOPIC
value: "/spot/cmd/servo"
- name: STATUS_TOPIC
value: "/spot/state/servo"
- name: PWM_HZ
value: "50"
- name: UPDATE_HZ
value: "20"
- name: MAX_SLEW_US_PER_S
value: "1200"
- name: SAFE_MIN_US
value: "100"
- name: SAFE_MAX_US
value: "3000"
- name: START_ARMED
value: "0"
- name: DISARM_FULL_OFF
value: "1"
- name: SERVO_DRIVER_REV
value: "b3a5e70-r2"
command: ["bash", "-lc"]
args:
- |
set -eo pipefail
source /opt/ros/kilted/setup.bash
source /opt/spot_servo_driver_cpp/share/spot_servo_driver_cpp/local_setup.bash
exec ros2 run spot_servo_driver_cpp spot_servo_driver_cpp_node
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "400m"
memory: "256Mi"
volumeMounts:
- name: i2c-1
mountPath: /dev/i2c-1
- name: cmd-mux
image: ghcr.io/gorizond/spot-cmd-mux-cpp:latest
imagePullPolicy: Always
env:
- name: AUTO_TOPIC
value: "/spot/cmd/servo_auto"
- name: MANUAL_TOPIC
value: "/spot/cmd/servo_manual"
- name: OUT_TOPIC
value: "/spot/cmd/servo"
- name: MODE_TOPIC
value: "/spot/ctrl/mode"
- name: STATUS_TOPIC
value: "/spot/state/mux"
- name: DEFAULT_MODE
value: "auto"
- name: MANUAL_TIMEOUT_S
value: "0"
- name: STATUS_PUBLISH_S
value: "1.0"
command: ["bash", "-lc"]
args:
- |
set -eo pipefail
source /opt/ros/kilted/setup.bash
source /opt/spot_cmd_mux_cpp/share/spot_cmd_mux_cpp/local_setup.bash
exec ros2 run spot_cmd_mux_cpp spot_cmd_mux_cpp_node
resources:
requests:
cpu: "50m"
memory: "96Mi"
limits:
cpu: "200m"
memory: "192Mi"
volumeMounts: []
volumes:
- name: spot-node-label-config
configMap:
name: spot-node-label-config
defaultMode: 0555
items:
- key: spot_cli.py
path: spot_cli.py
- name: i2c-1
hostPath:
path: /dev/i2c-1
type: CharDevice
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: spot-champ
labels:
app.kubernetes.io/name: spot-champ
app.kubernetes.io/part-of: spot
spec:
selector:
matchLabels:
app.kubernetes.io/name: spot-champ
template:
metadata:
labels:
app.kubernetes.io/name: spot-champ
app.kubernetes.io/part-of: spot
spec:
nodeSelector:
kubernetes.io/arch: arm64
gorizond.io/robot: "true"
gorizond.io/spot-champ: "true"
containers:
- name: champ-controller
image: ghcr.io/gorizond/spot-champ:main
imagePullPolicy: IfNotPresent
env:
- name: PYTHONUNBUFFERED
value: "1"
- name: RSP_PUBLISH_FREQUENCY
value: "20.0"
command: ["bash", "-lc"]
args:
- |
set -eo pipefail
source /opt/ros/kilted/setup.bash
if [ -f /ws/install/setup.bash ]; then
source /ws/install/setup.bash
fi
CHAMP_BASE_PREFIX="$(ros2 pkg prefix champ_base 2>/dev/null || true)"
EKF_DIR="${CHAMP_BASE_PREFIX}/share/champ_base/config/ekf"
if [ -d "${EKF_DIR}" ]; then
if [ -f /opt/spot/champ/ekf/base_to_footprint.yaml ]; then
cp /opt/spot/champ/ekf/base_to_footprint.yaml "${EKF_DIR}/base_to_footprint.yaml" || true
fi
if [ -f /opt/spot/champ/ekf/footprint_to_odom.yaml ]; then
cp /opt/spot/champ/ekf/footprint_to_odom.yaml "${EKF_DIR}/footprint_to_odom.yaml" || true
fi
fi
RSP_PUBLISH_FREQUENCY="${RSP_PUBLISH_FREQUENCY:-40.0}"
echo "[spot-champ] target /robot_state_publisher publish_frequency=${RSP_PUBLISH_FREQUENCY}"
ros2 launch champ_bringup bringup.launch.py \
rviz:=false use_sim_time:=false gazebo:=false \
description_path:=/opt/spot/champ/spotmicroai.urdf.xacro \
joints_map_path:=/opt/spot/champ/joints_ros2.yaml \
links_map_path:=/opt/spot/champ/links_ros2.yaml \
gait_config_path:=/opt/spot/champ/gait_ros2.yaml \
publish_joint_states:=true publish_joint_control:=false &
LAUNCH_PID=$!
for _ in $(seq 1 60); do
RSP_NODE="$(ros2 node list 2>/dev/null | awk '/robot_state_publisher$/ {print; exit}')"
if [ -n "${RSP_NODE}" ] && ros2 param set "${RSP_NODE}" publish_frequency "${RSP_PUBLISH_FREQUENCY}" >/tmp/rsp_param_set.log 2>&1; then
echo "[spot-champ] ${RSP_NODE} publish_frequency set to ${RSP_PUBLISH_FREQUENCY}"
break
fi
sleep 2
done
wait "${LAUNCH_PID}"
resources:
requests:
cpu: "300m"
memory: "384Mi"
limits:
cpu: "1500m"
memory: "1Gi"
volumeMounts:
- name: spot-node-label-config
mountPath: /opt/spot
readOnly: true
- name: champ-bridge
image: ghcr.io/gorizond/spot-champ-bridge-cpp:latest
imagePullPolicy: Always
env:
- name: CHAMP_GAIN
value: "-0.45"
- name: CHAMP_UPPER_RANGE_RAD
value: "1.30"
- name: CHAMP_LOWER_RANGE_RAD
value: "1.30"
- name: CHAMP_HIP_SIGN
value: "-1.0"
- name: CHAMP_BRIDGE_HZ
value: "8"
- name: STAND_HIP
value: "0.00"
- name: STAND_UPPER
value: "0.05"
- name: STAND_LOWER
value: "0.05"
- name: STAND_HIP_REAR_OFFSET
value: "0.04"
- name: STAND_REAR_UPPER_OFFSET
value: "0.0"
- name: STAND_REAR_LOWER_OFFSET
value: "0.0"
- name: JOINT_STATES_TOPIC
value: "/joint_states"
- name: CMD_TOPIC
value: "/spot/cmd/servo_auto"
command: ["bash", "-lc"]
args:
- |
set -eo pipefail
source /opt/ros/kilted/setup.bash
source /opt/spot_champ_bridge_cpp/share/spot_champ_bridge_cpp/local_setup.bash
exec ros2 run spot_champ_bridge_cpp spot_champ_bridge_cpp_node
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "400m"
memory: "256Mi"
volumeMounts: []
volumes:
- name: spot-node-label-config
configMap:
name: spot-node-label-config
defaultMode: 0555
items:
- key: spotmicroai.urdf.xacro
path: champ/spotmicroai.urdf.xacro
- key: joints_ros2.yaml
path: champ/joints_ros2.yaml
- key: links_ros2.yaml
path: champ/links_ros2.yaml
- key: gait_ros2.yaml
path: champ/gait_ros2.yaml
- key: base_to_footprint.yaml
path: champ/ekf/base_to_footprint.yaml
- key: footprint_to_odom.yaml
path: champ/ekf/footprint_to_odom.yaml