当前位置: 首页 > news >正文

​​​​​​​Installing ROS on the Raspberry Pi

 参考官网

ROSberryPi - ROS Wikihttp://wiki.ros.org/ROSberryPiInstallation/Source - ROS Wikiicon-default.png?t=M1L8http://wiki.ros.org/Installation/Source

--------------------------------------------------------------------- 

Raspberry Pi + Buster 安装 ROS melodic

Installing ROS Melodic on the Raspberry Pi

Description: This instruction covers the installation of ROS Melodic on the Raspberry Pi with Raspbian Buster. However as final repositories are available now, today it is faster and easier to use Ubuntu Mate 18.04 (Bionic, here) together with the standard ARM installation instructions here.

Keywords: RaspberryPi, Setup, Melodic, Buster

Tutorial Level: BEGINNER
 

Contents

  1. Introduction
  2. Prerequisites
    1. Setup ROS Repositories
    2. Install Bootstrap Dependencies
    3. Initializing rosdep
  3. Installation
    1. Create a catkin Workspace
    2. Resolve Dependencies
      1. Resolving Dependencies with rosdep
    3. Building the catkin Workspace
  4. Maintaining a Source Checkout
    1. Updating the Workspace
    2. Adding Released Packages
  5. References

Introduction

This tutorial explains how to install ROS Melodic from source on the Raspberry Pi. The instructions is based on the ROSberryPi Kinetic installation.

 Note: If you're using the Raspberry Pi 2 or 3 it is faster and easier to use the standard ARM installation instructions here.

Prerequisites

These instructions assume that Raspbian Buster is being used as the OS on the Raspberry Pi. The download page for current images of Raspbian is Raspberry Pi OS – Raspberry Pi.

Setup ROS Repositories

First install repository key:

$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
$ sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

Now, make sure your Debian package index is up-to-date:

$ sudo apt-get update
$ sudo apt-get upgrade

Install Bootstrap Dependencies

$ sudo apt install -y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake

Initializing rosdep

$ sudo rosdep init
$ rosdep update

Installation

Now, we will download and build ROS Melodic.

Create a catkin Workspace

In order to build the core packages, you will need a catkin workspace. Create one now:

$ mkdir -p ~/ros_catkin_ws
$ cd ~/ros_catkin_ws

Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:

ROS-Comm: (recommended) ROS package, build, and communication libraries. No GUI tools.

  • $ rosinstall_generator ros_comm --rosdistro melodic --deps --wet-only --tar > melodic-ros_comm-wet.rosinstall
    $ wstool init src melodic-ros_comm-wet.rosinstall

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

  • $ rosinstall_generator desktop --rosdistro melodic --deps --wet-only --tar > melodic-desktop-wet.rosinstall
    $ wstool init src melodic-desktop-wet.rosinstall

This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.

So far, only the ROS-Comm variant has been tested on the Raspberry Pi in Melodic; however, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:

$ rosinstall_generator robot --rosdistro melodic --deps --wet-only --tar > melodic-robot-wet.rosinstall
$ wstool init src melodic-robot-wet.rosinstall

Please feel free to update these instructions as you test more variants.

If wstool init fails or is interrupted, you can resume the download by running:

wstool update -j4 -t src

Resolve Dependencies

Before you can build your catkin workspace, you need to make sure that you have all the required dependencies. We use the rosdep tool for this.

Resolving Dependencies with rosdep

The dependencies should be resolved by running rosdep:

$ cd ~/ros_catkin_ws
$ rosdep install -y --from-paths src --ignore-src --rosdistro melodic -r --os=debian:buster

This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.

The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.

After a while rosdep will finish installing system dependencies and you can continue.

Building the catkin Workspace

Once you have completed downloading the packages and have resolved the dependencies, you are ready to build the catkin packages.

Invoke catkin_make_isolated:

$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic

Note: This will install ROS in the equivalent file location to Ubuntu in /opt/ros/melodic however you can modify this as you wish.

With older raspberries it is recommended to increase the add swap space. Also recommended to decrease the compilation thread count with the -j1 or -j2 option instead of the default -j4 option:

$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic -j2

Now ROS should be installed! Remember to source the new installation:

$ source /opt/ros/melodic/setup.bash

Or optionally source the setup.bash in the ~/.bashrc, so that ROS environment variables are automatically added to your bash session every time a new shell is launched:

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

Maintaining a Source Checkout

Updating the Workspace

See the Ubuntu source install instructions for steps on updating the ros_catkin_ws workspace. The same steps should apply to the Raspberry Pi.

Adding Released Packages

You may add additional packages to the installed ros workspace that have been released into the ros ecosystem. First, a new rosinstall file must be created including the new packages (Note, this can also be done at the initial install). For example, if we have installed ros_comm, but want to add ros_control and joystick_drivers, the command would be:

$ cd ~/ros_catkin_ws
$ rosinstall_generator ros_comm ros_control joystick_drivers --rosdistro melodic --deps --wet-only --tar > melodic-custom_ros.rosinstall

You may keep listing as many ROS packages as you'd like separated by spaces.

Next, update the workspace with wstool:

$ wstool merge -t src melodic-custom_ros.rosinstall
$ wstool update -t src

After updating the workspace, you may want to run rosdep to install any new dependencies that are required:

$ rosdep install --from-paths src --ignore-src --rosdistro melodic -y -r --os=debian:buster

Finally, now that the workspace is up to date and dependencies are satisfied, rebuild the workspace:

$ sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic

References

  • ROSberryPi/Installing ROS Kinetic on the Raspberry Pi - ROS Wiki

相关文章:

  • Ubuntu系统下通过remmina远程登陆raspberry pi
  • Ubuntu 键盘鼠标失效怎么办
  • raspberry pi 4检查ch340/ch341驱动
  • ROS ERROR: Could NOT find depth_image_proc (missing: depth_image_proc_DIR)
  • 如何在 Ubuntu 服务器上安装桌面环境(GUI) | Linux 中国
  • Ubuntu Server 20.04.4 在树莓派上的体验之连接网络和WIFI(WLAN0)
  • Ubuntu ERROR: sudo: unable to resolve host ubuntu: Name or service not known
  • Ubuntu Server 20.04.4 在树莓派上的体验之ROS-Noetic的安装
  • ROS移植机器人小车:catkin_make过程中碰到的各种小问题
  • ROS移植机器人小车:问题集
  • ROS移植机器人小车:问题集(2)
  • Linux查看IP地址的几种方法
  • linux常用命令:查看硬件配置的方法示例(含Jetson)
  • anaconda安装opencv -> python[version=‘>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0‘]
  • VIM的一些常指令和用法
  • Android 初级面试者拾遗(前台界面篇)之 Activity 和 Fragment
  • CAP理论的例子讲解
  • create-react-app做的留言板
  • java2019面试题北京
  • Java应用性能调优
  • Python 基础起步 (十) 什么叫函数?
  • Selenium实战教程系列(二)---元素定位
  • 百度地图API标注+时间轴组件
  • 关于使用markdown的方法(引自CSDN教程)
  • 机器学习学习笔记一
  • 名企6年Java程序员的工作总结,写给在迷茫中的你!
  • 前端面试之CSS3新特性
  • 收藏好这篇,别再只说“数据劫持”了
  • 推荐一款sublime text 3 支持JSX和es201x 代码格式化的插件
  • 一起参Ember.js讨论、问答社区。
  • 一起来学SpringBoot | 第十篇:使用Spring Cache集成Redis
  • 异常机制详解
  • 数据可视化之下发图实践
  • 说说我为什么看好Spring Cloud Alibaba
  • ​​​​​​​sokit v1.3抓手机应用socket数据包: Socket是传输控制层协议,WebSocket是应用层协议。
  • #QT(一种朴素的计算器实现方法)
  • (03)光刻——半导体电路的绘制
  • (1)(1.13) SiK无线电高级配置(五)
  • (4.10~4.16)
  • (9)YOLO-Pose:使用对象关键点相似性损失增强多人姿态估计的增强版YOLO
  • (html5)在移动端input输入搜索项后 输入法下面为什么不想百度那样出现前往? 而我的出现的是换行...
  • (第8天)保姆级 PL/SQL Developer 安装与配置
  • (牛客腾讯思维编程题)编码编码分组打印下标题目分析
  • (十七)devops持续集成开发——使用jenkins流水线pipeline方式发布一个微服务项目
  • (算法设计与分析)第一章算法概述-习题
  • (转)Oracle存储过程编写经验和优化措施
  • (转)全文检索技术学习(三)——Lucene支持中文分词
  • ***汇编语言 实验16 编写包含多个功能子程序的中断例程
  • .bat批处理(十一):替换字符串中包含百分号%的子串
  • .htaccess配置重写url引擎
  • .NET 发展历程
  • .NET 命令行参数包含应用程序路径吗?
  • .net和jar包windows服务部署
  • .net使用excel的cells对象没有value方法——学习.net的Excel工作表问题
  • .Net转前端开发-启航篇,如何定制博客园主题