(訳注:最新の情報は原文を参照したください.)

ROS ファイルシステム コンセプト: パッケージ | マニフェスト | スタック | スタック マニフェスト | msg | srv

概要

マニフェスト (manifest.xml) は,あなたのパッケージの最小構成であり,ディストリビューションのコンパイルから文書まで,幅広い ROS ツールをサポートします.パッケージの最小構成メタデータを提供するのに加えて,マニフェストの重要な役割は言語中立かつOS中立な方法で依存関係を宣言することです.ディレクトリ内の manifest.xml の存在は,意味を持ちます.ROS パッケージパス内の manifest.xml ファイルが含まれるディレクトリは,パッケージとみなされます[1].

原始的な最小のマニフェストファイルは注意書きのようなもので,”誰が書いたのか”と”どんなライセンス下にあるのか”という記述で始まっています.パッケージにとってライセンスは重要で,どの ROS コードがそこに関わっているかを意味します.一番普通のマニフェストファイルは,パッケージのインストールと実際の使用を助ける <depend><export> タグもまた含まれています.

<depend> タグは他のインストールされているべき ROS パッケージを指します.指されているパッケージの内容には様々な意味があります.例えば,rospy コードによれば,他のパッケージを追加するために PYTHONPATH を宣言するべきです. For roslaunch files, a depend may indicate that this package includes roslaunch files from the other package.

<export> タグは言語依存のビルドとあなたのパッケージに依存するパッケージで使用されるべきランタイム フラグを示します.roscpp のコードを含むパッケージでは,export タグがそれに依存するパッケージを抽出して,ヘッダーファイルとライブラリで宣言するべきです.

[1]: パッケージがパッケージを含むことはできません.

XML リファレンス

manifest.xml タグ リファレンスを参照してください.

<package>
  <description brief="one line of text">
    long description goes here, 
    <em>XHTML is allowed</em>
  </description>
  <author>Alice/alice@somewhere.bar, Bob/bob@nowhere.foo</author>
  <license>BSD</license>
  <url>http://pr.willowgarage.com/</url>
  <logo>http://pr.willowgarage.com/blog/photos/sensor_head1_500.jpg</logo>

  <depend package="pkgname"/>
  <depend package="common"/>
  <rosdep name="python" />
  <versioncontrol type="svn" url="https://playerstage.svn.sourceforge.net/svnroot/playerstage/code/player/trunk"/>
  <export>
    <cpp cflags="-I${prefix}/include" lflags="-L${prefix}/lib -lros"/>
    <cpp os="osx" cflags="-I${prefix}/include" lflags="-L${prefix}/lib -Wl,-rpath,-L${prefix}lib -lrosthread -framework CoreServices"/>
  </export>

</package>

依存関係のタイプ

マニフェストで示される最もよくある依存関係のタイプは,<depend> タグで示される別のパッケージへの依存関係です. As explained earlier, the exact meaning of this dependency depends on the code involved and may either mean a compile-time dependency or runtime dependency.

A manifest can also declare dependencies on thirdparty software provided by the operating system, which is expressed by the <rosdep> tag. For example, your package may need boost:

<rosdep name="boost" />

By declaring this, users can now use the rosdep tool to install boost. rosdep will examine their operating system, find the appropriate package manager and package name, and install it.

A third type of dependency that a manifest can declare is on a version-control system, which is expressed by the <versioncontrol> tag. This option is less common, but occurs in packages that wrap thirdparty code in ROS. This information is primarily used by nightly build tools to streamline the process of authenticating to these external repositories.

Tools

rospack parses and retrieves information from manifest.xml files. For example, rospack depends package-name will tell you all of the dependencies of package-name (use depends1 to retrieve the direct dependencies).

Client Library Support

In Python, you can use the roslib.manifest module in the roslib package to retrieve information from manifests. For example:

  • import roslib.manifest
    
    # get the path of the manifest
    p = roslib.manifest.manifest_file('roscpp')
    
    # create a roslib.manifest.Manifest instance from the file
    m = roslib.manifest.parse_file(p)

Wiki: ja/Manifest (last edited 2010-01-11 17:37:48 by KentaYonekura)