Install Dependecies and Download the Packages
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
sudo apt-get install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake
sudo rosdep init
rosdep update
rosdep init 会报错。原因是网址被墙了 解决的办法是
sudo vi /etc/hosts
151.101.84.133 raw.githubusercontent.com //最后一行添加
sudo rosdep init
rosdep update
When that’s done let’s create a dedicated catkin workspace for building ROS and move to that directory.
mkdir ~/ros_catkin_ws
cd ~/ros_catkin_ws
rosinstall_generator desktop --rosdistro melodic --deps --wet-only --tar > melodic-desktop-wet.rosinstall
wstool init -j8 src melodic-desktop-wet.rosinstall
If wstool init fails or is interrupted, you can resume the download by running:
wstool update -j4 -t src
Fix the Issues
mkdir -p ~/ros_catkin_ws/external_src
cd ~/ros_catkin_ws/external_src
wget http://sourceforge.net/projects/assimp/files/assimp-3.1/assimp-3.1.1_no_test_models.zip/download -O assimp-3.1.1_no_test_models.zip
unzip assimp-3.1.1_no_test_models.zip
cd assimp-3.1.1
cmake .
make
sudo make install
cd ..
rosdep install --from-paths src --ignore-src --rosdistro melodic -y
Let’s also install OGRE for rviz
sudo apt-get install libogre-1.9-dev
Build and Source the Installation
sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic -j2
echo "source /opt/ros/melodic/setup.zsh" >> ~/.zshrc