ROS-kinetic installation

1. Configure Ubuntu repositories, "restricted," "universe," and "multiverse." Select Server from China. 2. Set the Ubuntu the sources.list (installation source)

2. Set the Ubuntu the sources.list (selected from a)

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' 

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'

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

3. Set the Key

sudo apt-key adv –keyserver hkp://ha.pool.sks-keyservers.net:80 –recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116 

4. Update

sudo apt-get update 

5. Install ROS kinetic full version

sudo apt-get install ros-kinetic-desktop-full 
安装完可以查看可用的package: 
apt-cache search ros-kinetic 

6. initialization rosdep, before using the ROS must be initialized rosdep

sudo rosdep init 
rosdep update 

7. Configure the Environment

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

8. The building package mounted reliance

sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
  1. ROS successful test installation
  1. Open Termial, enter the following command to initialize ROS environment:
    roscore
  2. Open a new Termial, enter the following command to bring up a small window turtle:
    rosrun turtlesim turtlesim_node
  3. Opens new termial, enter the following command can be controlled by moving the direction key little turtle in the termial:
    rosrun turtlesim turtle_teleop_key
  4. Open a new Termial, enter the following command to bring up a new window to view ROS node information:
    rosrun rqt_graph rqt_graph

Error Handling:
Error 1:
The first step 5 error message:

The following packages have unmet dependencies:
 ros-* -desktop-full : Depends: ros-* -mobile but it is not going to be installed
                          Depends: ros-* -perception but it is not going to be installed
                          Depends: ros-* -simulators but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Option 1:
(1) Delete ros-latest.list

sudo rm -rf /etc/apt/sources.list.d/ros-latest.list

(2) modify the source:

sudo gedit /etc/apt/sources.list

Then read as follows:

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

Then you can install from scratch.

Scenario 2:

sudo apt-get install aptitude
sudo aptitude install ros-kinetic-desktop-full
点击Y

Error two:
CAN not download default Sources List
the following error in the run sudo rosdep init is likely to occur:
ERROR: can not download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list. D / 20 is default.list-
Website On May BE Down.

There may not be installed due to the certificate store, you can try the following command:
sudo RM /etc/ros/rosdep/sources.list.d/20-default.list
sudo APT-GET-install CA Certificates

Reference from:
https://blog.csdn.net/stefan1992/article/details/79358960
https://www.cnblogs.com/liu-fa/p/5779206.html
http://www.liuxiao.org/2017 / 12 / ros- mounted on -ros-kinetic system -ubuntu-16-04- /
https://blog.csdn.net/xiangxianghehe/article/details/78483799
https://blog.csdn.net/qq_41628231/ article / details / 81046548

Guess you like

Origin blog.csdn.net/qq_28467367/article/details/92782411