2018年智慧機器人技術綜合實訓專題一系統基礎

zhangrelay發表於2018-12-11

2018年智慧機器人技術綜合實訓專題一系統基礎


此部分對應教材:《ROS機器人專案開發11例》,採用翻轉課堂模式,並未按書中章節順序授課。

請自學第一章,入門ROS機器人應用程式開發;第四章,使用ROS控制嵌入式電路板;第9章,構建自主移動機器人。

其中大部分內容,在之前課程已經全部講過了,模擬需要熟練掌握,實際機器人操作安排在第16周進行。


機器人系統設計基礎涵蓋內容非常廣,應用也非常豐富,從ARM到X86,RISC與CISC的區別,不同程式語言的介面與交叉呼叫。版本的升級,環境的更新等,都需要紮實掌握。

搜尋並瞭解最新的網路課程資訊,如下:

首先對比下面ROS 1兩類安裝過程amd64 arm64:



安裝
配置Debian儲存庫
配置Debian儲存庫以允許“contrib”和“non-free”。您可以按照Debian指南瞭解有關執行此操作的說明。

設定您的sources.list
設定您的計算機以接受packages.ros.org中的軟體。ROS Melodic 僅支援用於debian軟體包的Stretch(Debian 9)。


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

鏡子

Source Debs也可用

設定你的鑰匙
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
安裝
首先,確保您的Debian軟體包索引是最新的:

sudo apt-get update
ROS中有許多不同的庫和工具。我們提供了四種預設配置來幫助您入門。您也可以單獨安裝ROS軟體包。

桌面 - 完全安裝:(推薦):ROS,rqt,rviz,機器人通用庫,2D / 3D模擬器,導航和2D / 3D感知

sudo apt-get install ros-melodic-desktop-full
或點選這裡

桌面安裝: ROS,rqt,rviz和機器人通用庫

sudo apt-get install ros-melodic-desktop
或點選這裡

ROS-Base :( Bare Bones) ROS包,構建和通訊庫。沒有GUI工具。

sudo apt-get install ros-melodic-ros-base
或點選這裡

單個包:您還可以安裝特定的ROS包(用包名稱的短劃線替換下劃線):

sudo apt-get install ros-melodic-PACKAGE
例如
sudo apt-get install ros-melodic-slam-gmapping
要查詢可用的包,請使用:

apt-cache搜尋ros-melodic
初始化rosdep
在使用ROS之前,您需要初始化rosdep。rosdep使您可以輕鬆地為要編譯的源安裝系統依賴項,並且需要在ROS中執行一些核心元件。


sudo rosdep init
rosdep更新

環境設定
如果每次啟動新shell時ROS環境變數都自動新增到bash會話中,這很方便:


echo“source /opt/ros/melodic/setup.bash”>>〜/ .bashrc
source~ / .bashrc
如果安裝了多個ROS分發,則〜/ .bashrc必須僅為您當前使用的版本提供setup.bash。

如果您只想更改當前shell的環境,而不是上面的型別,則可以鍵入:


來源/opt/ros/melodic/setup.bash
如果使用zsh而不是bash,則需要執行以下命令來設定shell:


echo“source /opt/ros/melodic/setup.zsh”>>〜/ .zshrc
源〜/ .zshrc
構建包的依賴關係
到目前為止,您已經安裝了執行核心ROS軟體包所需的內容。要建立和管理自己的ROS工作區,可以單獨分發各種工具和要求。例如,rosinstall是一種常用的命令列工具,使您可以使用一個命令輕鬆下載ROS包的許多源樹。

要安裝此工具和其他依賴項以構建ROS包,請執行:


sudo apt-get install python-rosinstall python-rosinstall-generator python -wstool build-essential
建立農場狀態
您安裝的軟體包是由ROS構建伺服器場構建的。您可以在此處檢視各個包的狀態。



先決條件
安裝bootstrap依賴項
安裝bootstrap依賴項(Ubuntu):

這些工具用於促進ROS包及其依賴項的下載和管理。

Ubuntu或Debian:

$ sudo apt-get install python-rosdep python-rosinstall-generator python -wstool python-rosinstall build-essential
如果您在上面的命令中安裝軟體包時遇到問題,請確保已將packages.ros.org debian儲存庫新增到apt源列表,如下所述:melodic / Installation / Ubuntu#Installation.2BAC8-Ubuntu.2BAC8-Sources .Setup_your_sources.list

如果apt抱怨python-support包不可安裝,請確保在/etc/apt/sources.list中啟用了Ubuntu Universe儲存庫

Fedora的:

$ sudo dnf install gcc -c ++ python-rosdep python3-rosinstall_generator python -wstool python-rosinstall @ buildsys-build
目前,Fedora RPM儲存庫中不提供ROS中使用的一些軟體包。大多數其他軟體包都可以在RPM Fusion中使用。請參閱RPM Fusion命令列設定。

通用(pip):

如果您使用的是非Debian系統,則需要確保已安裝所有構建工具(編譯器,CMake等)。您可以通過PIP安裝所有ROS Python工具:
$ sudo pip install -U rosdep rosinstall_generator wstool rosinstall
如果下面有這個或rosdep步驟有錯誤,你的系統版本的pip可能已經過時了。使用系統的包管理來更新它,或使用它來更新自己:
$ sudo pip install --upgrade setuptools
請注意,在許多平臺(如OSX)上,您可能需要安裝上述軟體包並在virtualenv中使用ROS,以確保不會與系統依賴性發生衝突。

初始化rosdep

$ sudo rosdep init
$ rosdep更新

安裝
首先構建核心ROS包。

建立一個catkin工作區
為了構建核心包,您需要一個catkin工作區。立即建立一個:

$ mkdir~ / ros_catkin_ws
$ cd~ / ros_catkin_ws
接下來我們將要獲取核心包,以便我們可以構建它們。我們將使用wstool。為要安裝的特定變體選擇wstool命令:

桌面 - 完全安裝: ROS,rqt,rviz,機器人通用庫,2D / 3D模擬器,導航和2D / 3D感知

$ rosinstall_generator desktop_full --rosdistro melodic --deps --tar> melodic-desktop-full.rosinstall
$ wstool init -j8 src melodic-desktop-full.rosinstall
桌面安裝(推薦): ROS,rqt,rviz和機器人通用庫

$ rosinstall_generator desktop --rosdistro melodic --deps --tar> melodic-desktop.rosinstall
$ wstool init -j8 src melodic-desktop.rosinstall
ROS-Comm :( Bare Bones) ROS包,構建和通訊庫。沒有GUI工具。

$ rosinstall_generator ros_comm --rosdistro melodic --deps --tar> melodic-ros_comm.rosinstall
$ wstool init -j8 src melodic-ros_comm.rosinstall
這將新增給定變體中的所有catkin包,然後將源提取到〜/ ros_catkin_ws / src目錄中。該命令將花費幾分鐘時間將所有核心ROS包下載到src資料夾中。該-j8選項下載8封裝並行。


除了上面的3個變體之外,還有更多在REP 131中定義的內容,例如機器人,感知等。只需將包路徑更改為您想要的路徑,例如,對於機器人來說:


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

如果wstool init失敗或被中斷,您可以通過執行以下命令恢復下載:


wstool update -j 4 -t src
解決依賴關係
在構建catkin工作區之前,您需要確保擁有所有必需的依賴項。我們使用rosdep工具:

$ rosdep install --from-paths src --ignore-src --rosdistro melodic -y
這將檢視src目錄中的所有包,並找到它們具有的所有依賴項。然後它將遞迴安裝依賴項。

該--from路徑選項指示我們要安裝的依賴性針對封裝的整個目錄,在這種情況下SRC。該--ignore-SRC選項指示rosdep,它不應該嘗試在安裝任何ROS包SRC從包管理器資料夾,我們並不需要它,因為我們正在建設他們自己。該--rosdistro因為我們沒有ROS環境設定又選項是必需的,所以我們要指示rosdep我們正在建設的是什麼版本的ROS的。最後,-y選項向rosdep表明我們不希望被包管理器的太多提示所困擾。

一段時間後(可能會提示輸入您的密碼),rosdep將完成系統依賴項的安裝,您可以繼續。

構建catkin工作區
一旦完成下載包並解決依賴關係,您就可以構建catkin包了。我們將使用catkin_make_isolated因為有兩個絮和滑動cmake的包在基本安裝,您柳絮開發時只工作區,你可以選擇使用命令柳絮/命令/ catkin_make只與工作柳絮包。

呼叫catkin_make_isolated:

$ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE =發布

注意:您可能希望選擇不同的CMake構建型別(例如,RelWithDebInfo或Debug,請參閱http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE)。


注意:預設的catkin安裝位置是〜/ ros_catkin_ws / install_isolated,如果你想安裝在其他地方,那麼你可以通過在catkin_make_isolated呼叫中新增--install-space / opt / ros / melodic引數來實現。

對於沒有Ubuntu的機器人的使用,建議將編譯後的程式碼安裝到/ opt / ros / melodic中,就像Ubuntu軟體包那樣。不要在Ubuntu中這樣做,因為軟體包會與apt-get軟體包發生衝突。它也可以安裝在別處(例如/ usr),但除非你真的知道自己在做什麼,否則不建議這樣做。

有關如何放置已安裝檔案的更多詳細文件,請參閱REP 122:檔案系統層次結構佈局。


注意:在上面的命令中,我們從catkin原始檔夾執行catkin_make_isolated命令,因為它尚未安裝,一旦安裝,它可以直接呼叫。

現在應該已經將軟體包安裝到〜/ ros_catkin_ws / install_isolated或者使用--install-space引數指定的任何位置。如果檢視該目錄,您將看到已生成setup.bash檔案。要利用那裡安裝的東西,只需輸出這樣的檔案:

$ source~ / ros_catkin_ws / install_isolated / setup.bash

維護源結帳
如果我們想要保持我們的原始碼檢查是最新的,我們將不得不定期更新我們的rosinstall檔案,下載最新的原始碼,並重建我們的工作區。

更新工作區
要更新工作區,請先移動現有的rosinstall檔案,以免被覆蓋,並生成更新版本。為簡單起見,我們將介紹* destop-full *變體。對於其他變體,請相應地更新檔名和rosinstall_generator引數。


$ mv -i melodic-desktop-full.rosinstall melodic-desktop-full.rosinstall.old
$ rosinstall_generator desktop_full --rosdistro melodic --deps --tar> melodic-desktop-full.rosinstall
然後,將新的rosinstall檔案與舊版本進行比較,以檢視將更新的軟體包:


$ diff -u melodic-desktop-full.rosinstall melodic-desktop-full.rosinstall.old
如果您對這些更改感到滿意,請將新的rosinstall檔案合併到工作區中並更新工作區:


$ wstool merge -t src melodic-desktop-full.rosinstall
$ wstool update -t​​ src
重建您的工作區
現在工作區是最新的原始碼,重建它:


$ ./src/catkin/bin/catkin_make_isolated --install

如果最初在工作區中指定了--install-space選項,則應在重建工作區時再次指定它

重建工作區後,應再次獲取安裝檔案:


$ source~ / ros_catkin_ws / install_isolated / setup.bash



說明,對比上述兩種安裝方式,並詳細說明。

並類比ROS 2和ROS 1安裝的差異,與不同作業系統的異同之處:



在Windows上安裝ROS2¶
本頁介紹如何從預構建的二進位制包中在Windows上安裝ROS 2。

系統要求¶
從beta-2開始,僅支援Windows 10。

安裝先決條件¶
安裝的巧克力¶
Chocolatey是Windows的軟體包管理器,按照安裝說明進行安裝:

https://chocolatey.org/

您將使用Chocolatey安裝其他一些開發人員工具。

安裝Python¶
開啟命令提示符並鍵入以下內容以通過Chocolatey安裝Python:

> choco install -y python
安裝OpenSSL¶
從此頁面下載OpenSSL安裝程式。滾動到頁面底部並下載Win64 OpenSSL v1.0.2。不要下載Win32或Light版本。

使用預設引數執行安裝程式。然後,定義環境變數(以下命令假定您使用了預設安裝目錄):

setx -m OPENSSL_CONF C:\OpenSSL-Win64\bin\openssl.cfg
新增C:\OpenSSL-Win64\bin\到您的路徑
安裝Visual Studio ¶
如果使用Ardent或更早版本,請安裝Visual Studio 2015
如果使用Bouncy或每晚,請安裝Visual Studio 2017
安裝其他DDS實現(可選)¶
ROS 2建立在DDS之上。它與多個DDS或RTPS(DDS線協議)供應商相容。

您下載的軟體包是為多個供應商提供的可選支援:eProsima FastRTPS,Adlink OpenSplice和(作為ROS 2 Bouncy)RTI Connext作為中介軟體選項。預設情況下捆綁了eProsima快速RTPS的執行時支援。如果您想使用其他供應商之一,則需要單獨安裝其軟體。

凌華OpenSplice ¶
如果你想使用OpenSplice,你需要下載最新版本(對於ROS 2 Bouncy,我們至少要求版本6.7.180404OSS-HDE-x86_64.win-vs2017)。對於直到並包括Ardent的ROS 2發布,提取它但此時不做任何其他事情。對於晚於Ardent的ROS 2版本,將OSPL_HOME環境變數設定為包含該release.bat指令碼的解壓縮目錄。

器R Connext ¶
要使用RTI Connext(從ROS 2 Bouncy開始提供),您需要獲得RTI的許可。

您可以從他們的下載頁面安裝RTI提供的Connext版本5.3.1的Windows軟體包。

安裝完成後,執行RTI啟動程式並將其指向許可證檔案。

設定NDDSHOME環境變數:

設定 “NDDSHOME = C:\ Program Files \ rti_connext_dds-5.3.1”
如果要安裝Connext DDS-Security外掛,請參閱此頁面

安裝OpenCV ¶
一些示例需要安裝OpenCV。

您可以從https://github.com/ros2/ros2/releases/download/opencv-archives/opencv-3.4.1-vc15.VS2017.zip下載預編譯版本的OpenCV 3.4.1。

假設您將其解壓縮到C:\opencv,請在命令提示符下鍵入以下內容(需要管理員許可權):

setx -m OpenCV_DIR C:\ o pencv
由於您使用的是預編譯的ROS版本,因此我們必須告訴它在哪裡可以找到OpenCV庫。您必須將PATH變數擴充套件為c:\opencv\x64\vc15\bin

在熱情和早期¶
這些版本使用OpenCV 2.您可以從https://github.com/ros2/ros2/releases/download/release-beta2/opencv-2.4.13.2-vc14.VS2015.zip下載預編譯版本的OpenCV 2.4.13.2。

由於您使用的是預編譯的ROS版本,因此我們必須告訴它在哪裡可以找到OpenCV庫。假設你正在提取OpenCV,c:\你必須將PATH變數擴充套件到c:\opencv-2.4.13.2-vc14.VS2015\x64\vc14\bin

安裝依賴項¶
Chocolatey包資料庫中有一些不可用的依賴項。為了簡化手動安裝過程,我們提供必要的Chocolatey包裝。

由於一些巧克力包依賴於它,我們首先安裝CMake

> choco install -y cmake
您需要將CMake bin資料夾附加到PATH(您可以通過單擊Windows圖示,鍵入“Environment Variables”,然後單擊“編輯系統環境變數”來執行此操作。在出現的對話方塊中,單擊“環境變數” ,單擊底部窗格中的“路徑”,然後單擊“編輯”並新增路徑)。C:\Program Files\CMake\bin

請從下載這些包這個 GitHub的倉庫。

asio.1.12.1.nupkg
本徵3.3.4.nupkg
TinyXML的-usestl.2.6.2.nupkg
tinyxml2.6.0.0.nupkg
下載這些軟體包後,開啟管理shell並執行以下命令:

> choco install -y -s <PATH \ T O \ D OWNLOADS \> asio eigen tinyxml-usestl tinyxml2
請替換<PATH\TO\DOWNLOADS>您下載軟體包的資料夾。

您還必須為命令列工具安裝一些python依賴項:

python -m pip install -U catkin_pkg empy git + https://github.com/lark-parser/lark.git@0.7b pyparsing pyyaml setuptools
下載ROS2¶
轉到發布頁面:https://github.com/ros2/ros2/releases
下載適用於Windows的最新軟體包,例如ros2-package-windows-AMD64.zip。
筆記:
可能有多個二進位制下載選項可能導致檔名不同。
[僅限ROS Bouncy]要下載ROS 2除錯庫,您需要下載 ros2-bouncy-windows-Debug-AMD64.zip
解壓縮zip檔案(我們假設C:\dev\ros2)。
注意(Ardent和更早版本):似乎存在一個問題,即使用7zip解壓縮zip檔案會導致RViz在啟動時崩潰。使用Windows資源管理器解壓縮zip檔案以防止這種情況發生。
設定ROS 2環境¶
啟動命令shell並獲取ROS 2安裝檔案來設定工作區:

>呼叫C:\ d ev \ r os2 \ l ocal_setup.bat
對於直到並包括Ardent的ROS 2版本,如果您下載了具有OpenSplice支援的版本,則必須另外手動獲取OpenSplice安裝檔案(這可以比Ardent更晚的ROS 2版本自動完成;可以跳過此步驟)。如果沒有其他錯誤,前一個命令正常輸出“系統無法找到指定的路徑。”恰好一次。只有在獲取ROS 2安裝檔案後才執行此步驟:

>呼叫“C:\ opensplice67 \ HDE \ x86_64.win64 \ release.bat”
試試一些例子¶
在命令shell中,如上所述設定ROS 2環境,然後執行talker:

> ros2執行demo_nodes_cpp talker
啟動另一個命令shell並執行listener:

> ros2執行demo_nodes_py監聽器
你應該看到talker它的Publishing訊息和listener說這些訊息的說法。萬歲!I heard

如果已安裝對可選供應商的支援,請參閱此頁面以獲取有關如何使用該供應商的詳細資訊。

故障排除¶
如果您的示例在某一時刻由於缺少dll而無法啟動,請驗證來自外部依賴項(如OpenCV)的所有庫都位於PATH變數內。
如果您忘記local_setup.bat從終端呼叫該檔案,則演示程式很可能會立即崩潰。



在OS X上安裝ROS2¶
本頁介紹如何從預構建的二進位制包中在OS X上安裝ROS 2。

系統要求¶
我們支援OS X El Capitan和Sierra(10.11.x和10.12.x)。

安裝先決條件¶
在安裝ROS 2之前,您需要安裝以下內容。

brew (需要安裝更多東西;你可能已經有了這個):

按照http://brew.sh/上的安裝說明進行操作

可選:執行以下命令檢查brew您的系統配置是否滿意:

  釀造醫生


修復它識別的任何問題。
使用brew安裝更多的東西:

brew安裝python3

#install asio和tinyxml2用於Fast-RTPS
brew install asio tinyxml2

#started狀態發布者的安裝依賴項
brew install tinyxml eigen pcre poco

#OpenCV不是ROS 2的依賴,但它被一些演示使用。
brew安裝opencv

#install DDS-Security的OpenSSL
brew安裝openssl

#stal Qt for RViz
brew install qt freetype assimp
為命令列工具安裝其他執行時依賴項:

python3 -m pip install catkin_pkg empy git + https://github.com/lark-parser/lark.git@0.7b pyparsing pyyaml setuptools argcomplete
禁用系統完整性保護(SIP)¶
OS X版本> = 10.11預設啟用系統完整性保護。因此,SIP不會阻止程式繼承動態連結器環境變數,例如DYLD_LIBRARY_PATH,您需要按照這些說明禁用它。

下載ROS2¶
轉到發布頁面:https://github.com/ros2/ros2/releases

下載OS X的最新軟體包; 讓我們假設它最終到了~/Downloads/ros2-package-osx-x86_64.tar.bz2。

注意:可能有多個二進位制下載選項可能導致檔名不同。
開啟包裝:

mkdir -p~ / ros2_install
 cd ~ / ros2_install
tar xf~ / Downloads / ros2-package-osx-x86_64.tar.bz2
安裝其他DDS實現(可選)¶
ROS 2建立在DDS之上。它與多個DDS或RTPS(DDS線協議)供應商相容。

對於ROS 2 Bouncy和更新版:

您下載的軟體包已經構建,可選擇支援三個供應商。預設情況下捆綁了eProsima快速RTPS的執行時支援。如果您想使用其他供應商之一,則需要單獨安裝其軟體。

對於ROS 2 Ardent和更久:

如果您下載的軟體包包含對OpenSplice的支援,則必須安裝OpenSplice,詳情如下。

啟用OpenSplice支援:¶
從https://github.com/ADLINK-IST/opensplice/releases下載最新版本並解壓縮。對於直到並包括Ardent的ROS 2版本,此時不要做任何其他事情。對於晚於Ardent的ROS 2版本,將OSPL_HOME環境變數設定為包含該release.com指令碼的解壓縮目錄。

啟用Connext支援:¶
要使用RTI Connext,您需要從RTI獲得許可。

您可以從他們的下載頁面安裝RTI提供的Connext版本5.3.1的OS X軟體包。

安裝完成後,執行RTI啟動程式並將其指向許可證檔案。

設定NDDSHOME環境變數:

export  NDDSHOME = /Applications/rti_connext_dds-5.3.1/
您可能需要在https://community.rti.com/kb/osx510之後增加共享記憶體資源。

如果要安裝Connext DDS-Security外掛,請參閱此頁面

設定ROS 2環境¶
源ROS 2安裝檔案:

。〜/ ros2_install / ros2-OSX / setup.bash
對於直到並包括Ardent的ROS 2版本,如果您下載了具有OpenSplice支援的版本,則必須另外手動獲取OpenSplice安裝檔案(這比在Ardent之後的ROS 2版本自動完成)。只有在您獲得ROS 2 之後才能執行此操作:

。<path_to_opensplice> /x86_64.darwin10_clang/release.com
試試一些例子¶
在一個終端中,如上所述設定ROS 2環境,然後執行talker:

ros2執行demo_nodes_cpp說話者
在另一個終端中,設定ROS 2環境,然後執行listener:

ros2執行demo_nodes_cpp監聽器
你應該看到talker它的Publishing訊息和listener說這些訊息的說法。萬歲!I heard

如果已安裝對可選供應商的支援,請參閱此頁面以獲取有關如何使用該供應商的詳細資訊。

如果遇到問題,請參閱源安裝頁面上的疑難解答部分。



機器人作業系統適用環境,windows、Linux、Mac OS、Android、iOS等所有桌面平臺和手機裝置!可以使用C++、Python、Lisp、Java、Matlab等所有程式語言進行演算法設計!!!

熟練掌握:roscpp rospy roslisp rosjava。

理解虛擬機器(Parallels Desktop ,Vmware,VirtualBox,Virtual PC)與容器(kubernetes ,docker)的區別。

hub.docker.com/_/ros/

詳細說明容器技術使用ROS的優勢與不足???

提示如下:



虛擬化技術

虛擬化技術即通過hypervisor將OS執行在物理裝置或是宿主OS上,此兩種虛擬化為裸機虛擬化和宿主虛擬化:

裸機
虛擬機器直接執行在系統硬體上,建立硬體全模擬例項,被稱為“裸機”型。
裸機型在虛擬化中Hypervisor直接管理呼叫硬體資源,不需要底層作業系統,也可以將Hypervisor看
作一個很薄的作業系統。這種方案的效能處於主機虛擬化與作業系統虛擬化之間。
宿主
虛擬機器執行在傳統作業系統上,同樣建立的是硬體全模擬例項,被稱為“託管(宿主)”型。
託管型/主機型Hypervisor執行在基礎作業系統上,構建出一整套虛擬硬體平臺
(CPU/Memory/Storage/Adapter),使用者根據需要安裝新的作業系統和應用軟體,底層和上層的
作業系統可以完全無關化,如Windows執行Linux作業系統。主機虛擬化中VM的應用程式呼叫硬體資
源時需要經過:VM核心->Hypervisor->主機核心,因此相對來說,效能是三種虛擬化技術中最差的。
容器技術

容器是通過一種虛擬化技術來隔離執行在主機上不同程式,從而達到程式之間、程式和宿主作業系統相互隔離、互不影響的技術。這種相互孤立程式就叫容器,它有自己的一套檔案系統資源和從屬程式。



作業:

複習並完成如下教程:

ROS1 :: wiki.ros.org/ROS/Tutorials

ROS2 :: index.ros.org/doc/ros2/Tutorials/



ROS 1

Core ROS Tutorials
Beginner Level
Installing and Configuring Your ROS Environment
This tutorial walks you through installing ROS and setting up the ROS environment on your computer.

Navigating the ROS Filesystem
This tutorial introduces ROS filesystem concepts, and covers using the roscd, rosls, and rospack commandline tools.

Creating a ROS Package
This tutorial covers using roscreate-pkg or catkin to create a new package, and rospack to list package dependencies.

Building a ROS Package
This tutorial covers the toolchain to build a package.

Understanding ROS Nodes
This tutorial introduces ROS graph concepts and discusses the use of roscore, rosnode, and rosrun commandline tools.

Understanding ROS Topics
This tutorial introduces ROS topics as well as using the rostopic and rqt_plot commandline tools.

Understanding ROS Services and Parameters
This tutorial introduces ROS services, and parameters as well as using the rosservice and rosparam commandline tools.

Using rqt_console and roslaunch
This tutorial introduces ROS using rqt_console and rqt_logger_level for debugging and roslaunch for starting many nodes at once. If you use ROS fuerte or ealier distros where rqt isn't fully available, please see this page with this page that uses old rx based tools.

Using rosed to edit files in ROS
This tutorial shows how to use rosed to make editing easier.

Creating a ROS msg and srv
This tutorial covers how to create and build msg and srv files as well as the rosmsg, rossrv and roscp commandline tools.

Writing a Simple Publisher and Subscriber (C++)
This tutorial covers how to write a publisher and subscriber node in C++.

Writing a Simple Publisher and Subscriber (Python)
This tutorial covers how to write a publisher and subscriber node in python.

Examining the Simple Publisher and Subscriber
This tutorial examines running the simple publisher and subscriber.

Writing a Simple Service and Client (C++)
This tutorial covers how to write a service and client node in C++.

Writing a Simple Service and Client (Python)
This tutorial covers how to write a service and client node in python.

Examining the Simple Service and Client
This tutorial examines running the simple service and client.

Recording and playing back data
This tutorial will teach you how to record data from a running ROS system into a .bag file, and then to play back the data to produce similar behavior in a running system.

Getting started with roswtf
Basic introduction to the roswtf tool.

Navigating the ROS wiki
This tutorial discusses the layout of the ROS wiki (ros.org) and talks about how to find what you want to know.

Where Next?
This tutorial discusses options for getting to know more about using ROS on real or simulated robots.


Now that you have completed the beginner level tutorials please answer this short questionnaire.

Intermediate Level
More client API tutorials can be found in the relevant package (roscpp, rospy, roslisp)

Creating a ROS package by hand.
This tutorial explains how to manually create a ROS package.

Managing System dependencies
This explains how to use rosdep to install system dependencies.

Roslaunch tips for large projects
This tutorial describes some tips for writing roslaunch files for large projects. The focus is on how to structure launch files so they may be reused as much as possible in different situations. We'll use the 2dnav_pr2 package as a case study.

Running ROS across multiple machines
This tutorial explains how to start a ROS system using two machines. It explains the use of ROS_MASTER_URI to configure multiple machines to use a single master.

Defining Custom Messages
This tutorial will show you how to define your own custom message data types using the ROS Message Description Language.

Using a C++ class in Python
This tutorial illustrates a way to use a C++ class with ROS messages in Python.

Packaging your ROS project as a snap
This tutorial covers how to package and deploy your ROS project as a snap.

How to Write a Tutorial
This tutorial covers useful template and macros for writing tutorials, along with example tutorials that are available for guidance on ros.org


ROS Standards
ROS Developers Guide Guidelines for coding style, package layout and much more

Standard Units of Measure and Coordinate Conventions

Tutorials for Other ROS Libraries
Robot Model

Visualization

actionlib

Pluginlib

Nodelets

Navigation

ROS-Industrial Tutorials

Dynamixel Tutorials

Tutorials for Libraries with ROS Interfaces
Stage

TF

PCL with ROS

External ROS Resources
External Tutorials
ROS Online Courses Library

ROS Weekly LIVE-Class

Udemy Course on ROS: Video tutorials on learning to program robots from scratch

Online ROS Tutorials:Learn ROS by programming online simulated robots

ROS Q&A Videos Tutorials

ROS Tutorial Video Demos at ANU

NooTriX Step-by-Step ROS Tutorials

Clearpath Robotics' knowledge base

Erle Robotics - Learning ROS

ROS-Industrial Training Class Curriculum

Jonathan Bohren's ROS Tutorials

An Introduction to Robot Operating System (ROS)

Programming Robots Using ROS: An introduction (Arabic Language)

Learn ROS using a URDF simulation model from basics through SLAM - by Husarion

External Seminar/Lecture
ROS Meetup by The Construct

Free introductory seminar for enterprises by TORK in Tokyo

Using ROS on your custom Robot
Bringing ROS to real life: Barista The first robot serving coffee to the tables in the world

Create your own URDF file Creating a custom Universal Robot Description Format file

ros_control Use ROS's standard controller framework for interfacing with hardware.

Using a URDF in Gazebo Add the necessary tags to get your robot in the Gazebo robotic simulator

Setting up MoveIt! Creating the configuration package to use the MoveIt! Motion Planning Framework



ROS 2

Tutorials¶
About ROS 2¶
Overview of ROS 2 concepts
DDS and ROS middleware implementations
ROS 2 Client Libraries
About ROS interfaces
About Quality of Service Settings
ROS 2 Tutorials¶
Installation from binary and source, all platforms
Using colcon to build a custom package
Introspection with command-line tools
Passing ROS arguments to nodes via the command-line
Launching/monitoring multiple nodes with Launch
Working with multiple RMW implementations
Composing multiple nodes in a single process
Defining custom interfaces (msg/srv)
New features in ROS 2 interfaces (msg srv)
Eclipse Oxygen with ROS 2 and rviz2 [community-contributed]
Building ROS 2 on Linux with Eclipse Oxygen [community-contributed]
Building Realtime rt_preempt kernel for ROS 2 [community-contributed]
Advanced¶
Implement a custom memory allocator
Docker¶
Run 2 nodes in a single docker container [community-contributed]
Run 2 nodes in two separate docker containers [community-contributed]
ROS 2 Demos¶
Use quality-of-service settings to handle lossy networks
Management of nodes with managed lifecycles
Efficient intra-process communication
Bridge communication between ROS 1 and ROS 2
Recording and playback of topic data with rosbag using the ROS 1 bridge
Turtlebot 2 demo using ROS 2
TurtleBot 3 demo using ROS 2 [community-contributed]
Using tf2 with ROS 2
Write real-time safe code that uses the ROS 2 APIs
Use the rclpy API to write ROS 2 programs in Python
Use the robot state publisher to publish joint states and TF
Use DDS-Security
Logging and logger configuration
ROS 2 Examples¶
Python and C++ minimal examples
Troubleshooting¶
Enable Multicast¶
In order to communicate successfully via DDS, the used network interface has to be multicast enabled. We’ve seen in past experiences that this might not necessarily be enabled by default (on Ubuntu or OSX) when using the loopback adapter. See the original issue or a conversation on ros-answers. You can verify that your current setup allows multicast with the ROS 2 tool:

In Terminal 1:

ros2 multicast receive
In Terminal 2:

ros2 multicast send



 

相關文章