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

Source file of ROS

asked 2015-03-29 20:33:22 -0500

zurish gravatar image

Hi there. I have installed ROS on Mac OS and found there are source files in most packages' src folder. But in Ubuntu, ROS packages reside in opt folder and I can not find source file. What is the difference?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-03-30 02:27:45 -0500

gvdhoorn gravatar image

updated 2015-03-30 02:28:14 -0500

On an OSX installation, you compile all packages yourself, on your local machine. In order to do that, you need the sources, so you download them to your machine as one of the steps in the OSX Installation tutorial.

On Ubuntu (or any platform for which ROS builds binary packages), users typically install the debians (or .deb). These are build by the ROS buildfarm (status here), and apt-get only downloads the .deb archives. Those archives typically only contain the binaries (ie: the results of the compilation steps) and not the sources (the input of the compilation process). That is the main reason you don't find the sources on a ROS Ubuntu installation that didn't do the source install.

It is perfectly possible for the author of the package however to include the sources in a .deb: all he needs to do is add an install rule to his CMakeLists.txt which copies the sources into a directory which will be included in the .deb. Upon installation of the .deb, the user will then also find the sources on his system (probably somewhere under /opt/ros/DISTRO/share/PKG_NAME/).

Installing the sources in that way is not recommended though, as (at least on Debian/Ubuntu) you can get the sources for any .deb using: apt-get source PKG_NAME (no sudo). Note that this requires that you have a correct deb-src .. line in your /etc/apt/sources.list for the relevant repository.

edit flag offensive delete link more


Thank you. Your answer explains.

zurish gravatar image zurish  ( 2015-03-30 12:31:28 -0500 )edit

Question Tools

1 follower


Asked: 2015-03-29 20:33:22 -0500

Seen: 1,337 times

Last updated: Mar 30 '15