[ROS Tutorial] The whole process of installing ROS and possible problems encountered


1.Configure Software & Updates

  • Just configure it as shown in the picture

Insert image description here

2. Add software source

  • If you do not add the software source, you cannot locate the software package.

Tsinghuayuan

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

3.Set key

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  • If you do not set the key, you will have the following problems when sudo apt update

Insert image description here

4. Update and install

4.1 Update

sudo apt update

4.2 Installation (ros-noetic-desktop-full)

  • If you use apt to install, almost 100% of the time the following problems will occur

Insert image description here

  • So we use aptitude to install

4.2.1 Install aptitude

sudo apt install aptitude

4.2.2 Install ROS software package

sudo aptitude install ros-noetic-desktop-full
  • Next, a column of uninstalled items will be listed, as shown below.

Insert image description here

  • Remember, you must choose no at this time
  • Then, aptitude will give the second solution. There are still many uninstalled ones. Continue to select no.

Insert image description here

  • For the third time, aptitude gave a satisfactory solution, but only one was not installed. At this time, you can choose yes.

Insert image description here

5. Add environment variables

echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

6. Install build dependencies

sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential

7.Initialization and update

7.1 Initialization

sudo rosdep init
  • Since overseas resources are blocked, initialization will almost 100% fail.

Insert image description here

7.1.1 Currently feasible solution: Relocate resources

  1. Modify line 68 of /usr/lib/python3/dist-packages/rosdistro/__init__.py
  2. Modify line 64 of /usr/lib/python3/dist-packages/rosdep2/sources_list.py
  3. Modify line 36 of /usr/lib/python3/dist-packages/rosdep2/rep3
  • Modification method: raw.githubusercontent.com/ros/rosdistro/masterReplace with gitee.com/zhao-xuzuo/rosdistro/raw/master, as shown below

Insert image description here
Insert image description here

7.1.2 Results

sudo rosdep init
  • It is successful if the following result occurs

Insert image description here

7.2 Update

rosdep update
  • result

Insert image description here

Guess you like

Origin blog.csdn.net/qq_50791664/article/details/129897017