就如同各位從開始的夥伴們,你們一定很想快點看到,一台可以裝上雷射LiDAR導航,自主漫遊 + 路徑規劃 + 自主避障 + 影像AI   &^$%^#%%^%^&%^  ~ 等等集合了目前self-driving 前端科技的家用小車八 !! 我們記錄一位工程師,他是如何從開始的學習、蛻變到一位 self-driving developer的過程。

話說,這一開始的動作應該也是記錄摸索的過程,不過,這卻是最真實的、殘酷與慘痛代價的經驗。希望這些記錄可以減少後面跟進的學習者們寶貴的時間。

0-1、如何接近ROS ? 

在此先定義這個初階段的學習標的 :

  • 遠端遙控機器人
  • LiDAR雷達建地圖
  • 自主導航與避障
  • 路徑規劃   (到這 ~ 基本該會的操作都已經具備了)

我們就從 “ROS遠端遙控機器人” 開始吧 !

0-2、遠端遙控之系統架構

使用裝備 :

  • ACER i5 筆電 win10系統
  • 樹梅派 Pi4 B (2020 年最新版)

測試架構 :

筆電端 : 經過資料蒐集與無數次的誤打誤撞後,決定灌 VM 走 ROS Melodic Morenia。參考以下

官網資訊說明 Melodic 是最新持續update。

根據官網說法,

ROS Melodic installation instructions

These instructions will install the ROS Melodic Morenia distribution, which is available for Ubuntu Artful (17.10), Bionic (18.04 LTS) and Debian Stretch, among other platform options.

0-3、win10 筆電安裝VM (虛擬機)進行ubuntu環境安裝

我們決定先用PC安裝VM環境,如下 :

到Ubuntu官網下載 18.04LTS 印像檔 (ubuntu-18.04.3-desktop-amd64.iso ) , 約2.3G 下載時間約需 40分。

到VM中,點選 “Create a New Virtual Machine” ,一個按鍵可以安裝完成Ubuntu 18.04系統。不過系統安裝時間也約需40分鐘。

0-4、安裝 ROS Melodic Morenia 

請到ROS官網,按照步驟操作 :

1. Configure your Ubuntu repositories

按照下面的選項, “source code” 要勾一下,下載地點可依據下拉選單,選擇 “Select Best Server”,系統會自動去測試哪個server下載比較快。

Software Sources.png

選完下載伺服器後,點 “close”,接著會問是否要更新清單,選 “Reload” 來更新倉庫清單。

Select “Close” to save your changes. A dialog box should appear, asking whether you’d like to update the list of repositories. Select “Reload” to update the list.

Repobuttons.png

接著在 Alt+Ctrl照做以下動作。 refer to : http://wiki.ros.org/melodic/Installation/Ubuntu

Setup your sources.list

Setup your computer to accept software from packages.ros.org.

  • sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

Mirrors

Source Debs are also available

Set up your keys

  • sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

If you experience issues connecting to the keyserver, you can try substituting hkp://pgp.mit.edu:80 or hkp://keyserver.ubuntu.com:80 in the previous command.

Alternatively, you can use curl instead of the apt-key command, which can be helpful if you are behind a proxy server:

  • curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add -

Installation

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

  • sudo apt update

There are many different libraries and tools in ROS. We provided four default configurations to get you started. You can also install ROS packages individually.

In case of problems with the next step, you can use following repositories instead of the ones mentioned above ros-shadow-fixed

    • Desktop-Full Install: (Recommended) : ROS, rqtrviz, robot-generic libraries, 2D/3D simulators and 2D/3D perception

      • sudo apt install ros-melodic-desktop-full

        or click here

      Desktop Install: ROS, rqtrviz, and robot-generic libraries (~ 我們這裡用這個 ~ 耗時30分) 

      • sudo apt install ros-melodic-desktop

        or click here

      ROS-Base: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.

      • sudo apt install ros-melodic-ros-base

        or click here

      Individual Package: You can also install a specific ROS package (replace underscores with dashes of the package name):

    • sudo apt install ros-melodic-PACKAGE

      e.g.

      sudo apt install ros-melodic-slam-gmapping

To find available packages, use:

apt search ros-melodic

Environment setup

It’s convenient if the 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
source ~/.bashrc

To install this tool and other dependencies for building ROS packages, run:

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

Initialize rosdep

Before you can use many ROS tools, you will need to initialize rosdeprosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS. If you have not yet installed rosdep, do so as follows.

sudo apt install python-rosdep

With the following, you can initialize rosdep.

sudo rosdep init
rosdep update

到此為止,ROS算是安裝完成了。

可以試試看以下 roscore 命令,得到正確的回應。

2,948 thoughts on “ROS從”零”開始 – 0. 準備自己的虛擬機

  1. Heya i am for the first time here. I found this board and I find It really useful & it helped me out much.I hope to give something back and aid others like youhelped me.My blog: ACV Rx Reviews

  2. Hello There. I found your blog the use of msn. That is an extremely smartly written article.I’ll be sure to bookmark it and return to learn extra of your useful info.Thanks for the post. I’ll definitely return.

  3. An interesting discussion is definitely worth comment. I believe that you should write more about this subject, it might not be a taboo matter but usually folks don’t discuss these subjects. To the next! All the best.

  4. Hey! I just wanted to ask if you ever have any problems with hackers?My last blog (wordpress) was hacked and I ended up losing several weeksof hard work due to no back up. Do you have any solutions toprotect against hackers?

  5. Beer Bike offers affordable bikes & scooters for medium to long-term expats in Chiang Mai. The bikes are well-maintained by Gwang & Joe, and if you ask nicely, they’ll even a phone holder to your scooter, which is super useful. Price-wise, the monthly rates start at 1800 in low season and 2000 per month in high season. You can reach them via their Facebook page to check which bikes they currently have available.

  6. I’m really impressed with your writing skills as well as with thelayout on your blog. Is this a paid theme or did you modify it yourself?Either way keep up the excellent quality writing,it’s rare to see a nice blog like this one today.

  7. Pingback: Anonymous
  8. A motivating discussion is definitely worth comment. I do think that you need to write more on this subject, it may not be a taboo subject but typically people do not talk about such topics. To the next! Kind regards!!|

  9. Pingback: Anonymous
  10. Pingback: Anonymous
  11. I’m not sure where you’re getting your info, but good topic. I needs to spend some time learning more or understanding more. Thanks for wonderful information I was looking for this information for my mission.

  12. XEvil 5.0 solved captcha on your website!!

    Want to post your text to 12.000.000 (12 MILLIONS!) websites? No problem – with new “XEvil 5.0 + XRumer 19.0.8” software complex!
    Blogs, forums, boards, shops, guestbooks, social networks – any engines with any captchas!
    XEvil also compatible with any SEO/SMM programms and scripts, and can accept captchas from any source. Just try it! 😉

    Regards, MashaKeJew5616

    P.S. Huge discounts are available (up to 50%!) for a short review about XEvil on any popular forum or platform. Just ask Official support for discount!

    http://XEvil.Net/

  13. Pingback: ivermectin kaufen
  14. Having read this I believed it was extremely informative. I appreciate you spending some time and effort to put this article together. I once again find myself spending a significant amount of time both reading and leaving comments. But so what, it was still worth it!