Closed snozawa closed 1 year ago
If the main motivation is to prevent unnecessary accumulation of failure counts due to the sampled t0
and t1
being too close to each other, I wonder what differences will be if we just continue to the next iteration without incrementing the iteration count (iters
in Shortcut
function).
Thanks for your comment!
I think your comment is equivalent as follows:
git diff
diff --git a/plugins/rplanners/parabolicsmoother2.cpp b/plugins/rplanners/parabolicsmoother2.cpp
index 9c6eaaaf9..d275d9415 100644
--- a/plugins/rplanners/parabolicsmoother2.cpp
+++ b/plugins/rplanners/parabolicsmoother2.cpp
@@ -2565,6 +2565,8 @@ protected:
++vShortcutStats[SS_TimeInstantsTooClose];
shortcutprogress << SS_TimeInstantsTooClose << "\n";
#endif
+ iters--;
+ nItersFromPrevSuccessful--;
continue;
}
I originally tried this, and yes, it's reasonable. But, in this PR, I try to compute the times directly, since:
t0
and t1
in a fixed time. Of course, I think such probability is extremely small. Meanwhile, the way in this PR will return feasible t0
and t1
in a fixed function call.Rand
. So, retrying this situation would be bit complicated in terms of coding.worth a try, thanks~
Summary
ParabolicSmoother2
.Detail
minTimeStep
, reject since it's too close: https://github.com/rdiankov/openrave/blob/master/plugins/rplanners/parabolicsmoother2.cpp#L2566sample+reject
, directly sample the times from feasible range. to do so, combine the inequality aboutminTimeStep
with the existing inequalities fort0
andt1
.minTimeStep
for usual case: https://github.com/rdiankov/openrave/blob/master/plugins/rplanners/parabolicsmoother2.cpp#L2551-L2552t0
andt1
are always feasible.minTimeStep
for zero-velocity case : https://github.com/rdiankov/openrave/blob/master/plugins/rplanners/parabolicsmoother2.cpp#L2538-L2539t0
andt1
might be infeasible, due tospecialShortcutCutoffTime
. if feasible, use the computed values. if infeasible, removespecialShortcutCutoffTime
and compute the times again as a fallback. This fallback computation is always feasible.nItersFromPrevSuccessful
is unexpectedly accumulated, and thus, the iteration might quit too early.