Check that there are no pending keyframes while writing a spec.

This can happen when a body is detached without compiling or recompiling.

Also added error catching when trying to delete a body instead of detaching it.

Fixes #2327

PiperOrigin-RevId: 712526730
Change-Id: I4b48df83120fca12d475c85b3a54893841449653
This commit is contained in:
Alessio Quaglino
2025-01-06 07:49:35 -08:00
committed by Copybara-Service
parent b5df2c10bf
commit f607d9554e
9 changed files with 37 additions and 15 deletions
+1 -1
View File
@@ -3918,7 +3918,7 @@ Add frame to body.
.. mujoco-include:: mjs_delete
Delete object corresponding to the given element.
Delete object corresponding to the given element, return 0 on success.
.. _AddNonTreeElements:
+1 -1
View File
@@ -3578,7 +3578,7 @@ mjsGeom* mjs_addGeom(mjsBody* body, const mjsDefault* def);
mjsCamera* mjs_addCamera(mjsBody* body, const mjsDefault* def);
mjsLight* mjs_addLight(mjsBody* body, const mjsDefault* def);
mjsFrame* mjs_addFrame(mjsBody* body, mjsFrame* parentframe);
void mjs_delete(mjsElement* element);
int mjs_delete(mjsElement* element);
mjsActuator* mjs_addActuator(mjSpec* s, const mjsDefault* def);
mjsSensor* mjs_addSensor(mjSpec* s);
mjsFlex* mjs_addFlex(mjSpec* s);