ros robot operating system installation

The ubuntu version is ubuntu12.04

1 Open the terminal ( ctrl+alt+t ), install the software library

sudo sh -c 'echo "deb precise main" > /etc/apt/sources.list.d/ros-latest.list'  


ubuntu12.10 needs to change precise to quantal in the above  command 

ubuntu13.04 needs to change precise to raring in the above command

ubuntu14.04 needs to change precise to trusty in the above command

Correspondence between Ubuntu version and ros version

  ROS version Corresponding to Ubutnu version  

ROS Kinetic Kame

Ubuntu 16.04 (Xenial) / Ubuntu 15.10 (Wily)  

ROS Jade Turtle

Ubuntu 15.04 (Wily) / Ubuntu LTS 14.04 (Trusty)  

ROS Indigo Igloo

Ubuntu 14.04 (Trusty)  

ROS Hydro Medusa

Ubuntu 12.04 LTS (Precise)  

ROS Groovy Galapagos

Ubuntu 12.04 (Precise)   

Installing the software library is to let the system know where to download the program and install the software automatically according to the command.

2 Set the key to make sure the code comes from an authorized website and has not been modified

wget -O - | sudo apt-key add -  

3 Upgrade the software to ensure the latest software library and software to avoid problems

sudo apt-get update  

4 Install the software

sudo apt-get install ros-hydro-desktop-full

Similarly, as in the first step, different Ubuntu system versions correspond to different ros software. My system is 12.04 so the installation is hydro. Note that different systems need to install the corresponding ros version, otherwise it may not be available.

The full version installed here has all the features and requires the most hard disk space. Specifically installed ROS, rpt toolbox, rviz visualization environment, general robot library, 2D (such as stage) and 3D (such as gazebo) simulation environment, navigation function package set (movement, positioning, mapping, robotic arm control), and other Perception libraries such as vision, lidar and RGBD cameras (depth cameras).

5 Install and initialize rosdep

sudo rosdep init  
rosdep update

6 Configure the environment

At this point, it means that ros has been installed correctly. At this point, some configuration needs to be done to let the system know the location of the executable bin file and other instructions

source /opt/ros/hydro/setup.bash  

This is temporary and needs to be executed every time a new terminal is opened. Very inconvenient.

The following are permanent, i.e. write the instructions into the .bashrc script file.

echo "source /opt/ros/hydro/setup.bash" >> ~/.bashrc  
source ~/.bashrc  

7 Install a very useful command tool rosinstall

sudo apt-get install python-rosinstall  

At this point, the installation of the ROS system has been completed.

Open 2 terminals and execute the following 2 commands respectively

rosrun turtlesim turtlesim_node

When running roscore, the following error is reported:
[~]$ roscore
Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/", line 257, in main
    write_pid_file(options.pid_fn, options.core, options.port)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/", line 110, in write_pid_file
    with open(pid_fn, "w") as f:
IOError: [Errno 13] Permission denied: '/home/dmgy/.ros/'
Solution: Refer to
Replace sudo rosdep init with sudo rosdep fix-permissions
Do not add sudo before rosdep update
can be solved.

you can see this screen

Guess you like