From 8c4d6f3bf85d95b2a658acc35f3717db6ab59322 Mon Sep 17 00:00:00 2001 From: Kaiyu Zheng Date: Thu, 24 Feb 2022 10:45:58 -0500 Subject: [PATCH] en route to building open3d (but decided to do it in docker instead) --- shared/install_open3d.sh | 40 ++++++++++++++++++++++++++++++++++ spot/docs/Functions/Mapping.md | 4 ++++ tools.sh | 10 +++++++++ 3 files changed, 54 insertions(+) create mode 100644 shared/install_open3d.sh diff --git a/shared/install_open3d.sh b/shared/install_open3d.sh new file mode 100644 index 0000000..4dfc788 --- /dev/null +++ b/shared/install_open3d.sh @@ -0,0 +1,40 @@ +# Install Open3D from source +# https://github.com/isl-org/Open3D +# Note: +# - you should activate the desired robot python virtualenv (e.g. spot) +# before you run this script. +# Run this script by source setup_movo.bash +if [[ ! $PWD = *robotdev ]]; then + echo "You must be in the root directory of the robotdev repository." + return 1 +else + . "./tools.sh" +fi +repo_root=$PWD + +if not in_venv; then + echo "You must activate the robot-specific virtualenv." + return 1 + +OPEN3D_INSTALL_PATH=$repo_root/thirdparty/Open3D/install + +cd thirdparty +git clone https://github.com/isl-org/Open3D +cd Open3D + +# Install dependencies +util/install_deps_ubuntu.sh + +# build +mkdir build +cd build +cmake .. -DCMAKE_INSTALL_PREFIX=$OPEN3D_INSTALL_PATH +make -j$(nproc) +make install + +# install python package +pip install cmake # from open3d docs https://github.com/isl-org/Open3D/blob/master/docs/arm.rst +make install-pip-package +make python-package +make pip-package +python -c "import open3d" diff --git a/spot/docs/Functions/Mapping.md b/spot/docs/Functions/Mapping.md index 8ec80ca..0a2fe75 100644 --- a/spot/docs/Functions/Mapping.md +++ b/spot/docs/Functions/Mapping.md @@ -27,3 +27,7 @@ There does not seem to be [active support for ROS](https://github.com/UZ-SLAMLab and the authors have basically left the repository hanging. **I think to build complicated software like this, you need to use docker. Docker is the way to for "one effort and release stress forever".** + +The question is: do you want to use docker for ORB_SLAM3 or RTABMap? + +**THE ANSWER IS: NEITHER. We will use Open3D.** diff --git a/tools.sh b/tools.sh index 4d0ed82..e4d34fc 100644 --- a/tools.sh +++ b/tools.sh @@ -242,3 +242,13 @@ function ping_success { false fi } + +function in_venv { + # returns true if you are in virtualenv. + if [[ "$VIRTUAL_ENV" != "" ]] + then + true && return + else + false + fi +}