diff --git a/install_deps.sh b/install_deps.sh new file mode 100644 index 0000000..1b88da7 --- /dev/null +++ b/install_deps.sh @@ -0,0 +1,119 @@ +#!/bin/bash + +set -e # Exit on any error + +# SuperOdometry Dependencies Installation Script +# Place this file at: /ws/src/SuperOdom/install_deps.sh + +echo "=========================================" +echo "SuperOdometry Dependencies Installer" +echo "=========================================" + +# Get script directory and create deps folder +SCRIPT_DIR=$(dirname "$(realpath "$0")") +DEPS_DIR="$SCRIPT_DIR/deps" + +echo "Creating dependencies directory: $DEPS_DIR" +mkdir -p "$DEPS_DIR" +cd "$DEPS_DIR" + +# Update system packages +echo "Updating system packages..." +sudo apt update +sudo apt install -y build-essential cmake git python3-pip \ + libboost-all-dev libeigen3-dev libpcl-dev \ + pkg-config libgoogle-glog-dev libgflags-dev \ + libatlas-base-dev libsuitesparse-dev + +# Install Sophus +echo "Installing Sophus..." +if [ ! -d "Sophus" ]; then + echo " Cloning Sophus repository..." + git clone https://github.com/strasdat/Sophus.git + cd Sophus + git checkout 97e7161 + mkdir -p build && cd build + echo " Building Sophus..." + cmake .. -DBUILD_TESTS=OFF + make -j$(nproc) + echo " Installing Sophus..." + sudo make install + cd "$DEPS_DIR" + echo " ✓ Sophus installed successfully" +else + echo " ✓ Sophus already exists, skipping..." +fi + +# Install GTSAM +echo "Installing GTSAM..." +if [ ! -d "gtsam" ]; then + echo " Cloning GTSAM repository..." + git clone https://github.com/borglab/gtsam.git + cd gtsam + git checkout 4abef92 + mkdir -p build && cd build + echo " Building GTSAM..." + cmake \ + -DGTSAM_USE_SYSTEM_EIGEN=ON \ + -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \ + .. + make -j$(nproc) + echo " Installing GTSAM..." + sudo make install + cd "$DEPS_DIR" + echo " ✓ GTSAM installed successfully" +else + echo " ✓ GTSAM already exists, skipping..." +fi + +# Install Ceres Solver +echo "Installing Ceres Solver..." +if [ ! -d "ceres-solver" ]; then + echo " Cloning Ceres Solver repository..." + git clone https://github.com/ceres-solver/ceres-solver.git + cd ceres-solver + git checkout f68321e7de8929fbcdb95dd42877531e64f72f66 + mkdir -p build && cd build + echo " Building Ceres Solver..." + cmake .. + make -j$(nproc) + echo " Installing Ceres Solver..." + sudo make install + cd "$DEPS_DIR" + echo " ✓ Ceres Solver installed successfully" +else + echo " ✓ Ceres Solver already exists, skipping..." +fi + +# Install rviz_2d_overlay_plugins +echo "rviz_2d_overlay_plugins..." +if [ ! -d "rviz_2d_overlay_plugins" ]; then + echo " Cloning rviz_2d_overlay_plugins repository..." + git clone https://github.com/teamspatzenhirn/rviz_2d_overlay_plugins.git + echo " ✓rviz_2d_overlay_plugins downloaded successfully" +else + echo " ✓ rviz_2d_overlay_plugins already exists, skipping..." +fi + +# Install Python packages +echo "Installing Python packages..." +pip3 install --user rerun-sdk +echo " ✓ Rerun SDK installed successfully" + +# Update library cache +echo "Updating library cache..." +sudo ldconfig + +echo "" +echo "=========================================" +echo "✓ All SuperOdometry dependencies installed successfully!" +echo "=========================================" +echo "" +echo "Dependencies installed in: $DEPS_DIR" +echo "" +echo "Please follow instructions to install livox_ros2_driver" +echo "You can now build SuperOdometry using:" +echo " cd ~/ros2_ws" +echo " colcon build --packages-select super_odometry" +echo "" + diff --git a/readme.md b/readme.md index de33ea5..2a8a083 100644 --- a/readme.md +++ b/readme.md @@ -71,7 +71,7 @@ ## 📦 3. Installation > Highly recommend to check our docker files to run our code with step 4 and step 5. -### System Requirements +### System Requirements for Installation on Host machine. - ROS2 Humble - PCL @@ -80,46 +80,43 @@ - [GTSAM (4.0.2 or 4.1)](https://github.com/borglab/gtsam) - [Ceres Solver (2.1.0)](http://ceres-solver.org/) -### Dependencies Installation +### Workspace Structure -#### Install Sophus +First create your own local ROS2 workspace and clone `SuperOdom`: ```bash -git clone http://github.com/strasdat/Sophus.git -cd Sophus && git checkout 97e7161 -mkdir build && cd build -cmake .. -DBUILD_TESTS=OFF -make -j8 && sudo make install +mkdir -p ~/ros2_ws/src +cd ~/ros2_ws/src +git clone https://github.com/superxslam/SuperOdom ``` +Clone respective repos and ensure they follow this exact structure under `ros2_ws/src`: -#### Install GTSAM -```bash -git clone https://github.com/borglab/gtsam.git -cd gtsam && git checkout 4abef92 -mkdir build && cd build -cmake \ - -DGTSAM_USE_SYSTEM_EIGEN=ON \ - -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \ - .. -make -j6 && sudo make install ``` - -#### Install Ceres -```bash -git clone https://github.com/ceres-solver/ceres-solver.git -cd ceres-solver -git checkout f68321e7de8929fbcdb95dd42877531e64f72f66 -mkdir build -cd build -cmake .. -make -j8 # Use number of cores you have, e.g., -j8 for 8 cores -sudo make install +ros2_ws/src +├── SuperOdom +├── livox_ros_driver2 ``` +> **Important**: Maintain this exact structure within `ros_ws/src` + +### Dependencies Installation + +We provide a bash script which will setup the project on your host system. -#### Install Rerun +`SuperOdom`: ```bash -pip install rerun-sdk +mkdir -p ~/ros2_ws/src +cd ~/ros2_ws/src +git clone https://github.com/superxslam/SuperOdom +cd SuperOdom +sudo chmod +x install_deps.sh && ./install_deps.sh + ``` +This will install all the required dependecies for the project except livox_ros_driver2. Please follow the instructions for installing Livox related dependencies here: +- [Livox-ROS-driver2](https://github.com/Livox-SDK/livox_ros_driver2) + + +Additionally we also provide dockerized environment for our project. Follow the next steps for the same. + ## 🐳 4. Docker Setup ### Prerequisites @@ -132,28 +129,6 @@ cd ros2_humble_docker docker build -t superodom-ros2:latest . ``` -### Workspace Structure - -First create your own local ROS2 workspace and clone `SuperOdom`: -```bash -mkdir -p ~/ros2_ws/src -cd ~/ros2_ws/src -git clone https://github.com/superxslam/SuperOdom -``` -Clone respective repos and ensure they follow this exact structure under `ros2_ws/src`: -``` -ros2_ws/src -├── SuperOdom -├── livox_ros_driver2 -└── rviz_2d_overlay_plugins -``` -You can clone `livox_ros_driver2` and `rviz_2d_overlay_plugins` using the following link: - -- [Livox-ROS-driver2](https://github.com/Livox-SDK/livox_ros_driver2) -- [ROS2-jsk-plugin](https://github.com/teamspatzenhirn/rviz_2d_overlay_plugins) - -> **Important**: Maintain this exact structure within `ros_ws/src` - ### Docker Container Setup ```bash # Allow Docker GUI access