概述
5. INSTALLING THE ROS-BY-EXAMPLE CODE
Before installing the ROS By Example code itself, it will save some time if we install most of the additional ROS packages we will need later. (Instructions will also be provided for installing individual packages as needed throughout the book.) Simply copy and paste the following command (without the $ sign) into a terminal window to install the Debian packages we will need. The character at the end of each line makes the entire block appear like a single line to Linux when doing a copy-and-paste:
$ sudo apt-get install ros-hydro-turtlebot-*
ros-hydro-openni-camera ros-hydro-openni-launch
ros-hydro-openni-tracker ros-hydro-laser-*
ros-hydro-audio-common ros-hydro-joystick-drivers
ros-hydro-orocos-kdl ros-hydro-python-orocos-kdl
ros-hydro-dynamixel-motor-* ros-hydro-pocketsphinx
gstreamer0.10-pocketsphinx python-setuptools python-rosinstall
ros-hydro-opencv2 ros-hydro-vision-opencv
ros-hydro-depthimage-to-laserscan ros-hydro-arbotix-*
git subversion mercurial
5.2 Cloning the Hydro ros-by-example Repository
the Hydro version now uses catkin. If this is your first time installing the ros-by-example code, you can skip the first two sections and go straight to section 5.2.3.
重要提示:如果您已经安装了ros-by-example的ROS lectric,Fuerte或Groovy的早期版本,请按照下面的相应说明,用hydro取代或覆盖您之前安装版本。需要注意的是的ros-by-example代码,所有三个以前的版本中使用的rosbuild系统,而hydro使用catkin。如果这是你第一次安装的ROS按示例代码,你可以跳过前两个部分,直接进入第5.2.3节。
The ros-by-example stack for ROS Electric and Fuerte is distributed as an SVN repository called rbx_vol_1 on Google Code. Either remove the this old stack from your ~/ros_workspace directory or, if you've made modifications you don't want to lose, move the old rbx_vol_1 directory out of your ROS_PACKAGE_PATH before
installing the new repository.
The ros-by-example stack for ROS Electric and Fuerte是名为rbx_vol_1的SVN库分布在谷歌代码中。要么从您的〜/ ros_workspace目录中删除这个旧堆栈,或者,如果你已经做了你不想失去的修改,在安装新仓库之前将旧RBX_vol_1目录从你的ROS_PACKAGE_PATH路径中移除。
The ros-by-example packages for ROS Groovy and Hydro are distributed as a Git repository called rbx1 on GitHub. The default branch is called groovy-devel and it is a rosbuild version of the repository used with the Groovy version of the book. For ROS Hydro, you need to use the hydro-devel branch of the repository which as been converted to the newer catkin build system. This means you also need to install the code in your personal ~/catkin_ws/src directory rather than ~/ros_workspace.
The ros-by-example packages for ROS Groovy and Hydro分布在GitHub上名为rbx1的Git库。默认的分支为groovy-devel,它是Groovy的版本书中使用的rosbuild版本库。对于ROS hydro,你需要使用hydro-devel软件包分支,这个软件包已经转换为新的catkin构建系统。这意味着你还需要在你的个人〜/ catkin_ws/ src目录中安装代码,而不是〜/ ros_workspace。
5.2.3 Cloning the rbx1 repository for Hydro
To clone the rbx1 repository for Hydro, follow these steps:
$ cd ~/catkin_ws/src
$ git clone https://github.com/pirobot/rbx1.git
$ cd rbx1
$ git checkout hydro-devel
$ cd ~/catkin_ws
$ catkin_make
$ source ~/catkin_ws/devel/setup.bash
NOTE 1: The fourth command above (git checkout hydro-devel) is critical—this is where you select the Hydro branch of the repository. (By default, the clone operation checks out the Groovy branch for the benefit of those still using Groovy.)
注1:上述(git checkout hydro-devel)第四条命令是至关重要的,这是你选择的hydro包分支所在地。 (默认情况下,克隆操作检出Groovy的分支那些仍然使用Groovy。)
NOTE 2: The last line above should be added to the end of your ~/.bashrc file if you haven't done so already. This will ensure that your catkin packages are added to your ROS_PACKAGE_PATH whenever you open a new terminal. If you will be running a mix of rosbuild and catkin packages, refer back to section 4.7 in Chapter 4 on how to set up your ~/.bashrc file so that both types of packages can be found.
your local copy of the repository by using the following commands:
如果ROS通过示例代码在之后更新,您可以使用以下命令存储库的本地副本与更新的代码合并:
$ cd ~/catkin_ws/src/rbx1
$ git pull
$ cd ~/catkin_ws
$ catkin_make
$ source devel/setup.bash
Staying Up-To-Date: If you'd like to receive notifications of updates to both the book and the accompanying code, please join the ros-by-example Google Group.
All of the ROS By Example packages begin with the letters rbx1. To list the packages, move into the parent of the rbx1 meta-package and use the Linux ls command:
$ roscd rbx1
$ cd ..
$ ls -F
which should result in the following listing:
rbx1/
rbx1_apps/
rbx1_bringup/
rbx1_description/
rbx1_dynamixels/
rbx1_experimental/
rbx1_nav/
rbx1_speech/
rbx1_vision/
README.md
Throughout the book we will be using the roscd command to move from one package to another. For example, to move into the rbx1_speech package, you would use the command:
$ roscd rbx1_speech
Note that you can run this command from any directory and ROS will find the package. IMPORTANT: If you are using two computers to control or monitor your robot, such as a laptop on the robot together with a second computer on your desktop, be sure to
clone and build the Hydro branch of the rbx1 repository on both machines.
5.3 About the Code Listings in this Book
As with most programming code, there is usually more than one way to solve a problem. The sample programs described here are no exception and if you can think of a better way to accomplish the same goal, great. The code included in the ROS By Example
repository is meant only as a guide and certainly does not represent the best or only way to accomplish a given task using ROS.
最后
以上就是受伤小笼包为你收集整理的ROS By Example_hydro_volume1_CN_5的全部内容,希望文章能够帮你解决ROS By Example_hydro_volume1_CN_5所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复