Add nJmom, the number of non-zeros in sparse actuator_moment matrix, to mjModel.
PiperOrigin-RevId: 698343986 Change-Id: I3d4a4dea1ec095d4e7b231c2fffc0e6241cee39f
This commit is contained in:
committed by
Copybara-Service
parent
cd84011d7b
commit
aae5fd6906
@@ -116,6 +116,30 @@ TEST_F(UserCModelTest, SameFrame) {
|
||||
mj_deleteModel(model);
|
||||
}
|
||||
|
||||
TEST_F(UserCModelTest, ActuatorSparsity) {
|
||||
static constexpr char xml[] = R"(
|
||||
<mujoco>
|
||||
<worldbody>
|
||||
<body>
|
||||
<geom size="1"/>
|
||||
<joint name="a"/>
|
||||
<body>
|
||||
<geom size="1"/>
|
||||
<joint name="b"/>
|
||||
</body>
|
||||
</body>
|
||||
</worldbody>
|
||||
<actuator>
|
||||
<motor joint="a"/>
|
||||
<motor joint="b"/>
|
||||
</actuator>
|
||||
</mujoco>
|
||||
)";
|
||||
mjModel* m = LoadModelFromString(xml);
|
||||
ASSERT_EQ(m->nJmom, 4);
|
||||
mj_deleteModel(m);
|
||||
}
|
||||
|
||||
|
||||
// ------------- test automatic inference of nuser_xxx -------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user