|
| 1 | +.. _installation: |
| 2 | + |
| 3 | +Installation |
| 4 | +================================================== |
| 5 | + |
| 6 | +CUDA & cuDNN |
| 7 | +----------------------- |
| 8 | + |
| 9 | +The tested versions are CUDA10.2, 11.6 |
| 10 | + |
| 11 | +`CUDA <https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ubuntu-installation>`_ |
| 12 | +`cuDNN <https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#install-linux>`_ |
| 13 | + |
| 14 | + |
| 15 | +Check how to install :ref:`here<media/cuda-installation.md>`. |
| 16 | + |
| 17 | +Python dependencies |
| 18 | +------------------------------- |
| 19 | + |
| 20 | +You will need |
| 21 | + |
| 22 | +* `cupy <https://cupy.chainer.org/>`_ |
| 23 | +* `numpy <https://www.numpy.org/>`_ |
| 24 | +* `scipy <https://www.scipy.org/>`_ |
| 25 | +* `shapely==1.7.1 <https://github.com/Toblerity/Shapely>`_ |
| 26 | + |
| 27 | +For traversability filter, either of |
| 28 | + |
| 29 | +* `torch <https://pytorch.org/>`_ |
| 30 | +* `chainer <https://chainer.org/>`_ |
| 31 | + |
| 32 | +Optionally, OpenCV for inpainting filter. |
| 33 | + |
| 34 | +* `opencv-python <https://opencv.org/>`_ |
| 35 | + |
| 36 | +Install `numpy`, `scipy`, `shapely`, `opencv-python` with the following command. |
| 37 | + |
| 38 | +```bash |
| 39 | +pip3 install -r requirements.txt |
| 40 | +``` |
| 41 | + |
| 42 | +Cupy |
| 43 | +------------------------------- |
| 44 | + |
| 45 | + |
| 46 | +cupy can be installed with specific CUDA versions. (On jetson, only "from source" i.e. `pip install cupy` could work) |
| 47 | +> For CUDA 10.2 |
| 48 | +> pip install cupy-cuda102 |
| 49 | +> |
| 50 | +> For CUDA 11.0 |
| 51 | +> pip install cupy-cuda110 |
| 52 | +> |
| 53 | +> For CUDA 11.1 |
| 54 | +> pip install cupy-cuda111 |
| 55 | +> |
| 56 | +> For CUDA 11.2 |
| 57 | +> pip install cupy-cuda112 |
| 58 | +> |
| 59 | +> For CUDA 11.3 |
| 60 | +> pip install cupy-cuda113 |
| 61 | +> |
| 62 | +> For CUDA 11.4 |
| 63 | +> pip install cupy-cuda114 |
| 64 | +> |
| 65 | +> For CUDA 11.5 |
| 66 | +> pip install cupy-cuda115 |
| 67 | +> |
| 68 | +> For CUDA 11.6 |
| 69 | +> pip install cupy-cuda116 |
| 70 | +> |
| 71 | +> (Install CuPy from source) |
| 72 | +> % pip install cupy |
| 73 | + |
| 74 | +Traversability filter |
| 75 | +------------------------------- |
| 76 | + |
| 77 | +You can choose either pytorch, or chainer to run the CNN based traversability filter. |
| 78 | +Install by following the official documents. |
| 79 | + |
| 80 | +* `torch <https://pytorch.org/>`_ |
| 81 | +* `chainer <https://chainer.org/>`_ |
| 82 | + |
| 83 | +Pytorch uses ~2GB more GPU memory than Chainer, but runs a bit faster. |
| 84 | +Use parameter `use_chainer` to select which backend to use. |
| 85 | + |
| 86 | +ROS package dependencies |
| 87 | +------------------------------- |
| 88 | + |
| 89 | +* `pybind11_catkin <https://github.com/ipab-slmc/pybind11_catkin>`_ |
| 90 | +* `grid_map <https://github.com/ANYbotics/grid_map>`_ |
| 91 | + |
| 92 | +```bash |
| 93 | +sudo apt install ros-noetic-pybind11-catkin |
| 94 | +sudo apt install ros-noetic-grid-map-core ros-noetic-grid-map-msgs |
| 95 | +``` |
| 96 | + |
| 97 | +On Jetson |
| 98 | +================================================== |
| 99 | + |
| 100 | +CUDA CuDNN |
| 101 | +------------------------------- |
| 102 | + |
| 103 | +`CUDA` and `cuDNN` can be installed via apt. It comes with nvidia-jetpack. The tested version is jetpack 4.5 with L4T 32.5.0. |
| 104 | + |
| 105 | +python dependencies |
| 106 | +------------------------------- |
| 107 | + |
| 108 | +On jetson, you need the version for its CPU arch: |
| 109 | + |
| 110 | +```bash |
| 111 | +wget https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl -O torch-1.8.0-cp36-cp36m-linux_aarch64.whl |
| 112 | +pip3 install Cython |
| 113 | +pip3 install numpy==1.19.5 torch-1.8.0-cp36-cp36m-linux_aarch64.whl |
| 114 | +``` |
| 115 | + |
| 116 | +Also, you need to install cupy with |
| 117 | + |
| 118 | +```bash |
| 119 | +pip3 install cupy |
| 120 | +``` |
| 121 | + |
| 122 | +This builds the packages from source so it would take time. |
| 123 | + |
| 124 | +ROS dependencies |
| 125 | +------------------------------- |
| 126 | + |
| 127 | +* `pybind11_catkin <https://github.com/ipab-slmc/pybind11_catkin>`_ |
| 128 | +* `grid_map <https://github.com/ANYbotics/grid_map>`_ |
| 129 | + |
| 130 | +```bash |
| 131 | +sudo apt install ros-melodic-pybind11-catkin |
| 132 | +sudo apt install ros-melodic-grid-map-core ros-melodic-grid-map-msgs |
| 133 | +``` |
| 134 | + |
| 135 | +Also, on jetson you need fortran (should already be installed). |
| 136 | + |
| 137 | +```bash |
| 138 | +sudo apt install gfortran |
| 139 | +``` |
| 140 | + |
| 141 | +If the Jetson is set up with Jetpack 4.5 with ROS Melodic the following package is additionally required: |
| 142 | + |
| 143 | +```bash |
| 144 | +git clone [email protected]:ros/filters.git -b noetic-devel |
| 145 | +``` |
| 146 | + |
| 147 | +### Plane segmentation dependencies |
| 148 | + |
| 149 | +#### OpenCV |
| 150 | + |
| 151 | +```bash |
| 152 | +sudo apt install libopencv-dev |
| 153 | +``` |
| 154 | + |
| 155 | +#### Eigen |
| 156 | + |
| 157 | +```bash |
| 158 | +sudo apt install libeigen3-dev |
| 159 | +``` |
| 160 | + |
| 161 | +#### CGAL |
| 162 | + |
| 163 | +CGAL5 is required. It will be automatically downloaded and installed into the catkin workspace by the cgal5_catkin package. Make sure you |
| 164 | +have the third-party libaries installed on you machine: |
| 165 | + |
| 166 | +```bash |
| 167 | +sudo apt install libgmp-dev |
| 168 | +sudo apt install libmpfr-dev |
| 169 | +sudo apt install libboost-all-dev |
| 170 | +``` |
| 171 | + |
0 commit comments