Add nested keyframes attachment test.

This is a no-op change for keyframes but it shows an example of behavior.

Also, fixed two bugs:
- Missing namespace when attaching frames.
- Incorrect body id and subtreedof when attaching a compiled spec. Fixes #2063.

PiperOrigin-RevId: 680289467
Change-Id: I2ddaa7ad2226fa466ec3bbf74a7553d497bb4bb9
This commit is contained in:
Alessio Quaglino
2024-09-29 11:56:50 -07:00
committed by Copybara-Service
parent 807ee852d0
commit 58a49bad96
3 changed files with 116 additions and 1 deletions
+6 -1
View File
@@ -802,7 +802,8 @@ mjCBody& mjCBody::operator=(const mjCBody& other) {
sites.clear();
cameras.clear();
lights.clear();
id = other.id;
id = -1;
subtreedofs = 0;
// add elements to lists
*this += other;
@@ -1040,6 +1041,10 @@ void mjCBody::NameSpace_(const mjCModel* m, bool propagate) {
for (auto& light : lights) {
light->NameSpace(m);
}
for (auto& frame : frames) {
frame->NameSpace(m);
}
}