Show EOL distros:
NOT SUPPORTED
Installing on Ubuntu from source
Install from source requires that you download and compile the source code on your own.
Contents
Prerequisites
Install bootstrap dependencies (Ubuntu):
$ sudo apt-get install python-rosdep python-rosinstall-generator python-wstool build-essential
If you have trouble installing the packages in the command above, make sure you have added the packages.ros.org debian repository to your apt source lists as described starting here: groovy/Installation/Ubuntu#groovy.2BAC8-Installation.2BAC8-Sources.Setup_your_sources.list
Next ensure rosdep has been initialized:
$ sudo rosdep init $ rosdep update
Installation
Start by building the core ROS packages.
Building the catkin Packages
ROS is in the process of converting to a new build system, catkin, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.
Create a catkin Workspace
In order to build the core packages, you will need a catkin workspace. Create one now:
$ mkdir ~/ros_catkin_ws $ cd ~/ros_catkin_ws
Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:
Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception
$ rosinstall_generator desktop-full --rosdistro groovy --deps --wet-only > groovy-desktop-full-wet.rosinstall $ wstool init -j8 src groovy-desktop-full-wet.rosinstall
Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries
$ rosinstall_generator desktop --rosdistro groovy --deps --wet-only > groovy-desktop-wet.rosinstall $ wstool init -j8 src groovy-desktop-wet.rosinstall
ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.
$ rosinstall_generator ros_comm --rosdistro groovy --deps --wet-only > groovy-ros_comm-wet.rosinstall $ wstool init -j8 src groovy-ros_comm-wet.rosinstall
This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.
In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:
$ rosinstall_generator robot --rosdistro groovy --deps --wet-only > groovy-robot-wet.rosinstall $ wstool init -j8 src groovy-robot-wet.rosinstall
Resolving Dependencies
Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:
$ rosdep install --from-paths src --ignore-src --rosdistro groovy -y
This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.
The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.
After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.
Building the catkin Workspace
Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.
Invoke catkin_make_isolated:
$ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).
Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install some where else then you can do this by adding the --install-space /opt/ros/groovy argument to your catkin_make_isolated call.
For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/groovy just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.
Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.
Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.
Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Lets do that now before building the rest of ROS:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Build the rosbuild Packages
Now that you have the catkin ROS packages built and sourced, you can build any of the packages and stacks using the rosbuild build system.
Create a rosbuild workspace
Note: You do not need to do this part of the installation for the ROS-Comm: (Bare Bones) variant as it does not contain any rosbuild packages in it.
Like with building catkin packages, it is convenient to build rosbuild packages in a workspace. Lets create a ROS workspace using rosws:
$ mkdir ~/ros_ws $ cd ~/ros_ws $ rosws init . ~/ros_catkin_ws/install_isolated
Note that we are pointing the ROS workspace to the catkin install location that we built in the previous step. This allows the ROS workspace to always source the catkin install location environment before you use the ROS workspace.
Download ROS Stacks
Now we need to get the dry (rosbuild) components of the variant you chose before. Use the corresponding command for your variant to do this:
Desktop-Full Install: 2d/3d simulators, navigation, robot models and several tutorial stacks
$ rosinstall_generator desktop-full --rosdistro groovy --deps --dry-only > groovy-desktop-full-dry.rosinstall $ rosws merge groovy-desktop-full-dry.rosinstall
Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries
$ rosinstall_generator desktop --rosdistro groovy --deps --dry-only > groovy-desktop-dry.rosinstall $ rosws merge groovy-desktop-dry.rosinstall
Now this just setups your rosbuild workspace, you need to tell rosws to fetch the packages still:
$ rosws update -j8
Build the ROS Stack
Once this is done fetching the stack you can source this workspace and then build the stack:
$ source ~/ros_ws/setup.bash $ rosmake -a
Installing from source
Install from source requires that you download and compile the source code on your own. ROS Hydro ONLY supports Precise, Quantal, and Raring. Other platforms are possible to use but are not expected to work out of the box. Target platforms are defined in REP 3
Contents
Prerequisites
Installing bootstrap dependencies
These tools are used to facilitate the download and management of ROS packages and their dependencies, among other things.
Ubuntu:
$ sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential
If you have trouble installing the packages in the command above, make sure you have added the packages.ros.org debian repository to your apt source lists as described starting here: hydro/Installation/Ubuntu#hydro.2BAC8-Installation.2BAC8-Sources.Setup_your_sources.list
Fedora:
$ sudo yum install python-rosdep python-rosinstall_generator python-wstool python-rosinstall @buildsys-build
Some packages used in ROS are not currently available in the Fedora RPM repositories. Most of the other packages are available in RPM Fusion. See RPM Fusion Command Line Setup.
Any packages not available in RPM Fusion are staged in the SDSM&T ROS RPM staging repository, which is available from csc.mcs.sdsmt.edu.
Generic (pip):
- If you are using a non-Debian system you need to make sure that you have all build tools (compiler, CMake, etc.) installed. You can install all ROS Python tools via PIP:
$ sudo pip install -U rosdep rosinstall_generator wstool rosinstall
Initializing rosdep
$ sudo rosdep init $ rosdep update
Installation
Start by building the core ROS packages.
Building the catkin Packages
ROS is in the process of converting to a new build system, catkin, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.
Create a catkin Workspace
In order to build the core packages, you will need a catkin workspace. Create one now:
$ mkdir ~/ros_catkin_ws $ cd ~/ros_catkin_ws
Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:
Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception
$ rosinstall_generator desktop_full --rosdistro hydro --deps --wet-only --tar > hydro-desktop-full-wet.rosinstall $ wstool init -j8 src hydro-desktop-full-wet.rosinstall
Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries
$ rosinstall_generator desktop --rosdistro hydro --deps --wet-only --tar > hydro-desktop-wet.rosinstall $ wstool init -j8 src hydro-desktop-wet.rosinstall
ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.
$ rosinstall_generator ros_comm --rosdistro hydro --deps --wet-only --tar > hydro-ros_comm-wet.rosinstall $ wstool init -j8 src hydro-ros_comm-wet.rosinstall
This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.
In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:
$ rosinstall_generator robot --rosdistro hydro --deps --wet-only --tar > hydro-robot-wet.rosinstall $ wstool init -j8 src hydro-robot-wet.rosinstall
If wstool init fails or is interrupted, you can resume the download by running:
wstool update -j 4 -t src
Resolving Dependencies
Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:
$ rosdep install --from-paths src --ignore-src --rosdistro hydro -y
This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.
The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.
After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.
Building the catkin Workspace
Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.
Invoke catkin_make_isolated:
$ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).
Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install some where else then you can do this by adding the --install-space /opt/ros/hydro argument to your catkin_make_isolated call.
For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/hydro just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.
Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.
Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.
Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Lets do that now before building the rest of ROS:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Maintaining a Source Checkout
If we want to keep our source checkout up to date, we will have to periodically update our rosinstall file, download the latest sources, and rebuild our workspace.
Update the workspace
To update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.
$ mv -i hydro-desktop-full-wet.rosinstall hydro-desktop-full-wet.rosinstall.old $ rosinstall_generator desktop_full --rosdistro hydro --deps --wet-only --tar > hydro-desktop-full-wet.rosinstall
Then, compare the new rosinstall file to the old version to see which packages will be updated:
$ diff -u hydro-desktop-full-wet.rosinstall hydro-desktop-full-wet.rosinstall.old
If you're satified with these changes, incorporate the new rosinstall file into the workspace and update your workspace:
$ wstool merge -t src hydro-desktop-full-wet.rosinstall $ wstool update -t src
Rebuild your workspace
Now that the workspace is up to date with the latest sources, rebuild it:
$ ./src/catkin/bin/catkin_make_isolated --install
If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace
Once your workspace has been rebuilt, you should source the setup files again:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Installing from source
Install from source requires that you download and compile the source code on your own. ROS Indigo ONLY supports Saucy and Trusty. Other platforms are possible to use but are not expected to work out of the box. Target platforms are defined in REP 3
Contents
Prerequisites
Installing bootstrap dependencies
These tools are used to facilitate the download and management of ROS packages and their dependencies, among other things.
Ubuntu:
$ sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential
Note: python-rosinstall-generator requires that the ROS debian repository be added. You can skip this by instead using 'sudo pip install rosinstall-generator'
If you have trouble installing the packages in the command above, make sure you have added the packages.ros.org debian repository to your apt source lists as described starting here: indigo/Installation/Ubuntu#Installation.2BAC8-Ubuntu.2BAC8-Sources.Setup_your_sources.list
If apt complains that the python-support package is not installable, make sure that you have the Ubuntu universe repositories enabled in your /etc/apt/sources.list
Fedora:
$ sudo yum install python-rosdep python-rosinstall_generator python-wstool python-rosinstall @buildsys-build
Some packages used in ROS are not currently available in the Fedora RPM repositories. Most of the other packages are available in RPM Fusion. See RPM Fusion Command Line Setup.
Any packages not available in RPM Fusion are staged in the SDSM&T ROS RPM staging repository, which is available from csc.mcs.sdsmt.edu.
Generic (pip):
- If you are using a non-Debian system you need to make sure that you have all build tools (compiler, CMake, etc.) installed. You can install all ROS Python tools via PIP:
$ sudo pip install -U rosdep rosinstall_generator wstool rosinstall
If there are errors with this or the rosdep step below, your system's version of pip may be out-of-date. Use your system's package management to update it, or use it to update itself:$ sudo pip install --upgrade setuptools
Note that on many platforms such as OSX you may want to install the above packages and use ROS inside a virtualenv so as to make sure not to collide with system dependencies.
Initializing rosdep
$ sudo rosdep init $ rosdep update
Installation
Start by building the core ROS packages.
Building the catkin Packages
ROS is in the process of converting to a new build system, catkin, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.
Create a catkin Workspace
In order to build the core packages, you will need a catkin workspace. Create one now:
$ mkdir ~/ros_catkin_ws $ cd ~/ros_catkin_ws
Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:
Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception
$ rosinstall_generator desktop_full --rosdistro indigo --deps --wet-only --tar > indigo-desktop-full-wet.rosinstall $ wstool init -j8 src indigo-desktop-full-wet.rosinstall
Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries
$ rosinstall_generator desktop --rosdistro indigo --deps --wet-only --tar > indigo-desktop-wet.rosinstall $ wstool init -j8 src indigo-desktop-wet.rosinstall
ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.
$ rosinstall_generator ros_comm --rosdistro indigo --deps --wet-only --tar > indigo-ros_comm-wet.rosinstall $ wstool init -j8 src indigo-ros_comm-wet.rosinstall
This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.
In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:
$ rosinstall_generator robot --rosdistro indigo --deps --wet-only --tar > indigo-robot-wet.rosinstall $ wstool init -j8 src indigo-robot-wet.rosinstall
If wstool init fails or is interrupted, you can resume the download by running:
wstool update -j 4 -t src
Resolving Dependencies
Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:
$ rosdep install --from-paths src --ignore-src --rosdistro indigo -y
This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.
The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.
After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.
If you installed something from source or from pip and don't want rosdep to try to install it for you use the --skip-keys option. For example if you installed the bootstrap tools such as rosdep, rospkg, and rosinstall_generator from source add the arguments --skip-keys python-rosdep --skip-keys python-rospkg --skip-keys python-catkin-pkg
Building the catkin Workspace
Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.
Invoke catkin_make_isolated:
$ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).
Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install some where else then you can do this by adding the --install-space /opt/ros/indigo argument to your catkin_make_isolated call.
For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/indigo just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.
Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.
Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.
Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Let's do that now before building the rest of ROS:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Maintaining a Source Checkout
If we want to keep our source checkout up to date, we will have to periodically update our rosinstall file, download the latest sources, and rebuild our workspace.
Update the workspace
To update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.
$ mv -i indigo-desktop-full-wet.rosinstall indigo-desktop-full-wet.rosinstall.old $ rosinstall_generator desktop_full --rosdistro indigo --deps --wet-only --tar > indigo-desktop-full-wet.rosinstall
Then, compare the new rosinstall file to the old version to see which packages will be updated:
$ diff -u indigo-desktop-full-wet.rosinstall indigo-desktop-full-wet.rosinstall.old
If you're satisfied with these changes, incorporate the new rosinstall file into the workspace and update your workspace:
$ wstool merge -t src indigo-desktop-full-wet.rosinstall $ wstool update -t src
Rebuild your workspace
Now that the workspace is up to date with the latest sources, rebuild it:
$ ./src/catkin/bin/catkin_make_isolated --install
If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace
Once your workspace has been rebuilt, you should source the setup files again:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Installing from source
Install from source requires that you download and compile the source code on your own. ROS Jade supports Trusty, Utopic, and Vivid. Other platforms are possible to use but are not expected to work out of the box. Target platforms are defined in REP 3
Contents
Prerequisites
Installing bootstrap dependencies
Install bootstrap dependencies (Ubuntu):
These tools are used to facilitate the download and management of ROS packages and their dependencies, among other things.
Ubuntu:
$ sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential
If you have trouble installing the packages in the command above, make sure you have added the packages.ros.org debian repository to your apt source lists as described starting here: jade/Installation/Ubuntu#Installation.2BAC8-Ubuntu.2BAC8-Sources.Setup_your_sources.list
If apt complains that the python-support package is not installable, make sure that you have the Ubuntu universe repositories enabled in your /etc/apt/sources.list
Fedora:
$ sudo yum install python-rosdep python-rosinstall_generator python-wstool python-rosinstall @buildsys-build
Some packages used in ROS are not currently available in the Fedora RPM repositories. Most of the other packages are available in RPM Fusion. See RPM Fusion Command Line Setup.
Any packages not available in RPM Fusion are staged in the SDSM&T ROS RPM staging repository, which is available from csc.mcs.sdsmt.edu.
Generic (pip):
- If you are using a non-Debian system you need to make sure that you have all build tools (compiler, CMake, etc.) installed. You can install all ROS Python tools via PIP:
$ sudo pip install -U rosdep rosinstall_generator wstool rosinstall
If there are errors with this or the rosdep step below, your system's version of pip may be out-of-date. Use your system's package management to update it, or use it to update itself:$ sudo pip install --upgrade setuptools
Note that on many platforms such as OSX you may want to install the above packages and use ROS inside a virtualenv so as to make sure not to collide with system dependencies.
Initializing rosdep
$ sudo rosdep init $ rosdep update
Installation
Start by building the core ROS packages.
Building the catkin Packages
ROS is in the process of converting to a new build system, catkin, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.
Create a catkin Workspace
In order to build the core packages, you will need a catkin workspace. Create one now:
$ mkdir ~/ros_catkin_ws $ cd ~/ros_catkin_ws
Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:
Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception
$ rosinstall_generator desktop_full --rosdistro jade --deps --wet-only --tar > jade-desktop-full-wet.rosinstall $ wstool init -j8 src jade-desktop-full-wet.rosinstall
Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries
$ rosinstall_generator desktop --rosdistro jade --deps --wet-only --tar > jade-desktop-wet.rosinstall $ wstool init -j8 src jade-desktop-wet.rosinstall
ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.
$ rosinstall_generator ros_comm --rosdistro jade --deps --wet-only --tar > jade-ros_comm-wet.rosinstall $ wstool init -j8 src jade-ros_comm-wet.rosinstall
This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.
In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:
$ rosinstall_generator robot --rosdistro jade --deps --wet-only --tar > jade-robot-wet.rosinstall $ wstool init -j8 src jade-robot-wet.rosinstall
If wstool init fails or is interrupted, you can resume the download by running:
wstool update -j 4 -t src
Resolving Dependencies
Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:
$ rosdep install --from-paths src --ignore-src --rosdistro jade -y
This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.
The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.
After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.
Building the catkin Workspace
Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.
Invoke catkin_make_isolated:
$ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).
Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install some where else then you can do this by adding the --install-space /opt/ros/jade argument to your catkin_make_isolated call.
For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/jade just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.
Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.
Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.
Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Lets do that now before building the rest of ROS:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Maintaining a Source Checkout
If we want to keep our source checkout up to date, we will have to periodically update our rosinstall file, download the latest sources, and rebuild our workspace.
Update the workspace
To update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.
$ mv -i jade-desktop-full-wet.rosinstall jade-desktop-full-wet.rosinstall.old $ rosinstall_generator desktop_full --rosdistro jade --deps --wet-only --tar > jade-desktop-full-wet.rosinstall
Then, compare the new rosinstall file to the old version to see which packages will be updated:
$ diff -u jade-desktop-full-wet.rosinstall jade-desktop-full-wet.rosinstall.old
If you're satisfied with these changes, incorporate the new rosinstall file into the workspace and update your workspace:
$ wstool merge -t src jade-desktop-full-wet.rosinstall $ wstool update -t src
Rebuild your workspace
Now that the workspace is up to date with the latest sources, rebuild it:
$ ./src/catkin/bin/catkin_make_isolated --install
If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace
Once your workspace has been rebuilt, you should source the setup files again:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Installing from source
Install from source requires that you download and compile the source code on your own. ROS Kinetic supports Ubuntu Wily and Xenial. Other platforms are possible to use but are not expected to work out of the box. Target platforms are defined in REP 3
Contents
Prerequisites
Installing bootstrap dependencies
Install bootstrap dependencies (Ubuntu):
These tools are used to facilitate the download and management of ROS packages and their dependencies, among other things.
Ubuntu or Debian:
$ sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential
If you have trouble installing the packages in the command above, make sure you have added the packages.ros.org debian repository to your apt source lists as described starting here: kinetic/Installation/Ubuntu#Installation.2BAC8-Ubuntu.2BAC8-Sources.Setup_your_sources.list
If apt complains that the python-support package is not installable, make sure that you have the Ubuntu universe repositories enabled in your /etc/apt/sources.list
Fedora:
$ sudo yum install python-rosdep python-rosinstall_generator python-wstool python-rosinstall @buildsys-build
Some packages used in ROS are not currently available in the Fedora RPM repositories. Most of the other packages are available in RPM Fusion. See RPM Fusion Command Line Setup.
Any packages not available in RPM Fusion are staged in the SDSM&T ROS RPM staging repository, which is available from csc.mcs.sdsmt.edu.
Generic (pip):
- If you are using a non-Debian system you need to make sure that you have all build tools (compiler, CMake, etc.) installed. You can install all ROS Python tools via PIP:
$ sudo pip install -U rosdep rosinstall_generator wstool rosinstall
If there are errors with this or the rosdep step below, your system's version of pip may be out-of-date. Use your system's package management to update it, or use it to update itself:$ sudo pip install --upgrade setuptools
Note that on many platforms such as OSX you may want to install the above packages and use ROS inside a virtualenv so as to make sure not to collide with system dependencies.
Initializing rosdep
$ sudo rosdep init $ rosdep update
Installation
Start by building the core ROS packages.
Building the catkin Packages
ROS is in the process of converting to the catkin build system, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.
Create a catkin Workspace
In order to build the core packages, you will need a catkin workspace. Create one now:
$ mkdir ~/ros_catkin_ws $ cd ~/ros_catkin_ws
Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:
Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception
$ rosinstall_generator desktop_full --rosdistro kinetic --deps --wet-only --tar > kinetic-desktop-full-wet.rosinstall $ wstool init -j8 src kinetic-desktop-full-wet.rosinstall
Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries
$ rosinstall_generator desktop --rosdistro kinetic --deps --wet-only --tar > kinetic-desktop-wet.rosinstall $ wstool init -j8 src kinetic-desktop-wet.rosinstall
ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.
$ rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --tar > kinetic-ros_comm-wet.rosinstall $ wstool init -j8 src kinetic-ros_comm-wet.rosinstall
This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.
In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:
$ rosinstall_generator robot --rosdistro kinetic --deps --wet-only --tar > kinetic-robot-wet.rosinstall $ wstool init -j8 src kinetic-robot-wet.rosinstall
If wstool init fails or is interrupted, you can resume the download by running:
wstool update -j 4 -t src
Resolving Dependencies
Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:
$ rosdep install --from-paths src --ignore-src --rosdistro kinetic -y
This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.
The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.
After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.
Building the catkin Workspace
Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.
Invoke catkin_make_isolated:
$ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).
Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install some where else then you can do this by adding the --install-space /opt/ros/kinetic argument to your catkin_make_isolated call.
For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/kinetic just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.
Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.
Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.
Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Lets do that now before building the rest of ROS:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Maintaining a Source Checkout
If we want to keep our source checkout up to date, we will have to periodically update our rosinstall file, download the latest sources, and rebuild our workspace.
Update the workspace
To update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.
$ mv -i kinetic-desktop-full-wet.rosinstall kinetic-desktop-full-wet.rosinstall.old $ rosinstall_generator desktop_full --rosdistro kinetic --deps --wet-only --tar > kinetic-desktop-full-wet.rosinstall
Then, compare the new rosinstall file to the old version to see which packages will be updated:
$ diff -u kinetic-desktop-full-wet.rosinstall kinetic-desktop-full-wet.rosinstall.old
If you're satisfied with these changes, incorporate the new rosinstall file into the workspace and update your workspace:
$ wstool merge -t src kinetic-desktop-full-wet.rosinstall $ wstool update -t src
Rebuild your workspace
Now that the workspace is up to date with the latest sources, rebuild it:
$ ./src/catkin/bin/catkin_make_isolated --install
If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace
Once your workspace has been rebuilt, you should source the setup files again:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Installing from source
Install from source requires that you download and compile the source code on your own. ROS Lunar supports Ubuntu Xenial, Yakkety and Zesty as well as Debian Stretch. Other platforms are possible to use but are not expected to work out of the box. Target platforms are defined in REP 3
Contents
Prerequisites
Installing bootstrap dependencies
Install bootstrap dependencies (Ubuntu):
These tools are used to facilitate the download and management of ROS packages and their dependencies, among other things.
Ubuntu or Debian:
$ sudo apt-get install python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential
If you have trouble installing the packages in the command above, make sure you have added the packages.ros.org debian repository to your apt source lists as described starting here: lunar/Installation/Ubuntu#Installation.2BAC8-Ubuntu.2BAC8-Sources.Setup_your_sources.list
If apt complains that the python-support package is not installable, make sure that you have the Ubuntu universe repositories enabled in your /etc/apt/sources.list
Fedora:
$ sudo yum install python-rosdep python-rosinstall_generator python-wstool python-rosinstall @buildsys-build
Some packages used in ROS are not currently available in the Fedora RPM repositories. Most of the other packages are available in RPM Fusion. See RPM Fusion Command Line Setup.
Any packages not available in RPM Fusion are staged in the SDSM&T ROS RPM staging repository, which is available from csc.mcs.sdsmt.edu.
Generic (pip):
- If you are using a non-Debian system you need to make sure that you have all build tools (compiler, CMake, etc.) installed. You can install all ROS Python tools via PIP:
$ sudo pip install -U rosdep rosinstall_generator wstool rosinstall
If there are errors with this or the rosdep step below, your system's version of pip may be out-of-date. Use your system's package management to update it, or use it to update itself:$ sudo pip install --upgrade setuptools
Note that on many platforms such as OSX you may want to install the above packages and use ROS inside a virtualenv so as to make sure not to collide with system dependencies.
Initializing rosdep
$ sudo rosdep init $ rosdep update
Installation
Start by building the core ROS packages.
Create a catkin Workspace
In order to build the core packages, you will need a catkin workspace. Create one now:
$ mkdir ~/ros_catkin_ws $ cd ~/ros_catkin_ws
Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:
Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception
$ rosinstall_generator desktop_full --rosdistro lunar --deps --tar > lunar-desktop-full.rosinstall $ wstool init -j8 src lunar-desktop-full.rosinstall
Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries
$ rosinstall_generator desktop --rosdistro lunar --deps --tar > lunar-desktop.rosinstall $ wstool init -j8 src lunar-desktop.rosinstall
ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.
$ rosinstall_generator ros_comm --rosdistro lunar --deps --tar > lunar-ros_comm.rosinstall $ wstool init -j8 src lunar-ros_comm.rosinstall
This will add all of the catkin packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.
In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:
$ rosinstall_generator robot --rosdistro lunar --deps --tar > lunar-robot.rosinstall $ wstool init -j8 src lunar-robot.rosinstall
If wstool init fails or is interrupted, you can resume the download by running:
wstool update -j 4 -t src
Resolving Dependencies
Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:
$ rosdep install --from-paths src --ignore-src --rosdistro lunar -y
This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.
The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.
After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.
Building the catkin Workspace
Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you may choose to use catkin/commands/catkin_make which only works with catkin packages.
Invoke catkin_make_isolated:
$ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).
Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install somewhere else then you can do this by adding the --install-space /opt/ros/lunar argument to your catkin_make_isolated call.
For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/lunar just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.
Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.
Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.
Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file like so:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Maintaining a Source Checkout
If we want to keep our source checkout up to date, we will have to periodically update our rosinstall file, download the latest sources, and rebuild our workspace.
Update the workspace
To update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.
$ mv -i lunar-desktop-full.rosinstall lunar-desktop-full.rosinstall.old $ rosinstall_generator desktop_full --rosdistro lunar --deps --tar > lunar-desktop-full.rosinstall
Then, compare the new rosinstall file to the old version to see which packages will be updated:
$ diff -u lunar-desktop-full.rosinstall lunar-desktop-full.rosinstall.old
If you're satisfied with these changes, incorporate the new rosinstall file into the workspace and update your workspace:
$ wstool merge -t src lunar-desktop-full.rosinstall $ wstool update -t src
Rebuild your workspace
Now that the workspace is up to date with the latest sources, rebuild it:
$ ./src/catkin/bin/catkin_make_isolated --install
If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace
Once your workspace has been rebuilt, you should source the setup files again:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Installing from source
Install from source requires that you download and compile the source code on your own. ROS Melodic supports Ubuntu Artful and Bionic as well as Debian Stretch. Other platforms are possible to use but are not expected to work out of the box. Target platforms are defined in REP 3
Contents
Prerequisites
Installing bootstrap dependencies
Install bootstrap dependencies (Ubuntu):
These tools are used to facilitate the download and management of ROS packages and their dependencies, among other things.
Ubuntu or Debian:
$ sudo apt-get install python-rosdep python-rosinstall-generator python-vcstool python-rosinstall build-essential
If you have trouble installing the packages in the command above, make sure you have added the packages.ros.org debian repository to your apt source lists as described starting here: melodic/Installation/Ubuntu#Installation.2BAC8-Ubuntu.2BAC8-Sources.Setup_your_sources.list
If apt complains that the python-support package is not installable, make sure that you have the Ubuntu universe repositories enabled in your /etc/apt/sources.list
Fedora:
$ sudo dnf install gcc-c++ python-rosdep python3-rosinstall_generator python-vcstool python-rosinstall @buildsys-build
Some packages used in ROS are not currently available in the Fedora RPM repositories. Most of the other packages are available in RPM Fusion. See RPM Fusion Command Line Setup.
Generic (pip):
- If you are using a non-Debian system you need to make sure that you have all build tools (compiler, CMake, etc.) installed. You can install all ROS Python tools via PIP:
$ sudo pip install -U rosdep rosinstall_generator vcstool rosinstall
If there are errors with this or the rosdep step below, your system's version of pip may be out-of-date. Use your system's package management to update it, or use it to update itself:$ sudo pip install --upgrade setuptools
Note that on many platforms such as OSX you may want to install the above packages and use ROS inside a virtualenv so as to make sure not to collide with system dependencies.
Initializing rosdep
$ sudo rosdep init $ rosdep update
Installation
Start by building the core ROS packages.
Create a catkin Workspace
In order to build the core packages, you will need a catkin workspace. Create one now:
$ mkdir ~/ros_catkin_ws $ cd ~/ros_catkin_ws
Next we will want to fetch the core packages so we can build them. We will use vcstool for this. Select the vcstool command for the particular variant you want to install:
Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception
$ rosinstall_generator desktop_full --rosdistro melodic --deps --tar > melodic-desktop-full.rosinstall $ vcs import src < melodic-desktop-full.rosinstall
Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries
$ rosinstall_generator desktop --rosdistro melodic --deps --tar > melodic-desktop.rosinstall $ mkdir src $ vcs import src < melodic-desktop.rosinstall
ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.
$ rosinstall_generator ros_comm --rosdistro melodic --deps --tar > melodic-ros_comm.rosinstall $ vcs import src < melodic-ros_comm.rosinstall
This will add all of the catkin packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.
In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:
$ rosinstall_generator robot --rosdistro melodic --deps --tar > melodic-robot.rosinstall $ vcs import src < melodic-robot.rosinstall
Resolving Dependencies
Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:
$ rosdep install --from-paths src --ignore-src --rosdistro melodic -y
This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.
The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.
After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.
Building the catkin Workspace
Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you may choose to use catkin/commands/catkin_make which only works with catkin packages.
Invoke catkin_make_isolated:
$ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).
Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install somewhere else then you can do this by adding the --install-space /opt/ros/melodic argument to your catkin_make_isolated call.
For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/melodic just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.
Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.
Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.
Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file like so:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Maintaining a Source Checkout
If we want to keep our source checkout up to date, we will have to periodically update our rosinstall file, download the latest sources, and rebuild our workspace.
Update the workspace
To update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.
$ mv -i melodic-desktop-full.rosinstall melodic-desktop-full.rosinstall.old $ rosinstall_generator desktop_full --rosdistro melodic --deps --tar > melodic-desktop-full.rosinstall
Then, compare the new rosinstall file to the old version to see which packages will be updated:
$ diff -u melodic-desktop-full.rosinstall melodic-desktop-full.rosinstall.old
If you're satisfied with these changes, incorporate the new rosinstall file into the workspace and update your workspace:
$ vcs import src < melodic-desktop-full.rosinstall
Rebuild your workspace
Now that the workspace is up to date with the latest sources, rebuild it:
$ ./src/catkin/bin/catkin_make_isolated --install
If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace
Once your workspace has been rebuilt, you should source the setup files again:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Installing from source
Install from source requires that you download and compile the source code on your own. ROS Noetic supports Ubuntu Focal and Debian Buster, but other platforms are possible. The target platforms are defined in REP 3
Contents
Prerequisites
Installing bootstrap dependencies
Install bootstrap dependencies (Ubuntu):
These tools are used to facilitate the download and management of ROS packages and their dependencies, among other things.
Ubuntu or Debian:
$ sudo apt-get install python3-rosdep python3-rosinstall-generator python3-vcstools python3-vcstool build-essential
If you have trouble installing the packages in the command above, make sure you have added the packages.ros.org debian repository to your apt source lists as described starting here: noetic/Installation/Ubuntu#Installation.2BAC8-Ubuntu.2BAC8-Sources.Setup_your_sources.list
Fedora:
$ sudo dnf install gcc-c++ python3-rosdep python3-rosinstall_generator python3-vcstool @buildsys-build
Some packages used in ROS are not currently available in the Fedora RPM repositories. Most of the other packages are available in RPM Fusion. See RPM Fusion Command Line Setup.
Generic (pip):
- If you are using a non-Debian system you need to make sure that you have all build tools (compiler, CMake, etc.) installed. You can install all ROS Python tools via PIP:
$ sudo pip3 install -U rosdep rosinstall_generator vcstool
If there are errors with this or the rosdep step below, your system's version of pip may be out-of-date. Use your system's package management to update it, or use it to update itself:$ sudo pip3 install --upgrade setuptools
Note that on many platforms such as OSX you may want to install the above packages and use ROS inside a virtualenv so as to make sure not to collide with system dependencies.
Initializing rosdep
$ sudo rosdep init $ rosdep update
Installation
Start by building the core ROS packages.
Create a catkin Workspace
In order to build the core packages, you will need a catkin workspace. Create one now:
$ mkdir ~/ros_catkin_ws $ cd ~/ros_catkin_ws
Next we will want to download the source code for ROS packages so we can build them. We will use vcstool for this. For the purpose of this guide, we'll assume you'd like to build all of Desktop.
$ rosinstall_generator desktop --rosdistro noetic --deps --tar > noetic-desktop.rosinstall $ mkdir ./src $ vcs import --input noetic-desktop.rosinstall ./src
This will download all of the source code for packages part of Desktop into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download everything.
Looking for something other than Desktop? More variants are defined in REP 150 such as desktop_full, robot, perception, etc. Just change the package path above from desktop to the one you want.
Resolving Dependencies
Before you can build your catkin workspace you need to make sure that you have all the system dependencies on your platform. We use the rosdep tool for this:
$ rosdep install --from-paths ./src --ignore-packages-from-source --rosdistro noetic -y
rosdep looks at all the packages in the src directory and tries to find and install their dependencies on your platform. After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.
Building the catkin Workspace
By now you have a workspace with all of the source code, and all required system dependencies have been installed. Now it's time to build the code. ROS 1 packages use CMake; however, calling cmake by hand on all the packages by hand would be tedious. There are tools we can use to build all the packages in the right order. The tool we'll use is catkin_make_isolated.
catkin_make_isolated isn't the only tool we could use. There are other tools that would work, like catkin_make or catkin_tools (which has a command line executable called catkin), or colcon. Some of those might be better for your use case, but we'll use catkin_make_isolated here since that's what the ROS buildfarm uses.
This command will build everything in the workspace. It may take a while. The command is running catkin_make_isolated command from the source folder because it has not been installed yet. Once installed it can be called using just catkin_make_isolated.
$ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
Note: If you see an error relating to the EMPY module being missing you may be building using Python 2 rather than Python 3. To ensure you are using the latter, append the the following to the command above. If you have Python 3 installed elsewhere, update the path accordingly.
-DPYTHON_EXECUTABLE=/usr/bin/python3
Note: Want debug symbols? You might want to select a different CMake build type.
When the above command finishes, it will have installed everything into ~/ros_catkin_ws/install_isolated. If you would like to install somewhere else then add --install-space path/to/somewhere/else to the catkin_make_isolated call.
For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/noetic just as the Ubuntu packages would do. Of course, don't do this in Ubuntu, as the packages would collide with apt-get packages.
Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file like so:
$ source ~/ros_catkin_ws/install_isolated/setup.bash
Maintaining a Source Checkout
If we want to keep our source checkout up to date, you will have to periodically update your rosinstall file, download the latest sources, and rebuild the workspace.
Update your rosinstall file
To update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version
$ mv -i noetic-desktop.rosinstall noetic-desktop.rosinstall.old $ rosinstall_generator desktop --rosdistro noetic --deps --tar > noetic-desktop.rosinstall
Then, compare the new rosinstall file to the old version to see which packages will be updated:
$ diff -u noetic-desktop.rosinstall noetic-desktop.rosinstall.old
Download the latest sources
If you're satisfied with these changes, incorporate the new rosinstall file into the workspace and update your workspace:
$ vcs import --input noetic-desktop.rosinstall ./src
Rebuild your workspace
Now that the workspace is up to date with the latest sources, rebuild it:
$ ./src/catkin/bin/catkin_make_isolated --install
If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace
Once your workspace has been rebuilt, you should source the setup files again:
$ source ~/ros_catkin_ws/install_isolated/setup.bash