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

Aperta
#3,897 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 6 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api, robotics

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
C++
Stelle
18.3k
Fork
2.2k
Merge medio
9g 11h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di google-deepmind/mujoco

Tutte le issue di google-deepmind/mujoco

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.