This package provides an implementation of a 2D costmap that takes in sensor data from the world, builds a 2D or 3D occupancy grid of the data (depending on whether a voxel based implementation is used), and inflates costs in a 2D costmap based on the occupancy grid and a user specified inflation radius. このパッケージは2Dコストマップの実装を提供する。それは外界からのセンサデータを受け取り、2Dまたは、3D(ボクセルベースの実装がされているかどうかに依存)の占有グリッドデータを作成し、占有グリッドとユーザーが定義するインフレーション半径に基づき、2Dコストマップでコストのインフレート(拡大)を行う。 This package also provides support for map_server based initialization of a costmap, rolling window based costmaps, and parameter based subscription to and configuration of sensor topics. このパッケージは、マップサーバベースのコストマップの初期化、コストマップベースの移動ウィンドウ、パラメーターベースのセンサートピックのサブスクライブと設定もサポートしている。 1.:Overview 【図】 Note: In the picture above, the red cells represent obstacles in the costmap, the blue cells represent obstacles inflated by the inscribed radius of the robot, and the red polygon represents the footprint of the robot. 注記:上図において、赤色のセルはコストマップ上の障害物、青色のセルは、障害物をロボットの半径分ふくらました部分、多角形はロボットのフットプリントである。 For the robot to avoid collision, the footprint of the robot should never intersect a red cell and the center point of the robot should never cross a blue cell. ロボットが衝突を避けるために、フットプリントは赤いセルに、ロボットの中心は青いセルに重なってはならない。 The costmap_2d package provides a configurable structure that maintains information about where the robot should navigate in the form of a occupancy grid. costmap_2dパッケージは、調整可能な、ロボットが占有グリッドのどこをナビゲートするべきかの情報を操作する構造体を提供する。 The costmap uses sensor data and information from the static map to store and update information about obstacles in the world through the costmap_2d::Costmap2DROS object. コストマップは、costmap_2d::Costmap2DROSオブジェクトを通して、センサデータと静的マップからの情報を、周囲の環境の障害物に関する情報を保存したり更新したりするために用いる。 The costmap_2d::Costmap2DROS object provides a purely two dimensional interface to its users, meaning that queries about obstacles can only be made in columns. costmap_2d::Costmap2DROSオブジェクトは、純粋な二次元のインターフェイスを持ち、これは、障害物に関する問い合わせは、コラム単位でのみ行うことが出来ることを意味している。(?) For example, a table and a shoe in the same position in the XY plane, but with different Z positions would result in the corresponding cell in the costmap_2d::Costmap2DROS object's costmap having an identical cost value. 例えば、XY平面上の同じ場所に、テーブルと靴があり、Z位置のみ異なる場合、costmap_2d::Costmap2DROSオブジェクトのコストマップの両者の情報は同一のものになる。 This is designed to help planning in planar spaces. これは、平らな空間に於ける(移動)プランニングを助けるよう、デザインされている。 As of the Hydro release, the underlying methods used to write data to the costmap is fully configurable. Hydro版では、コストマップにデータを書き込む基礎的なメソッドが、完全に定義可能になっている。 Each bit of functionality exists in a layer. 機能する各ビット(?)はレイヤーに存在する。 For instance, the static map is one layer, and the obstacles are another layer. 例えば、静的マップは一つのレイヤーであり、障害物は別のレイヤーである。 By default, the obstacle layer maintains information three dimensionally (see voxel_grid). デフォルトでは、障害物レイヤーは3次元で取り扱われる(voxel_gridを見よ) Maintaining 3D obstacle data allows the layer to deal with marking and clearing more intelligently. 障害物の3Dデータを利用することは、レイヤーをより賢く(障害物の)マーキングと消去に対応させる。 The main interface is costmap_2d::Costmap2DROS which maintains much of the ROS related functionality. 主要なインターフェイスは、ROSの関連するたくさんの機能とつながる、costmap_2d::Costmap2DROSである。 It contains a costmap_2d::LayeredCostmap which is used to keep track of each of the layers. それは、それぞれのレイヤーと連絡するために用いられる、costmap_2d::LayeredCostmapを含んでいる。 Each layer is instantiated in the Costmap2DROS using pluginlib and is added to the LayeredCostmap. それぞれのレイヤーは、pluginlibを使って、Costmap2DROSにインスタンス化され、LayeredCostmapに追加される。 The layers themselves may be compiled individually, allowing arbitrary changes to the costmap to be made through the C++ interface. The costmap_2d::Costmap2D class implements the basic data structure for storing and accessing the two dimensional costmap. それ自身、独立してコンパイルされるかもしれないレイヤーは、コストマップに対する任意の変更を、C++のインターフェイスを通して行われることを許可する。 The details about how the Costmap updates the occupancy grid are described below, along with links to separate pages describing how the individual layers work. どうやってコストマップの占有グリッドを更新するかの詳細は、どうやってそれぞれのレイヤーが働くかの解説へのリンクとともに、下記に解説する。 2.:Marking and Clearing The costmap automatically subscribes to sensors topics over ROS and updates itself accordingly. コストマップは、ROSを通して送られてくるセンサートピックを自動的にサブスクライブし、それに伴って更新される。 Each sensor is used to either mark (insert obstacle information into the costmap), clear (remove obstacle information from the costmap), or both. それぞれのセンサーは(障害物の)マーク(コストマップに障害物の情報を追加)、削除(コストマップから障害物情報を削除)、またその双方に用いられる。 A marking operation is just an index into an array to change the cost of a cell. マーキング操作は、セルのコストを変更するのに、一つの配列の一つのインデックスに書き込むだけである。 A clearing operation, however, consists of raytracing through a grid from the origin of the sensor outwards for each observation reported. 削除操作は、しかしながら、センサーから障害物が観測される所までのグリッドすべてに対して行われる If a three dimensional structure is used to store obstacle information, obstacle information from each column is projected down into two dimensions when put into the costmap. 障害物データを格納するのに3次元の構造体が使われるなら、障害物情報を構成するそれぞれのコラムは、コストマップに格納されるときに、二次元の情報に変換される。 3.:Occupied, Free, and Unknown Space 占有、空き、未知の領域 While each cell in the costmap can have one of 255 different cost values (see the inflation section), the underlying structure that it uses is capable of representing only three. コストマップのセルは255のコスト値を持つが、それを基本的な構造体は、たった3つの状態を持つにすぎない。 Specifically, each cell in this structure can be either free, occupied, or unknown. はっきり言うと、構造体のそれぞれのセルは、空き、占有、それに 未知のいずれかの状態を持つことが出来る。 Each status has a special cost value assigned to it upon projection into the costmap. それぞれのステータスは、コストマップに対応する、特別なコスト値を持つ。 Columns that have a certain number of occupied cells (see mark_threshold parameter) are assigned a costmap_2d::LETHAL_OBSTACLE cost, columns that have a certain number of unknown cells (see unknown_threshold parameter) are assigned a costmap_2d::NO_INFORMATION cost, and other columns are assigned a costmap_2d::FREE_SPACE cost. 占有セルが一定数あるコラムは、costmap_2d::LETHAL_OBSTACLEコストに割り当てられ、未知セルが一定数あるカラムは、costmap_2d::NO_INFORMATIONコストに割り当てられ、さらに、その他のコラムは、costmap_2d::FREE_SPACEコストに割り当てられる。 4.:Map Updates マップの更新 The costmap performs map update cycles at the rate specified by the update_frequency parameter. コストマップは、update_frequencyパラメータで指定されたレートで、マップを更新する。 Each cycle, sensor data comes in, marking and clearing operations are perfomed in the underlying occupancy structure of the costmap, and this structure is projected into the costmap where the appropriate cost values are assigned as described above. それぞれの(更新)サイクルでは、センサの情報が入力され、コストマップの基本的な占有操作構造体が、マーク、削除を実行し、その構造体は、前に説明した通り、適切なコスト値を格納したコストマップに反映される。 After this, each obstacle inflation is performed on each cell with a costmap_2d::LETHAL_OBSTACLE cost. その後、それぞれの障害物のインフレーションを、costmap_2d::LETHAL_OBSTACLEコストとともに、各セルに適用する。 This consists of propagating cost values outwards from each occupied cell out to a user-specified inflation radius. これは、コスト値が、それぞれの占有セルから、ユーザが指定したインフレーション半径まで、伝搬することで実現している。 The details of this inflation process are outlined below. インフレーションの詳細なプロセスは、下記に。 5.:tf In order to insert data from sensor sources into the costmap, the costmap_2d::Costmap2DROS object makes extensive use of tf. センサーからのデータをコストマップに挿入するために、costmap_2d::Costmap2DROSオブジェクトは、tfを使用する。 Specifically, it assumes that all transforms between the coordinate frames specified by the global_frame parameter, the robot_base_frame parameter, and sensor sources are connected and up-to-date. はっきり言うと、座標系間のすべての変換は、global_frameパラメータ、robot_base_frameパラメータ、接続されたセンサーソースで定義され、更新される。 The transform_tolerance parameter sets the maximum amount of latency allowed between these transforms. transform_toleranceパラメータは、これらの変換の遅れを許容する最大値をセットする。 If the tf tree is not updated at this expected rate, the navigation stack stops the robot. もし、tfツリーがこの想定されるレートで更新されない場合、ナビゲーションスタックはロボットを停止させる。 6.:Inflation 【図】 Inflation is the process of propagating cost values out from occupied cells that decrease with distance. インフレーションは、占有セルから外側に、距離に応じて弱まりながらコスト値が伝搬するプロセスである。 For this purpose, we define 5 specific symbols for costmap values as they relate to a robot. このため、5つの特別なシンボルを、ロボットに関連するコストマップの値に設定した。 ・”Lethal" cost means that there is an actual (workspace) obstacle in a cell. ・Lethal(致命的)コストは、セル内に実際に(workspace上に?)障害物があることを示している。 So if the robot's center were in that cell, the robot would obviously be in collision. 従って、ロボットの中心がこのセルに入ると、ロボットは当然衝突していることになる。 ・”Inscribed" cost means that a cell is less than the robot's inscribed radius away from an actual obstacle. ・Inscribed(刻み込む)コストは、あるセル(のコスト値)が、実際の障害物より離れているロボットのinscribed半径より少ないことを示している。 So the robot is certainly in collision with some obstacle if the robot center is in a cell that is at or above the inscribed cost. 従って、ロボットの中心があるセルが、inscribedコスト以上なら、ロボットは確実に障害物と衝突状態にあることになる。 ・”Possibly circumscribed" cost is similar to "inscribed", but using the robot's circumscribed radius as cutoff distance. ・Possibly circumscribed(可能性領域)コストはinscribedと同様だが、距離を切り捨てるのに、ロボットのcircumscribed半径を用いている。 Thus, if the robot center lies in a cell at or above this value, then it depends on the orientation of the robot whether it collides with an obstacle or not. そのため、ロボットの中心があるセルがこの値以上なら、ロボットの姿勢次第で、障害物と衝突するかどうかが決まってくる。 We use the term "possibly" because it might be that it is not really an obstacle cell, but some user-preference, that put that particular cost value into the map. ここではpossiblyという言葉を、そのセルが本物の障害物ではないが、いくつかのユーザー設定で決まる、マップ上に設定された個別の値を持つセルとして使っている。 For example, if a user wants to express that a robot should attempt to avoid a particular area of a building, they may inset their own costs into the costmap for that region independent of any obstacles. 例えば、ユーザーがビル内のあるエリアをロボットが避けて通るようにしたいと思ったなら、コストマップに独自の値を挿入し、仮想の障害物とすることが出来る。 ・”Freespace" cost is assumed to be zero, and it means that there is nothing that should keep the robot from going there. ・Freespaceコストの値はゼロであり、そこにはロボットの進行を妨げる何もないことを意味している。 ・”Unknown" cost means there is no information about a given cell. The user of the costmap can interpret this as they see fit. ・Unknownコストは、そのセルに対しに何も情報がないことを意味している。コストマップのユーザーはこの部分を任意に解釈することができる。 All other costs are assigned a value between "Freespace" and "Possibly circumscribed" depending on their distance from a "Lethal" cell and the decay function provided by the user. その他のコストはすべてFreespaceとPossibly circumscribedの間にあり、Lethalセルからの距離で値が決まる。減衰関数はユーザーが提供する。 The rationale behind these definitions is that we leave it up to planner implementations to care or not about the exact footprint, yet give them enough information that they can incur the cost of tracing out the footprint only in situations where the orientation actually matters. これらの定義の後の正当性は、我々が世話に、または、正確な足跡についてでなくそれをプランナー実装例に任せるが、彼らに彼らが方針が実際に重要である状況だけで足跡の跡をたどるためのコストがかかることができるという十分な情報を与えるということです。(機械翻訳) 7.:Map Types There are two main ways to initialize a costmap_2d::Costmap2DROS object. costmap_2d::Costmap2DROSオブジェクトを初期化するには二つの方法がある。 The first is to seed it with a user-generated static map (see the map_server package for documentation on building a map). 最初のものは、ユーザーが作成した静的マップを元にするものである。(マップを作成するにはmap_serverパッケージのドキュメンテーションを参照) In this case, the costmap is initialized to match the width, height, and obstacle information provided by the static map. この場合、コストマップは静的マップと同じ幅、高さ、障害物情報で初期化される。 This configuration is normally used in conjunction with a localization system, like amcl, that allows the robot to register obstacles in the map frame and update its costmap from sensor data as it drives through its environment. この設定は、通常、acmlのようなローカライゼーションシステムと連携して、ロボットがマップフレームに障害物を登録したり、環境を動き回ることでセンサデータからコストマップを更新したりするのに用いられる。 The second way to initialize a costmap_2d::Costmap2DROS object is to give it a width and height and to set the rolling_window parameter to be true. 二番目のcostmap_2d::Costmap2DROSオブジェクトを初期化する方法は、幅と高さを与え、rolling_windowパラメータをtrueに設定することである。 The rolling_window parameter keeps the robot in the center of the costmap as it moves throughout the world, dropping obstacle information from the map as the robot moves too far from a given area. rolling_windowパラメータは、ロボットが環境を動き回っても、常にロボットをコストマップのセンターに保持する。また、与えられたエリアからロボットが遠く離れた場合、そこにあった(領域から外れた)障害物情報を、コストマップから削除する。 This type of configuration is most often used in an odometric coordinate frame where the robot only cares about obstacles within a local area. このタイプの設定は、主に、ロボットがローカルエリアの中で障害物を気にかけるだけの、オドメトリ座標系で使われる。 8.:Costmap2DROS The costmap_2d::Costmap2DROS object is a wrapper for a costmap_2d::Costmap2D object that exposes its functionality as a C++ ROS Wrapper. costmap_2d::Costmap2DROSオブジェクトは、C++ ROS Wrapperとして表現される、costmap_2d::Costmap2Dオブジェクトのラッパーである。 It operates withing a ROS namespace (assumed to be name from here on) specified on initialization. 【略】 Example creation of a costmap_2d::Costmap2DROS object: オブジェクト生成の例 #include #include ... tf::TransformListener tf(ros::Duration(10)); costmap_2d::Costmap2DROS costmap("my_costmap", tf); Note that the C++ API has changed as of Hydro. 注記:Hydroではc++ APIは変更されている。 8.1.1:ROS API Note on Old Parameters 古いパラメータへの注記 Many of the parameters have changed locations from pre-Hydro releases in order to allow for maximal customization. たくさんのHydro以前のパラメータの場所が、カスタマイズの自由度を大きくするために、変更されている Those namespaces for those original parameters will still work, so there is no need to reconfigure your robot. それらのネームスペースや、オリジナルのパラメータはまだ使えるので、(すでにcostmapを使っている)ロボットを再設定する必要はない。 However, the first thing that will happen when the costmap code is run is that the parameters will be removed from their old locations and placed in the new locations with plugins properly added. しかしながら、追加したプラグインによっては、コストマップの実行中に、パラメータが古い場所から、新しい場所に移動されるかもしれない。 8.1.2:Subscribed Topics サブスクライブされるトピック ~/footprint (geometry_msgs/Polygon) Specification for the footprint of the robot. ロボットのフットプリント(外形)のサブスクライブ This replaces the previous parameter specification of the footprint. これは以前のフットプリントを新しいもので置き換える。 8.1.3:Published Topics パブリッシュされるトピック ~/grid (nav_msgs/OccupancyGrid) The values in the costmap コストマップの内容 ~/grid_updates (nav_msgs/OccupancyGridUpdate) The value of the updated area of the costmap コストマップの更新エリアの内容 ~/voxel_grid (costmap_2d/VoxelGrid) Optionally advertised when the underlying occupancy grid uses voxels and the user requests the voxel grid be published. オプション。ユーザがボクセル情報を要求し、かつ占有グリッドがボクセルである場合。 8.1.4:Parameters パラメータ The costmap_2d::Costmap2DROS is highly configurable with several categories of ROS Parameters: coordinate frame and tf, rate, robot description and map management. Coordinate frame and tf parameters 座標系とtfのパラメータ ~/global_frame (string, default: "/map") The global frame for the costmap to operate in. コストマップを使用するグローバル座標系(環境の座標系) ~/robot_base_frame (string, default: "base_link") The name of the frame for the base link of the robot. ロボットのベースリンクの座標系(ロボットのローカル座標系) ~/transform_tolerance (double, default: 0.2) Specifies the delay in transform (tf) data that is tolerable in seconds. tfの遅れ時間を設定(単位は秒) This parameter serves as a safeguard to losing a link in the tf tree while still allowing an amount of latency the user is comfortable with to exist in the system. このパラメータは、システムの許容される遅延を設定することで、tfツリー構造で関連が失われることへの安全装置として扱われる。 For example, a transform being 0.2 seconds out-of-date may be tolerable, but a transform being 8 seconds out of date is not. 例えば、現時点より0.2秒古い変換は許容されるが、8秒古い変換はそうではない。 If the tf transform between the coordinate frames specified by the global_frame and robot_base_frame parameters is transform_tolerance seconds older than ros::Time::now(), then the navigation stack will stop the robot. もし、global_frameパラメータとrobot_base_frameパラメータで定義された座標間のtf変換が、transform_tolerance時間であり、ros::Time::now()より古い場合は、ナビゲーションスタックはロボットを停止させる。 Rate parameters レートのパラメータ ~/update_frequency (double, default: 5.0) The frequency in Hz for the map to be updated. マップを更新する周期(Hz) ~/publish_frequency (double, default: 0.0) The frequency in Hz for the map to be publish display information. マップの表示情報を更新する周期(Hz) Map management parameters マップ管理パラメータ ~/rolling_window (bool, default: false) Whether or not to use a rolling window version of the costmap. コストマップでローリングウィンドウ機能を使うかどうか。 If the static_map parameter is set to true, this parameter must be set to false. static_mapパラメータがtrueなら、これはfalseにセットする。 The following parameters can be overwritten by some layers, namely the static map layer. 下記のパラメータは、いくつかのレイヤーによって上書きすることが出来る。(例えば静的マップレイヤーによって) ~/width (int, default: 10) The width of the map in meters. ~/height (int, default: 10) The height of the map in meters. ~/resolution (double, default: 0.05) The resolution of the map in meters/cell. ~/origin_x (double, default: 0.0) The x origin of the map in the global frame in meters. ~/origin_y (double, default: 0.0) The y origin of the map in the global frame in meters. 8.1.5:Required tf Transforms 必須tf変換 (value of global_frame parameter) → (value of robot_base_frame parameter) Usually provided by a node responsible for odometry or localization such as amcl. (global_frameの値)→(robot_base_frameの値)通常、オドメトリまたはローカライゼーション(acmlのような)ノードで決まる。 8.1.6:C++ API For C++ level API documentation on the costmap_2d::Costmap2DROS class, please see the following page: Costmap2DROS C++ API 8.2:Layer Specifications 8.2.1:Static Map Layer The static map layer represents a largely unchanging portion of the costmap, like those generated by SLAM. SLAMで生成したような、変更することのない静的マップのレイヤー。 8.2.2:Obstacle Map Layer The obstacle layer tracks the obstacles as read by the sensor data. センサーデータによる障害物を記録するレイヤー。 The ObstacleCostmapPlugin marks and raytraces obstacles in two dimensions, while the VoxelCostmapPlugin does so in three dimensions. ObstacleCostmapPluginが2次元上で障害物をマークしレイトレースする。VoxelCostmapPluginは同様のことを3次元上で行う。 8.2.3:Inflation Layer The inflation layer is an optimization that adds new values around lethal obstacles (i.e. inflates the obstacles) in order to make the costmap represent the configuration space of the robot. インフレ層は、costmapをロボットの構成スペースを表させるために致死障害のまわりに新しい価格を加える最適化です。(機械翻訳) 8.2.4:Other Layers Other layers can be implemented and used in the costmap via pluginlib. 他のレイヤーはpluginlibを使うことで実装し使用することが出来る。 Any additional plugins are welcomed to be listed and linked to below. 他のプラグインは下記のリンクにリストがある。 SocialCostmapPlugin(リンク)