How to install ROS on Ubuntu?
To install ROS on Ubuntu, you can follow these steps:
- Add ROS software source: Open the terminal and enter the following command to add the ROS software source to the apt sources.list.
- Elevate your privileges to run the command that adds the ROS repository to your sources list.
- Set ROS key: Enter the following command in the terminal to set the ROS key:
- Add the ROS repository key from the raw GitHub content using curl command.
- Update the software package index: Enter the following command in the terminal to update the software package index:
- Please run the command “sudo apt update”
- Install ROS: Enter the following commands in the terminal to install ROS:
- Install the complete version of ROS (including ROS core, common libraries, and tools): $ sudo apt install ros-melodic-desktop-full.
- Install the minimal version of ROS (containing only the ROS core, suitable for custom installations): $ sudo apt install ros-melodic-ros-base
- Initialize rosdep by entering the following command in the terminal:
- Initialize rosdep
Update rosdep - To set environment variables: Enter the following command in the terminal to configure ROS environment variables:
- Add “source /opt/ros/melodic/setup.bash” to the ~/.bashrc file and then run “source ~/.bashrc”.
Now, ROS has been successfully installed on Ubuntu. You can start using ROS by entering the roscore command to launch the ROS core.