From e372d54aadd27fdbcada7919251737c8d2875fd9 Mon Sep 17 00:00:00 2001
From: Alejandro Lopez Gestoso <alopez@iri.upc.edu>
Date: Mon, 8 Nov 2021 13:04:50 +0100
Subject: [PATCH] Added source isntallation instructions

---
 README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/README.md b/README.md
index baf86b6..50c8b3b 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,52 @@ It also provides a [default bno055 calibration file](./calibration/bno055.cal).
   sudo apt update && sudo apt install iri-bno055-imu-driver-dev
   ```
 
+  If there is any problem with the installation, you can follow the instructions on how to install it from sources:
+  <details><summary>source installation</summary>
+  <p>
+
+  ```bash
+  roscd && cd ..
+  mkdir source_code && cd source_code
+  git clone https://gitlab.iri.upc.edu/labrobotica/algorithms/iriutils.git
+  cd iriutils
+  mkdir build && cd build
+  cmake .. -DCMAKE_BUILD_TYPE=RELEASE
+  make -j$nproc
+  sudo make install
+  ../scripts/add_lib_to_ld_config.sh -liriutils
+  sudo ldconfig
+  roscd && cd ../source_code
+  git clone https://gitlab.iri.upc.edu/labrobotica/drivers/comm.git
+  cd comm
+  mkdir build && cd build
+  cmake .. -DCMAKE_BUILD_TYPE=RELEASE
+  make -j$nproc
+  sudo make install
+  roscd && cd ../source_code/iriutils
+  ./scripts/add_lib_to_ld_config.sh -lcomm
+  sudo ldconfig
+  roscd && cd ../source_code
+  git clone https://gitlab.iri.upc.edu/labrobotica/drivers/bno055_imu_driver.git
+  cd bno055_imu_driver
+  mkdir build && cd build
+  cmake .. -DCMAKE_BUILD_TYPE=RELEASE
+  make -j$nproc
+  sudo make install
+  roscd && cd ../source_code/iriutils
+  ./scripts/add_lib_to_ld_config.sh -lbno055_imu_driver
+  sudo ldconfig
+  ```
+
+  At this point we will have installed all the c++ libraries. /etc/ must have the following lines:
+  ```
+  /usr/local/lib/iri/iriutils
+  /usr/local/lib/iri/comm
+  /usr/local/lib/iri/bno055_imu_driver
+  ```
+  </p>
+  </details>
+
 * **iri_base_algorithm**: Move to your active workspace, clone [this repository](https://gitlab.iri.upc.edu/labrobotica/ros/iri_core/iri_base_algorithm) and compile your workspace.
 
 * **iri_bno055_imu_driver**: Move to your active workspace, clone [this repository](https://gitlab.iri.upc.edu/labrobotica/ros/sensors/imu/iri_bno055_imu_driver) and compile your workspace.
-- 
GitLab