Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ubuntu 20.04 dev build #361

Merged
merged 6 commits into from
Jul 10, 2024
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
29 changes: 29 additions & 0 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,32 @@ jobs:
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/cpp/kiss_icp
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

# As the previous job will always install the dependencies from cmake, and this is guaranteed to
# work, we also want to support dev sandboxes where the main dependencies are already
# pre-installed in the system. For now, we only support dev machines under a GNU/Linux
# environmnets. If you are reading this and need the same functionallity in Windows/macOS please
# open a ticket.
cpp_api_dev:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04]

steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.apt/cache
key: ${{ runner.os }}-apt-${{ hashFiles('**/ubuntu_dependencies.yml') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake git libeigen3-dev libtbb-dev
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/cpp/kiss_icp
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
1 change: 1 addition & 0 deletions cpp/kiss_icp/core/Deskew.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ std::vector<Eigen::Vector3d> DeSkewScan(const std::vector<Eigen::Vector3d> &fram
const Sophus::SE3d &delta) {
const auto delta_pose = delta.log();
std::vector<Eigen::Vector3d> corrected_frame(frame.size());
// TODO(All): This tbb execution is ignoring the max_n_threads config value
tbb::parallel_for(size_t(0), frame.size(), [&](size_t i) {
const auto motion = Sophus::SE3d::exp((timestamps[i] - mid_pose_timestamp) * delta_pose);
corrected_frame[i] = motion * frame[i];
Expand Down
4 changes: 3 additions & 1 deletion cpp/kiss_icp/core/Registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <tbb/global_control.h>
#include <tbb/info.h>
#include <tbb/parallel_reduce.h>
#include <tbb/task_arena.h>

#include <algorithm>
#include <cmath>
Expand Down Expand Up @@ -171,7 +172,8 @@ Registration::Registration(int max_num_iteration, double convergence_criterion,
: max_num_iterations_(max_num_iteration),
convergence_criterion_(convergence_criterion),
// Only manipulate the number of threads if the user specifies something greater than 0
max_num_threads_(max_num_threads > 0 ? max_num_threads : tbb::info::default_concurrency()) {
max_num_threads_(max_num_threads > 0 ? max_num_threads
: tbb::this_task_arena::max_concurrency()) {
// This global variable requires static duration storage to be able to manipulate the max
// concurrency from TBB across the entire class
static const auto tbb_control_settings = tbb::global_control(
Expand Down
Loading