Skip to content

Commit f5261d2

Browse files
authored
[BUG FIX] Fix linesearch fallback exit condition. (Genesis-Embodied-AI#2339)
1 parent 81c3795 commit f5261d2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

genesis/engine/solvers/rigid/constraint/solver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2216,7 +2216,7 @@ def func_linesearch_batch(
22162216
if p1_cost <= p2_cost and p1_cost < p0_cost:
22172217
constraint_state.ls_result[i_b] = 4
22182218
res_alpha = p1_alpha
2219-
elif p2_cost <= p1_cost and p2_cost < p1_cost:
2219+
elif p2_cost <= p1_cost and p2_cost < p0_cost:
22202220
constraint_state.ls_result[i_b] = 4
22212221
res_alpha = p2_alpha
22222222
else:

genesis/engine/solvers/rigid/constraint/solver_island.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ def _func_linesearch(self, island, i_b):
806806
if p1_cost <= p2_cost and p1_cost < p0_cost:
807807
self.ls_result[i_b] = 4
808808
res_alpha = p1_alpha
809-
elif p2_cost <= p1_cost and p2_cost < p1_cost:
809+
elif p2_cost <= p1_cost and p2_cost < p0_cost:
810810
self.ls_result[i_b] = 4
811811
res_alpha = p2_alpha
812812
else:

0 commit comments

Comments
 (0)