How to Download a ROS Package from GitHub

2020-01-07-152032

Let’s say you see a ROS package on GitHub that you’d like to bring into your catkin workspace.

For example, I would like to download the rviz_plugin_tutorials package available on this page on GitHub.


First, you need to download the files to your computer.

Go to this page and download all the files. I like to download it to my Desktop.

Click the green “Clone” button to download a ZIP file of the repository.

Open up the zip file, and go to the rviz_plugin_tutorials folder. The rviz_plugin_tutorials package is the package we need.

Right-click on that folder, and click “Extract”.

Move that folder to your catkin_ws/src folder. I just dragged the folder to my catkin_ws/src folder on my computer, just as I would drag and drop any folder on a Mac or Windows computer.

Open up a terminal window, and type:

cd ~/catkin_ws/src
dir

You should see the rviz_plugin_tutorials package (i.e. a folder) in there.

Now you need to run this command so that your ROS environment knows about the rviz_plugin_tutorials package we just added. Open a new terminal window, and type:

cd ~/catkin_ws/
catkin_make

Open a new terminal window, and type:

rospack find rviz_plugin_tutorials

You should see the path of your new ROS package.

50-path-of-new-ros-packageJPG

To see if our package depends on other packages, type these commands. Ignore any error messages you see in the terminal:

rosdep update
rosdep check rviz_plugin_tutorials

You should see a message that says “All system dependencies have been satisfied.”

51-all-dependencies-satisfiedJPG