Fix normal only for libccd during hfield collisions.
PiperOrigin-RevId: 833933161 Change-Id: I3a4ff044276d9c7305154da09b440168f0f22305
This commit is contained in:
committed by
Copybara-Service
parent
7569ac960d
commit
e18e35f967
@@ -1342,9 +1342,11 @@ int mjc_ConvexHField(const mjModel* m, const mjData* d,
|
|||||||
mju_copy(mat2, savemat2, 9);
|
mju_copy(mat2, savemat2, 9);
|
||||||
mju_copy3(pos2, savepos2);
|
mju_copy3(pos2, savepos2);
|
||||||
|
|
||||||
// fix contact normals
|
if (mjDISABLED(mjDSBL_NATIVECCD)) {
|
||||||
for (int i=0; i < cnt; i++) {
|
// fix contact normals
|
||||||
mjc_fixNormal(m, d, con+i, g1, g2);
|
for (int i=0; i < cnt; i++) {
|
||||||
|
mjc_fixNormal(m, d, con+i, g1, g2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return cnt;
|
return cnt;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ TEST_F(SolverTest, IslandsEquivalent) {
|
|||||||
model->opt.jacobian = mjJAC_SPARSE; // use sparse
|
model->opt.jacobian = mjJAC_SPARSE; // use sparse
|
||||||
model->opt.tolerance = 0; // set tolerance to 0
|
model->opt.tolerance = 0; // set tolerance to 0
|
||||||
model->opt.ls_tolerance = 0; // set ls_tolerance to 0
|
model->opt.ls_tolerance = 0; // set ls_tolerance to 0
|
||||||
|
model->opt.ccd_tolerance = 0; // set ccd_tolerance to 0
|
||||||
|
|
||||||
int nv = model->nv;
|
int nv = model->nv;
|
||||||
|
|
||||||
@@ -56,7 +57,7 @@ TEST_F(SolverTest, IslandsEquivalent) {
|
|||||||
mjData* data_noisland = mj_makeData(model);
|
mjData* data_noisland = mj_makeData(model);
|
||||||
|
|
||||||
// Below are 3 tolerances associated with 3 different iteration counts,
|
// Below are 3 tolerances associated with 3 different iteration counts,
|
||||||
// they are only moderately tight, 2x higher than x86-64 failure on Linux,
|
// they are only moderately tight, 10x higher than x86-64 failure on Linux,
|
||||||
// i.e. in that case the test fails with rtol smaller than {5e-3, 5e-4, 5e-5}.
|
// i.e. in that case the test fails with rtol smaller than {5e-3, 5e-4, 5e-5}.
|
||||||
// The point of this test is to show that CG convergence is actually not very
|
// The point of this test is to show that CG convergence is actually not very
|
||||||
// precise, simply changing whether islands are used changes the solution by
|
// precise, simply changing whether islands are used changes the solution by
|
||||||
@@ -64,7 +65,7 @@ TEST_F(SolverTest, IslandsEquivalent) {
|
|||||||
// Increasing the iteration count higher than 60 does not improve convergence.
|
// Increasing the iteration count higher than 60 does not improve convergence.
|
||||||
constexpr int kNumTol = 3;
|
constexpr int kNumTol = 3;
|
||||||
mjtNum maxiter[kNumTol] = {30, 40, 60};
|
mjtNum maxiter[kNumTol] = {30, 40, 60};
|
||||||
mjtNum rtol[kNumTol] = {1e-2, 1e-3, 1e-4};
|
mjtNum rtol[kNumTol] = {5e-2, 5e-3, 5e-4};
|
||||||
|
|
||||||
for (int i = 0; i < kNumTol; ++i) {
|
for (int i = 0; i < kNumTol; ++i) {
|
||||||
model->opt.iterations = maxiter[i];
|
model->opt.iterations = maxiter[i];
|
||||||
|
|||||||
Reference in New Issue
Block a user