Skip to content

Commit 2a3746e

Browse files
authored
Merge pull request #29 from Simple-Robotics/topic/add-pixi-ci
Add pixi support, pixi CI
2 parents 3e29a8d + 7f102da commit 2a3746e

File tree

6 files changed

+7862
-2
lines changed

6 files changed

+7862
-2
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI - OSX/Linux via Pixi
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'doc/**'
7+
- '.gitignore'
8+
- '*.md'
9+
- 'CHANGELOG.md'
10+
pull_request:
11+
paths-ignore:
12+
- 'doc/'
13+
- '.gitignore'
14+
- '*.md'
15+
- 'CHANGELOG.md'
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
simple-mpc-pixi:
22+
name: ${{ matrix.os }} - Env ${{ matrix.environment }} ${{ matrix.build_type }}
23+
runs-on: ${{ matrix.os }}
24+
env:
25+
CCACHE_BASEDIR: "${GITHUB_WORKSPACE}"
26+
CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache"
27+
CCACHE_COMPRESS: true
28+
CCACHE_COMPRESSLEVEL: 6
29+
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
os: [ubuntu-latest, macos-latest]
34+
environment: [all]
35+
build_type: [Release, Debug]
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
submodules: recursive
41+
42+
- uses: actions/cache@v4
43+
with:
44+
path: .ccache
45+
key: ccache-macos-linux-pixi-${{ matrix.os }}-${{ matrix.build_type }}-${{ github.sha }}
46+
restore-keys: ccache-macos-linux-pixi-${{ matrix.os }}-${{ matrix.build_type }}-
47+
48+
- uses: prefix-dev/[email protected]
49+
with:
50+
pixi-version: v0.39.2
51+
cache: true
52+
environments: ${{ matrix.environment }}
53+
54+
- name: Build simple-mpc
55+
shell: bash -l {0}
56+
env:
57+
CMAKE_BUILD_PARALLEL_LEVEL: 4
58+
SIMPLE_MPC_BUILD_TYPE: ${{ matrix.build_type }}
59+
run: |
60+
pixi run -e ${{ matrix.environment }} test
61+
62+
check:
63+
if: always()
64+
name: check-macos-linux-pixi
65+
66+
needs:
67+
- simple-mpc-pixi
68+
69+
runs-on: ubuntu-latest
70+
71+
steps:
72+
- name: Decide whether the needed jobs succeeded or failed
73+
uses: re-actors/alls-green@release/v1
74+
with:
75+
jobs: ${{ toJSON(needs) }}

include/simple-mpc/math-util.hpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <Eigen/Core>
2+
3+
namespace simple_mpc
4+
{
5+
namespace math
6+
{
7+
8+
/// @note Backport from <pinocchio/math/matrix.hpp> in topic/simulation branch.
9+
template<typename Matrix>
10+
void make_symmetric(const Eigen::MatrixBase<Matrix> & mat, const int mode = Eigen::Upper)
11+
{
12+
if (mode == Eigen::Upper)
13+
{
14+
mat.const_cast_derived().template triangularView<Eigen::StrictlyLower>() =
15+
mat.transpose().template triangularView<Eigen::StrictlyLower>();
16+
}
17+
else if (mode == Eigen::Lower)
18+
{
19+
mat.const_cast_derived().template triangularView<Eigen::StrictlyUpper>() =
20+
mat.transpose().template triangularView<Eigen::StrictlyUpper>();
21+
}
22+
}
23+
24+
} // namespace math
25+
} // namespace simple_mpc

include/simple-mpc/robot-handler.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ namespace simple_mpc
130130
}
131131
size_t getFootNb(const std::string & foot_name) const
132132
{
133-
return std::find(feet_names_.begin(), feet_names_.end(), foot_name) - feet_names_.begin();
133+
return size_t(std::find(feet_names_.begin(), feet_names_.end(), foot_name) - feet_names_.begin());
134134
}
135135

136136
const std::vector<FrameIndex> & getFeetIds() const

0 commit comments

Comments
 (0)