Add error checking in mjs_setFrame.

Also raise error if the frame is not found in the mjCBody copy constructor.

Fixes #2543.

PiperOrigin-RevId: 742624013
Change-Id: I4999b3165c97f8d079412214d027ca7a8dae8cb3
This commit is contained in:
Alessio Quaglino
2025-04-01 03:33:54 -07:00
committed by Copybara-Service
parent ebd30493c8
commit 86c970bc23
11 changed files with 125 additions and 25 deletions
+1 -1
View File
@@ -4448,7 +4448,7 @@ Set element's default.
.. mujoco-include:: mjs_setFrame
Set element's enclosing frame.
Set element's enclosing frame, return 0 on success.
.. _mjs_resolveOrientation:
+1 -1
View File
@@ -3683,7 +3683,7 @@ void mjs_setPluginAttributes(mjsPlugin* plugin, void* attributes);
const char* mjs_getString(const mjString* source);
const double* mjs_getDouble(const mjDoubleVec* source, int* size);
void mjs_setDefault(mjsElement* element, const mjsDefault* def);
void mjs_setFrame(mjsElement* dest, mjsFrame* frame);
int mjs_setFrame(mjsElement* dest, mjsFrame* frame);
const char* mjs_resolveOrientation(double quat[4], mjtByte degree, const char* sequence,
const mjsOrientation* orientation);
mjsFrame* mjs_bodyToFrame(mjsBody** body);