首页 > 技术文章 > ROS Melodic在Ubuntu18.04下的安装

dervon 2021-05-29 19:37 原文

主要注意使用代理的情况下无法init的问题。

 1 sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
 2 sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
 3 sudo apt update
 4 sudo apt install ros-melodic-desktop-full
 5 echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
 6 source ~/.bashrc
 7 sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
 8 #在使用代理的情况下,可能export http_proxy后还是无法连接,这是因为sudo rosdep init是在root账户下运行的,所以export http_proxy命令也应该是root账户执行的。否则无法连接。所以建议先切换到root账户
 9 sudo su
10 export http_proxy=ip:port
11 export https_proxy=ip:port
12 rosdep init 
13 #然后切回ubuntu账户 
14 rosdep update

参考: http://wiki.ros.org/melodic/Installation/Ubuntu

推荐阅读