Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/macos-linux-pixi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI - OSX/Linux via Pixi

on:
push:
paths-ignore:
- 'doc/**'
- '.gitignore'
- '*.md'
- 'CHANGELOG.md'
pull_request:
paths-ignore:
- 'doc/'
- '.gitignore'
- '*.md'
- 'CHANGELOG.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
simple-mpc-pixi:
name: ${{ matrix.os }} - Env ${{ matrix.environment }} ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
env:
CCACHE_BASEDIR: "${GITHUB_WORKSPACE}"
CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache"
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
environment: [all]
build_type: [Release, Debug]

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/cache@v4
with:
path: .ccache
key: ccache-macos-linux-pixi-${{ matrix.os }}-${{ matrix.build_type }}-${{ github.sha }}
restore-keys: ccache-macos-linux-pixi-${{ matrix.os }}-${{ matrix.build_type }}-

- uses: prefix-dev/[email protected]
with:
pixi-version: v0.39.2
cache: true
environments: ${{ matrix.environment }}

- name: Build simple-mpc
shell: bash -l {0}
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
SIMPLE_MPC_BUILD_TYPE: ${{ matrix.build_type }}
run: |
pixi run -e ${{ matrix.environment }} test

check:
if: always()
name: check-macos-linux-pixi

needs:
- simple-mpc-pixi

runs-on: ubuntu-latest

steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
25 changes: 25 additions & 0 deletions include/simple-mpc/math-util.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include <Eigen/Core>

namespace simple_mpc
{
namespace math
{

/// @note Backport from <pinocchio/math/matrix.hpp> in topic/simulation branch.
template<typename Matrix>
void make_symmetric(const Eigen::MatrixBase<Matrix> & mat, const int mode = Eigen::Upper)
{
if (mode == Eigen::Upper)
{
mat.const_cast_derived().template triangularView<Eigen::StrictlyLower>() =
mat.transpose().template triangularView<Eigen::StrictlyLower>();
}
else if (mode == Eigen::Lower)
{
mat.const_cast_derived().template triangularView<Eigen::StrictlyUpper>() =
mat.transpose().template triangularView<Eigen::StrictlyUpper>();
}
}

} // namespace math
} // namespace simple_mpc
2 changes: 1 addition & 1 deletion include/simple-mpc/robot-handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace simple_mpc
}
size_t getFootNb(const std::string & foot_name) const
{
return std::find(feet_names_.begin(), feet_names_.end(), foot_name) - feet_names_.begin();
return size_t(std::find(feet_names_.begin(), feet_names_.end(), foot_name) - feet_names_.begin());
}

const std::vector<FrameIndex> & getFeetIds() const
Expand Down
Loading
Loading