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

use an awesome package? - Getting started

asked 2017-03-24 08:21:12 -0500

cerebraldad gravatar image

updated 2022-02-13 17:05:17 -0500

lucasw gravatar image

Can anyone direct me to a tutorial on how to use a package i find in a search.

Say i find a package or library using the ros wiki - how do I use it or implement it?

Thanks for your patience, I'm just getting started.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
4

answered 2017-03-24 10:19:18 -0500

updated 2017-05-09 13:06:30 -0500

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.

edit flag offensive delete link more

Comments

This is a good answer (especially the "install using apt-get first", +1 for that), but could be better if you'd add a step between cd .. and catkin_make where you use rosdep to install a pkg's dependencies.

See #q252478 for how that would work.

gvdhoorn gravatar image gvdhoorn  ( 2017-03-24 10:49:45 -0500 )edit

Thanks for the comment. To be honest, I haven't used rosdep so far. It seems to be a convenient tool. I added the instructions to my answer above.

Andre Volk gravatar image Andre Volk  ( 2017-03-24 13:00:02 -0500 )edit
-1

answered 2017-03-24 10:28:49 -0500

you need to download the folder with the files and make it:

$ cd pepperl_fuchs_r2000

$ mv CMakeLists.txt.NO_ROS_LIB_ONLY CMakeLists.txt

$ mkdir build

$ cd build

$ cmake ..

$ make

other way is to do:

$sudo apt-get install ros-kinetic-<your package="">

but the pakage must exist in the repo-source!

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2017-03-24 08:21:12 -0500

Seen: 614 times

Last updated: May 09 '17