Skip to content

Installation

Laurens Oostwegel edited this page Oct 6, 2021 · 15 revisions

Page is under construction

Blender

Blender should be installed before g2opy, because Blender uses it's own python version. Do not install blender from snap, as that gives problems later on! Find the latest long-term release on http://www.blender.org and download. Unpack in the desired location.

  • Setup environment variables for blender and python:

this step is important! If the blender python version is not 3.9, replace all 'python3.9' with your python version.

Open ~/.bash_aliases

vi ~/.bash_aliases

put following aliases in there:

alias blender="path/to/blender/blender"
alias python3.9="path/to/blender/2.93/python/bin"

save & close with ":wq"

activate aliases by typing:

source ~/.bash_aliases
  • Install numpy, cv2, ruamel.yaml, tqdm
  • libpython3.X-dev is needed to build a shared library using a C extension file
sudo apt update
python3.9 -m ensurepip
python3.9 -m pip install numpy opencv-contrib-python ruamel.yaml tqdm
sudo apt install libpython3.9-dev

Stereo-PTAM

sudo apt update
sudo apt install cmake libeigen3-dev 
sudo apt install libsuitesparse-dev qtdeclarative5-dev qt5-qmake libqglviewer-dev-qt5
sudo apt install build-essential
  • Installing g2opy

First, clone g2opy from github:

git clone https://github.com/uoip/g2opy.git

I had the same issue as: https://github.com/uoip/g2opy/issues/48, where some Eigen3 library referenced something incorrectly. So, before continuing, replace in g2opy/python/core/eigen_types.h:

	.def("x", (double (Eigen::Quaterniond::*) () const) &Eigen::Quaterniond::x)
        .def("y", (double (Eigen::Quaterniond::*) () const) &Eigen::Quaterniond::y)
        .def("z", (double (Eigen::Quaterniond::*) () const) &Eigen::Quaterniond::z)
        .def("w", (double (Eigen::Quaterniond::*) () const) &Eigen::Quaterniond::w)

To:

	.def("x", [](const Eigen::Quaterniond& q) { return q.x(); })
        .def("y", [](const Eigen::Quaterniond& q) { return q.y(); })
        .def("z", [](const Eigen::Quaterniond& q) { return q.z(); })
        .def("w", [](const Eigen::Quaterniond& q) { return q.w(); })

Continue to build the library in the power shell. Make sure you bind the correct python version:

cd g2opy
mkdir build
cd build
cmake -DPBIND11_PYTHON_VERSION=3.9 ../
make -j8
cd ..
python3.9 setup.py install
  • Install Point Cloud Visualizer Option 1: Install full version from the Blender Market (www.blendermarket.com). Option 2: Install 1.0 version from GitHub:
    • Clone PCV and add space_view3d_point_cloud_visualizer.py to the add-ons (see images).
git clone https://github.com/uhlik/bpy.git
  • Install blender_stereo_ptam
    • Download ZIP of this github repo.
    • Open Blender, go to preferences and install the ZIP as an add-on.

Try out stereo_ptam library

  • Download KITTI dataset (grayscale odometry is least amount of data ~20gb): http://www.cvlibs.net/datasets/kitti/eval_odometry.php. However, if grayscale instead of colour is used, the sequences/00/image_00 & sequences/00/image_01 directories sould be renamed to sequences/00/image_02 & sequences/00/image_03.
  • Unzip blender_stereo_ptam
  • Navigate to blender_stereo_ptam/stereo_ptam dir and try out:
cd blender_stereo_ptam/stereo_ptam
python3.9 sptam.py --dataset kitti --path path/to/your/KITTI_odometry_dataset/sequences/00 --no-viz

If there are no errors, the library works!

Clone this wiki locally