ubuntu16.4安装ROS

参考了许多大神的教程,本人这样安装上了
古月居ROS入门21讲:https://www.bilibili.com/video/av59458869 第5节,注意用的是18,本人用的16
ROS安装:http://wiki.ros.org/melodic/Installation/Ubuntu -->记得用中国的镜像

hhc@hhc-Aspire-A715-71G:~$ sudo sh -c ‘. /etc/lsb-release && echo “deb http://mirrors.ustc.edu.cn/ros/ubuntu/ lsb_release -cs main” > /etc/apt/sources.list.d/ros-latest.list’
[sudo] password for hhc:
hhc@hhc-Aspire-A715-71G:~$ sudo apt-key adv --keyserver ‘hkp://keyserver.ubuntu.com:80’ --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
Executing: /tmp/tmp.rUw4VVlAAA/gpg.1.sh --keyserver
hkp://keyserver.ubuntu.com:80
–recv-key
C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
gpg: requesting key AB17C654 from hkp server keyserver.ubuntu.com
gpg: key AB17C654: public key “Open Robotics [email protected]” imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
hhc@hhc-Aspire-A715-71G:~$ sudo apt install
Reading package lists… Done
Building dependency tree
Reading state information… Done
0 upgraded, 0 newly installed, 0 to remove and 300 not upgraded.

加了两源 网址https://blog.csdn.net/CoralZr/article/details/80283619
#deb http://packages.ros.org/ros/ubuntu xenial main
deb http://packages.ros.org/ros-shadow-fixed/ubuntu xenial main

开始不知道16.04的适配版本是kinetic,按照教程安装的是:sudo apt-get install ros-jade-desktop-full。导致一直找不到软件包。
hhc@hhc-Aspire-A715-71G:~$ sudo apt update
hhc@hhc-Aspire-A715-71G:~$ sudo apt-get install ros-kinetic-desktop-full
[sudo] password for hhc:
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:

53 upgraded, 865 newly installed, 0 to remove and 247 not upgraded.
Need to get 494 MB/541 MB of archives.
After this operation, 2,507 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) …
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) …
Rebuilding /usr/share/applications/bamf-2.index…
Processing triggers for shared-mime-info (1.5-2ubuntu0.2) …
Processing triggers for fontconfig (2.11.94-0ubuntu1.1) …
Processing triggers for initramfs-tools (0.122ubuntu8.14) …
update-initramfs: Generating /boot/initrd.img-4.15.0-74-generic
W: Possible missing firmware /lib/firmware/i915/kbl_guc_ver9_14.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_ver8_7.bin for module i915
Processing triggers for libc-bin (2.23-0ubuntu11) …
Processing triggers for systemd (229-4ubuntu21.16) …
Processing triggers for ureadahead (0.100.0-19) …

hhc@hhc-Aspire-A715-71G:~$ sudo rosdep init
[sudo] password for hhc:
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.
网站进不去 --> 换源
hhc@hhc-Aspire-A715-71G:~$ rosdep update
ERROR: no sources directory exists on the system meaning rosdep has not yet been initialized.

Please initialize your rosdep with

sudo rosdep init

hhc@hhc-Aspire-A715-71G:~$ sudo apt-get remove ros-*
Y
hhc@hhc-Aspire-A715-71G:~$ sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ D I S T R I B C O D E N A M E m a i n " > / e t c / a p t / s o u r c e s . l i s t . d / r o s − l a t e s t . l i s t ′ h h c @ h h c − A s p i r e − A 715 − 71 G :   DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list' hhc@hhc-Aspire-A715-71G:~ DISTRIBCODENAMEmain">/etc/apt/sources.list.d/roslatest.listhhc@hhcAspireA71571G:  sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 0xB01FA116
Executing: /tmp/tmp.Eb7yEsIi9t/gpg.1.sh --keyserver
hkp://pool.sks-keyservers.net
–recv-key
0xB01FA116
gpg: requesting key B01FA116 from hkp server pool.sks-keyservers.net
gpg: key B01FA116: public key “Totally Legit Signing Key [email protected]” imported
gpg: key B01FA116: public key “ROS Builder [email protected]” imported
gpg: Total number processed: 2
gpg: imported: 2 (RSA: 1)
hhc@hhc-Aspire-A715-71G:~$ sudo apt-get update

Reading package lists… Done
W: The repository ‘http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial Release’ does not have a Release file.
N: Data from such a repository can’t be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu/dists/xenial/main/binary-i386/Packages 403 Forbidden [IP: 91.189.95.83 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
hhc@hhc-Aspire-A715-71G:~$ sudo apt-get install ros-kinetic-desktop-full

hhc@hhc-Aspire-A715-71G:~$ sudo rosdep init
换网试试–换网试试–换网试试–换网试试–换网试试–换网试试–换网试试
hhc@hhc-Aspire-A715-71G:~$ sudo rosdep init
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run

rosdep update

hhc@hhc-Aspire-A715-71G:~$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro “ardent”
Skip end-of-life distro “bouncy”
Skip end-of-life distro “crystal”
Add distro “dashing”
Add distro “eloquent”
Add distro “foxy”
Skip end-of-life distro “groovy”
Skip end-of-life distro “hydro”
Skip end-of-life distro “indigo”
Skip end-of-life distro “jade”
Add distro “kinetic”
Skip end-of-life distro “lunar”
Add distro “melodic”
Add distro “noetic”
updated cache in /home/hhc/.ros/rosdep/sources.cache
hhc@hhc-Aspire-A715-71G:~$ echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc
hhc@hhc-Aspire-A715-71G:~$ gedit .bashrc
在打开文件的最后找到/opt/ros/Kinetic/setup.bash
这几行全部第一个加# 注释掉
eg:
#source /opt/ros/melodic/setup.bash
#source /opt/ros/kinetic/setup.bash
#source /opt/ros/kinetic/setup.bash
#source /opt/ros/kinetic/setup.bash

hhc@hhc-Aspire-A715-71G:~$ echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc
hhc@hhc-Aspire-A715-71G:~$ source ~/.bashrc
hhc@hhc-Aspire-A715-71G:~$ ros 双击tab
rosawesome rosdistro_migrate_to_rep_141 rospack
rosbag rosdistro_migrate_to_rep_143 rosparam
rosboost-cfg rosdistro_reformat rospd
roscat rosed rospython
roscd rosgraph rosrun
rosclean roslaunch rosservice
rosconsole roslaunch-complete rossrv
roscore roslaunch-deps rosstack
roscp roslaunch-logs rostest
roscreate-pkg rosls rostopic
rosd rosmake rosunit
rosdep rosmaster rosversion
rosdep-source rosmsg roswtf
rosdistro_build_cache rosmsg-proto
rosdistro_freeze_source rosnode
hhc@hhc-Aspire-A715-71G:~$ sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
[sudo] password for hhc:
Reading package lists… Done
Building dependency tree
Reading state information… Done
build-essential is already the newest version (12.1ubuntu2).
The following additional packages will be installed:
bzr git git-core git-man liberror-perl libjs-excanvas libserf-1-1 libsvn1
mercurial mercurial-common python-bzrlib python-configobj python-dbus python-gi
python-gpgme python-httplib2 python-keyring python-launchpadlib
python-lazr.restfulclient python-lazr.uri python-oauth python-secretstorage
python-simplejson python-vcstools python-wadllib subversion
Suggested packages:
bzr-doc bzrtools python-bzrlib.tests git-daemon-run | git-daemon-sysvinit
git-doc git-el git-email git-gui gitk gitweb git-arch git-cvs git-mediawiki
git-svn qct kdiff3 | kdiff3-qt | kompare | meld | tkcvs | mgdiff python-mysqldb
python-bzrlib-dbg python-kerberos python-pycurl python-configobj-doc
python-dbus-doc python-dbus-dbg python-gi-cairo python-fs python-gdata
python-kde4 python-keyczar python-testresources python-secretstorage-doc
db5.3-util subversion-tools
The following NEW packages will be installed:
bzr git git-core git-man liberror-perl libjs-excanvas libserf-1-1 libsvn1
mercurial mercurial-common python-bzrlib python-configobj python-dbus python-gi
python-gpgme python-httplib2 python-keyring python-launchpadlib
python-lazr.restfulclient python-lazr.uri python-oauth python-rosinstall
python-rosinstall-generator python-secretstorage python-simplejson
python-vcstools python-wadllib python-wstool subversion
0 upgraded, 29 newly installed, 0 to remove and 88 not upgraded.
Need to get 9,539 kB of archives.
After this operation, 54.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

安装目录: /opt/ros路径下

finish

你可能感兴趣的:(ubuntu16.4安装ROS)