From d1c89b5a0aa92ec684449125de7e88b19c343f74 Mon Sep 17 00:00:00 2001 From: Fabricio Emder <148896288+femder-bdai@users.noreply.github.com> Date: Fri, 19 Apr 2024 15:03:40 -0300 Subject: [PATCH] Add compilation instructions and an script to install all necessary things (#9) --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ README.md | 14 ++++++++++++++ install_dependencies.sh | 16 ++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 README.md create mode 100755 install_dependencies.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b74e1a0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: Install dependencies and build +on: + # By default, this workflow is not triggered when a PR is merged. + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + - labeled + - unlabeled + push: + branches: + - "*" + +jobs: + compile: + name: Install dependencies and compile project + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install dependencies & build + run: | + # Install dependencies + ./install_dependencies.sh + # Build realsense lcm driver + bazel build //... diff --git a/README.md b/README.md new file mode 100644 index 0000000..b9ccb2f --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +## Dependency installation + +Install all necessary dependencies to run realsense lcm drivers you need to run the following: + +`./install_dependencies.sh` + +After that, you will need to compile: + +`bazel build //...` + +Finally, you can run the nodes: + +`bazel run rgbd_sensor:realsense_rgbd_publisher` + diff --git a/install_dependencies.sh b/install_dependencies.sh new file mode 100755 index 0000000..b9e62c8 --- /dev/null +++ b/install_dependencies.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +sudo apt-get update \ +&& sudo apt-get install -y python3-dev python3-pip libglib2.0-dev \ +&& sudo rm -rf /var/lib/apt/lists/* + +# Install Bazel +sudo apt-get update \ +&& sudo apt-get install apt-transport-https curl gnupg -y \ +&& sudo rm -rf /var/lib/apt/lists/* +curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg +sudo mv bazel-archive-keyring.gpg /usr/share/keyrings +echo "deb [arch=amd64 signed-by=/usr/share/keyrings/bazel-archive-keyring.gpg] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list + +#install realsense driver dependencies +sudo apt-get update && sudo apt-get install -y libjpeg-dev libtbb-dev libtiff5-dev libpng-dev libboost-all-dev libeigen3-dev libfmt-dev libspdlog-dev && sudo rm -rf /var/lib/apt/lists/*