您的位置:首页 > 其它

ros 安装及基础学习

2017-12-03 20:29 316 查看

安装网址(ubuntu 16.04):

http://wiki.ros.org/kinetic/Installation/Ubuntu

安装问题:
* Could not resolve 'cn.archive.ubuntu.com'
解决:
* sudo gedit /etc/hosts
* 末尾添加:
91.189.88.149    archive.ubuntu.com
91.189.88,149    security.ubuntu.com
202.118.1.64 cn.archive.ubuntu.com
* /etc/init.d/networking restart
* snapd is not configured yet
解决:
* 先到 /etc/apt/sources.list更新sources.list,执行sources.list问题的所有命令
* https://www.ubuntuupdates.org/package/core/xenial/main/proposed/snapd * 网页中: apt重新下载安装  即可
* 如果再次安装 ros kinetic出错,那你需要执行以下命令: http://blog.csdn.net/heray1990/article/details/47803541 链接中第19行说要执行:sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old/,但是我发现/var/lib/dpkg/info/是个空文件夹,所以没执行19-21的命令,执行运行安装ros kinetic的命令,完美安装完毕

* sources.list问题:
 解决:
* 更新命令:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo gedit /etc/apt/sources.list , 然后复制文末souces.lists内容到sources.lists内
sudo apt update
* 在文末


ros官方网站:

http://www.ros.org/ http://wiki.ros.org/cn


学习博客:

由浅到深理解ROSP: http://www.cnblogs.com/zjiaxing/p/5541733.html


基础学习:

运行catkin_make命令一定要在workspace文件夹下;

创建完workspace文件夹后,就有必要将此目录添加到ROS_PACKAGE_PATH

echo “export ROS_PACKAGE_PATH=~/dev/catkin_ws:${ROS_PACKAGE_PATH}” >> ~/.bashrc

~/.bashrc

修改CMakeLists:

查看package.xml, 确保它包含一下两条语句:

message_generation

message_runtime

注意,在构建的时候,我们只需要”message_generation”。然而,在运行的时候,我们只需要”message_runtime”。

Do not just add this line to your CMakeLists.txt, modify the existing line

find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation)

catkin_package(



CATKIN_DEPENDS message_runtime …

…)

add_message_files(

FILES

Num.msg

)

add_service_files(

FILES

AddTwoInts.srv

)

generate_messages(

DEPENDENCIES

std_msgs

)

In your catkin workspace

$ catkin_make

运行py文件:

Don’t forget to make the node executable:

chmod +x scripts/add_two_ints_client.py

In your catkin workspace

cd ~/catkin_ws

catkin_make

cd ~/catkin_ws

. devel/setup.bash

rosrun package node

sources.list 文件:

# deb cdrom:[Ubuntu 16.04.3 LTS _Xenial Xerus_ - Release amd64 (20170801)]/ xenial main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ubuntu ros