Common ROS Package Commands in ROS Noetic

2020-01-07-143952

Locate the Package on Your Computer

Here are some common ROS package commands.

rospack find [name of package]

For example, 

rospack find noetic_basics_part_1
6-locate-packageJPG

Note that you can type only the first letter or two of the name of the package and press the Tab button on your keyboard, and the system will automatically complete the rest of command. For example, type:

rospack find noe

Then press the Tab button, and press Enter.

You should see the directory where the noetic_basics_part_1 package is located.

Determine What Packages a Package Depends on

To determine the dependencies of a package, you need to make sure you have rosdep installed. You only need to do this one time after you’ve installed ROS Noetic.

First we need to install rosdep.

sudo apt-get install python3-rosdep

Now initialize rosdep.

sudo rosdep init

Now update rosdep.

rosdep update

That’s it. You only need to do that process once for your ROS Noetic installation.

7-thats-itJPG

Now, let’s find out the dependencies of our newly built noetic_basics_part_1 package.

rospack depends [name of package]

For example, to find the dependencies of the noetic_basics_part_1 package, we write:

rospack depends noetic_basics_part_1
8-dependencies-of-packageJPG

You can see our package depends on a lot of stuff. It depends on std_msgs and roscpp, as we expected. However, there are other packages which are added as dependencies by default.