Preparation content
1. You need to install VMware yourself
2. Install the ubantu operating system in the virtual machine (all instructions in this article are applied on ubantu 18.04.6)
The personal test is effective, three times.
Configuring software and updates for ubuntu
Configure software and updates for ubuntu to allow installation of unauthenticated software.
First, open the "software and updates" dialog box, which can be searched in the Ubuntu search button.
After opening, configure according to the following figure (make sure "restricted", "universal," and "multiverse." are checked)
By the way, I'll change the download option to Alibaba cloud server
Add ROS software source
Installation source of China University of science and technology
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
Add key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
After the addition is successful, it will show that it has been imported, and repeated addition will not affect it.
Update software source
sudo apt update
Start installing ROS
sudo apt install ros-melodic-desktop-full
This process may take a long time. In the middle, you can ctrl+c to terminate the installation. Subsequent re operation will continue the installation where it was last installed.
After installation, you can enter it again
An error occurred. The connection timed out. The installation failed
The update and install commands can be called repeatedly until successful.
sudo apt install ros-melodic-desktop-full
He will show that ROS melody desktop full is the latest version to prove that the installation is complete.
Initialize rosdep
sudo rosdep init
If it appears, execute it directly
rosdep update
- If an error occurs: 1: command not found
sudo apt install python-rosdep2
Or enter
sudo apt install python3-rosdep2
I usually enter the former.
- If: error: cannot download default sources list from: HTTPS: / / raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.listwebsite may be down
implement
sudo gedit /etc/hosts
Add at the end of the hosts file
199.232.28.133 raw.githubusercontent.com
Exit after saving. If you are not sure, you can re open it to determine whether the modification is successful.
- If: error: default sources list file already exists: / etc / ROS / rosdep / sources.list.d/20-default.listplease delete if you wish to re initialize
sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
Update rosdep
rosdep update
Because you need to connect to the Internet for data update, this step is easy to fail. Anyway, I repeatedly run this step for two or three days and failed to install it successfully. Some people say that switching mobile hotspot can be solved, but I didn't succeed.
Personally, I suggest you find a ladder airport to solve it.
The connection here will teach you how to implement web proxy and command-line proxy on the virtual machine after implementing the proxy on the window machine.
VMware virtual machine host agent
But again, the protocol used in the above article is socks, but I tested that my proxy is not socks. I made all four options again. Mine is HTTP. I will write another record in this regard to prevent me from forgetting when I use it again.
Setting environment variables
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
Make environment variables effective
source ~/.bashrc
Install rosinstall
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
Normally, you can start running ROS at this step. Try it first;
roscore
If there is an error or other problem, you can try to run it again
sudo apt install ros-noetic-desktop-full
Finally, run roscore again
Start the little turtle simulator and keyboard input node
When roscore runs successfully, open a terminal and run the turtle simulator node:
rosrun turtlesim turtlesim_node
Open a terminal and open the keyboard control node to run the following instructions
rosrun turtlesim turtle_teleop_key
You should be able to run successfully at this time.
Please refer to the following links in this article. Thank you here:
Muyu ★– introduce in detail how to install ROS system in Ubuntu 20.04
Zhao Xu left ROS course connection
If you have any questions about installing ros, please leave a message.