ROS Kinetic配置记录

ROS Kinetic配置记录

记录一下配置ROS环境的基本问题

换源

通过换源提升软件安装和更新速度,选择阿里源。
备份源配置文件sudo cp /etc/apt/source.list /etc/apt/source.list.bak
编辑源配置文件sudo gedit /etc/apt/source.list,将其中的内容注释掉,或删掉,换成下列内容。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bio

更新源sudo apt update,更新包和软件sudo apt upgrade

SSH

查看ssh服务是否开启ps -e | grep ssh
安装ssh服务apt install ssh
开启ssh服务service ssh start

VM 共享文件夹问题

查看设置的共享文件夹:vmware-hgfsclient
挂载共享文件夹:sudo vmhgfs-fuse .host:/pub /home/greedbob/pub -o allow_other

ROS配置

RM的ROS库基于kinetic,所以我们参考ROS Wiki安装kinetic版本。

设置源

  • 设置apt源,上文已经设置过了
  • 将ROS源换源到清华源,设置apt密匙
    1
    2
    sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
    sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  • 更新源sudo apt update

    ROS-Kinetic安装

  • 安装ROS Kinetic和RM所需一些依赖
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    sudo apt install ros-kinetic-desktop-full
    sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
    sudo apt install -y ros-kinetic-opencv3 \
    ros-kinetic-cv-bridge \
    ros-kinetic-image-transport \
    ros-kinetic-stage-ros \
    ros-kinetic-map-server \
    ros-kinetic-laser-geometry \
    ros-kinetic-interactive-markers \
    ros-kinetic-tf \
    ros-kinetic-pcl-* \
    ros-kinetic-libg2o \
    ros-kinetic-rplidar-ros \
    ros-kinetic-rviz \
    protobuf-compiler \
    libprotobuf-dev \
    libsuitesparse-dev \
    libgoogle-glog-dev \
  • 设置环境变量,并初始化
    1
    2
    3
    4
    echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
    source ~/.bashrc
    sudo rosdep init
    rosdep update

    RoboRTS下载与编译

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    # 创建工作空间文件夹
    mkdir -p roborts_ws/src
    # 切换至src目录
    cd roborts_ws/src
    # 下载RoboRTS源码
    git clone https://github.com/RoboMaster/RoboRTS
    # 编译源码
    cd ..
    catkin_make
    # 加载环境变量
    source devel/setup.bash

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×