mjSpec: allow custom elements outside of the `custom` section

オープン
#3,897 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
15/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
活発
技術スタック
python
領域
api, robotics

調査の方向性

The payload names only mjSpec, the MJCF custom section and the custom/text workaround, so start by reading how the existing custom section is described in the MJCF docs and the issue's serialization example. The issue asks for a design decision, not a patch: the open questions are the API shape, whether a declared-spec section is needed, and how attribute types survive round-tripping. Done means maintainers have agreed on a design in the thread.

索引モデルが issue の本文から書いたものです。

説明

enhancement
The feature, motivation and pitch

USD has the benefit of custom APIs, whereas mjSpec/mjcf needs text blobs or sidecar files to approximate the same function.

As an example for discussion, consider a python interface similar to h5py's attrs. Supporting any number of named "custom specs", which are flat dicts of key/value pairs, add-able to other mjSpec elements (bodies, sites, joints, actuators, etc):

site # site(name="fid-site")

c = site.add_custom("fiducial")
c["label"] = "fid3"
c["id"] = 3
c["size"] = 0.01

c = site.get_custom("lidar")
c["model"] # "VLP-16"
c["range-m"] # numpy.array([0.5, 30])

Which serializes as

<site name="fid-site" pos...>
    <custom>
        <fiducial label="fid3" id="3" size="0.01"/>
        <lidar model="VLP-16" rotation-hz="10" elevations-deg="-10 -5 0 5 10" range-m="0.5 30"/>
    </custom>
</site>

To avoid silently-misspelled custom elements, let the spec also hold a section declaring the available custom specs. Perhaps this section could also be used to declare the attribute types to be used for those specs, so they are not lost in serialization nor inferred in deserialization.

Alternatives

Using a custom/text block to hold a json blob with arbitrary data. This data does not follow attach calls, nor can it be used as part of a default class.

Additional context

No response

主要言語
C++
スター
18.3k
フォーク
2.2k
平均マージ
9日 11時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google-deepmind/mujoco のほかの issue

google-deepmind/mujoco の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。