Add mjENBL_DIAGEXACT for exact constraint diagonal. Fixes #2472
PiperOrigin-RevId: 916932908 Change-Id: Id23ac39b5cd996afc52990719a4e07c0cc7de600
This commit is contained in:
committed by
Copybara-Service
parent
66d764a116
commit
71d1014e70
@@ -917,6 +917,43 @@ TEST_F(ImplicitIntegratorTest, MidpointEligibility) {
|
||||
mj_deleteModel(m);
|
||||
}
|
||||
|
||||
// model with degenerate translational inertia
|
||||
TEST_F(ForwardTest, DegenerateInertia) {
|
||||
static constexpr char xml[] = R"(
|
||||
<mujoco>
|
||||
<option integrator="implicitfast" cone="elliptic">
|
||||
<flag gravity="disable" diagexact="enable"/>
|
||||
</option>
|
||||
<worldbody>
|
||||
<body name="1" pos="0.05 0.3 0">
|
||||
<joint name="1" axis="0 1 0"/>
|
||||
<geom type="capsule" size="0.1 0.5"/>
|
||||
</body>
|
||||
<body name="2">
|
||||
<joint name="2" axis="1 0 0" stiffness="1" springref="90"/>
|
||||
<geom type="capsule" size="0.1 0.5"/>
|
||||
</body>
|
||||
</worldbody>
|
||||
</mujoco>
|
||||
)";
|
||||
char error[1024];
|
||||
mjModel* model = LoadModelFromString(xml, error, sizeof(error));
|
||||
ASSERT_THAT(model, NotNull()) << error;
|
||||
mjData* data = mj_makeData(model);
|
||||
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
mj_step(model, data);
|
||||
EXPECT_EQ(data->warning[mjWARN_BADQACC].number, 0)
|
||||
<< "divergence at timestep " << i;
|
||||
if (data->warning[mjWARN_BADQACC].number != 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mj_deleteData(data);
|
||||
mj_deleteModel(model);
|
||||
}
|
||||
|
||||
TEST_F(ForwardTest, ControlClamping) {
|
||||
static constexpr char xml[] = R"(
|
||||
<mujoco>
|
||||
|
||||
Reference in New Issue
Block a user