Check the autolimits attribute before assigning default values for joint limitedness
This commit is contained in:
@@ -164,7 +164,14 @@ 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] is not XmlElement
|
||||
compilerElement || !compilerElement.GetBoolAttribute("autolimits").Equals("false")) {
|
||||
defaultLimited = mjcf.HasAttribute("range");
|
||||
}
|
||||
|
||||
Limited = mjcf.GetBoolAttribute("limited", defaultLimited);
|
||||
Margin = mjcf.GetFloatAttribute("margin", defaultValue: 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user