Install ROS Noetic on Ubuntu 20.04

This article refers to the installation tutorial on the ros official website http://wiki.ros.org/

1. Preparation

1. Add ROS software source

Open the software and update, select the first four download options.
Be sure to check them all, if you don’t continue the installation, there will be dependency problems,
Insert picture description here
and then execute the following command to add the software source

sudo sh -c 'echo "deb https://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
2. Add public key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
3. Update the index
sudo apt-get update

Second, install ROS

1. Install ROS

It is recommended to install the full version of the desktop

sudo apt install ros-noetic-desktop-full
2. Set environment variables
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
3. Initialize rosdep

Before using many ROS tools, rosdep needs to be initialized. rosdep is necessary to run certain core components in ROS, first install rosdep

sudo apt install python3-rosdep

Then initialize

sudo rosdep init
rosdep update

If rosdep init appears [ERROR: cannot download default sources list from:...
Website may be down.]
rosdep update has a timeout problem
. Both of the above problems can be solved by modifying the host, but the update problem is still The network must be reliable.
Reference blog: https://blog.csdn.net/weixin_44543463/article/details/113875658

4. Install other tools and dependencies
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential

Three, test

Open the terminal, type roscore, run ros
and then open a new terminal, type:, rosrun turtlesim turtlesim_nodeyou can see that the simulation interface of the little tortoise has been opened. Then open a new terminal and enter the command:, rosrun turtlesim turtle_teleop_keyin this key terminal, you can control the little turtle to move in the interface through the arrow keys on the keyboard
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44543463/article/details/113862391