Building ROS Development Environment
Here’s how to install ROS Melodic on Ubuntu 18.04:
Set Up Your Sources List:
Open a terminal window and add the ROS repository to your sources list:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
Set Up Your Keys:
You need to add the ROS key to ensure the packages are authentic:
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
Update Package Index:
Update the package index to make the ROS packages available:
sudo apt update
Install ROS Melodic:
Install the ROS desktop-full package. This package includes ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation, and perception:
sudo apt install ros-melodic-desktop-full
Initialize rosdep:
Before you can use ROS, you need to initialize rosdep. rosdep enables you to easily install system dependencies for ROS packages.
sudo rosdep init rosdep update
Environment Setup:
To automatically add ROS environment variables to your bash session every time a new shell is launched, add the following line to your ~/.bashrc file:
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc source ~/.bashrc
Dependencies for Building Packages:
To install the dependencies required to build ROS packages, run:
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
Now, you have successfully installed ROS Melodic on your Ubuntu 18.04 system. You can create a ROS workspace and start working on your robotic projects.
Remember to consult the official ROS Melodic installation guide for any updates or additional information.