This Python package provides Python bindings for Octomap.
It is a submodule of smglib, the open-source Python framework associated with our drone research in the Cyber-Physical Systems group at the University of Oxford.
Note: Please read the top-level README for smglib before following these instructions.
-
Open the terminal.
-
Build and install Octomap.
i. Clone our fork of Octomap into
C:/octomap
:git clone git@github.com:sgolodetz/octomap.git C:/octomap
ii. Change to the
C:/octomap
directory.iii. Check out the
heightcolouring
branch.iv. Configure
Octomap
using CMake, withC:/octomap/build
as the build directory. Set relevant variables as per the box below. Then build (but don't install)Octomap
using Visual Studio to check that it builds cleanly.BUILD_DYNAMICETD3D_SUBPROJECT=no BUILD_OCTOVIS_SUBPROJECT=no BUILD_TESTING=no CMAKE_INSTALL_PREFIX=C:/octomap/install
v. Now go back to CMake, enable
BUILD_OCTOVIS_SUBPROJECT
and reconfigure. This will result in an error saying that libQGLViewer cannot be found or generated. Unfortunately, this must be built using Qt Creator, so you need to download Qt. The version we used was 5.14.2, the installer for which can be found here. You then need to run Qt Creator and buildC:/octomap/octovis/src/extern/QGLViewer/QGLViewer.pro
.vi. If you go back to CMake and reconfigure, QGLViewer should now be found. However, the Qt5 directories and library paths will be detected wrongly (we want the ones from our downloaded version of Qt, not the ones in the Anaconda library). They should thus be modified accordingly (assuming that you installed Qt in
C:/Qt
):QT5CORE_LIBRARY_DEBUG=C:/Qt/5.14.2/5.14.2/msvc2017_64/lib/Qt5Cored.lib QT5CORE_LIBRARY_RELEASE=C:/Qt/5.14.2/5.14.2/msvc2017_64/lib/Qt5Core.lib Qt5Core_DIR=C:/Qt/5.14.2/5.14.2/msvc2017_64/lib/cmake/Qt5Core Qt5Gui_DIR=C:/Qt/5.14.2/5.14.2/msvc2017_64/lib/cmake/Qt5Gui Qt5OpenGL_DIR=C:/Qt/5.14.2/5.14.2/msvc2017_64/lib/cmake/Qt5OpenGL Qt5Widgets_DIR=C:/Qt/5.14.2/5.14.2/msvc2017_64/lib/cmake/Qt5Widgets Qt5Xml_DIR=C:/Qt/5.14.2/5.14.2/msvc2017_64/lib/cmake/Qt5Xml
vii. Reconfigure once again, and then try regenerating the Visual Studio project.
viii. If that works, try building and installing
Octomap
inDebug
mode. If that works, rename theC:/octomap/install
directory toinstall-debug
. Then try building and installingOctomap
inRelease
mode. If that works, rename theC:/octomap/install
directoryinstall-release
. (In both cases, use Rebuild All when doing the build to avoid issues with stale files.)ix. To run
C:/octomap/install-release/bin/octovis.exe
, set theQT_PLUGIN_PATH
environment variable (at the system level) toC:\Qt\5.14.2\5.14.2\msvc2017_64\plugins
, and copy the QGLViewer and Qt5 DLLs across to theC:/octomap/install-release/bin
directory. Note that settingQT_PLUGIN_PATH
in this way will temporarily prevent Qt Creator from running. To fix this, you can simply remove theQT_PLUGIN_PATH
environment variable again (or rename it). -
Set (at a system level, not in the terminal) the following environment variables:
SMGLIB_OCTOMAP_DIR=C:/octomap SMGLIB_Qt5_DIR=C:/Qt/5.14.2/5.14.2/msvc2017_64/lib/cmake/Qt5
-
Re-open the terminal, and change to the
<root>/smg-pyoctomap
directory. -
Check out the
master
branch. -
Activate the Conda environment, e.g.
conda activate smglib
. -
Run
pip install -e .
to install the package.
If you build on this framework for your research, please cite the following paper:
@inproceedings{Golodetz2022TR,
author = {Stuart Golodetz and Madhu Vankadari* and Aluna Everitt* and Sangyun Shin* and Andrew Markham and Niki Trigoni},
title = {{Real-Time Hybrid Mapping of Populated Indoor Scenes using a Low-Cost Monocular UAV}},
booktitle = {IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
month = {October},
year = {2022}
}
This work was supported by Amazon Web Services via the Oxford-Singapore Human-Machine Collaboration Programme, and by UKRI as part of the ACE-OPS grant. We would also like to thank Graham Taylor for the use of the Wytham Flight Lab, Philip Torr for the use of an Asus ZenFone AR, and Tommaso Cavallari for implementing TangoCapture.