1. 程式人生 > >ROS 進階學習筆記(17):ROS導航2:關於 move_base Package(底盤移動包)

ROS 進階學習筆記(17):ROS導航2:關於 move_base Package(底盤移動包)

== 關於move_base 包(底盤移動包?移動底盤包?) ==

開始之前,我[email protected]有幾個問題(Link on ROS_Answer)需要搞定:

  1. costmap_2d包 與 move_base包 是什麼關係?
  2. 導航時,在RviZ工具中,可以看到,inflate 地圖是由一個叫做 /move_base/local_costmap/costmap 主題生成的,這個主題的釋出者又是move_base,怎麼釋出的?
  3. 到底是costmap_2d釋出的/move_base/local_costmap/costmap還是move_base釋出的它?又回到第1個問題,關係問題。
  4. [email protected]
    要解決的就是inflated obstacle層的重新整理機制

How to solve the problem:


=== 我學這個包的時候,儘量總結wiki page上的內容如下,算是[email protected]讀書筆記:===
wikipage: http://wiki.ros.org/move_base
move_base package 所屬Stack: navigation
關於這個包在 ROS Navigation 框架中的位置,參見:ROS探索總結(十三)——導航與定位框架

【Summary】

The move_base package provides an implementation of an action (see the

actionlib package) that, given a goal in the world, will attempt to reach it with a mobile base. The move_base node links together a global and local planner to accomplish its global navigation task. It supports any global planner adhering to the nav_core::BaseGlobalPlanner interface specified in the
nav_core
package and any local planner adhering to the nav_core::BaseLocalPlanner interface specified in thenav_core package. The move_base node also maintains two costmaps, one for the global planner, and one for a local planner (see thecostmap_2d package) that are used to accomplish navigation tasks.

這個包就是一個Action的實現,關於action,是一個ROS裡的概念,需要到連結去學習。這個action就是要有幾個輸入,比如goal,然後它要給出的就是你的mobile base怎麼到那裡去的一個action輸出。the move_base node實際上是一個link, 把全域性規劃器、區域性規劃器連線起來,以達成導航到目的地的目標。nav_core::BaseGlobalPlanner 接口裡由nav_core指定的那些全域性或 nav_core::BaseLocalPlanner 接口裡由nav_core指定的區域性規劃器都被 move_base 支援。move_base node 還維護了倆costmap, 一個是為全域性規劃器準備的 global costmap, 一個是local的,這倆costmap也是為了完成[email protected]導航的任務。

【關於 move_base Nodes】

This package provides the move_base ROS Node which is a major component of thenavigation stack. A detailed description of this Node and its configuration options is found below. 主要的結構就是見下圖咯:


    要說的呢,就是move_base看起來彷彿是個殼兒,殼兒負責和外界交流,它肚子裡的才是乾貨[email protected]呵呵!

    The move_base node provides a ROS interface for configuring, running, and interacting with thenavigation stack on a robot. A high-level view of the move_base node and its interaction with other components is shown above. The blue vary based on the robot platform, the gray are optional but are provided for all systems, and the white nodes are required but also provided for all systems. For more information on configuration of themove_base node, and the navigation stack as a whole, please see thenavigation setup and configuration tutorial.

    這裡講了各個顏色的方框代表的含義,給了一個tutorial的連結,教你怎麼配置 navigation setup and configuration. 配置導航stack肯定會用到的link

【期望的機器人的行為】

先扔了一幅圖:

Running the move_base node on a robot that is properly configured (please seenavigation stack documentation for more details) results in a robot that will attempt to achieve a goal pose with its base to within a user-specified tolerance. In the absence of dynamic obstacles, the move_base node will eventually get within this tolerance of its goal or signal failure to the user. Themove_base node may optionally perform recovery behaviors when the robot perceives itself as stuck. By default, themove_base node will take the following actions to attempt to clear out space([email protected]):

First, obstacles outside of a user-specified region will be cleared from the robot's map. Next, if possible, the robot will perform an in-place rotation to clear out space. If this too fails, the robot will more aggressively clear its map, removing all obstacles outside of the rectangular region in which it can rotate in place. This will be followed by another in-place rotation. If all this fails, the robot will consider its goal infeasible and notify the user that it has aborted. These recovery behaviors can be configured using the recovery_behaviors parameter, and disabled using therecovery_behavior_enabled parameter.

對圖作一下解釋: 在你已經配置得比較好的機器人上執行 move_base node就會讓你的機器人跑到指定的位姿去,在tolerance,容錯值允許的範圍內到達。In the absence of dynamic obstacles,要麼 move_base node會最終到達,要麼會返回一個失敗訊號。當機器人感覺被卡住stuck時,the move_base node可能會選擇性地執行recovery 恢復行為。預設的,這個 move_base node 會採取以下的措施來clear out space: 搞清楚自己的處境?

  • 首先,機器人清掃地圖,無關緊要的障礙就不處理了。
  • 然後,機器人會原地轉圈來搞清楚自己處境clear out space
  • 如果這個失敗,機器人會變得更勇敢地clear its map, 移除矩形區域以外的所有的障礙,而這個矩形區域是它可以在其中原地轉圈的區域。
  • 接下來就是另一個 in-place 轉圈原地轉圈。
  • 如果上述所有步驟都失敗了,機器人可能會考慮它的goal達不到了並通知使用者aborted任務失敗。
        [email protected]: 這些恢復行為可以在 the recovery_behaviors parameter 裡配置,或者開關這些行為:and be disabled using the recovery_behavior_enabled parameter

【Action API】

The move_base node provides an implementation of theSimpleActionServer (seeactionlib documentation), that takes in goals containinggeometry_msgs/PoseStamped messages. You can communicate with themove_base node over ROS directly, but the recommended way to send goals tomove_base if you care about tracking their status is by using theSimpleActionClient. Please see actionlib documentation for more information.

The move_base node 提供的是一個SimpleActionServer (seeactionlib documentation)的動作伺服器,它吃進 goals containinggeometry_msgs/PoseStamped messages。你可以在ROS架構上和move_base node 通訊,但如果你關心它們的狀態的話,推薦的方式是通過使用 theSimpleActionClient給它發goals, 詳見actionlib documentation for more information。(看來 actionlib documentation 是必須要搞一搞才行了~~)

sonictl: 這裡面涉及到ROS裡的幾個值得總結的概念分類問題: 1. What is Service/Actionlib/plugin...     2. What is message/topic/parameter/node/tf   3. ...other concepts

Action Subscribed Topics:

  •         A goal for move_base to pursue in the world.
move_base/cancel (actionlib_msgs/GoalID)
  •         A request to cancel a specific goal.

Action Published Topics:

  •         Feedback contains the current position of the base in the world.
move_base/status (actionlib_msgs/GoalStatusArray)
  •         Provides status information on the goals that are sent to themove_base action.
move_base/result (move_base_msgs/MoveBaseActionResult)Result is empty for the move_base action.

【Subscribed Topics】

move_base_simple/goal (geometry_msgs/PoseStamped)Provides a non-action interface to move_base for users that don't care about tracking the execution status of their goals.

【Published Topics】

cmd_vel (geometry_msgs/Twist)A stream of velocity commands meant for execution by a mobile base.

【Services】

這幾個services還是挺有用的,我sonictl就不純翻譯了。[email protected]

  • Allows an external user to ask for a plan to a given pose frommove_base without causingmove_base to execute that plan.  請求一個plan, 但它不執行
~clear_unknown_space (std_srvs/Empty)
  • Allows an external user to tell move_base to clear unknown space in the area directly around the robot. This is useful when move_base has its costmaps stopped for a long period of time and then started again in a new location in the environment. - Available in versions from 1.1.0-groovy 
~clear_costmaps (std_srvs/Empty)Allows an external user to tell move_base to clear obstacles in the costmaps used by move_base. This could cause a robot to hit things and should be used with caution. -New in 1.3.1

【Parameters】

這些引數一般是寫在 ~/ws_catkin/rbx1/rbx1_nav/config/turtlebot/base_local_planner_params.yaml 檔案裡(MyBook: ros_by_example_hydro_volume1)

~base_global_planner (string, default:"navfn/NavfnROS"For 1.1+ series)

  • The name of the plugin for the global planner to use withmove_base, seepluginlib documentation for more details on plugins. This plugin must adhere to thenav_core::BaseGlobalPlanner interface specified in thenav_core package. (1.0 series default:"NavfnROS")
    全域性規劃器的名字,讓move_base拿來用的,關於pluginlib, 要看文件。這個plugin 必須要粘在nave_core::BaseGlobalPlanner 的介面上使用,nav_core定義了那些介面。1.0 系列的預設的全域性規劃器名字是:NavfnROS
~base_local_planner (string, default:"base_local_planner/TrajectoryPlannerROS"For 1.1+ series)
  • The name of the plugin for the local planner to use withmove_base seepluginlib documentation for more details on plugins. This plugin must adhere to thenav_core::BaseLocalPlanner interface specified in thenav_core package. (1.0 series default:"TrajectoryPlannerROS")
    區域性規劃器的外掛名,關於外掛的事情就還是那個連結了。這個plugin 必須要粘在nave_core::BaseLocalPlanner 的介面上使用,nav_core定義了那些介面。1.0 系列的預設的全域性規劃器名字是:TrajectoryPlannerROS
~recovery_behaviors (list, default: [{name: conservative_reset, type: clear_costmap_recovery/ClearCostmapRecovery}, {name: rotate_recovery, type: rotate_recovery/RotateRecovery}, {name: aggressive_reset, type: clear_costmap_recovery/ClearCostmapRecovery}] For 1.1+ series)
  • A list of recovery behavior plugins to use with move_base, see pluginlib documentation for more details on plugins. These behaviors will be run whenmove_base fails to find a valid plan in the order that they are specified. After each behavior completes,move_base will attempt to make a plan. If planning is successful,move_base will continue normal operation. Otherwise, the next recovery behavior in the list will be executed. These plugins must adhere to thenav_core::RecoveryBehavior interface specified in the nav_core package. (1.0 series default: [{name: conservative_reset, type: ClearCostmapRecovery}, {name: rotate_recovery, type: RotateRecovery}, {name: aggressive_reset, type: ClearCostmapRecovery}]).
    Note: For the default parameters, the aggressive_reset behavior will clear out to a distance of 4 *~/local_costmap/circumscribed_radius.
    這個就是區域性擺脫困境的一些動作列表,這裡呢也可以使用外掛來弄,你sonictl的擺脫效能好不好就看這個核心技術了喲!!抓狂
~controller_frequency (double, default: 20.0)
  • The rate in Hz at which to run the control loop and send velocity commands to the base.
    控制器釋出速度命令的頻率(看看,預設值20!一般設定為3。這裡暗示了一個向底盤傳送速度指令的頻率要求,而不是給個值就不管了~~)
~planner_patience (double, default: 5.0)
  • How long the planner will wait in seconds in an attempt to find a valid plan before space-clearing operations are performed.
    字面意思是:規劃器在一個操作執行前等幾秒鐘就去找合適的路徑,那個操作就是 space-clearing 。這個有點confusing
  • 理解看的話,應該是 全域性/區域性 規劃器要在 space-clearing 操作(obstacle就會被清掉)執行幾秒之後開始規劃路徑。而不是之前~~疑問不懂~
    操作器找路5s後,如果還找不到,就space-clearing操作?
~controller_patience (double, default: 15.0)
  • How long the controller will wait in seconds without receiving a valid control before space-clearing operations are performed.
    控制器要等15s沒有接到一個合法的控制,然後就要執行space-clearing操作(obstacle就會被清掉)了。
~conservative_reset_dist (double, default: 3.0)
  • The distance away from the robot in meters at which obstacles will be cleared from thecostmap when attempting to clear space in the map. Note, this parameter is only used when the default recovery behaviors are used formove_base.
    距離機器人多遠的距離的obstacle就會被從costmap上清掉。注意,只有 default recovery behaviors are used for move_base 時,這個引數才有用。
~recovery_behavior_enabled (bool, default:true)
  • Whether or not to enable the move_base recovery behaviors to attempt to clear out space.
    是否允許 move_base 的恢復動作來clear out space.
  • clear out space 究竟是什麼意思?重新整理costmap上的obstacle?
~clearing_rotation_allowed (bool, default:true)
  • Determines whether or not the robot will attempt an in-place rotation when attempting to clear out space. Note: This parameter is only used when the default recovery behaviors are in use, meaning the user has not set therecovery_behaviors parameter to anything custom.
    要不要機器人在clear out space時執行一個原地轉圈。注意,只有 default recovery behaviors are used for move_base 時,這個引數才有用。這意味著使用者sonictl並沒有把 recovery_behaviors 這個引數設定為 anything custom(定製的任何值)。
~shutdown_costmaps (bool, default:false)
  • Determines whether or not to shutdown the costmaps of the node whenmove_base is in an inactive state
    當move_base在不活動狀態時,是不是要關掉move_base node的 costmap
~oscillation_timeout (double, default: 0.0)
  • How long in seconds to allow for oscillation before executing recovery behaviors. A value of 0.0 corresponds to an infinite timeout.New in navigation 1.3.1
    在執行恢復動作前等多久,來 oscillation (晃盪),如果是 0.0 的話,意味著可以永久晃盪下去.sonictl at CSDN。
~oscillation_distance (double, default: 0.5)
  • How far in meters the robot must move to be considered not to be oscillating. Moving this far resets the timer counting up to the~oscillation_timeoutNew in navigation 1.3.1
    機器人跑多遠才不被認為是在晃盪,超過這個值就會重設那個定時器,而定時器的timeout時間是由 ~oscillation_timeout 引數指定的。
~planner_frequency (double, default: 0.0)
  • The rate in Hz at which to run the global planning loop. If the frequency is set to 0.0, the global planner will only run when a new goal is received or the local planner reports that its path is blocked.New in navigation 1.6.0
    頻率 - 就是全域性規劃器迴圈的頻率Hz. 0.0 = 只有當收到一個新的goal時或收到local planner發的path is blocked報告時才進行一次全域性規劃。sonictl認為這個也很重要

【Component APIs】

The move_base node 包含的這些元件都有它們自己的ROS API, 也許因為這些元件的值而會不同,具體的Links就在下面列出供查詢。
The move_base node contains components that have their own ROS APIs. These components may vary based on the values of the~base_global_planner,~base_local_planner, and~recovery_behaviors respectively. Links to the APIs for the default components can be found below:

  • costmap_2d - Documentation on thecostmap_2d package used in move_base

  • nav_core - Documentation on thenav_core::BaseGlobalPlanner andnav_core::BaseLocalPlanner interfaces used bymove_base.

  • navfn - Documentation on thenavfn global planner used inmove_base

  • rotate_recovery - Documentation on therotate_recovery recovery behavior used inmove_base

Class Diagram (partially & not strictly drawn) is available here.

======== 以上就是我sonictl的讀書筆記 ======

相關推薦

ROS 學習筆記17ROS導航2關於 move_base Package(底盤移動)

== 關於move_base 包(底盤移動包?移動底盤包?) == 開始之前,我[email protected]有幾個問題(Link on ROS_Answer)需要搞定: costmap_2d包 與 move_base包 是什麼關係?導航時,在RviZ工具中,

ROS 學習筆記16ROS導航1關於Costmap_2d Package 代價地圖

 === 關於Costmap_2d Package === wiki page: http://wiki.ros.org/costmap_2d=== 我遇到的問題是 obstacle layer的重新整理頻率太低 ===  costmap_2d包下的所有類文件:http:

python學習筆記——實現python任意個數的關鍵字引數

class Person(object): def __init__(self, name, gender, birth, **kw): self.name = name self.gender = gender self.birth = birth

ROS學習筆記9-- 關於Overlay重名 package 在不同catkin workspace 中,

要把ROS玩轉,必須把 catkin 玩轉。 http://wiki.ros.org/catkin/Tutorials 其中,Overlay問題是 重名 package 在不同catkin workspace 中時,如何處理他們的關係。 一個檢查的命令:echo $ROS

ROS學習筆記7 -- Metapackage

ROS進階學習筆記(24) -- Metapackage Metapackage 是ROS File System 概念層中的一個概念: 2. Create and Configure a Metapackage: url: http://wiki.ros.org/

ROS學習筆記8-- 關於rospy 和 parameters

ref: ros進階學習筆記(24)-- 關於rospy 和 parameters 進行rospy程式設計時,需要用到parameter,但如何靈活用好它,還需進一步學習總結。 節點程式如何宣告parameter,是global, relative or private

ROS學習筆記6 -- ROS Bag

ROS Bag是ROS計算圖級的一個概念: Bags: ref : http://wiki.ros.org/Bags 在 計算圖裡 線上使用    工具:rosbag    建立bags, 收聽topic,記錄資料。可以回放或者remap到別的topic。   

JS的學習筆記函式,物件

1.JS的Array物件 2.js的獲取日期時間方法 1.js與java的比較 3.js的Math方法 方法: 屬性: 4.js的全域性函式 5

Linux學習筆記17

17近期參加了朋友的婚禮。比較遠,沒有拿電腦。所以一直沒有更新。很慚愧,從今天起開始正式更新學習內容。一、vimvim是vi的升級版,最大的區別就是編輯一個文本時,vi不會顯示顏色,vim會顯示顏色。yum install -y vim-enhanced 安裝vim二、vim的3種常用模式一般模式h或者向

Linux第一周學習筆記17

看到了 spa image ges 作用 -o water 存在 ffffff Linux第一周學習筆記(17)2.10環境變TH量PAPATH:只要加入了PATH的路徑都可以直接打開命令,可以不去運行命令的絕對路徑。這就是環境變量在起作用。which命令:用於查找並顯示給

Spark學習筆記17——窗戶函式

1 原始碼 package window import mystreaming.LoggerLevels import org.apache.spark.SparkConf import org.apache.spark.streaming.{Milliseconds, Secon

C++ 學習筆記17 pimpl

pimpl 物件內含一個指標,指標指向另一個物件,另一個物件常常含有真正的資料。典型例子就是智慧指標。 基本形式: class other {} ; class Object { public: // ... private: other *ptr; } ;

Python資料爬蟲學習筆記17Scrapy糗事百科自動爬蟲

一、需求:在糗事百科主頁下,無需設定頁碼,自動爬取所有段子詳情頁的段子完整內容。 (1)糗事百科主頁: (2)段子詳情頁: 二、Scrapy實現思路:        在糗事百科主頁上自動提取出所有段子的詳情連結,在每個段字詳情頁中爬取段子內容。 三、網頁原始

C++基礎教程面向物件學習筆記17

綜合測驗 在本章中,我們探討了C ++的本質 - 面向物件程式設計!這是教程系列中最重要的一章。 總結 類允許您建立自己的資料型別,這些資料型別捆綁了處理該資料的資料和函式。類中的資料和函式稱為成員。通過使用選擇該類的成員。運算子(或者 - >如果您通過指

Javascript高階程式設計學習筆記17—— 引用型別6基本包裝類

基本包裝類 基本包裝類這個概念或許有的小夥伴沒有聽說過 但是小夥伴們有沒有想過,為什麼基本資料型別的例項也有方法呢? 其實這些方法都來自基本包裝型別 這是JS為了方便操作基礎資料型別而建立的特殊引用型別   基本包裝類有三種 1. Boolean型別 2. Number型別 3.

周志華《Machine Learning》學習筆記17--強化學習

上篇主要介紹了概率圖模型,首先從生成式模型與判別式模型的定義出發,引出了概率圖模型的基本概念,即利用圖結構來表達變數之間的依賴關係;接著分別介紹了隱馬爾可夫模型、馬爾可夫隨機場、條件隨機場、精確推斷方法以及LDA話題模型:HMM主要圍繞著評估/解碼/學習這三個實

Java學習筆記17-static和final

static final      static:靜態的,只能在類內部使用,可以修飾:屬性,方法,內部類,靜態程式碼塊     靜態修飾的成員:屬於類級別的成員,是全體類例項共享的資源     靜態屬性:只有一份,全體例項共享,類似於全域性變數     靜態方法:屬於類的方法

ROS學習筆記理解ROS服務和引數

1.ROS 服務 服務(services)是節點間通訊的另一種方法,服務允許節點發送一個服務或者接收一個服務 2.使用rosservice 一些相關用法 rosservice list print information about active services r

ROS學習筆記探索ROS檔案系統

1.學習之前需要安裝一個tutorial package sudo apt-get install ros-<distro>-ros-tutorials 2.基本概念 Package:類似與我們程式設計的一個project,包含庫、程式碼、可執行檔案等等

java 設計模式 學習筆記17 橋接模式

 橋接模式:           將抽象部分與它的實現部分分離,使他們多可以獨立的變化。抽象與實現分離,表示抽象類和他的派生類用來實現自己的物件。        在系統中,可能有多角度分類,每一種分類都有可能變化,這時就把這種多角度分離出來讓他們獨立變化,減少各個角度的耦合。