Ros File System Introduction--2

Source: Internet
Author: User

Ros Primary Core Tutorial--ros File system Introduction (original blog, reprint please indicate the source-Zhou Xuewei)

1.ROS File System Introduction:

  1.1. Preparatory work: We will use the ros-tutorials package In this tutorial, please install it first:

Replace <distro> with the version you installed (such as Jade, Indigo, hydro, groovy, fuerte, etc.)

[Email protected]: sudo apt-get Install Ros-<distro>-ros-tutorials

1.2. Quick understanding of File system concepts

    • Packages: A software package that is an organizational unit of ROS application code, each of which can contain libraries, executables, scripts, or other manually created items.

    • Manifest (package.xml): A manifest is a description of the ' package ' related information that defines the dependencies between package-related meta-information, including versions, maintainers, and license agreements.

1.3. File System Tools

program code is distributed among many Ros packages and is cumbersome to navigate using command-line tools such as LS and cd, so Ros provides specialized command tools to simplify these operations.

A. Using Rospack

Rospack allows you to obtain information about the package. In this tutorial, we only refer to the find parameter option in rospack , which returns the path information for the package.

Usage:

# Rospack Find [package name] Example: [email protected]: Rospack find roscpp should output:    Your_install_path/share/roscpp If you are installing Ros on an Ubuntu Linux operating system via APT, you should be able to see exactly: /opt/ros/groovy/share/ Roscpp

B. Using ROSCD

  OSCD is part of the Rosbash command set, which allows you to switch (CD) working directories directly into a package or package set.

usage: # ROSCD [Local package name [/ subdirectory]] Example:[email protected]: ROSCD roscpp in order to verify that we have switched to the Roscpp package directory, Now we can use the Unix command pwd to output the current working directory:[email protected]: pwd You should see:    your_install_path/share/roscpp

You can see that the your_install_path/share/roscpp is the same as the path name previously obtained using Rospack find . Note that, like other tools in Ros, ROSCD can only switch to packages that are already contained in the ROS_PACKAGE_PATH environment variable, and to see the paths contained in the Ros_package_path can be entered:

[email protected]: echo $ROS _package_path

Your ROS_PACKAGE_PATH environment variable should contain the paths where the Ros packages are stored, separated by colons between each path. A typical Ros_package_path environment variable is as follows:

Similar to other PATH environment variables, you can add additional paths in Ros_package_path, each separated by a colon ': '.

You can also switch to a sub-directory of a package or package set using ROSCD.

Execution:[email protected]: roscd roscpp/cmake[email protected]: pwd should see:    Your_install_ PATH/share/roscpp/cmake

C. Using ROSCD Log

  Use ROSCD log to switch to the Ros save journal file directory. It should be noted that if you have not performed any ROS programs, the system will say that the directory does not exist.

If you have already run a ROS program, you can try:

[email protected]: ROSCD Log

D. Using Rosls

Rosls is part of the Rosbash command set, which allows you to execute the LS command (listing directories) directly by the name of the package instead of the absolute path.

  

usage: # ROSLS [Local package name [/ subdirectory]] Example:[email protected]: Rosls roscpp_tutorials should output:    cmake  Package.xml  SRV

E.tab Auto-Complete input

It becomes tedious to enter a full package name. In the previous example Roscpp tutorials was a fairly long name, fortunately, some Ros tools support tab AutoComplete or the ability to enter hints.

[email protected]: roscd roscpp_tut<<< Now, press the TAB key >>>

 F. Review

You may have noticed how the ROS command tool is named:

    • Rospack = Ros + Pack (age)
    • ROSCD = Ros + CD
    • Rosls = ros + ls

This naming method is used in many ROS command tools.

Now that you have a look at the file system structure of ROS, let's start creating a workspace. (Take a look at the next blog post)

Ros File System Introduction--2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.