Merge pull request #1330 from Balint-H:fix/unity-joint-limits

PiperOrigin-RevId: 598603093
Change-Id: I441631e33e812988694f8eed48c719c6bab86148
This commit is contained in:
Copybara-Service
2024-01-15 07:08:03 -08:00
2 changed files with 17 additions and 3 deletions
@@ -164,7 +164,15 @@ namespace Mujoco {
RefFriction.FromMjcf(mjcf, "solreffriction");
ImpFriction.FromMjcf(mjcf, "solimpfriction");
FrictionLoss = mjcf.GetFloatAttribute("frictionloss", 0.0f);
Limited = mjcf.GetBoolAttribute("limited", false);
bool defaultLimited = false;
if ((mjcf.OwnerDocument.GetElementsByTagName("compiler") [0]["compiler"])
?.GetBoolAttribute("autolimits", true) ??
true) {
defaultLimited = mjcf.HasAttribute("range");
}
Limited = mjcf.GetBoolAttribute("limited", defaultLimited);
Margin = mjcf.GetFloatAttribute("margin", defaultValue: 0.0f);
}
}