google-deepmind / google-deepmind/mujoco
[Performance; Model editing] Batch adding of bodies/geoms/etc.
- Dominant language
- C++
- Stars
- 15.2k
- Forks
- 1.8k
- Avg merge
- 10d 16h
- Merged PRs (30d)
- 25
Description
### The feature, motivation and pitch
Currently, MuJoCo's model editing (C) API allows adding a single item (e.g., geom via [`mjs_addGeom`](https://github.com/google-deepmind/mujoco/blob/main/src/user/user_api.cc#L737)) at a time. Each time, the signature is recomputed which can be painfully slow in worlds that already contain a lot of items and need a lot more items added.
For example, `mjs_addGeom` ends up going into, which recomputes signature each time:
https://github.com/google-deepmind/mujoco/blob/fbf031a7d5afb87bc252346276e8c983c81ab407/src/user/user_objects.cc#L2085-L2101
### Alternatives
_No response_
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.