Ubuntu 18.04 melodic安装ROS

在Ubuntu18.04下安装Ros-melodic
参考连接:官网连接
ROS包:https://github.com/IntelRealSense/realsense-ros
Ros-melodic安装: http://wiki.ros.org/melodic/Installation/Ubuntu

1.1配置Ubuntu存储库

1.2设置sources.list

sudo sh -c'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc)main"> /etc/apt/sources.list.d/ros-latest.list'

1.3 set up your keys:添加密钥

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

1.4 Installation更新

sudo apt update

1.5 桌面完整安装

a: Desktop-Full Install: (Recommended) : ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators and 2D/3D perception:

sudo apt install ros-melodic-desktop-full

若此时运行出错: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).

sudo apt --fix-broken install

b: Desktop Install: ROS, rqt, rviz, and robot-generic libraries

sudo apt install ros-melodic-desktop

c: ROS-Base: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.

sudo apt install ros-melodic-ros-base

d: Individual Package: You can also install a specific ROS package (replace underscores with dashes of the package name):

sudo apt install ros-melodic-PACKAGE

e.g.

sudo apt install ros-melodic-slam-gmapping

1.6 Environment setup:环境变量

a: If you have more than one ROS distribution installed, ~/.bashrc must only source the setup.bash for the version you are currently using.

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

b: If you just want to change the environment of your current shell, instead of the above you can type:

source /opt/ros/melodic/setup.bash

c: If you use zsh instead of bash you need to run the following commands to set up your shell:

echo "source /opt/ros/melodic/setup.zsh" >> ~/.zshrc
source ~/.zshrc

1.7 Dependencies for building packages:

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

1.8 Initialize rosdep:

sudo apt install python-rosdep
sudo rosdep init
rosdep update

在这里插入图片描述
运行出错sudo rosdep init
解决:

#打开hosts文件
sudo gedit /etc/hosts
#在文件末尾添加
151.101.84.133  raw.githubusercontent.com

在这里插入图片描述解决:

sudo rm /etc/ros/rosdep/sources.list.d/20-default.list

rosdep update出错:
https://blog.csdn.net/Kenny_GuanHua/article/details/116845781

1.9 测试

在终端运行

roscore
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值