PC端系统:Ubuntu 18.04
ros版本:melodic
polyscope版本:3.14
机器人:UR5/CB3
- 以下步骤亲测可用
1、Ubuntu18.04 安装ros-melodic
最好按照官网步骤来,以防秘钥有变
官网地址:http://wiki.ros.org/Installation
(1)配置Ubuntu软件库
保证 “restricted,” “universe,” and “multiverse” 被选中,以及【下载自】选项选择一个国内镜像源。
(2)设置sources.list
官网默认提供的是国外源,点击【Mirrors】进入国内源的配置,下面使用的是中科大的源。
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'
(3)设置秘钥
操作不成功的话,可以将hkp://keyserver.ubuntu.com:80 换成 hkp://pgp.mit.edu:80 或者hkp://keyserver.ubuntu.com:80
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
(4)安装
sudo apt update
sudo apt install ros-melodic-desktop-full
(5)设置环境变量
当使用ros的时候,必须每启动一个终端执行一次:
source /opt/ros/noetic/setup.bash
因此可以将其写入~/.bashrc
中,就不用每次手动source
了
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc # 使修改起作用
(5)安装依赖包
sudo apt install python-rosdep python-rosinstall pyt