Add policies for global attribute conflict resolution upon attach

For example when loading parent_merge.xml:

```
WARNING: Attach conflict when attaching 'child' to 'parent_merge', policy is 'merge'
timestep: parent has 0.005, child has 0.002, taking the minimum
iterations: parent has 50, child has 100, taking the maximum
flag 'Damper': added from child
```

When loading parent_error.xml:

```
XML Error: Attach conflict when attaching 'child' to 'parent_error', policy is 'error'
timestep: parent has 0.005, child has 0.002
iterations: parent has 50, child has 100
Element 'attach', line 10
```
PiperOrigin-RevId: 933620810
Change-Id: Ib477863b5ef763474d27fb4be5a4148be1d5d500
This commit is contained in:
Yuval Tassa
2026-06-17 03:34:10 -07:00
committed by Copybara-Service
parent 30357c38a3
commit 410c73168c
37 changed files with 2705 additions and 449 deletions
+2 -1
View File
@@ -48,6 +48,7 @@ extern const int stage_sz;
extern const int datatype_sz;
extern const int camout_sz;
extern const int reduce_sz;
extern const int conflict_sz;
extern const mjMap angle_map[];
extern const mjMap enable_map[];
extern const mjMap bool_map[];
@@ -86,7 +87,7 @@ extern const mjMap meshtype_map[];
extern const mjMap meshinertia_map[];
extern const mjMap flexself_map[];
extern const mjMap elastic2d_map[];
extern const mjMap conflict_map[];
//---------------------------------- Base XML class ------------------------------------------------
File diff suppressed because it is too large Load Diff
+2
View File
@@ -1034,6 +1034,8 @@ void mjXWriter::Compiler(XMLElement* root) {
if (!model->compiler.autolimits) {
WriteAttrTxt(section, "autolimits", "false");
}
WriteAttrKey(section, "conflict", conflict_map, conflict_sz,
model->compiler.conflict, mjCONFLICT_WARNING);
}