Skip to content

Commit

Permalink
Merge pull request #11 from tier4/sync-upstream
Browse files Browse the repository at this point in the history
chore: sync upstream
  • Loading branch information
tier4-autoware-public-bot[bot] authored Feb 15, 2022
2 parents 355609b + 942f81c commit b6beeec
Show file tree
Hide file tree
Showing 46 changed files with 1,049 additions and 328 deletions.
2 changes: 1 addition & 1 deletion .github/sync-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- source: DISCLAIMER.md
- source: LICENSE
- source: .github/dependabot.yaml
- source: .github/workflows/pre-commit.yaml
- source: .github/workflows/pre-commit-optional.yaml
- source: .github/workflows/semantic-pull-request.yaml
- source: .github/workflows/spell-check-differential.yaml
Expand All @@ -25,7 +26,6 @@
- source: .github/workflows/build-and-test-differential-self-hosted.yaml
- source: .github/workflows/build-and-test-self-hosted.yaml
- source: .github/workflows/check-build-depends.yaml
- source: .github/workflows/pre-commit.yaml

- repository: autowarefoundation/autoware-documentation
files:
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/build-and-test-differential-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,17 @@ jobs:
id: get-modified-packages
uses: autowarefoundation/autoware-github-actions/get-modified-packages@tier4/proposal

- name: Build and test
- name: Build
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
uses: autowarefoundation/autoware-github-actions/colcon-build-and-test@tier4/proposal
uses: autowarefoundation/autoware-github-actions/colcon-build@tier4/proposal
with:
rosdistro: galactic
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
build-depends-repos: build_depends.repos

- name: Test
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
uses: autowarefoundation/autoware-github-actions/colcon-test@tier4/proposal
with:
rosdistro: galactic
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/build-and-test-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@ jobs:
id: get-modified-packages
uses: autowarefoundation/autoware-github-actions/get-modified-packages@tier4/proposal

- name: Build and test
- name: Build
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
uses: autowarefoundation/autoware-github-actions/colcon-build-and-test@tier4/proposal
uses: autowarefoundation/autoware-github-actions/colcon-build@tier4/proposal
with:
rosdistro: galactic
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
build-depends-repos: build_depends.repos

- name: Check the existence of coverage files
id: check-file-existence
uses: autowarefoundation/autoware-github-actions/check-file-existence@tier4/proposal
- name: Test
id: test
if: ${{ steps.get-modified-packages.outputs.modified-packages != '' }}
uses: autowarefoundation/autoware-github-actions/colcon-test@tier4/proposal
with:
files: |
lcov/total_coverage.info
coveragepy/.coverage
condition: or
rosdistro: galactic
target-packages: ${{ steps.get-modified-packages.outputs.modified-packages }}
build-depends-repos: build_depends.repos

- name: Upload coverage to CodeCov
if: ${{ steps.check-file-existence.outputs.exists == 'true' }}
if: ${{ steps.test.outputs.coverage-report-files != '' }}
uses: codecov/codecov-action@v2
with:
files: lcov/total_coverage.info,coveragepy/.coverage
files: ${{ steps.test.outputs.coverage-report-files }}
fail_ci_if_error: false
verbose: true

Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/build-and-test-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,17 @@ jobs:
id: get-self-packages
uses: autowarefoundation/autoware-github-actions/get-self-packages@tier4/proposal

- name: Build and test
uses: autowarefoundation/autoware-github-actions/colcon-build-and-test@tier4/proposal
- name: Build
if: ${{ steps.get-self-packages.outputs.self-packages != '' }}
uses: autowarefoundation/autoware-github-actions/colcon-build@tier4/proposal
with:
rosdistro: galactic
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
build-depends-repos: build_depends.repos

- name: Test
if: ${{ steps.get-self-packages.outputs.self-packages != '' }}
uses: autowarefoundation/autoware-github-actions/colcon-test@tier4/proposal
with:
rosdistro: galactic
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,27 @@ jobs:
id: get-self-packages
uses: autowarefoundation/autoware-github-actions/get-self-packages@tier4/proposal

- name: Build and test
uses: autowarefoundation/autoware-github-actions/colcon-build-and-test@tier4/proposal
- name: Build
if: ${{ steps.get-self-packages.outputs.self-packages != '' }}
uses: autowarefoundation/autoware-github-actions/colcon-build@tier4/proposal
with:
rosdistro: galactic
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
build-depends-repos: build_depends.repos

- name: Check the existence of coverage files
id: check-file-existence
uses: autowarefoundation/autoware-github-actions/check-file-existence@tier4/proposal
- name: Test
if: ${{ steps.get-self-packages.outputs.self-packages != '' }}
id: test
uses: autowarefoundation/autoware-github-actions/colcon-test@tier4/proposal
with:
files: |
lcov/total_coverage.info
coveragepy/.coverage
condition: or
rosdistro: galactic
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
build-depends-repos: build_depends.repos

- name: Upload coverage to CodeCov
if: ${{ steps.check-file-existence.outputs.exists == 'true' }}
if: ${{ steps.test.outputs.coverage-report-files != '' }}
uses: codecov/codecov-action@v2
with:
files: lcov/total_coverage.info,coveragepy/.coverage
files: ${{ steps.test.outputs.coverage-report-files }}
fail_ci_if_error: false
verbose: true
11 changes: 9 additions & 2 deletions .github/workflows/check-build-depends.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ jobs:
id: get-self-packages
uses: autowarefoundation/autoware-github-actions/get-self-packages@tier4/proposal

- name: Build and test
uses: autowarefoundation/autoware-github-actions/colcon-build-and-test@tier4/proposal
- name: Build
uses: autowarefoundation/autoware-github-actions/colcon-build@tier4/proposal
with:
rosdistro: galactic
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
build-depends-repos: build_depends.repos

- name: Test
uses: autowarefoundation/autoware-github-actions/colcon-test@tier4/proposal
with:
rosdistro: galactic
target-packages: ${{ steps.get-self-packages.outputs.self-packages }}
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/clang-tidy-pr-comments.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: clang-tidy-pr-comments

on:
workflow_run:
workflows:
- build-and-test-differential
types:
- completed

jobs:
clang-tidy-pr-comments:
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Download analysis results
run: |
gh run download ${{ github.event.workflow_run.id }} -D /tmp
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set variables
id: set-variables
run: |
echo ::set-output name=pr-id::"$(cat /tmp/clang-tidy-result/pr-id.txt)"
echo ::set-output name=pr-head-repo::"$(cat /tmp/clang-tidy-result/pr-head-repo.txt)"
echo ::set-output name=pr-head-ref::"$(cat /tmp/clang-tidy-result/pr-head-ref.txt)"
- name: Check out PR head
uses: actions/checkout@v2
with:
repository: ${{ steps.set-variables.outputs.pr-head-repo }}
ref: ${{ steps.set-variables.outputs.pr-head-ref }}
persist-credentials: false

- name: Replace paths in fixes.yaml
run: |
sed -i -e "s|/__w/|/home/runner/work/|g" /tmp/clang-tidy-result/fixes.yaml
cat /tmp/clang-tidy-result/fixes.yaml
- name: Copy fixes.yaml to access from Docker Container Action
run: |
cp /tmp/clang-tidy-result/fixes.yaml fixes.yaml
- name: Run clang-tidy-pr-comments action
uses: platisd/clang-tidy-pr-comments@1.1.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clang_tidy_fixes: fixes.yaml
pull_request_id: ${{ steps.set-variables.outputs.pr-id }}
2 changes: 1 addition & 1 deletion .github/workflows/spell-check-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
- name: Run spell-check
uses: autowarefoundation/autoware-github-actions/spell-check@tier4/proposal
with:
cspell-json-url: https://raw.githubusercontent.com/tier4/autoware-spell-check-dict/main/cspell/.cspell.json
cspell-json-url: https://raw.githubusercontent.com/tier4/autoware-spell-check-dict/main/.cspell.json
14 changes: 11 additions & 3 deletions common/osqp_interface/include/osqp_interface/osqp_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class OSQP_INTERFACE_PUBLIC OSQPInterface
int64_t m_exitflag;

// Runs the solver on the stored problem.
std::tuple<std::vector<float64_t>, std::vector<float64_t>, int64_t, int64_t> solve();
std::tuple<std::vector<float64_t>, std::vector<float64_t>, int64_t, int64_t, int64_t> solve();

static void OSQPWorkspaceDeleter(OSQPWorkspace * ptr) noexcept;

Expand All @@ -75,6 +75,9 @@ class OSQP_INTERFACE_PUBLIC OSQPInterface
OSQPInterface(
const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector<float64_t> & q,
const std::vector<float64_t> & l, const std::vector<float64_t> & u, const c_float eps_abs);
OSQPInterface(
const CSC_Matrix & P, const CSC_Matrix & A, const std::vector<float64_t> & q,
const std::vector<float64_t> & l, const std::vector<float64_t> & u, const c_float eps_abs);

/****************
* OPTIMIZATION
Expand All @@ -97,7 +100,7 @@ class OSQP_INTERFACE_PUBLIC OSQPInterface
/// \details std::vector<float> param = std::get<0>(result);
/// \details float64_t x_0 = param[0];
/// \details float64_t x_1 = param[1];
std::tuple<std::vector<float64_t>, std::vector<float64_t>, int64_t, int64_t> optimize();
std::tuple<std::vector<float64_t>, std::vector<float64_t>, int64_t, int64_t, int64_t> optimize();

/// \brief Solves convex quadratic programs (QPs) using the OSQP solver.
/// \return The function returns a tuple containing the solution as two float vectors.
Expand All @@ -115,7 +118,7 @@ class OSQP_INTERFACE_PUBLIC OSQPInterface
/// \details std::vector<float> param = std::get<0>(result);
/// \details float64_t x_0 = param[0];
/// \details float64_t x_1 = param[1];
std::tuple<std::vector<float64_t>, std::vector<float64_t>, int64_t, int64_t> optimize(
std::tuple<std::vector<float64_t>, std::vector<float64_t>, int64_t, int64_t, int64_t> optimize(
const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector<float64_t> & q,
const std::vector<float64_t> & l, const std::vector<float64_t> & u);

Expand All @@ -128,6 +131,9 @@ class OSQP_INTERFACE_PUBLIC OSQPInterface
int64_t initializeProblem(
const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector<float64_t> & q,
const std::vector<float64_t> & l, const std::vector<float64_t> & u);
int64_t initializeProblem(
CSC_Matrix P, CSC_Matrix A, const std::vector<float64_t> & q,
const std::vector<float64_t> & l, const std::vector<float64_t> & u);

// Updates problem parameters while keeping solution in memory.
//
Expand All @@ -138,7 +144,9 @@ class OSQP_INTERFACE_PUBLIC OSQPInterface
// l_new: (m) vector defining the lower bound problem constraint.
// u_new: (m) vector defining the upper bound problem constraint.
void updateP(const Eigen::MatrixXd & P_new);
void updateCscP(const CSC_Matrix & P_csc);
void updateA(const Eigen::MatrixXd & A_new);
void updateCscA(const CSC_Matrix & A_csc);
void updateQ(const std::vector<double> & q_new);
void updateL(const std::vector<double> & l_new);
void updateU(const std::vector<double> & u_new);
Expand Down
Loading

0 comments on commit b6beeec

Please sign in to comment.