Merge pull request #1646 from Balint-H:fix/unity-sensornoise
PiperOrigin-RevId: 639722238 Change-Id: I80a941e97923169150f665fb3411605affcc0702
This commit is contained in:
@@ -101,7 +101,6 @@ public class MjGlobalSettingsGenerationTests {
|
||||
Assert.That(_doc.OuterXml, Does.Contain(@"override="));
|
||||
Assert.That(_doc.OuterXml, Does.Contain(@"energy="));
|
||||
Assert.That(_doc.OuterXml, Does.Contain(@"fwdinv="));
|
||||
Assert.That(_doc.OuterXml, Does.Contain(@"sensornoise="));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,19 +53,16 @@ public class MjBaseSensorTests {
|
||||
|
||||
[Test]
|
||||
public void GeneratingNoiseAndCutoffMjcf() {
|
||||
_sensor.Noise = 2.0f;
|
||||
_sensor.Cutoff = 3.0f;
|
||||
_doc.AppendChild(_sensor.GenerateMjcf("name", _doc));
|
||||
Assert.That(_doc.OuterXml, Does.Contain("noise=\"2\""));
|
||||
Assert.That(_doc.OuterXml, Does.Contain("cutoff=\"3\""));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ParsingShapePropertiesMjcf() {
|
||||
var mjcfString = "<sensor noise=\"3\" cutoff=\"4\" actuator=\"actuator\"/>";
|
||||
var mjcfString = "<sensor cutoff=\"4\" actuator=\"actuator\"/>";
|
||||
var mjcfElement = Parse(mjcfString, "sensor");
|
||||
_sensor.ParseMjcf(mjcfElement);
|
||||
Assert.That(_sensor.Noise, Is.EqualTo(3.0f));
|
||||
Assert.That(_sensor.Cutoff, Is.EqualTo(4.0f));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user