ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

The best way to install a ROS package, if you just want to use it, is to install it with apt-get under Ubuntu.

sudo apt-get install ros-kinetic-PACKAGE

e.g.

sudo apt-get install ros-kinetic-slam-gmapping

To see, whether the package you are looking for is availabe through apt, just type:

apt-cache search ros-kinetic

If there is no apt package available, you typically have to go to the src directory in your catkin workspace, clone the git repository, that contains your package and run catkin_make from the root of your workspace. You can get the URL to clone the repo from GitHub.

Step-by-step:

  1. Go to the ROS-wiki page of your package and click on the GitHub link under the "Source:" bullet point.
  2. On GitHub click on the green "Clone or Download" button and copy the URL from the text field.
  3. Open a terminal and got to the src directory of your catkin workspace.
  4. Type:
git clone https://github.com/PATH-TO-YOUR-PACKAGE.git
cd ..
catkin_make

Hopefully, the package will build without errors. Sometimes you will have to install some additional packages or libraries via apt first which your package depends on.

Afterwards, you should probably source your setup.bash:

source PATH-TO-YOUR-WORKSPACE/devel/setup.bash

Now you are ready to run the nodes in your package, by using rosrun or roslaunch. But the usage of each package varies individually. Hopefully you will find the specific documentation on the ROS wiki.

A good example is IMHO the Pepperl&Fuchs R2000 driver.

The best way to install a ROS package, if you just want to use it, is to install it with apt-get under Ubuntu.

sudo apt-get install ros-kinetic-PACKAGE

e.g.

sudo apt-get install ros-kinetic-slam-gmapping

To see, whether the package you are looking for is availabe through apt, just type:

apt-cache search ros-kinetic

If there is no apt package available, you typically have to go to the src directory in your catkin workspace, clone the git repository, that contains your package and run catkin_make from the root of your workspace. You can get the URL to clone the repo from GitHub.

Step-by-step:

  1. Go to the ROS-wiki page of your package and click on the GitHub link under the "Source:" bullet point.
  2. On GitHub click on the green "Clone or Download" button and copy the URL from the text field.
  3. Open a terminal and got to the src directory of your catkin workspace.
  4. Type:
# Clone the repository
git clone https://github.com/PATH-TO-YOUR-PACKAGE.git
cd ..

# Install dependencies via rosdep. Be sure to use the correct
# 'rosdistro' string, that fits to your ROS version.
rosdep update
rosdep install --from-paths src/ --ignore-src --rosdistro kinetic

# Run catkin
catkin_make

Hopefully, the package will build without errors. Sometimes you will have to install some additional packages or libraries via apt first which your package depends on.

Afterwards, you should probably source your setup.bash:

source PATH-TO-YOUR-WORKSPACE/devel/setup.bash

Now you are ready to run the nodes in your package, by using rosrun or roslaunch. But the usage of each package varies individually. Hopefully you will find the specific documentation on the ROS wiki.

A good example is IMHO the Pepperl&Fuchs R2000 driver.