diff --git a/docs/source/building.rst b/docs/source/building.rst deleted file mode 100644 index 30017d2c..00000000 --- a/docs/source/building.rst +++ /dev/null @@ -1,110 +0,0 @@ -.. _building: - -====================== -Building -====================== - -1. First-time build -==================== - -Get the sources -------------------- - -Clone the main project git superproject with: - -.. code-block:: bash - - git clone --recurse-submodules https://github.com/MOLAorg/mola.git - -Build dependencies ------------------------ -- A C++17 compiler. Either gcc-7, clang-4 or MSVC 2017 are good. -- CMake >=3.9 -- Mandatory libraries: - - MRPT >= 2.1.0 - - GTSAM >= 4.0.2 -- Optional libraries: - - opencv - - ros1: roscpp, sensor-msgs - ------------------ -Ubuntu (>=18.04) ------------------ - -Install all dependencies in Ubuntu systems with: - -.. code-block:: bash - - # MRPT >2.1.0, for now from this PPA (or build from sources if preferred): - sudo add-apt-repository ppa:joseluisblancoc/mrpt - sudo apt update - sudo apt install libmrpt-dev mrpt-apps - - # GTSAM >=4.0.0, from this PPA, or build it from sources: - sudo add-apt-repository ppa:joseluisblancoc/gtsam-develop - sudo apt update - sudo apt install libgtsam-dev - - # Boost, etc: - sudo apt install libboost-serialization-dev libboost-system-dev \ - libboost-filesystem-dev libboost-thread-dev libboost-program-options-dev \ - libboost-date-time-dev libboost-timer-dev libboost-chrono-dev \ - libboost-regex-dev - - # ROS1 (Optional) - # To install from the official Ubuntu repository (under /usr): - sudo apt install libroscpp-dev libsensor-msgs-dev - # Alternatively, install a particular ROS distribution (under /opt) and - # source the corresponding setup.bash file before invoking cmake: - -Compile ---------------------- -Classic cmake stuff: - -.. code-block:: bash - - mkdir build - cd build - cmake .. - cmake --build . - -.. highlights:: - - For Ubuntu 16.04 (Xenial): Use, instead: `cmake -DMOLA_BUILD_MARCH_NATIVE=OFF ..` - -Run tests ----------------------- -To make sure the system works, you can run unit tests with: - -.. code-block:: bash - - make test - -2. Add MOLA to PATH -====================== - -Add the `build/bin` build subdirectory to the environment variable `PATH` to -ease the invocation of MOLA commands and demos. -For example, if `MOLA_BINARY_DIR` is `$HOME/code/mola`, run the next command to -automatically add its build directory to PATH when opening a console: - -.. code-block:: bash - - echo 'set $PATH=$PATH:$HOME/code/mola/build/bin' >> ~/.bashrc - - -3. Updating sources for rebuilding -==================================== - -Since MOLA is under heavy development, it is expected that cloned repositories -quickly get out of date. - -To get the latest version of all modules, and clone recently added modules, run: - -.. code-block:: bash - - cd MOLA_SOURCE_ROOT_DIR - git pull - git submodule update --init - -then rebuild as usual with `make`, `cmake --build .`, etc. diff --git a/docs/source/conf.py b/docs/source/conf.py index a23efabb..ee2dba3d 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -39,11 +39,17 @@ # ones. extensions = [ 'sphinx.ext.mathjax', - 'sphinx.ext.ifconfig' + 'sphinx.ext.ifconfig', + 'sphinx.ext.mathjax', + 'sphinx_design', + 'sphinx.ext.autosectionlabel', + 'sphinxcontrib.bibtex', ] extensions += ['doxyrest', 'cpplexer'] +bibtex_bibfiles = ['refs.bib'] + # Show build time html_last_updated_fmt = '%H:%M, %b %d, %Y' diff --git a/docs/source/index.rst b/docs/source/index.rst index 4f798216..7bb2785d 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -10,7 +10,7 @@ MOLA :hidden: :caption: Quickstart - building + installing demos .. toctree:: diff --git a/docs/source/installing.rst b/docs/source/installing.rst new file mode 100644 index 00000000..e4ac580f --- /dev/null +++ b/docs/source/installing.rst @@ -0,0 +1,85 @@ +.. _installing: + +====================== +Installing +====================== + +.. contents:: :local: + + +From ROS 2 repositories +------------------------ + +**Recommended**: This is the easiest way to install MOLA. + +In Debian/Ubuntu systems, activate your ROS environment (``setup.bash``) if not done automatically +in your ``~./bashrc`` file, then just run: + +.. code-block:: bash + + sudo apt install ros-$ROS_DISTRO-mola + +Check the `build status table `_ to find out +what MOLA version is available for your ROS distribution. + +Build from sources +---------------------- + +Building tools +~~~~~~~~~~~~~~~~~ +MOLA uses ``colcon`` so you need to `install it first `_. + + +Get the sources +~~~~~~~~~~~~~~~~~ + +Clone the git repositories, including the submodules: + +.. code-block:: bash + + mkdir ~/ros2_mola_ws/src/ + cd ~/ros2_mola_ws/src/ + # Get MRPT2 (until we get the latest version on rosdistro) + git clone https://github.com/MRPT/mrpt.git mrpt2 --recursive + + # Main MOLA modules: + git clone https://github.com/MOLAorg/mola_common.git + git clone https://github.com/MOLAorg/mp2p_icp.git --recursive + git clone https://github.com/MOLAorg/mola.git --recursive + + # MOLA lidar odometry package: + # not published yet! + #git clone https://github.com/MOLAorg/mola_lidar_odometry.git --recursive + +Dependencies +~~~~~~~~~~~~~~~~~ + +Make sure you have all dependencies installed (make sure of having `rosdep already installed `_): + +.. code-block:: bash + + cd ~/ros2_mola_ws/src/ + rosdep install --from-paths src --ignore-src -r -y + + +Build and test +~~~~~~~~~~~~~~~~~ + +Now, compile as usual with colcon: + +.. code-block:: bash + + cd ~/ros2_mola_ws/src/ + colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release + + +Next, activate the new environment and check if all new modules are visible: + +.. code-block:: bash + + cd ~/ros2_mola_ws/src/ + . install/setup.bash + + # For example, let's launch the mm map viewer: + mm-viewer +