-
Notifications
You must be signed in to change notification settings - Fork 19
352 lines (350 loc) · 14.6 KB
/
ci.yaml
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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
name: CI of BaselineWalkingController
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
schedule:
- cron: '0 0 * * 0'
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
catkin-build: [catkin, standalone]
build-type: [RelWithDebInfo, Debug]
mc-rtc-version: [head, stable]
compiler: [gcc]
mpc-method: [PreviewControlZmp]
mpc-framework: [OpenLoopMpc]
motion-type: [WalkingOnPlane]
exclude:
- build-type: Debug
mc-rtc-version: stable
# Some packages have not been released onto the stable mirror yet
- catkin-build: standalone
mc-rtc-version: stable
include:
# compiler
- os: ubuntu-20.04
catkin-build: standalone # catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: clang # gcc
mpc-method: PreviewControlZmp
mpc-framework: OpenLoopMpc
motion-type: WalkingOnPlane
# motion-type
- os: ubuntu-20.04
catkin-build: catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: PreviewControlZmp
mpc-framework: OpenLoopMpc
motion-type: WalkingOnStairs # WalkingOnPlane
- os: ubuntu-20.04
catkin-build: catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: PreviewControlZmp
mpc-framework: OpenLoopMpc
motion-type: WalkingOnPlaneVel # WalkingOnPlane
- os: ubuntu-20.04
catkin-build: catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: PreviewControlZmp
mpc-framework: OpenLoopMpc
motion-type: WalkingWithFootstepPlanner # WalkingOnPlane
- os: ubuntu-20.04
catkin-build: standalone # catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: PreviewControlZmp
mpc-framework: OpenLoopMpc
motion-type: WalkingOnStairs # WalkingOnPlane
- os: ubuntu-20.04
catkin-build: standalone # catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: PreviewControlZmp
mpc-framework: OpenLoopMpc
motion-type: WalkingOnPlaneVel # WalkingOnPlane
- os: ubuntu-20.04
catkin-build: standalone # catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: PreviewControlZmp
mpc-framework: OpenLoopMpc
motion-type: WalkingWithFootstepPlanner # WalkingOnPlane
# mpc-method, mpc-framework
- os: ubuntu-20.04
catkin-build: catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: DdpZmp # PreviewControlZmp
mpc-framework: OpenLoopMpc
motion-type: WalkingOnPlane
- os: ubuntu-20.04
catkin-build: catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: FootGuidedControl # PreviewControlZmp
mpc-framework: OpenLoopMpc
motion-type: WalkingOnPlane
- os: ubuntu-20.04
catkin-build: catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: IntrinsicallyStableMpc # PreviewControlZmp
mpc-framework: OpenLoopMpc
motion-type: WalkingOnPlane
- os: ubuntu-20.04
catkin-build: catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: PreviewControlZmp
mpc-framework: ClosedLoopMpc # OpenLoopMpc
motion-type: WalkingOnPlane
- os: ubuntu-20.04
catkin-build: catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: DdpZmp # PreviewControlZmp
mpc-framework: ClosedLoopMpc # OpenLoopMpc
motion-type: WalkingOnPlane
- os: ubuntu-20.04
catkin-build: catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: FootGuidedControl # PreviewControlZmp
mpc-framework: ClosedLoopMpc # OpenLoopMpc
motion-type: WalkingOnPlane
- os: ubuntu-20.04
catkin-build: catkin
build-type: RelWithDebInfo
mc-rtc-version: head
compiler: gcc
mpc-method: IntrinsicallyStableMpc # PreviewControlZmp
mpc-framework: ClosedLoopMpc # OpenLoopMpc
motion-type: WalkingOnPlane
runs-on: ${{ matrix.os }}
env:
RESULTS_POSTFIX: ${{ matrix.mpc-method }}-${{ matrix.mpc-framework }}-${{ matrix.motion-type }}-${{ matrix.catkin-build }}
steps:
- name: Setup environment variables
run: |
set -e
set -x
if [ "${{ matrix.os }}" == "ubuntu-20.04" ] && \
[ "${{ matrix.build-type }}" == "RelWithDebInfo" ] && \
[ "${{ matrix.mc-rtc-version }}" == "head" ] && \
[ "${{ matrix.compiler }}" == "gcc" ]
then
echo "RUN_SIMULATION_STEPS=true" >> $GITHUB_ENV
else
echo "RUN_SIMULATION_STEPS=false" >> $GITHUB_ENV
fi
if [ "${{ matrix.os }}" == "ubuntu-20.04" ] && \
[ "${{ matrix.catkin-build }}" == "catkin" ] && \
[ "${{ matrix.build-type }}" == "RelWithDebInfo" ] && \
[ "${{ matrix.mc-rtc-version }}" == "head" ] && \
[ "${{ matrix.compiler }}" == "gcc" ] && \
[ "${{ matrix.mpc-method }}" == "PreviewControlZmp" ] && \
[ "${{ matrix.mpc-framework }}" == "OpenLoopMpc" ] && \
[ "${{ matrix.motion-type }}" == "WalkingOnPlane" ] && \
[ "${{ github.repository_owner }}" == "isri-aist" ] && \
[ "${{ github.ref }}" == "refs/heads/master" ]
then
echo "UPLOAD_DOCUMENTATION=true" >> $GITHUB_ENV
else
echo "UPLOAD_DOCUMENTATION=false" >> $GITHUB_ENV
fi
if [ "${{ matrix.catkin-build }}" == "catkin" ]
then
echo "CI_DIR=${GITHUB_WORKSPACE}/catkin_ws/src/${{ github.repository }}/.github/workflows" >> $GITHUB_ENV
else
echo "CI_DIR=${GITHUB_WORKSPACE}/.github/workflows" >> $GITHUB_ENV
fi
if [ "${{ matrix.motion-type }}" == "WalkingWithFootstepPlanner" ]
then
echo "BASELINE_FOOTSTEP_PLANNER=baseline_footstep_planner" >> $GITHUB_ENV
else
echo "BASELINE_FOOTSTEP_PLANNER=" >> $GITHUB_ENV
fi
- name: Install dependencies
uses: jrl-umi3218/github-actions/install-dependencies@master
with:
ubuntu: |
apt-mirrors:
mc-rtc:
cloudsmith: mc-rtc/${{ matrix.mc-rtc-version }}
apt: libmc-rtc-dev mc-rtc-utils mc-state-observation doxygen graphviz jvrc-choreonoid choreonoid libcnoid-dev
ros: |
apt: ros-base mc-rtc-plugin eigen-conversions
- name: Install standalone dependencies
if: matrix.catkin-build == 'standalone'
uses: jrl-umi3218/github-actions/install-dependencies@master
with:
compiler: ${{ matrix.compiler }}
build-type: ${{ matrix.build-type }}
ubuntu: |
apt: libforcecontrolcollection-dev libtrajectorycollection-dev libcentroidalcontrolcollection-dev
- name: Install BaselineFootstepPlanner for standalone build
if: matrix.catkin-build == 'standalone' && matrix.motion-type == 'WalkingWithFootstepPlanner'
uses: jrl-umi3218/github-actions/install-dependencies@master
with:
compiler: ${{ matrix.compiler }}
build-type: ${{ matrix.build-type }}
ros: |
apt: sbpl
github: |
- path: isri-aist/BaselineFootstepPlanner
ref: master
- name: Checkout repository code for standalone build
if: matrix.catkin-build == 'standalone'
uses: actions/checkout@v3
with:
submodules: recursive
- name: Standalone build
if: matrix.catkin-build == 'standalone'
uses: jrl-umi3218/github-actions/build-cmake-project@master
with:
compiler: ${{ matrix.compiler }}
build-type: ${{ matrix.build-type }}
- name: Catkin build
if: matrix.catkin-build == 'catkin'
uses: jrl-umi3218/github-actions/build-catkin-project@master
with:
build-type: ${{ matrix.build-type }}
cmake-args: -DINSTALL_DOCUMENTATION=${{ env.UPLOAD_DOCUMENTATION }} -DENABLE_QLD=ON
catkin-test-args: --no-deps
build-packages: "baseline_walking_controller ${{ env.BASELINE_FOOTSTEP_PLANNER }}"
test-packages: baseline_walking_controller
- name: Catkin build again to ensure footstep planner found
if: matrix.catkin-build == 'catkin' && matrix.motion-type == 'WalkingWithFootstepPlanner'
run: |
set -e
set -x
cd ${GITHUB_WORKSPACE}/catkin_ws
set +x
. devel/setup.bash
set -x
catkin build baseline_walking_controller --no-deps --force-cmake --limit-status-rate 0.1 --cmake-args -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} --catkin-make-args all run_tests
catkin_test_results --verbose --all build
- name: Run simulation
if: env.RUN_SIMULATION_STEPS == 'true'
# https://github.com/jrl-umi3218/lipm_walking_controller/blob/b564d655388ae6a6725c504e5c74a62192e58c7c/.github/workflows/build.yml#L64-L92
run: |
set -e
set -x
sudo apt-get install -y -qq xvfb ffmpeg mesa-utils fluxbox xserver-xorg xserver-xorg-core xserver-xorg-video-all libwayland-egl1-mesa
set +x
if [ "${{ matrix.catkin-build }}" == "catkin" ]
then
. ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash
fi
set -x
export DISPLAY=":1"
Xvfb ${DISPLAY} -screen 0 1920x1080x24 &
sleep 10s
fluxbox 2> /dev/null &
mkdir -p ${HOME}/.config/mc_rtc/controllers
if [ "${{ matrix.catkin-build }}" == "catkin" ]
then
cp ${GITHUB_WORKSPACE}/catkin_ws/src/${{ github.repository }}/etc/mc_rtc.yaml ${HOME}/.config/mc_rtc
else
echo "Enabled: BaselineWalkingController" > ${HOME}/.config/mc_rtc/mc_rtc.yaml
fi
python3 ${{ env.CI_DIR }}/scripts/mergeConfigs.py ${{ env.CI_DIR }}/config/${{ matrix.mpc-method }}.yaml ${{ env.CI_DIR }}/config/${{ matrix.mpc-framework }}.yaml ${{ env.CI_DIR }}/config/${{ matrix.motion-type }}.yaml > ${HOME}/.config/mc_rtc/controllers/BaselineWalkingController.yaml
ffmpeg -y -f x11grab -s 1920x1080 -r 30 -i ${DISPLAY} -qscale 0 -vcodec huffyuv /tmp/video.avi > /dev/null 2>&1 < /dev/null &
FFMPEG_PID=$!
cd /usr/share/hrpsys/samples/JVRC1
./clear-omninames.sh
roscore > /dev/null 2>&1 < /dev/null &
ROSCORE_PID=$!
sleep 1s
if [ "${{ matrix.motion-type }}" == "WalkingOnPlane" -o "${{ matrix.motion-type }}" == "WalkingOnPlaneVel" ]; then
CNOID_FILE=sim_mc.cnoid
else
CNOID_FILE=sim_mc_comanoid_staircase.cnoid
fi
choreonoid ${CNOID_FILE} --test-mode --start-simulation &
CNOID_PID=$!
if [ "${{ matrix.motion-type }}" == "WalkingWithFootstepPlanner" ]; then
SLEEP_DURATION="70s"
else
SLEEP_DURATION="50s"
fi
sleep ${SLEEP_DURATION}
kill -2 ${ROSCORE_PID}
kill -2 ${CNOID_PID}
kill -2 ${FFMPEG_PID}
sleep 1s
kill -9 ${CNOID_PID} || true
sleep 10s
mkdir -p /tmp/results
ffmpeg -nostats -i /tmp/video.avi /tmp/results/BWC-video-${RESULTS_POSTFIX}.mp4
LOG_FILENAME=BWC-log-${RESULTS_POSTFIX}
mv `readlink -f /tmp/mc-control-BaselineWalkingController-latest.bin` /tmp/${LOG_FILENAME}.bin
tar czf /tmp/results/${LOG_FILENAME}.tar.gz -C /tmp ${LOG_FILENAME}.bin
- name: Upload simulation data
if: env.RUN_SIMULATION_STEPS == 'true'
uses: actions/upload-artifact@v3
with:
name: BWC-ci-results-${{ matrix.catkin-build }}
path: /tmp/results
- name: Check simulation results
if: env.RUN_SIMULATION_STEPS == 'true'
run: |
set -e
set -x
if [ "${{ matrix.motion-type }}" == "WalkingOnPlane" ]; then
EXPECTED_BASE_POS="1.34 -0.41 0.8"
elif [ "${{ matrix.motion-type }}" == "WalkingOnStairs" ]; then
EXPECTED_BASE_POS="1.75 0.0 1.68"
elif [ "${{ matrix.motion-type }}" == "WalkingOnPlaneVel" ]; then
EXPECTED_BASE_POS="0.74 -0.53 0.8"
else # if [ "${{ matrix.motion-type }}" == "WalkingWithFootstepPlanner" ]; then
EXPECTED_BASE_POS="2.5 -0.25 0.8"
fi
LOG_FILENAME=BWC-log-${RESULTS_POSTFIX}
python3 ${{ env.CI_DIR }}/scripts/checkSimulationResults.py /tmp/${LOG_FILENAME}.bin --expected-base-pos ${EXPECTED_BASE_POS}
- name: Upload documentation
if: env.UPLOAD_DOCUMENTATION == 'true'
run: |
set -e
set -x
cd ${GITHUB_WORKSPACE}/catkin_ws/src/${{ github.repository }}
git config --global user.name "Masaki Murooka"
git config --global user.email "[email protected]"
git remote set-url origin "https://mmurooka:${{ secrets.CI_TOKEN }}@github.com/isri-aist/BaselineWalkingController"
git fetch --depth=1 origin gh-pages:gh-pages
git clean -dfx
rm -rf cmake/
git checkout --quiet gh-pages
rm -rf doxygen/
cp -r ${GITHUB_WORKSPACE}/catkin_ws/build/baseline_walking_controller/doc/html/ doxygen
git add doxygen
git_status=`git status -s`
if test -n "$git_status"; then
git commit --quiet -m "Update Doxygen HTML files from commit ${{ github.sha }}"
git push origin gh-pages
else
echo "Github pages documentation is already up-to-date."
fi