google-deepmind / google-deepmind/mujoco

[Performance; Model editing] Batch adding of bodies/geoms/etc.

Open
#3,397 7 comments 0 reactions 1 assignee Claimed by @quagla View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.