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

Ensure and document OpenVDB support #475

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
4 changes: 4 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ Within a development environment:
rosdep install --from-path src
```


> [!IMPORTANT]
> `beluga_vdb` requires OpenVDB to be installed in order to be used. For Ubuntu distributions previous to `Noble` OpenVDB needs to be installed from sources before building. Installation instructions can be found [here](beluga_vdb/README.md). If you don't need `beluga_vdb`, you can skip it using `colcon build --symlink-install --packages-ignore beluga_vdb`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvela2017 nit:

Suggested change
> `beluga_vdb` requires OpenVDB to be installed in order to be used. For Ubuntu distributions previous to `Noble` OpenVDB needs to be installed from sources before building. Installation instructions can be found [here](beluga_vdb/README.md). If you don't need `beluga_vdb`, you can skip it using `colcon build --symlink-install --packages-ignore beluga_vdb`
> `beluga_vdb` requires OpenVDB to be installed in order to be used. For Ubuntu distributions previous to `Noble` OpenVDB needs to be installed from sources before building. Installation instructions can be found [here](beluga_vdb/README.md). If you don't need `beluga_vdb`, you can skip it using `colcon build --symlink-install --packages-ignore beluga_vdb`.


For more advanced tooling, check repository [tools](./tools).

## CI/CD
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ This repository contains the following packages:
| [`beluga_example`](beluga_example) | Example launch files, showing how to run Beluga-based nodes. |
| [`beluga_benchmark`](beluga_benchmark) | Scripts to benchmark, profile and also compare Beluga with other MCL implementations. |
| [`beluga_system_tests`](beluga_system_tests) | System integration tests for Beluga. |
| [`beluga_vdb`](beluga_vdb) | A library extension for `beluga` facilitating the use of OpenVDB for 3D localization. |

## ⚙️ First Steps

Expand Down
51 changes: 51 additions & 0 deletions beluga_vdb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Beluga VDB

<div align="center">
<img alt="Shows the Beluga logo." src="images/57fe338a-3e7e-46b3-ad2f-17011d6d306a.png" height="200">
</div>

## 🌐 Overview

BelugaVDB is a library extension for `beluga` that integrates [OpenVDB](https://www.openvdb.org/), enabling advanced 3D localization capabilities. Currently, this extension uses OpenVDB to efficiently process 3D maps and pointcloud data. Maps in `vdb` format can be generated using any third party library such as [VDB Mapping](https://github.com/fzi-forschungszentrum-informatik/vdb_mapping).

## 📦 External Dependencies

### OpenVDB

For Ubuntu 24.04 and newer distributions, OpenVDB can be installed using `apt`:

```bash
sudo apt install libopenvdb-dev
```

For older distributions, it must be installed from sources as follows:

#### Step 1: Download OpenVDB

Clone [OpenVDB](https://github.com/AcademySoftwareFoundation/openvdb) into your machine (for Jammy version 8.2.0 is recommended):

```bash
git clone -b v8.2.0 https://github.com/AcademySoftwareFoundation/openvdb.git
```

#### Step 2: Compile OpenVDB

Now you need to build OpenVDB:

```bash
cd openvdb && \
mkdir build && cd build && \
cmake .. && \
make -j$(nproc)
```

#### Step 3: Install OpenVDB

You can now install OpenVDB using:

```bash
sudo make install
```

> [!NOTE]
> For more information about OpenVDB please refer to the [official documentation](https://www.openvdb.org/documentation/doxygen/).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

#include <Eigen/Core>

#include <range/v3/algorithm/fold_left.hpp>
#include <range/v3/algorithm/for_each.hpp>
#include <range/v3/numeric/accumulate.hpp>
#include <range/v3/range/conversion.hpp>
#include <range/v3/view/all.hpp>
Expand Down Expand Up @@ -133,7 +131,7 @@ class LikelihoodFieldModel3 {
ranges::to<std::vector>();

return [this, points = std::move(transformed_points)](const state_type& state) -> weight_type {
return ranges::fold_left(
return ranges::accumulate(
points | //
ranges::views::transform([this, &state](const auto& point) {
const Eigen::Vector3d point_in_state_frame = state * point;
Expand Down
32 changes: 32 additions & 0 deletions docker/images/humble/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ RUN git clone -b develop https://github.com/NERSC/timemory.git \
. \
&& cmake --build ./build --target timem

FROM ros:humble-ros-base-jammy AS openvdb-builder

RUN apt-get update \
&& apt-get install --no-install-recommends -y \
git \
libboost-all-dev \
libtbb-dev \
libblosc-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /opt

RUN git clone -b v8.2.0 https://github.com/AcademySoftwareFoundation/openvdb.git \
&& cd openvdb \
&& mkdir build && cd build \
&& cmake .. \
&& make -j$(nproc)

FROM ros:humble-ros-base-jammy AS builder

ENV DEBIAN_FRONTEND noninteractive
Expand Down Expand Up @@ -84,6 +102,15 @@ RUN /bin/bash -c '\

RUN cd /opt && git clone https://github.com/brendangregg/FlameGraph

# Install OpenVDB from sources
RUN cd /tmp && \
git clone -b v8.2.0 https://github.com/AcademySoftwareFoundation/openvdb.git && \
cd openvdb && \
mkdir build && cd build && \
cmake .. && \
make -j$(nproc) && sudo make install && \
rm -rf /tmp/openvdb

USER $USER:$GROUP

ENV USER_WS /ws
Expand All @@ -106,6 +133,11 @@ RUN sudo apt-get update \

COPY --from=cacher --chown=$USER:$GROUP /ws/ $USER_WS/

COPY --from=openvdb-builder --chown=$USER:$GROUP /opt/openvdb/ /opt/openvdb
RUN cd /opt/openvdb/build \
&& sudo make install \
&& sudo rm -rf /opt/openvdb

ENV WITHIN_DEV 1

ENV SHELL /bin/bash
Expand Down
Loading