Open maxpla3 opened 7 months ago
The 1D LP in the above post does not have a solution unless one assumes 5.68434e-14 = 0, then the LP becomes solvable with x = 0. I have to figure out where 5.68434e-14 comes from and why it's not exactly 0.
Would this solution make sense?
if upper_bound < lower_bound AND lower_bound - upper_bound < 2 * ABS_TOLERANCE
then
lower_bound -= ABS_TOLERANCE
upper_bound += ABS_TOLERANCE
That way, if upper bound is smaller than lower bound due to numerical errors, we'd extend the bounds by a tiny amount and allow a solution between the new bounds?
The issue can be reproduced with following test:
{
// Issue #244
v = { -65.960772491990838, 0.0 };
A.resize(8, 2);
A << -65.9607724919908, -0.0151605259038078,
65.9607724919908, -0.00782362866419491,
0.468679477393087, 5.6843418860808e-14,
-0.468679477393087, -1000,
0, -std::numeric_limits<double>::infinity(),
0, -std::numeric_limits<double>::infinity(),
-65.9607724919908, 0,
65.9607724919908, -0.0229841545680027;
auto sol = seidel::solve_lp1d(v, A);
EXPECT_TRUE(sol.feasible);
}
It fails on EXPECT_TRUE(sol.feasible)
.
While trying to calculate the trajectory for one joint with setN(1000) I get the following error:
Changing N to other values does not cause that problem. Looks like a numerical problem. The actual solution should probably be 0 here but due do numerical errors the upper bound becomes slightly negative.