Fix a bug in mj_recompile.

The qposadr_ and dofadr_ variables of the joints were not being reset to -1 when a joint is copied. This could lead to errors when calling mj_recompile after attaching a compiled spec.

PiperOrigin-RevId: 686152004
Change-Id: I9e058089ce87ea0d8e51a7f43475bc48c6527a26
This commit is contained in:
Alessio Quaglino
2024-10-15 10:23:43 -07:00
committed by Copybara-Service
parent d646ba8de1
commit 11af1e2a95
5 changed files with 80 additions and 21 deletions
+2
View File
@@ -1951,6 +1951,8 @@ mjCJoint& mjCJoint::operator=(const mjCJoint& other) {
this->spec = other.spec;
*static_cast<mjCJoint_*>(this) = static_cast<const mjCJoint_&>(other);
*static_cast<mjsJoint*>(this) = static_cast<const mjsJoint&>(other);
qposadr_ = -1;
dofadr_ = -1;
}
PointToLocal();
return *this;