Check for duplicated names when setting element names.

PiperOrigin-RevId: 778827590
Change-Id: I77a208c1571cf735cae80840ea830aa347681f71
This commit is contained in:
Alessio Quaglino
2025-07-03 03:19:51 -07:00
committed by Copybara-Service
parent 594e17074a
commit 564c51ddb9
12 changed files with 96 additions and 74 deletions
+7
View File
@@ -323,6 +323,9 @@ class mjCModel : public mjCModel_, private mjSpec {
// set attached flag
void SetAttached(bool deepcopy) { attached_ |= !deepcopy; }
// check for repeated names in list
void CheckRepeat(mjtObj type);
private:
// settings for each defaults class
std::vector<mjCDef*> defaults_;
@@ -411,6 +414,10 @@ class mjCModel : public mjCModel_, private mjSpec {
// populate objects ids
void ProcessLists(bool checkrepeat = true);
// process list of objects
template <class T> void ProcessList_(mjListKeyMap& ids, std::vector<T*>& list,
mjtObj type, bool checkrepeat = true);
// reset lists of kinematic tree
void ResetTreeLists();