赞
踩
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
打不开则:
sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 0xB01FA116
sudo apt-get update
,会报GPG错误,解决办法是添加公钥:sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654
sudo apt-get install ros-melodic-desktop-full
安装目录在/opt/ros下。
sudo rosdep init
rosdep update
提示:sudo rosdep:找不到命令提示
,执行下面指令:
sudo apt install python-rosdep
提示:ERROR: cannot download default sources list from: https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list Website may be down.
https://site.ip138.com/raw.Githubusercontent.com/
,输入raw.githubusercontent.com查询出一个可用的ip地址,然后在/etc/hosts文件最后添加:199.232.28.133 raw.githubusercontent.com
151.101.228.133 raw.github.com
#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
sudo mkdir -p /etc/ros/rosdep/sources.list.d
touch /etc/ros/rosdep/sources.list.d/20-default.list
rosdep update
放到~/.bashrc文件最后
source /opt/ros/melodic/setup.bash
然后执行source ~/.bashrc
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
安装ros插件sudo apt install ros-melodic-jsk-rviz-plugins
roscore &
rosrun turtlesim turtlesim_node
rosrun rviz rviz
,发现报段错误,需要将export LIBGL_ALWAYS_INDIRECT=
添加到.bashrc文件最后。
sudo apt-get remove ros-melodic-*
建议启动新的节点时,将roscore重启一下,防止莫名其妙的错误!!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。