1.终端命令(不解释,指令含义没啥大用)
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install ros-indigo-desktop-full
sudo rosdep init
rosdep update
sudo apt-get install python-rosinstall
echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
source ~/.bashrc
roscore
如果最后一条命令正确执行,则表示安装成功。
2.可能出现的问题
1.sudo rosdep init提示“ERROR: cannot download default sources list from:https://raw.github.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.listWebsite may be down.”
方法1:sudo -E rosdep init
方法2:在/etc/environment中加入(注意改成自己的信息)
http_proxy=http://[user:password@]proxy_server:port/
https_proxy=https://[user:password@]proxy_server:port/
方法3:在home下新建20-default.list文件,将写入下列内容并保存。
# os-specific listings first
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
# generic
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
然后
cd /etc
sudo mkdir -p ros/rosdep/sources.list.d
sudo cp ~/20-default.list /etc/ros/rosdep/sources.list.d
再执行rosdep update
2.roscore提示Unable to contact my own server at …
- 1.首先保证自己的主机名不是数字,即打开终端后显示的aiiage@ausu中ausu位置的内容
- 2.将~/.bashrc中的
export ROS_MASTER_URI=http://ip:11311
export ROS_HOSTNAME=ip
改成
export ROS_MASTER_URI=http://laptop_name:11311
export ROS_HOSTNAME=laptop_name
3. sudo apt-get install ros-indigo-desktop-full出错:The following packages have unmet dependencies: ros-indigo-perception but it is not going to be installed
- 先尝试sudo apt-get install -f,无效则使用一下方法。
- 安装提示的依赖,然后会一直到提示依赖tcl-vtk,所以反向安装依赖项,类似问题也可以这样尝试解决。
sudo apt-get install tcl-vtk
sudo apt-get install python-vtk
sudo apt-get install ros-indigo-pcl-ros
sudo apt-get install ros-indigo-perception-pcl
sudo apt-get install ros-indigo-perception
sudo apt-get install ros-indigo-desktop-full
4. roscore提示terminate called after throwing an instance of ‘std::runtime_error’
- 在~/.bashrc中加入export LC_ALL=”C”
- 如果问题未解决,尝试
sudo dpkg-reconfigure locales
sudo apt-get install language-pack-en-base