[2022ROS melodic version installation trial and error]

This chapter records the installation of ROS system:

We can learn more about the current mainstream robot framework platform ROS from the videos or books explained by ROS (it is not a real operating system, but a set of environment framework similar to various virtual machines or dockers running on the host. Its main function is to correlate and graft the messages between actuators and sensors, so as to make the complex machine communication docking simple (so to speak, it should be.), This framework gives our host operating system the ability to call the interface to implement interface related operations).
< it should be noted that the open source ROS framework generally has a maximum official maintenance cycle of 5 years for each stable version >;
Well, the most important step now is to install this general machine framework first. Do it!
This chapter follows the official installation tutorial

"https://wiki.ros.org/noetic/Installation/Ubuntu"

Use the operating system for Ubuntu aarch version.

  1. First, we need to create a file to read the relevant ros software source (a file with the address path of the indexed software source written):
    By the way, you can check the file generated by this command. You can see the creation of a ROS latest List file, in which an entry is entered http://mirrors.tuna.tsinghua.edu.cn/ Index information of the web site. The website I use here is the software source address of Tsinghua University in China.
ubuntu@ubuntu-desktop:~$ sudo sh -c 'sh /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
ubuntu@ubuntu-desktop:~$ ll /etc/apt/sources.list.d/
cuda-l4t-10-2-local.list        ros-latest.list                 visionworks-sfm-repo.list
nvidia-l4t-apt-source.list      visionworks-repo.list           visionworks-tracking-repo.list
ubuntu@ubuntu-desktop:~$ cat /etc/apt/sources.list.d/ros-latest.list
deb http://mirrors.ustc.edu.cn/ros/ubuntu bionic main
  1. Next, add a secret key that can authorize software download:
ubuntu@ubuntu-desktop:~$ sudo apt-key adv --keyserver hkp://keyserver. ubuntu. COM: 80 -- recv key 421c365bd9ff1f717815a3895523baeeb01fa116 -- self defined
gpg: key 5523BAEEB01FA116: public key "ROS Builder <rosbuild@ros.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1
ubuntu@ubuntu-desktop:~$
  1. Install another public key to verify the signature:
ubuntu@ubuntu-desktop:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654
Executing: /tmp/apt-key-gpghome.Xg2moig1B0/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654
gpg: key F42ED6FBAB17C654: public key "Open Robotics <info@osrfoundation.org>" imported
gpg: Total number processed: 1
gpg:               imported: 1
ubuntu@ubuntu-desktop:~$
  1. Because it is the source address of ROS software that has just been added, at present, the ubuntu system does not contain ROS software, so it is necessary to update the software package list of the system. Through this update of the software package list, the ROS software package can be updated into the system software list together: it is also OK
    sudo apt-get update && sudo apt-get upgrade

  1. Next, install the melody system:


Install the Rosdep tool (ros dependent package checking tool):

ubuntu@ubuntu-desktop:~$ sudo rosdep init
[sudo] password for ubuntu:
sudo: rosdep: command not found
ubuntu@ubuntu-desktop:~$ sudo rosdep init
sudo: rosdep: command not found
  1. It is suggested here that rosdep cannot be found, so I saw on the Internet that a python rosdep needs to be installed:
ubuntu@ubuntu-desktop:~$ sudo apt-get install python-rosdep
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-rosdep is already the newest version (0.21.0-1).
The following packages were automatically installed and are no longer required:
  apt-clone archdetect-deb bogl-bterm busybox-static cryptsetup-bin dpkg-repack gir1.2-timezonemap-1.0 gir1.2-xkl-1.0
  grub-common kde-window-manager kinit kio kpackagetool5 kwayland-data kwin-common kwin-data kwin-x11
  libdebian-installer4 libkdecorations2-5v5 libkdecorations2private5v5 libkf5activities5 libkf5attica5
  libkf5completion-data libkf5completion5 libkf5declarative-data libkf5declarative5 libkf5doctools5
  libkf5globalaccel-data libkf5globalaccel5 libkf5globalaccelprivate5 libkf5idletime5 libkf5jobwidgets-data
  libkf5jobwidgets5 libkf5kcmutils-data libkf5kcmutils5 libkf5kiocore5 libkf5kiontlm5 libkf5kiowidgets5
  libkf5newstuff-data libkf5newstuff5 libkf5newstuffcore5 libkf5package-data libkf5package5 libkf5plasma5
  libkf5quickaddons5 libkf5solid5 libkf5solid5-data libkf5sonnet5-data libkf5sonnetcore5 libkf5sonnetui5
  libkf5textwidgets-data libkf5textwidgets5 libkf5waylandclient5 libkf5waylandserver5 libkf5xmlgui-bin
  libkf5xmlgui-data libkf5xmlgui5 libkscreenlocker5 libkwin4-effect-builtins1 libkwineffects11 libkwinglutils11
  libkwinxrenderutils11 libqgsttools-p1 libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediaquick-p5
  libqt5multimediawidgets5 libxcb-composite0 libxcb-cursor0 libxcb-damage0 os-prober python3-dbus.mainloop.pyqt5
  python3-icu python3-pam python3-pyqt5 python3-pyqt5.qtsvg python3-pyqt5.qtwebkit
  qml-module-org-kde-kquickcontrolsaddons qml-module-qtmultimedia qml-module-qtquick2 rdate tasksel tasksel-data
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

The relevant Python rosdep installation is completed, but the error message of rosdep init is what? The read operation timed out
Read timeout...

ubuntu@ubuntu-desktop:~$ sudo rosdep init

ERROR: Rosdep experienced an error: ('The read operation timed out',)
Please go to the rosdep page [1] and file a bug report with the stack trace below.
[1] : http://www.ros.org/wiki/rosdep

rosdep version: 0.21.0

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 146, in rosdep_main
    exit_code = _rosdep_main(args)
  File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 441, in _rosdep_main
    return _no_args_handler(command, parser, options, args)
  File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 450, in _no_args_handler
    return command_handlers[command](options)
  File "/usr/lib/python2.7/dist-packages/rosdep2/main.py", line 594, in command_init
    data = download_default_sources_list()
  File "/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py", line 340, in download_default_sources_list
    f = urlopen(url, timeout=DOWNLOAD_TIMEOUT)
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1248, in https_open
    context=self._context)
  File "/usr/lib/python2.7/urllib2.py", line 1208, in do_open
    r = h.getresponse(buffering=True)
  File "/usr/lib/python2.7/httplib.py", line 1178, in getresponse
    response.begin()
  File "/usr/lib/python2.7/httplib.py", line 452, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.7/httplib.py", line 408, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "/usr/lib/python2.7/socket.py", line 480, in readline
    data = self._sock.recv(self._rbufsize)
  File "/usr/lib/python2.7/ssl.py", line 754, in recv
    return self.read(buflen)
  File "/usr/lib/python2.7/ssl.py", line 641, in read
    v = self._sslobj.read(len)
SSLError: ('The read operation timed out',)


ubuntu@ubuntu-desktop:~$
  1. So I logged in to the official according to the error information in it and re executed sudo apt get install Python rosdep according to the official prompt
    Then sudo rosdep init is OK again... It's really confused (later, it should be caused by the bad environment and network I was in):
ubuntu@ubuntu-desktop:~$ sudo rosdep init
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run

        rosdep update

ubuntu@ubuntu-desktop:~$

  1. Here, officials say that the init command only needs to be called once, so it doesn't have to be too frequent. In the next rosdep update
    When using the ubuntu operating system, it is customary to add 'sudo' before each command to execute the command. However, the official prompt here is that sudo is not recommended to run this command. It is said that it will cause errors in some permissions if it is authorized to run the update, so you only need to enter rosdep directly
    update:
ubuntu@ubuntu-desktop:~$ rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro "ardent"
Skip end-of-life distro "bouncy"
Skip end-of-life distro "crystal"
Skip end-of-life distro "dashing"
Skip end-of-life distro "eloquent"
Add distro "foxy"
Add distro "galactic"
Skip end-of-life distro "groovy"
Skip end-of-life distro "hydro"
Skip end-of-life distro "indigo"
Skip end-of-life distro "jade"
Skip end-of-life distro "kinetic"
Skip end-of-life distro "lunar"
Add distro "melodic"
Add distro "noetic"
Add distro "rolling"
updated cache in /home/ubuntu/.ros/rosdep/sources.cache

You can see that you have updated sources Cache file (* Please note! Please note! Before this update is successful, the author has tested for 2 days. Why? Why is it a failure to start update and tell me what timeout? What I was thinking about was MMP. You can use your current browser to load 20 default one by one Several yaml link files in the list file to see if the following picture contents can be loaded normally. If so, execute rosdep update, and there is a small probability of error. If the web page cannot be loaded ~ cough.. The author advises you to find a place with faster network speed and take it away after updating... I didn't update this until I went to the company to use the enterprise bandwidth).

  1. Next, add the following environment variables in the local bashrc file:
ubuntu@ubuntu-desktop:~$ echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
ubuntu@ubuntu-desktop:~$ tail -n 1 .bashrc
source /opt/ros/melodic/setup.bash
ubuntu@ubuntu-desktop:~$
  1. In my last line, I have added the environment variable, and then use source ~ / Bashrc to refresh the bashrc file.
    Install the relevant python dependency package: initialize python rosdep again
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
ubuntu@ubuntu-desktop:~$ sudo apt install python-rosdep  --I can say that this step is purely superfluous, because it has been implemented above.
[sudo] password for ubuntu:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-rosdep is already the newest version (0.21.0-1).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
ubuntu@ubuntu-desktop:~$
  1. Then, because I execute roscore after the installation is completed, and there is no such command, but there is a rosco command. It should be that the environment variable is not successfully brushed up. I directly give it to sudo
    reboot restart the host... (yes, all problems can be solved by restarting) after restarting, there will be roscore:
ubuntu@ubuntu-desktop:~$ roscore
... logging to /home/ubuntu/.ros/log/c066cf20-856b-11ec-9508-82771950a190/roslaunch-ubuntu-desktop-8154.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ubuntu-desktop:43551/
ros_comm version 1.14.12


SUMMARY
========

PARAMETERS
 * /rosdistro: melodic
 * /rosversion: 1.14.12

NODES

auto-starting new master
process[master]: started with pid [8164]
ROS_MASTER_URI=http://ubuntu-desktop:11311/

setting /run_id to c066cf20-856b-11ec-9508-82771950a190
process[rosout-1]: started with pid [8177]
started core service [/rosout]

All right! The author marks the steps of each step with serial number, which is about 11 steps in total to complete the installation of ros platform.
Next, how about the little turtle in the back ~ please Baidu by yourself! The environment you need to install successfully.
On the way of artificial intelligence in the future, you and I will forge ahead!

Keywords: Linux Ubuntu Machine Learning AI Operating System

Added by gterre on Fri, 04 Feb 2022 06:32:30 +0200