ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
See the answer to #q208963, but to make it slightly more generic (so this is an example set of commands for a 'regular' ROS package, not one with special requirements and / or system dependencies that have to be built from sources):
# make sure you have sourced the correct setup.bash file for your ROS distribution already
# go to workspace src space
cd /path/to/your/catkin_ws/src
# acquire a copy of the sources of the package that you want to build.
# For a package hosted on github, you'd do something like (where
# $organisation and $package obviously depend on what it is that you
# want to build):
git clone https://github.com/$organisation/$package.git
# change to the workspace base directory (this has to be the working directory
# in a minute anyway when building, and we can shorten the 'rosdep' command a bit)
cd /path/to/your/catkin_ws
# we need to make sure you have all dependencies installed.
# once in a while, update our local database
rosdep update
# then check (and install) for any missing dependencies
# NOTE: we ask rosdep to check for ROS Indigo here, if you are using another ROS
# distribution, substitute that there (ie: for Kinetic, use kinetic)
rosdep install --from-paths src/ --ignore-src --rosdistro indigo
# now build
catkin_make
If compilation was successful, you should now have a build
and devel
directory next to the src
directory, and after sourcing /path/to/your/catkin_ws/devel/setup.bash
you should now be able to use the package you just built from sources.
Note: just cloning a package from somewhere is not enough. Packages most likely depend on other packages and / or system libraries to be present, and we use rosdep
to install those for us. We do depend on the author(s) of the package that you are building to have properly declared their dependencies. If they haven't done so, catkin_make
will tell you about that (in the form of "Can't find .." etc errors).
2 | No.2 Revision |
See the answer to #q208963, but to make it slightly more generic (so this is an example set of commands for a 'regular' ROS package, not one with special requirements and / or system dependencies that have to be built from sources):
# make sure you have sourced the correct setup.bash file for your ROS distribution already
# go to workspace src space
cd /path/to/your/catkin_ws/src
# acquire a copy of the sources of the package that you want to build.
# For a package hosted on github, you'd do something like (where
# $organisation and $package obviously depend on what it is that you
# want to build):
git clone https://github.com/$organisation/$package.git
# change to the workspace base directory (this has to be the working directory
# in a minute anyway when building, and we can shorten the 'rosdep' command a bit)
cd /path/to/your/catkin_ws
# we need to make sure you have all dependencies installed.
# once in a while, update our local database
rosdep update
# then check (and install) for any missing dependencies
# NOTE: we ask rosdep to check for ROS Indigo here, if you are using another ROS
# distribution, substitute that there (ie: for Kinetic, use kinetic)
'kinetic', without the quotes)
rosdep install --from-paths src/ --ignore-src --rosdistro indigo
# now build
catkin_make
If compilation was successful, you should now have a build
and devel
directory next to the src
directory, and after sourcing /path/to/your/catkin_ws/devel/setup.bash
you should now be able to use the package you just built from sources.
Note: just cloning a package from somewhere is not enough. Packages most likely depend on other packages and / or system libraries to be present, and we use rosdep
to install those for us. We do depend on the author(s) of the package that you are building to have properly declared their dependencies. If they haven't done so, catkin_make
will tell you about that (in the form of "Can't find .." etc errors).