Thanks for the wiki website:ROS wiki
First :Ros version introduce
Kinetic and Melodic
In the first: Kinetic version is published in the 2016 with the ubuntu 16.04
and this version the offical worker said that they will shutdown support this version in the 2021
By the way the Ubuntu 18.04 has always published and Melodic is pubulished in the 2018 they will support help the version update and fix the bug in the next 5years
So i choose the Melodic
Melodic just like the Kinetic
Second: Ros setting
- First you should set the third part software setting : choose the best server for you internet ,I choose the aliyun.com
- Then you should use this command Setup your sources.list in the terminal:
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
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- Installation : this command list will cost your few minutes plz waitting for a moment
sudo apt update
sudo apt install ros-melodic-desktop-full
May be you will find the command can’t download the version you set plz use this command in the terminal to find out which version is available for your env.
apt search ros-melodic
- Then you can use the Enviroment setting :(this command change the global the env in your PC)
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
this command can set the env temporary just use in the current shell:
source /opt/ros/melodic/setup.bash
- Dependencies for building packages
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
Then you will need to init the rosdep:
sudo apt install python-rosdep
sudo rosdep init
rosdep update
Warning: May be you will find out the you cann’t init the rosdep
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
you should change the download hosts:
use the command :
sudo vim /etc/hosts
add the line 151.101.84.133 raw.githubusercontent.com in the end .Then go on .
sudo apt-get update
sudo rosdep init
rosdep update
Third: Ros
Every one knows in the Ros test command,and know the turtle maybe you should three terminal that you can :
Terminal1:
roscore
Terminal2:
rosrun turtlesim turtlesim_node
Terminal3:
rosrun turtlesim turtle_teleop_key
Then you can use arrow key to move the little turtle.
In the end you ros is OK.