Remove hard-coded nPOS and nVEL from mjCModel.

PiperOrigin-RevId: 661370196
Change-Id: Ib2c1876dfea55dbf496e2358000f24bbde29fc52
This commit is contained in:
Alessio Quaglino
2024-08-09 12:52:48 -07:00
committed by Copybara-Service
parent da15aa6a0e
commit ec43ec7c30
3 changed files with 44 additions and 40 deletions
+28
View File
@@ -1778,6 +1778,34 @@ bool mjCJoint::is_actfrclimited() const { return islimited(actfrclimited, actfrc
int mjCJoint::nq(mjtJoint joint_type) {
switch (joint_type) {
case mjJNT_FREE:
return 7;
case mjJNT_BALL:
return 4;
case mjJNT_SLIDE:
case mjJNT_HINGE:
return 1;
}
}
int mjCJoint::nv(mjtJoint joint_type) {
switch (joint_type) {
case mjJNT_FREE:
return 6;
case mjJNT_BALL:
return 3;
case mjJNT_SLIDE:
case mjJNT_HINGE:
return 1;
}
}
void mjCJoint::PointToLocal() {
spec.element = static_cast<mjsElement*>(this);
spec.name = &name;