Skip to content

Latest commit

 

History

History
117 lines (85 loc) · 4.98 KB

MAC.md

File metadata and controls

117 lines (85 loc) · 4.98 KB

Install pyslam under macOS

The following procedure has been tested under Sequoia 15.1.1 and Xcode 16.1.

Install steps

Please, follow these install steps:

  1. First you need to install homebrew and Xcode CLT (check the section below)
  2. Download this repo:
    $ git clone --recursive https://github.com/luigifreda/pyslam.git 
    $ cd pyslam 
  3. Change your default shell type to bash:
    $ chsh -s /bin/bash 
    (if you want to set zsh back then run: $ chsh -s /bin/zsh)
  4. Launch the macOS install script
    $ ./install_all_venv.sh

NOTE: The above install procedure (step 4) installs a virtual python environment pyslam in your system. That virtual environment can be easily activated by using the command:

$ . pyenv-activate.sh 

(do not forget the dot! without '/' ! ) You can find further details about python virtual environments here.

Usage

  • To test the basic visual odometry run
    $ . pyenv-activate.sh   # Activate pyslam environment. This is just needed once in a new terminal.
    $ ./main_vo.py
  • To test the full SLAM system run
    $ . pyenv-activate.sh   # Activate pyslam environment. This is just needed once in a new terminal.
    $ ./main_slam.py

Notes about macOS

Install homebrew

From https://brew.sh/, run the following command:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

You may also need to install gcc by using XCode Command Line Tools. Run

$ xcode-select --install

Known issues

First run of the scripts

On my machine, I've noticed that, the first time one of main scripts is run, it takes a while before it actually starts.

Issues found with OpenCV and pyenv

When you launch one of the scripts above, you get a warning:

objc[6169]: Class CaptureDelegate is implemented in both /Users/luigi/.python/venvs/pyslam/lib/python3.7/site-packages/cv2/cv2.cpython-37m-darwin.so (0x11923d590) and /usr/local/opt/opencv/lib/libopencv_videoio.4.3.dylib (0x13021d0c8). One of the two will be used. Which one is undefined.

This is an open issue which needs to be solved. In a few words, this is an "interference" between the OpenCV libs of the installed virtual python environment and the OpenCV libs installed by homebrew.

Issues found with boost serialization

On my mac, boost deserialization is very slow. On the other hand, under linux, it is very fast.