ROS Melodic安装(Ubuntu1804 有代理)


前言

这里只是记录了我个人的ROS Melodic安装过程,不一定对所有人适用!谨慎参考。


一、我觉得挺有用的两篇安装指导

https://blog.csdn.net/hxj0323/article/details/121215992
https://blog.csdn.net/qq_41450811/article/details/99079041

都是ubuntu18.04下安装ROS Melodic。

二、我的安装过程

1. 加载软件源

清华源的:

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 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654

2. 下载安装ROS Melodic

更新软件包列表:

sudo apt-get update

安装完整ROS Melodic

sudo apt-get install ros-melodic-desktop-full

安装ROS rqt图形开发组件

sudo apt-get install ros-melodic-rqt*

还有一些包需要安装

sudo apt install rospack-tools

3. 基础配置ROS Melodic

导入代理 IP和端口因电脑而异

export https_proxy="http://172.21.80.1:1080"
export http_proxy="http://172.21.80.1:1080"

初始化rosdep

sudo rosdep init

更新rosdep

rosdep update

如果代理没问题应该是可以自动更新,如果报错说连接超时那就返回开头看那两篇文章教的解决方案。

添加环境变量

echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc

重新载入环境变量

source ~/.bashrc

安装其余依赖软件包

sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential

4. 测试

roscore启动内核,可以正常启动。
ROSCORE
小海龟测试

rosrun turtlesim turtlesim_node

turtlesim_node
键盘输入测试也没什么问题

rosrun turtlesim turtle_teleop_key

turtle_teleop_key
基本上就代表安装成功啦!!

有代理确实会省不少事情!!

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值