ubuntu18.04软件源更换为清华源(其他也可以)。
设置软件源(都可以)官方wiki教程:
清华源:
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
国外源:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
sudo apt-get install ros-melodic-desktop-full
sudo apt-get install ros-melodic-rqt*(可以不装)
sudo rosdep init
rosdep update
问题一:
安装ROS时执行到sudo rosdep init时出现:sudo rosdep:找不到命令提示
解决方法:
sudo apt install python-rosdep2
问题二:
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://blog.csdn.net/ZJY_17998/article/details/105752816
注:有博主说手机热点可以,但我用两台电脑装出现这个问题都不能用手机热点解决。
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt-get install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key
注:可以控制乌龟就说明可以了。
欢迎留言讨论,指出不足和建议!