Don't save actdim="{0,1}" for state{less,ful} actuators, respectively.
actdim has a default value of -1 (==unset), which means it currently gets saved for all actuators. After this change, it will only be saved if the value is > 1, errors are thrown for stateful actuators with actdim=0 and stateless actuators with actdim>0. PiperOrigin-RevId: 520627313 Change-Id: Ia498dae5c7314cfaa0995f8077d297c2339a5c35
This commit is contained in:
committed by
Copybara-Service
parent
0becf8fd98
commit
c65e046043
@@ -844,6 +844,8 @@ TEST_F(XMLWriterTest, Actdim) {
|
||||
</worldbody>
|
||||
<actuator>
|
||||
<general joint="hinge" dyntype="user" actdim="2"/>
|
||||
<general joint="hinge" dyntype="filter" dynprm="1"/>
|
||||
<motor joint="hinge"/>
|
||||
</actuator>
|
||||
</mujoco>
|
||||
)";
|
||||
@@ -851,6 +853,8 @@ TEST_F(XMLWriterTest, Actdim) {
|
||||
ASSERT_THAT(model, NotNull());
|
||||
std::string saved_xml = SaveAndReadXml(model);
|
||||
EXPECT_THAT(saved_xml, HasSubstr("actdim=\"2\""));
|
||||
EXPECT_THAT(saved_xml, Not(HasSubstr("actdim=\"1\"")));
|
||||
EXPECT_THAT(saved_xml, Not(HasSubstr("actdim=\"0\"")));
|
||||
mj_deleteModel(model);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user