Installieren von ROS in einem Ubuntu Single-Board IMG-Image

Einführung


Als ich neulich an einem Diplom arbeitete, musste ich ein Ubuntu-Image für einen Single-Board-Player erstellen, auf dem ROS ( Robot Operating System - ein Roboter-Betriebssystem ) bereits installiert war . Kurz gesagt, das Diplom ist der Verwaltung einer Gruppe von Robotern gewidmet. Roboter sind mit zwei Rädern und drei Entfernungsmessern ausgestattet. Diese ganze Sache wird von ROS verwaltet, das sich auf dem ODROID-C2-Board dreht.


Roboterfoto
Marienkäfer-Roboter. Entschuldigung für die schlechte Qualität des Fotos


ROS , , ROS. , , .
.


  1. , (Distroshare Ubuntu Imager, linux live kit, linux respin, systemback .)
  2. , (yocto, linux from scratch)
  3. (liveCD customization , )

, live- ODROID . - . , .. .
chroot (chroot — change root, ) , . Ubuntu .


:


  • ( SD- balenaEtcher) Ubuntu 18.04.
  • , – Ubuntu 18.04.3 mate desktop .
  • , – ODROID-C2.


  1. Ubuntu ODROID



  2. unxz –kv <   >

  3. ,


    mkdir mnt

  4. ,


    file < >

    ext2, ext3 ext4. ( ):

    Bildschirm partitionierte Konsole

    . parted.



  5. sudo mount -o loop,offset=$((264192*512)) <  > mnt/

    264192 ( ), — 512 , , .



  6. cd mnt/
    sudo chroot ~/livecd/mnt/ bin/sh

    ~/livecd/mnt
    bin/sh — ( bin/bash)
    .



ROS


ROS (ROS Melodic) .



  1. sudo apt-get update

    :


    Err:6 http://deb.odroid.in/c2 bionic InRelease
    The following signatures were invalid: EXPKEYSIG 5360FB9DAB19BAC9 Mauro Ribeiro (mdrjr) <mauro.ribeiro@hardkernel.com>

    , . :


    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AB19BAC9

  2. ROS


    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://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

    sudo apt update

  3. ROS
    , desktop ROS, :


    sudo apt install ros-melodic-ros-base
    apt search ros-melodic

    1. :


    dpkg: error: failed to write status database record about 'iputils-ping' to '/var/lib/dpkg/status': No space left on device

    apt:


    sudo apt-get clean; sudo apt-get autoclean

    2. (source) :


    source /opt/ros/melodic/setup.bash

    , .. bash, .



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

    sudo apt install python-rosdep

    sudo rosdep init
    rosdep update


  5. , , root , ROS .
    roscore sudo :


    Traceback (most recent call last): File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 230, in main write_pid_file(options.pid_fn, options.core, options.port) File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/__init__.py", line 106, in write_pid_file with open(pid_fn, "w") as f: IOError: [Errno 13] Permission denied: '/home/user/.ros/roscore-11311.pid'

    , ROS. :


    sudo rosdep fix-permissions

  6. rviz rqt


    sudo apt-get install ros-melodic-rqt ros-melodic-rviz



  1. chroot:

    exit


  2. cd ..
    sudo umount mnt/


  3. xz –ckv1 < >

Alle! Jetzt können Sie mit balenaEtcher das System-Image auf eine SD-Karte schreiben, es in ODROID-C2 einlegen und Ubuntu mit ROS installiert haben!


Verweise:


  • Dieses Video hat mir sehr geholfen, wie man unter Linux kommt und warum es so sein sollte:


All Articles