Skip to content

Commit 906624c

Browse files
authored
Merge pull request #20 from xchg-dot-ca/master
Update FABRIK2D.cpp
2 parents ddf603c + 78c1f15 commit 906624c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/FABRIK2D.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ bool Fabrik2D::solve(float x, float y, int* lengths)
218218
*/
219219
bool Fabrik2D::solve2(float x, float y, float z, float toolAngle, float grippingOffset, int* lengths)
220220
{
221+
bool solvable = false;
222+
221223
if (this->numJoints >= 4) {
222224

223225
// Find wrist center by moving from the desired position with tool angle and link length
@@ -228,7 +230,7 @@ bool Fabrik2D::solve2(float x, float y, float z, float toolAngle, float gripping
228230
int tmp = this->numJoints;
229231
this->numJoints = this->numJoints-1;
230232

231-
bool solvable = solve(oc_x, oc_y, lengths);
233+
solvable = solve(oc_x, oc_y, lengths);
232234

233235
this->numJoints = tmp;
234236

@@ -270,6 +272,8 @@ bool Fabrik2D::solve2(float x, float y, float z, float toolAngle, float gripping
270272
}
271273

272274
}
275+
276+
return solvable;
273277
}
274278

275279
/* solve(x, y, angle, lengths)

0 commit comments

Comments
 (0)