Default to nativeccd for geomDistance test.
PiperOrigin-RevId: 698340192 Change-Id: I814286903e1726462b24390eb2c3dc5b3b76899e
This commit is contained in:
committed by
Copybara-Service
parent
867e8b8adb
commit
cd84011d7b
@@ -805,6 +805,9 @@ TEST_F(SupportTest, MulMIsland) {
|
||||
|
||||
static constexpr char GeomDistanceTestingModel[] = R"(
|
||||
<mujoco>
|
||||
<option>
|
||||
<flag nativeccd="enable"/>
|
||||
</option>
|
||||
<asset>
|
||||
<mesh name="box" scale=".1 .1 .1" vertex="0 0 0 1 0 0 0 1 0 1 1 0
|
||||
0 0 1 1 0 1 0 1 1 1 1 1"/>
|
||||
@@ -853,25 +856,20 @@ TEST_F(SupportTest, GeomDistance) {
|
||||
EXPECT_THAT(fromto, Pointwise(DoubleNear(eps),
|
||||
std::vector<mjtNum>{.7, 0, 1, .2, 0, 1}));
|
||||
|
||||
// TODO: b/339596989 - Improve the bounds below (mjc_Convex).
|
||||
|
||||
// mesh-sphere (close distmax)
|
||||
distmax = 0.701;
|
||||
eps = 1e-5;
|
||||
eps = model->opt.ccd_tolerance;
|
||||
EXPECT_THAT(mj_geomDistance(model, data, 3, 1, distmax, fromto),
|
||||
DoubleNear(0.7, eps));
|
||||
eps = 1e-3;
|
||||
EXPECT_THAT(fromto, Pointwise(DoubleNear(eps),
|
||||
std::vector<mjtNum>{0, 0, .1, 0, 0, .8}));
|
||||
std::vector<mjtNum>{0, 0, .8, 0, 0, .1}));
|
||||
|
||||
// mesh-sphere (far distmax)
|
||||
distmax = 1.0;
|
||||
eps = 1e-3;
|
||||
EXPECT_THAT(mj_geomDistance(model, data, 3, 1, distmax, fromto),
|
||||
DoubleNear(0.7, eps));
|
||||
eps = 2e-2;
|
||||
EXPECT_THAT(fromto, Pointwise(DoubleNear(eps),
|
||||
std::vector<mjtNum>{0, 0, .1, 0, 0, .8}));
|
||||
std::vector<mjtNum>{0, 0, .8, 0, 0, .1}));
|
||||
|
||||
mj_deleteData(data);
|
||||
mj_deleteModel(model);
|
||||
|
||||
Reference in New Issue
Block a user