Skip to content

Commit 706d98d

Browse files
Merge pull request #4 from ThomasDuvinage/ros2
Migrate centroidal control collection to ros2. Please note that examples are not yet support on ros2. Closes #4
2 parents ff6c4f3 + 7d82464 commit 706d98d

24 files changed

Lines changed: 399 additions & 300 deletions

.clang-format-common.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# This script is meant to be sourced from other scripts
22

3-
# Check for clang-format, prefer 10 if available
4-
if [[ -x "$(command -v clang-format-10)" ]]; then
5-
clang_format=clang-format-10
3+
# Check for clang-format, prefer 14 if available
4+
if [[ -x "$(command -v clang-format-14)" ]]; then
5+
clang_format=clang-format-14
66
elif [[ -x "$(command -v clang-format)" ]]; then
77
clang_format=clang-format
88
else
9-
echo "clang-format or clang-format-10 must be installed"
9+
echo "clang-format or clang-format-14 must be installed"
1010
exit 1
1111
fi
1212

.github/workflows/ci-catkin.yaml

Lines changed: 0 additions & 145 deletions
This file was deleted.

.github/workflows/ci-colcon.yaml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: CI of CentroidalControlCollection (colcon)
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
13+
clang-format:
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- name: Checkout repository code
17+
uses: actions/checkout@v3
18+
- name: Install clang-format-14
19+
run: |
20+
sudo apt-get -qq update
21+
sudo apt-get -qq install clang-format-14
22+
- name: Run clang-format-check
23+
run: |
24+
./.clang-format-check.sh
25+
26+
build-and-test:
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
os: [ubuntu-22.04]
31+
build-type: [RelWithDebInfo]
32+
standalone: [colcon]
33+
runs-on: ${{ matrix.os }}
34+
steps:
35+
- name: Set environment variables
36+
run: |
37+
set -e
38+
set -x
39+
echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
40+
if [ "${{ matrix.os }}" == "ubuntu-22.04" ] && \
41+
[ "${{ matrix.build-type }}" == "RelWithDebInfo" ] && \
42+
[ "${{ matrix.standalone }}" == "colcon" ] && \
43+
[ "${{ github.repository_owner }}" == "isri-aist" ] && \
44+
[ "${{ github.ref }}" == "refs/heads/master" ]
45+
then
46+
echo "UPLOAD_DOCUMENTATION=true" >> $GITHUB_ENV
47+
sudo apt-get install -qq doxygen graphviz
48+
else
49+
echo "UPLOAD_DOCUMENTATION=false" >> $GITHUB_ENV
50+
fi
51+
- name: Install ROS2
52+
if: matrix.standalone == 'colcon'
53+
uses: jrl-umi3218/github-actions/install-dependencies@master
54+
with:
55+
ros: |
56+
apt: ros-base
57+
- name: Install Dependencies
58+
uses: jrl-umi3218/github-actions/install-dependencies@master
59+
with:
60+
build-type: ${{ matrix.build-type }}
61+
ubuntu: |
62+
apt-mirrors:
63+
mc-rtc:
64+
cloudsmith: mc-rtc/head
65+
apt: libgtest-dev libeigen-qld-dev libmc-rtc-dev
66+
67+
- name: Checkout repository code
68+
uses: actions/checkout@v3
69+
with:
70+
path: colcon_ws/src/CentroidalControlCollection
71+
- name: Checkout QpSolverCollection
72+
uses: actions/checkout@v3
73+
with:
74+
repository: isri-aist/QpSolverCollection
75+
path: colcon_ws/src/QpSolverCollection
76+
- name: Checkout ForceControlCollection
77+
uses: actions/checkout@v3
78+
with:
79+
repository: isri-aist/ForceControlCollection
80+
path: colcon_ws/src/ForceControlCollection
81+
- name: Checkout NMPC
82+
uses: actions/checkout@v3
83+
with:
84+
repository: isri-aist/NMPC
85+
submodules: recursive
86+
path: colcon_ws/src/NMPC
87+
- name: Rosdep install
88+
run: |
89+
set -e
90+
set -x
91+
cd ${GITHUB_WORKSPACE}/colcon_ws
92+
if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]
93+
then
94+
sudo rosdep init
95+
fi
96+
rosdep update
97+
rosdep install -y -r --from-paths src --ignore-src
98+
- name: Colcon build
99+
run: |
100+
set -e
101+
set -x
102+
cd ${GITHUB_WORKSPACE}/colcon_ws
103+
colcon build --merge-install --cmake-args -DUSE_ROS2=ON -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_QLD=ON -DINSTALL_DOCUMENTATION=${{ env.UPLOAD_DOCUMENTATION }}
104+
- name: Run tests
105+
run: |
106+
set -e
107+
set -x
108+
cd ${GITHUB_WORKSPACE}/colcon_ws
109+
set +x
110+
. install/setup.bash
111+
set -x
112+
colcon test --merge-install --packages-select centroidal_control_collection
113+
colcon test-result --all --verbose
114+
- name: Upload documentation
115+
# Only run for one configuration and on origin master branch
116+
if: env.UPLOAD_DOCUMENTATION == 'true'
117+
run: |
118+
set -e
119+
set -x
120+
cd ${GITHUB_WORKSPACE}/colcon_ws/src/${{ github.repository }}
121+
git config --global user.name "Masaki Murooka"
122+
git config --global user.email "m-murooka@aist.go.jp"
123+
git remote set-url origin "https://mmurooka:${{ secrets.CI_TOKEN }}@github.com/isri-aist/CentroidalControlCollection"
124+
git fetch --depth=1 origin gh-pages:gh-pages
125+
git checkout --quiet gh-pages
126+
rm -rf doxygen/ cmake/
127+
cp -r ${GITHUB_WORKSPACE}/colcon_ws/build/centroidal_control_collection/doc/html/ doxygen
128+
git add doxygen
129+
git_status=`git status -s`
130+
if test -n "$git_status"; then
131+
git commit --quiet -m "Update Doxygen HTML files from commit ${{ github.sha }}"
132+
git push origin gh-pages
133+
else
134+
echo "Github pages documentation is already up-to-date."
135+
fi

.github/workflows/ci-standalone.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [ubuntu-20.04]
16+
os: [ubuntu-22.04]
1717
build-type: [Debug, RelWithDebInfo]
1818
compiler: [gcc, clang]
1919
runs-on: ${{ matrix.os }}
2020
steps:
21+
- name: Set environment variables
22+
run: |
23+
set -e
24+
set -x
25+
echo "LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
2126
- uses: actions/checkout@v3
22-
with:
23-
submodules: recursive
2427
- name: Install dependencies
2528
uses: jrl-umi3218/github-actions/install-dependencies@master
2629
with:

.github/workflows/package.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ jobs:
2222
uses: jrl-umi3218/github-actions/.github/workflows/package-project.yml@master
2323
with:
2424
main-repo: isri-aist/CentroidalControlCollection
25+
matrix: |
26+
{
27+
"dist": ["jammy"],
28+
"arch": ["amd64"]
29+
}
2530
secrets:
2631
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
2732
GH_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)