ros 安装及基础学习

来源:互联网 发布:java开发微信的步骤 编辑:程序博客网 时间:2024/06/05 02:12

安装网址(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文件:
      1. Don’t forget to make the node executable:
        • chmod +x scripts/add_two_ints_client.py
      2. In your catkin workspace
        • cd ~/catkin_ws
        • catkin_make
      3. 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 universedeb 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 multiversedeb 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 partnerdeb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricteddeb http://mirrors.aliyun.com/ubuntu/ xenial-security universe# deb-src http://security.ubuntu.com/ubuntu xenial-security universedeb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
原创粉丝点击