Do not use fast lookup for frames.

Fast lookup is not possible since mjOBJ_FRAME > mjNOBJECT, which is the size of the objects maps used for the search.

Fixes #2328.

PiperOrigin-RevId: 712479460
Change-Id: I7bcfa75ff8a1e288183d60ed4a44cab5bc6f4173
This commit is contained in:
Alessio Quaglino
2025-01-06 04:16:56 -08:00
committed by Copybara-Service
parent daed8f46c8
commit 65048d6b8f
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -614,7 +614,7 @@ mjsBody* mjs_findBody(mjSpec* s, const char* name) {
// find element in spec by name
mjsElement* mjs_findElement(mjSpec* s, mjtObj type, const char* name) {
mjCModel* model = static_cast<mjCModel*>(s->element);
if (model->IsCompiled()) {
if (model->IsCompiled() && type != mjOBJ_FRAME) {
return model->FindObject(type, std::string(name)); // fast lookup
}
switch (type) {