moveit2
The MoveIt Motion Planning Framework for ROS 2.
Loading...
Searching...
No Matches
prbt_manipulator_ikfast_solver.cpp
Go to the documentation of this file.
1
24#define IKFAST_HAS_LIBRARY
25#include "ikfast.h" // found inside share/openrave-X.Y/python/ikfast.h
26using namespace ikfast;
27
28// check if the included ikfast version matches what this file was compiled with
29static_assert(IKFAST_VERSION==61); // version found in ikfast.h
30
31#include <cmath>
32#include <vector>
33#include <limits>
34#include <complex>
35
36#ifndef IKFAST_ASSERT
37#include <stdexcept>
38#include <sstream>
39
40#ifdef _MSC_VER
41#ifndef __PRETTY_FUNCTION__
42#define __PRETTY_FUNCTION__ __FUNCDNAME__
43#endif
44#endif
45
46#ifndef __PRETTY_FUNCTION__
47#define __PRETTY_FUNCTION__ __func__
48#endif
49
50#define IKFAST_ASSERT(b) { if( !(b) ) { std::stringstream ss; ss << "ikfast exception: " << __FILE__ << ':' << __LINE__ << ": " <<__PRETTY_FUNCTION__ << ": Assertion '" << #b << "' failed"; throw std::runtime_error(ss.str()); } }
51
52#endif
53
54#if defined(_MSC_VER)
55#define IKFAST_ALIGNED16(x) __declspec(align(16)) x
56#else
57#define IKFAST_ALIGNED16(x) x __attribute((aligned(16)))
58#endif
59
60#define IK2PI ((IkReal)6.28318530717959)
61#define IKPI ((IkReal)3.14159265358979)
62#define IKPI_2 ((IkReal)1.57079632679490)
63
64#ifdef _MSC_VER
65#ifndef isnan
66#define isnan _isnan
67#endif
68#ifndef isinf
69#define isinf _isinf
70#endif
71//#ifndef isfinite
72//#define isfinite _isfinite
73//#endif
74#endif // _MSC_VER
75
76using namespace std; // necessary to get std math routines
77
78#ifdef IKFAST_NAMESPACE
79namespace IKFAST_NAMESPACE {
80#endif
81
82inline float IKabs(float f) { return fabsf(f); }
83inline double IKabs(double f) { return fabs(f); }
84
85inline float IKsqr(float f) { return f*f; }
86inline double IKsqr(double f) { return f*f; }
87
88inline float IKlog(float f) { return logf(f); }
89inline double IKlog(double f) { return log(f); }
90
91// allows asin and acos to exceed 1. has to be smaller than thresholds used for branch conds and evaluation
92#ifndef IKFAST_SINCOS_THRESH
93#define IKFAST_SINCOS_THRESH ((IkReal)1e-7)
94#endif
95
96// used to check input to atan2 for degenerate cases. has to be smaller than thresholds used for branch conds and evaluation
97#ifndef IKFAST_ATAN2_MAGTHRESH
98#define IKFAST_ATAN2_MAGTHRESH ((IkReal)1e-7)
99#endif
100
101// minimum distance of separate solutions
102#ifndef IKFAST_SOLUTION_THRESH
103#define IKFAST_SOLUTION_THRESH ((IkReal)1e-6)
104#endif
105
106// there are checkpoints in ikfast that are evaluated to make sure they are 0. This threshold specifies by how much they can deviate
107#ifndef IKFAST_EVALCOND_THRESH
108#define IKFAST_EVALCOND_THRESH ((IkReal)0.00001)
109#endif
110
111
112inline float IKasin(float f)
113{
114IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
115if( f <= -1 ) return float(-IKPI_2);
116else if( f >= 1 ) return float(IKPI_2);
117return asinf(f);
118}
119inline double IKasin(double f)
120{
121IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
122if( f <= -1 ) return -IKPI_2;
123else if( f >= 1 ) return IKPI_2;
124return asin(f);
125}
126
127// return positive value in [0,y)
128inline float IKfmod(float x, float y)
129{
130 while(x < 0) {
131 x += y;
132 }
133 return fmodf(x,y);
134}
135
136// return positive value in [0,y)
137inline double IKfmod(double x, double y)
138{
139 while(x < 0) {
140 x += y;
141 }
142 return fmod(x,y);
143}
144
145inline float IKacos(float f)
146{
147IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
148if( f <= -1 ) return float(IKPI);
149else if( f >= 1 ) return float(0);
150return acosf(f);
151}
152inline double IKacos(double f)
153{
154IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
155if( f <= -1 ) return IKPI;
156else if( f >= 1 ) return 0;
157return acos(f);
158}
159inline float IKsin(float f) { return sinf(f); }
160inline double IKsin(double f) { return sin(f); }
161inline float IKcos(float f) { return cosf(f); }
162inline double IKcos(double f) { return cos(f); }
163inline float IKtan(float f) { return tanf(f); }
164inline double IKtan(double f) { return tan(f); }
165inline float IKsqrt(float f) { if( f <= 0.0f ) return 0.0f; return sqrtf(f); }
166inline double IKsqrt(double f) { if( f <= 0.0 ) return 0.0; return sqrt(f); }
167inline float IKatan2Simple(float fy, float fx) {
168 return atan2f(fy,fx);
169}
170inline float IKatan2(float fy, float fx) {
171 if( isnan(fy) ) {
172 IKFAST_ASSERT(!isnan(fx)); // if both are nan, probably wrong value will be returned
173 return float(IKPI_2);
174 }
175 else if( isnan(fx) ) {
176 return 0;
177 }
178 return atan2f(fy,fx);
179}
180inline double IKatan2Simple(double fy, double fx) {
181 return atan2(fy,fx);
182}
183inline double IKatan2(double fy, double fx) {
184 if( isnan(fy) ) {
185 IKFAST_ASSERT(!isnan(fx)); // if both are nan, probably wrong value will be returned
186 return IKPI_2;
187 }
188 else if( isnan(fx) ) {
189 return 0;
190 }
191 return atan2(fy,fx);
192}
193
194template <typename T>
196{
198 bool valid;
199};
200
201template <typename T>
202inline CheckValue<T> IKatan2WithCheck(T fy, T fx, T /* unused */)
203{
204 CheckValue<T> ret;
205 ret.valid = false;
206 ret.value = 0;
207 if( !isnan(fy) && !isnan(fx) ) {
209 ret.value = IKatan2Simple(fy,fx);
210 ret.valid = true;
211 }
212 }
213 return ret;
214}
215
216inline float IKsign(float f) {
217 if( f > 0 ) {
218 return float(1);
219 }
220 else if( f < 0 ) {
221 return float(-1);
222 }
223 return 0;
224}
225
226inline double IKsign(double f) {
227 if( f > 0 ) {
228 return 1.0;
229 }
230 else if( f < 0 ) {
231 return -1.0;
232 }
233 return 0;
234}
235
236template <typename T>
238{
239 CheckValue<T> ret;
240 ret.valid = true;
241 if( n == 0 ) {
242 ret.value = 1.0;
243 return ret;
244 }
245 else if( n == 1 )
246 {
247 ret.value = f;
248 return ret;
249 }
250 else if( n < 0 )
251 {
252 if( f == 0 )
253 {
254 ret.valid = false;
255 ret.value = (T)1.0e30;
256 return ret;
257 }
258 if( n == -1 ) {
259 ret.value = T(1.0)/f;
260 return ret;
261 }
262 }
263
264 int num = n > 0 ? n : -n;
265 if( num == 2 ) {
266 ret.value = f*f;
267 }
268 else if( num == 3 ) {
269 ret.value = f*f*f;
270 }
271 else {
272 ret.value = 1.0;
273 while(num>0) {
274 if( num & 1 ) {
275 ret.value *= f;
276 }
277 num >>= 1;
278 f *= f;
279 }
280 }
281
282 if( n < 0 ) {
283 ret.value = T(1.0)/ret.value;
284 }
285 return ret;
286}
287
290IKFAST_API void ComputeFk(const IkReal* j, IkReal* eetrans, IkReal* eerot) {
291IkReal x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33,x34,x35,x36,x37,x38,x39,x40,x41,x42,x43,x44,x45,x46;
292x0=IKcos(j[0]);
293x1=IKcos(j[1]);
294x2=IKcos(j[2]);
295x3=IKsin(j[1]);
296x4=IKsin(j[2]);
297x5=IKsin(j[3]);
298x6=IKcos(j[3]);
299x7=IKsin(j[0]);
300x8=IKcos(j[5]);
301x9=IKsin(j[5]);
302x10=IKsin(j[4]);
303x11=IKcos(j[4]);
304x12=((1.0)*x7);
305x13=((1.0)*x6);
306x14=((0.307)*x7);
307x15=((0.084)*x3);
308x16=((0.084)*x7);
309x17=((1.0)*x0);
310x18=((1.0)*x10);
311x19=((0.35)*x3);
312x20=((0.084)*x6);
313x21=((0.307)*x0);
314x22=((0.084)*x0);
315x23=(x1*x2);
316x24=(x1*x4);
317x25=((-1.0)*x6);
318x26=(x2*x3);
319x27=(x5*x7);
320x28=(x3*x4);
321x29=(x10*x6);
322x30=(x17*x5);
323x31=((1.0)*x26);
324x32=((((-1.0)*x31))+x24);
325x33=((((-1.0)*x24))+x31);
326x34=((((1.0)*x23))+(((1.0)*x28)));
327x35=(x11*x32);
328x36=(x33*x5);
329x37=(x17*(((((-1.0)*x24))+x26)));
330x38=(x12*(((((-1.0)*x24))+x26)));
331x39=(x17*(((((-1.0)*x23))+(((-1.0)*x28)))));
332x40=(x12*(((((-1.0)*x23))+(((-1.0)*x28)))));
333x41=(x10*x38);
334x42=(x39*x5);
335x43=(x39*x6);
336x44=(((x0*x6))+((x40*x5)));
337x45=(x30+((x25*x40)));
338x46=(x11*x45);
339eerot[0]=(((x9*(((((-1.0)*x12*x6))+x42))))+((x8*((((x10*x37))+((x11*(((((-1.0)*x27))+((x25*x39)))))))))));
340eerot[1]=((((-1.0)*x9*((((x18*x37))+(((1.0)*x11*(((((-1.0)*x12*x5))+(((-1.0)*x13*x39))))))))))+((x8*((x42+((x25*x7)))))));
341eerot[2]=(((x10*((x43+x27))))+((x11*x37)));
342IkReal x47=((1.0)*x24);
343eetrans[0]=(((x21*x26))+((x0*x19))+((x11*(((((-1.0)*x22*x47))+((x0*x15*x2))))))+(((-1.0)*x21*x47))+((x10*((((x20*x39))+((x16*x5)))))));
344eerot[3]=(((x44*x9))+((x8*((x46+x41)))));
345eerot[4]=(((x9*(((((-1.0)*x41))+(((-1.0)*x46))))))+((x44*x8)));
346eerot[5]=(((x10*(((((-1.0)*x30))+((x40*x6))))))+((x11*x38)));
347IkReal x48=((1.0)*x24);
348eetrans[1]=(((x19*x7))+((x14*x26))+((x10*((((x20*x40))+(((-1.0)*x22*x5))))))+((x11*(((((-1.0)*x16*x48))+((x15*x2*x7))))))+(((-1.0)*x14*x48)));
349eerot[6]=(((x8*((((x10*x34))+((x35*x6))))))+((x36*x9)));
350eerot[7]=(((x9*(((((-1.0)*x18*x34))+(((-1.0)*x13*x35))))))+((x36*x8)));
351eerot[8]=(((x29*x33))+((x11*x34)));
352eetrans[2]=((0.2604)+(((0.35)*x1))+((x29*(((((-0.084)*x24))+((x15*x2))))))+((x11*(((((0.084)*x23))+((x15*x4))))))+(((0.307)*x23))+(((0.307)*x28)));
353}
354
355IKFAST_API int GetNumFreeParameters() { return 0; }
356IKFAST_API int* GetFreeParameters() { return nullptr; }
357IKFAST_API int GetNumJoints() { return 6; }
358
359IKFAST_API int GetIkRealSize() { return sizeof(IkReal); }
360
361IKFAST_API int GetIkType() { return 0x67000001; }
362
363class IKSolver {
364public:
366unsigned char _ij0[2], _nj0,_ij1[2], _nj1,_ij2[2], _nj2,_ij3[2], _nj3,_ij4[2], _nj4,_ij5[2], _nj5;
367
368IkReal j100, cj100, sj100;
369unsigned char _ij100[2], _nj100;
370 bool ComputeIk(const IkReal* eetrans, const IkReal* eerot, const IkReal* /* unused */, IkSolutionListBase<IkReal>& solutions) {
371j0=numeric_limits<IkReal>::quiet_NaN(); _ij0[0] = -1; _ij0[1] = -1; _nj0 = -1; j1=numeric_limits<IkReal>::quiet_NaN(); _ij1[0] = -1; _ij1[1] = -1; _nj1 = -1; j2=numeric_limits<IkReal>::quiet_NaN(); _ij2[0] = -1; _ij2[1] = -1; _nj2 = -1; j3=numeric_limits<IkReal>::quiet_NaN(); _ij3[0] = -1; _ij3[1] = -1; _nj3 = -1; j4=numeric_limits<IkReal>::quiet_NaN(); _ij4[0] = -1; _ij4[1] = -1; _nj4 = -1; j5=numeric_limits<IkReal>::quiet_NaN(); _ij5[0] = -1; _ij5[1] = -1; _nj5 = -1;
372for(int dummyiter = 0; dummyiter < 1; ++dummyiter) {
373 solutions.Clear();
374r00 = eerot[0*3+0];
375r01 = eerot[0*3+1];
376r02 = eerot[0*3+2];
377r10 = eerot[1*3+0];
378r11 = eerot[1*3+1];
379r12 = eerot[1*3+2];
380r20 = eerot[2*3+0];
381r21 = eerot[2*3+1];
382r22 = eerot[2*3+2];
383px = eetrans[0]; py = eetrans[1]; pz = eetrans[2];
384
388new_px=(px+(((-0.084)*r02)));
392new_py=(py+(((-0.084)*r12)));
396new_pz=((-0.2604)+pz+(((-0.084)*r22)));
398IkReal x49=((1.0)*px);
399IkReal x50=((1.0)*pz);
400IkReal x51=((1.0)*py);
401pp=((px*px)+(py*py)+(pz*pz));
402npx=(((px*r00))+((py*r10))+((pz*r20)));
403npy=(((px*r01))+((py*r11))+((pz*r21)));
404npz=(((px*r02))+((py*r12))+((pz*r22)));
405rxp0_0=((((-1.0)*r20*x51))+((pz*r10)));
406rxp0_1=(((px*r20))+(((-1.0)*r00*x50)));
407rxp0_2=((((-1.0)*r10*x49))+((py*r00)));
408rxp1_0=((((-1.0)*r21*x51))+((pz*r11)));
409rxp1_1=(((px*r21))+(((-1.0)*r01*x50)));
410rxp1_2=((((-1.0)*r11*x49))+((py*r01)));
411rxp2_0=(((pz*r12))+(((-1.0)*r22*x51)));
412rxp2_1=(((px*r22))+(((-1.0)*r02*x50)));
413rxp2_2=((((-1.0)*r12*x49))+((py*r02)));
414{
415IkReal j2array[2], cj2array[2], sj2array[2];
416bool j2valid[2]={false};
417_nj2 = 2;
418cj2array[0]=((-1.00860400186133)+(((4.65332712889716)*pp)));
419if( cj2array[0] >= -1-IKFAST_SINCOS_THRESH && cj2array[0] <= 1+IKFAST_SINCOS_THRESH )
420{
421 j2valid[0] = j2valid[1] = true;
422 j2array[0] = IKacos(cj2array[0]);
423 sj2array[0] = IKsin(j2array[0]);
424 cj2array[1] = cj2array[0];
425 j2array[1] = -j2array[0];
426 sj2array[1] = -sj2array[0];
427}
428else if( isnan(cj2array[0]) )
429{
430 // probably any value will work
431 j2valid[0] = true;
432 cj2array[0] = 1; sj2array[0] = 0; j2array[0] = 0;
433}
434for(int ij2 = 0; ij2 < 2; ++ij2)
435{
436if( !j2valid[ij2] )
437{
438 continue;
439}
440_ij2[0] = ij2; _ij2[1] = -1;
441for(int iij2 = ij2+1; iij2 < 2; ++iij2)
442{
443if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
444{
445 j2valid[iij2]=false; _ij2[1] = iij2; break;
446}
447}
448j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
449
450{
451IkReal j0eval[1];
452j0eval[0]=((IKabs(px))+(IKabs(py)));
453if( IKabs(j0eval[0]) < 0.0000010000000000 )
454{
455{
456IkReal j1eval[2];
457j1eval[0]=((IKabs(sj2))+(((3.25732899022801)*(IKabs(((0.35)+(((0.307)*cj2))))))));
458j1eval[1]=((1.29974853844603)+(sj2*sj2)+(cj2*cj2)+(((2.28013029315961)*cj2)));
459if( IKabs(j1eval[0]) < 0.0000010000000000 || IKabs(j1eval[1]) < 0.0000010000000000 )
460{
461continue; // no branches [j0, j1]
462
463} else
464{
465{
466IkReal j1array[2], cj1array[2], sj1array[2];
467bool j1valid[2]={false};
468_nj1 = 2;
469IkReal x52=((0.35)+(((0.307)*cj2)));
470CheckValue<IkReal> x55 = IKatan2WithCheck(IkReal(x52),IkReal(((0.307)*sj2)),IKFAST_ATAN2_MAGTHRESH);
471if(!x55.valid){
472continue;
473}
474IkReal x53=((1.0)*(x55.value));
475if((((((0.094249)*(sj2*sj2)))+(x52*x52))) < -0.00001)
476continue;
477CheckValue<IkReal> x56=IKPowWithIntegerCheck(IKabs(IKsqrt(((((0.094249)*(sj2*sj2)))+(x52*x52)))),-1);
478if(!x56.valid){
479continue;
480}
481if( ((pz*(x56.value))) < -1-IKFAST_SINCOS_THRESH || ((pz*(x56.value))) > 1+IKFAST_SINCOS_THRESH )
482 continue;
483IkReal x54=IKasin((pz*(x56.value)));
484j1array[0]=(x54+(((-1.0)*x53)));
485sj1array[0]=IKsin(j1array[0]);
486cj1array[0]=IKcos(j1array[0]);
487j1array[1]=((3.14159265358979)+(((-1.0)*x53))+(((-1.0)*x54)));
488sj1array[1]=IKsin(j1array[1]);
489cj1array[1]=IKcos(j1array[1]);
490if( j1array[0] > IKPI )
491{
492 j1array[0]-=IK2PI;
493}
494else if( j1array[0] < -IKPI )
495{ j1array[0]+=IK2PI;
496}
497j1valid[0] = true;
498if( j1array[1] > IKPI )
499{
500 j1array[1]-=IK2PI;
501}
502else if( j1array[1] < -IKPI )
503{ j1array[1]+=IK2PI;
504}
505j1valid[1] = true;
506for(int ij1 = 0; ij1 < 2; ++ij1)
507{
508if( !j1valid[ij1] )
509{
510 continue;
511}
512_ij1[0] = ij1; _ij1[1] = -1;
513for(int iij1 = ij1+1; iij1 < 2; ++iij1)
514{
515if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH )
516{
517 j1valid[iij1]=false; _ij1[1] = iij1; break;
518}
519}
520j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1];
521
522// The remainder of this scope is removed as it does not return a solution.
523// This is the branch (IKabs(px))+(IKabs(py)), from the kinematics we know,
524// that j0 is free. So we simply choose 4 values and pass directly to the
525// rotationfunction (orientation computation is unchanged).
526_nj0=4;
527for(int ij0=1; ij0 < _nj0; ++ij0)
528{
529j0=(IkReal)(ij0 - 1) * (3.14159265358979) / 2.; // -pi/2, 0, pi/2, pi
530cj0=IKcos(j0);
531sj0=IKsin(j0);
532_ij0[0] = ij0;
533rotationfunction0(solutions);
534}
535
536}
537}
538
539}
540
541}
542
543} else
544{
545{
546IkReal j0array[2], cj0array[2], sj0array[2];
547bool j0valid[2]={false};
548_nj0 = 2;
549CheckValue<IkReal> x1691 = IKatan2WithCheck(IkReal(py),IkReal(((-1.0)*px)),IKFAST_ATAN2_MAGTHRESH);
550if(!x1691.valid){
551continue;
552}
553IkReal x1690=x1691.value;
554j0array[0]=((-1.0)*x1690);
555sj0array[0]=IKsin(j0array[0]);
556cj0array[0]=IKcos(j0array[0]);
557j0array[1]=((3.14159265358979)+(((-1.0)*x1690)));
558sj0array[1]=IKsin(j0array[1]);
559cj0array[1]=IKcos(j0array[1]);
560if( j0array[0] > IKPI )
561{
562 j0array[0]-=IK2PI;
563}
564else if( j0array[0] < -IKPI )
565{ j0array[0]+=IK2PI;
566}
567j0valid[0] = true;
568if( j0array[1] > IKPI )
569{
570 j0array[1]-=IK2PI;
571}
572else if( j0array[1] < -IKPI )
573{ j0array[1]+=IK2PI;
574}
575j0valid[1] = true;
576for(int ij0 = 0; ij0 < 2; ++ij0)
577{
578if( !j0valid[ij0] )
579{
580 continue;
581}
582_ij0[0] = ij0; _ij0[1] = -1;
583for(int iij0 = ij0+1; iij0 < 2; ++iij0)
584{
585if( j0valid[iij0] && IKabs(cj0array[ij0]-cj0array[iij0]) < IKFAST_SOLUTION_THRESH && IKabs(sj0array[ij0]-sj0array[iij0]) < IKFAST_SOLUTION_THRESH )
586{
587 j0valid[iij0]=false; _ij0[1] = iij0; break;
588}
589}
590j0 = j0array[ij0]; cj0 = cj0array[ij0]; sj0 = sj0array[ij0];
591
592{
593IkReal j1eval[3];
594IkReal x1692=((307000.0)*cj2);
595IkReal x1693=(cj0*px);
596IkReal x1694=((307000.0)*sj2);
597IkReal x1695=(py*sj0);
598j1eval[0]=((-1.00860400186133)+(((-1.0)*cj2)));
599j1eval[1]=((IKabs(((((-1.0)*pz*x1692))+(((-350000.0)*pz))+((x1693*x1694))+((x1694*x1695)))))+(IKabs(((((-1.0)*x1692*x1693))+(((-1.0)*x1692*x1695))+(((-1.0)*pz*x1694))+(((-350000.0)*x1693))+(((-350000.0)*x1695))))));
600j1eval[2]=IKsign(((-216749.0)+(((-214900.0)*cj2))));
601if( IKabs(j1eval[0]) < 0.0000010000000000 || IKabs(j1eval[1]) < 0.0000010000000000 || IKabs(j1eval[2]) < 0.0000010000000000 )
602{
603{
604IkReal j1eval[3];
605IkReal x1696=(py*sj0);
606IkReal x1697=((1000.0)*pz);
607IkReal x1698=(pz*sj2);
608IkReal x1699=(cj0*px);
609IkReal x1700=(cj2*x1699);
610j1eval[0]=((((-1.0)*x1700))+x1698+(((-1.0)*cj2*x1696))+(((-1.1400651465798)*x1696))+(((-1.1400651465798)*x1699)));
611j1eval[1]=((IKabs(((((-1.0)*x1696*x1697))+(((-1.0)*x1697*x1699))+(((94.249)*cj2*sj2))+(((107.45)*sj2)))))+(IKabs(((-122.5)+(((-94.249)*(cj2*cj2)))+(((-214.9)*cj2))+((pz*x1697))))));
612j1eval[2]=IKsign(((((-307.0)*x1700))+(((-350.0)*x1699))+(((-350.0)*x1696))+(((-307.0)*cj2*x1696))+(((307.0)*x1698))));
613if( IKabs(j1eval[0]) < 0.0000010000000000 || IKabs(j1eval[1]) < 0.0000010000000000 || IKabs(j1eval[2]) < 0.0000010000000000 )
614{
615{
616IkReal j1eval[3];
617IkReal x1701=(cj0*px);
618IkReal x1702=((1.0)*cj2);
619IkReal x1703=((7000.0)*pz);
620IkReal x1704=(py*sj0);
621IkReal x1705=((2149.0)*cj2);
622IkReal x1706=(pz*sj2);
623IkReal x1707=((3070.0)*pp);
624j1eval[0]=((((-1.1400651465798)*x1704))+(((-1.1400651465798)*x1701))+(((-1.0)*x1702*x1704))+x1706+(((-1.0)*x1701*x1702)));
625j1eval[1]=((IKabs(((-98.8785)+(((-86.73057)*cj2))+(((-1.0)*cj2*x1707))+(((-3500.0)*pp))+((pz*x1703)))))+(IKabs(((((-1.0)*x1703*x1704))+((sj2*x1707))+(((-1.0)*x1701*x1703))+(((86.73057)*sj2))))));
626j1eval[2]=IKsign(((((2149.0)*x1706))+(((-2450.0)*x1704))+(((-2450.0)*x1701))+(((-1.0)*x1704*x1705))+(((-1.0)*x1701*x1705))));
627if( IKabs(j1eval[0]) < 0.0000010000000000 || IKabs(j1eval[1]) < 0.0000010000000000 || IKabs(j1eval[2]) < 0.0000010000000000 )
628{
629continue; // no branches [j1]
630
631} else
632{
633{
634IkReal j1array[1], cj1array[1], sj1array[1];
635bool j1valid[1]={false};
636_nj1 = 1;
637IkReal x1708=((7000.0)*pz);
638IkReal x1709=(cj0*px);
639IkReal x1710=(py*sj0);
640IkReal x1711=((2149.0)*cj2);
641IkReal x1712=((3070.0)*pp);
642CheckValue<IkReal> x1713 = IKatan2WithCheck(IkReal(((-98.8785)+(((-86.73057)*cj2))+(((-3500.0)*pp))+(((-1.0)*cj2*x1712))+((pz*x1708)))),IkReal(((((-1.0)*x1708*x1709))+(((-1.0)*x1708*x1710))+((sj2*x1712))+(((86.73057)*sj2)))),IKFAST_ATAN2_MAGTHRESH);
643if(!x1713.valid){
644continue;
645}
646CheckValue<IkReal> x1714=IKPowWithIntegerCheck(IKsign(((((-1.0)*x1710*x1711))+(((-1.0)*x1709*x1711))+(((-2450.0)*x1709))+(((-2450.0)*x1710))+(((2149.0)*pz*sj2)))),-1);
647if(!x1714.valid){
648continue;
649}
650j1array[0]=((-1.5707963267949)+(x1713.value)+(((1.5707963267949)*(x1714.value))));
651sj1array[0]=IKsin(j1array[0]);
652cj1array[0]=IKcos(j1array[0]);
653if( j1array[0] > IKPI )
654{
655 j1array[0]-=IK2PI;
656}
657else if( j1array[0] < -IKPI )
658{ j1array[0]+=IK2PI;
659}
660j1valid[0] = true;
661for(int ij1 = 0; ij1 < 1; ++ij1)
662{
663if( !j1valid[ij1] )
664{
665 continue;
666}
667_ij1[0] = ij1; _ij1[1] = -1;
668for(int iij1 = ij1+1; iij1 < 1; ++iij1)
669{
670if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH )
671{
672 j1valid[iij1]=false; _ij1[1] = iij1; break;
673}
674}
675j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1];
676{
677IkReal evalcond[5];
678IkReal x1715=IKcos(j1);
679IkReal x1716=IKsin(j1);
680IkReal x1717=(cj0*px);
681IkReal x1718=(py*sj0);
682IkReal x1719=((0.307)*x1715);
683IkReal x1720=((1.0)*x1718);
684IkReal x1721=(pz*x1715);
685IkReal x1722=((0.7)*x1716);
686IkReal x1723=((0.307)*x1716);
687evalcond[0]=((((-1.0)*pz))+((cj2*x1719))+(((0.35)*x1715))+((sj2*x1723)));
688evalcond[1]=((((-1.0)*x1715*x1720))+(((-1.0)*x1715*x1717))+(((-0.307)*sj2))+((pz*x1716)));
689evalcond[2]=((((-0.35)*x1716))+x1717+x1718+(((-1.0)*cj2*x1723))+((sj2*x1719)));
690evalcond[3]=((-0.028251)+((x1718*x1722))+((x1717*x1722))+(((-1.0)*pp))+(((0.7)*x1721)));
691evalcond[4]=((0.35)+(((-1.0)*x1716*x1717))+(((-1.0)*x1721))+(((-1.0)*x1716*x1720))+(((0.307)*cj2)));
692if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH )
693{
694continue;
695}
696}
697
698rotationfunction0(solutions);
699}
700}
701
702}
703
704}
705
706} else
707{
708{
709IkReal j1array[1], cj1array[1], sj1array[1];
710bool j1valid[1]={false};
711_nj1 = 1;
712IkReal x1724=((307.0)*cj2);
713IkReal x1725=(cj0*px);
714IkReal x1726=(py*sj0);
715IkReal x1727=((1000.0)*pz);
716CheckValue<IkReal> x1728 = IKatan2WithCheck(IkReal(((-122.5)+(((-94.249)*(cj2*cj2)))+((pz*x1727))+(((-214.9)*cj2)))),IkReal(((((-1.0)*x1726*x1727))+(((94.249)*cj2*sj2))+(((107.45)*sj2))+(((-1.0)*x1725*x1727)))),IKFAST_ATAN2_MAGTHRESH);
717if(!x1728.valid){
718continue;
719}
720CheckValue<IkReal> x1729=IKPowWithIntegerCheck(IKsign(((((-350.0)*x1726))+(((-350.0)*x1725))+(((307.0)*pz*sj2))+(((-1.0)*x1724*x1725))+(((-1.0)*x1724*x1726)))),-1);
721if(!x1729.valid){
722continue;
723}
724j1array[0]=((-1.5707963267949)+(x1728.value)+(((1.5707963267949)*(x1729.value))));
725sj1array[0]=IKsin(j1array[0]);
726cj1array[0]=IKcos(j1array[0]);
727if( j1array[0] > IKPI )
728{
729 j1array[0]-=IK2PI;
730}
731else if( j1array[0] < -IKPI )
732{ j1array[0]+=IK2PI;
733}
734j1valid[0] = true;
735for(int ij1 = 0; ij1 < 1; ++ij1)
736{
737if( !j1valid[ij1] )
738{
739 continue;
740}
741_ij1[0] = ij1; _ij1[1] = -1;
742for(int iij1 = ij1+1; iij1 < 1; ++iij1)
743{
744if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH )
745{
746 j1valid[iij1]=false; _ij1[1] = iij1; break;
747}
748}
749j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1];
750{
751IkReal evalcond[5];
752IkReal x1730=IKcos(j1);
753IkReal x1731=IKsin(j1);
754IkReal x1732=(cj0*px);
755IkReal x1733=(py*sj0);
756IkReal x1734=((0.307)*x1730);
757IkReal x1735=((1.0)*x1733);
758IkReal x1736=(pz*x1730);
759IkReal x1737=((0.7)*x1731);
760IkReal x1738=((0.307)*x1731);
761evalcond[0]=(((cj2*x1734))+(((0.35)*x1730))+(((-1.0)*pz))+((sj2*x1738)));
762evalcond[1]=(((pz*x1731))+(((-0.307)*sj2))+(((-1.0)*x1730*x1735))+(((-1.0)*x1730*x1732)));
763evalcond[2]=(x1733+x1732+(((-1.0)*cj2*x1738))+(((-0.35)*x1731))+((sj2*x1734)));
764evalcond[3]=((-0.028251)+(((-1.0)*pp))+(((0.7)*x1736))+((x1732*x1737))+((x1733*x1737)));
765evalcond[4]=((0.35)+(((-1.0)*x1731*x1735))+(((-1.0)*x1731*x1732))+(((-1.0)*x1736))+(((0.307)*cj2)));
766if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH )
767{
768continue;
769}
770}
771
772rotationfunction0(solutions);
773}
774}
775
776}
777
778}
779
780} else
781{
782{
783IkReal j1array[1], cj1array[1], sj1array[1];
784bool j1valid[1]={false};
785_nj1 = 1;
786IkReal x1739=((307000.0)*cj2);
787IkReal x1740=(cj0*px);
788IkReal x1741=((307000.0)*sj2);
789IkReal x1742=(py*sj0);
790CheckValue<IkReal> x1743=IKPowWithIntegerCheck(IKsign(((-216749.0)+(((-214900.0)*cj2)))),-1);
791if(!x1743.valid){
792continue;
793}
794CheckValue<IkReal> x1744 = IKatan2WithCheck(IkReal(((((-350000.0)*x1742))+(((-350000.0)*x1740))+(((-1.0)*x1739*x1740))+(((-1.0)*x1739*x1742))+(((-1.0)*pz*x1741)))),IkReal(((((-1.0)*pz*x1739))+(((-350000.0)*pz))+((x1740*x1741))+((x1741*x1742)))),IKFAST_ATAN2_MAGTHRESH);
795if(!x1744.valid){
796continue;
797}
798j1array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1743.value)))+(x1744.value));
799sj1array[0]=IKsin(j1array[0]);
800cj1array[0]=IKcos(j1array[0]);
801if( j1array[0] > IKPI )
802{
803 j1array[0]-=IK2PI;
804}
805else if( j1array[0] < -IKPI )
806{ j1array[0]+=IK2PI;
807}
808j1valid[0] = true;
809for(int ij1 = 0; ij1 < 1; ++ij1)
810{
811if( !j1valid[ij1] )
812{
813 continue;
814}
815_ij1[0] = ij1; _ij1[1] = -1;
816for(int iij1 = ij1+1; iij1 < 1; ++iij1)
817{
818if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH )
819{
820 j1valid[iij1]=false; _ij1[1] = iij1; break;
821}
822}
823j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1];
824{
825IkReal evalcond[5];
826IkReal x1745=IKcos(j1);
827IkReal x1746=IKsin(j1);
828IkReal x1747=(cj0*px);
829IkReal x1748=(py*sj0);
830IkReal x1749=((0.307)*x1745);
831IkReal x1750=((1.0)*x1748);
832IkReal x1751=(pz*x1745);
833IkReal x1752=((0.7)*x1746);
834IkReal x1753=((0.307)*x1746);
835evalcond[0]=((((0.35)*x1745))+((cj2*x1749))+(((-1.0)*pz))+((sj2*x1753)));
836evalcond[1]=(((pz*x1746))+(((-0.307)*sj2))+(((-1.0)*x1745*x1750))+(((-1.0)*x1745*x1747)));
837evalcond[2]=(x1748+x1747+(((-1.0)*cj2*x1753))+((sj2*x1749))+(((-0.35)*x1746)));
838evalcond[3]=((-0.028251)+((x1747*x1752))+(((-1.0)*pp))+((x1748*x1752))+(((0.7)*x1751)));
839evalcond[4]=((0.35)+(((-1.0)*x1746*x1747))+(((-1.0)*x1746*x1750))+(((-1.0)*x1751))+(((0.307)*cj2)));
840if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH )
841{
842continue;
843}
844}
845
846rotationfunction0(solutions);
847}
848}
849
850}
851
852}
853}
854}
855
856}
857
858}
859}
860}
861}
862return solutions.GetNumSolutions()>0;
863}
865for(int rotationiter = 0; rotationiter < 1; ++rotationiter) {
866IkReal x70=(r11*sj0);
867IkReal x71=(cj0*r02);
868IkReal x72=(r10*sj0);
869IkReal x73=((1.0)*sj0);
870IkReal x74=(cj2*sj1);
871IkReal x75=(cj1*sj2);
872IkReal x76=(r12*sj0);
873IkReal x77=(((sj1*sj2))+((cj1*cj2)));
874IkReal x78=(x75+(((-1.0)*x74)));
875IkReal x79=(x74+(((-1.0)*x75)));
876IkReal x80=(sj0*x79);
877IkReal x81=(cj0*x79);
878IkReal x82=(cj0*x77);
879new_r00=(((r00*x82))+((x72*x77))+((r20*x78)));
880new_r01=(((r21*x78))+((r01*x82))+((x70*x77)));
881new_r02=(((r22*x78))+((x76*x77))+((x71*x77)));
882new_r10=((((-1.0)*r00*x73))+((cj0*r10)));
883new_r11=((((-1.0)*r01*x73))+((cj0*r11)));
884new_r12=((((-1.0)*r02*x73))+((cj0*r12)));
885new_r20=(((r00*x81))+((x72*x79))+((r20*x77)));
886new_r21=(((r21*x77))+((r01*x81))+((x70*x79)));
887new_r22=(((r22*x77))+((x76*x79))+((x71*x79)));
888{
889IkReal j4array[2], cj4array[2], sj4array[2];
890bool j4valid[2]={false};
891_nj4 = 2;
892cj4array[0]=new_r22;
893if( cj4array[0] >= -1-IKFAST_SINCOS_THRESH && cj4array[0] <= 1+IKFAST_SINCOS_THRESH )
894{
895 j4valid[0] = j4valid[1] = true;
896 j4array[0] = IKacos(cj4array[0]);
897 sj4array[0] = IKsin(j4array[0]);
898 cj4array[1] = cj4array[0];
899 j4array[1] = -j4array[0];
900 sj4array[1] = -sj4array[0];
901}
902else if( isnan(cj4array[0]) )
903{
904 // probably any value will work
905 j4valid[0] = true;
906 cj4array[0] = 1; sj4array[0] = 0; j4array[0] = 0;
907}
908for(int ij4 = 0; ij4 < 2; ++ij4)
909{
910if( !j4valid[ij4] )
911{
912 continue;
913}
914_ij4[0] = ij4; _ij4[1] = -1;
915for(int iij4 = ij4+1; iij4 < 2; ++iij4)
916{
917if( j4valid[iij4] && IKabs(cj4array[ij4]-cj4array[iij4]) < IKFAST_SOLUTION_THRESH && IKabs(sj4array[ij4]-sj4array[iij4]) < IKFAST_SOLUTION_THRESH )
918{
919 j4valid[iij4]=false; _ij4[1] = iij4; break;
920}
921}
922j4 = j4array[ij4]; cj4 = cj4array[ij4]; sj4 = sj4array[ij4];
923
924{
925IkReal j5eval[3];
926j5eval[0]=sj4;
927j5eval[1]=IKsign(sj4);
928j5eval[2]=((IKabs(new_r20))+(IKabs(new_r21)));
929if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
930{
931{
932IkReal j3eval[3];
933j3eval[0]=sj4;
934j3eval[1]=IKsign(sj4);
935j3eval[2]=((IKabs(new_r12))+(IKabs(new_r02)));
936if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
937{
938{
939IkReal j3eval[2];
940j3eval[0]=new_r12;
941j3eval[1]=sj4;
942if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 )
943{
944{
945IkReal evalcond[5];
946bool bgotonextstatement = true;
947do
948{
949evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j4))), 6.28318530717959)));
950evalcond[1]=new_r02;
951evalcond[2]=new_r12;
952evalcond[3]=new_r21;
953evalcond[4]=new_r20;
954if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
955{
956bgotonextstatement=false;
957IkReal j5mul = 1;
958j5=0;
959j3mul=-1.0;
961 continue;
962j3=IKatan2(((-1.0)*new_r01), new_r00);
963{
964std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
965vinfos[0].jointtype = 1;
966vinfos[0].foffset = j0;
967vinfos[0].indices[0] = _ij0[0];
968vinfos[0].indices[1] = _ij0[1];
969vinfos[0].maxsolutions = _nj0;
970vinfos[1].jointtype = 1;
971vinfos[1].foffset = j1;
972vinfos[1].indices[0] = _ij1[0];
973vinfos[1].indices[1] = _ij1[1];
974vinfos[1].maxsolutions = _nj1;
975vinfos[2].jointtype = 1;
976vinfos[2].foffset = j2;
977vinfos[2].indices[0] = _ij2[0];
978vinfos[2].indices[1] = _ij2[1];
979vinfos[2].maxsolutions = _nj2;
980vinfos[3].jointtype = 1;
981vinfos[3].foffset = j3;
982vinfos[3].fmul = j3mul;
983vinfos[3].freeind = 0;
984vinfos[3].maxsolutions = 0;
985vinfos[4].jointtype = 1;
986vinfos[4].foffset = j4;
987vinfos[4].indices[0] = _ij4[0];
988vinfos[4].indices[1] = _ij4[1];
989vinfos[4].maxsolutions = _nj4;
990vinfos[5].jointtype = 1;
991vinfos[5].foffset = j5;
992vinfos[5].fmul = j5mul;
993vinfos[5].freeind = 0;
994vinfos[5].maxsolutions = 0;
995std::vector<int> vfree(1);
996vfree[0] = 5;
997solutions.AddSolution(vinfos,vfree);
998}
999
1000}
1001} while(0);
1002if( bgotonextstatement )
1003{
1004bool bgotonextstatement = true;
1005do
1006{
1007evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j4)))), 6.28318530717959)));
1008evalcond[1]=new_r02;
1009evalcond[2]=new_r12;
1010evalcond[3]=new_r21;
1011evalcond[4]=new_r20;
1012if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
1013{
1014bgotonextstatement=false;
1015IkReal j5mul = 1;
1016j5=0;
1017j3mul=1.0;
1018if( IKabs(((-1.0)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r00)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r01))+IKsqr(((-1.0)*new_r00))-1) <= IKFAST_SINCOS_THRESH )
1019 continue;
1020j3=IKatan2(((-1.0)*new_r01), ((-1.0)*new_r00));
1021{
1022std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
1023vinfos[0].jointtype = 1;
1024vinfos[0].foffset = j0;
1025vinfos[0].indices[0] = _ij0[0];
1026vinfos[0].indices[1] = _ij0[1];
1027vinfos[0].maxsolutions = _nj0;
1028vinfos[1].jointtype = 1;
1029vinfos[1].foffset = j1;
1030vinfos[1].indices[0] = _ij1[0];
1031vinfos[1].indices[1] = _ij1[1];
1032vinfos[1].maxsolutions = _nj1;
1033vinfos[2].jointtype = 1;
1034vinfos[2].foffset = j2;
1035vinfos[2].indices[0] = _ij2[0];
1036vinfos[2].indices[1] = _ij2[1];
1037vinfos[2].maxsolutions = _nj2;
1038vinfos[3].jointtype = 1;
1039vinfos[3].foffset = j3;
1040vinfos[3].fmul = j3mul;
1041vinfos[3].freeind = 0;
1042vinfos[3].maxsolutions = 0;
1043vinfos[4].jointtype = 1;
1044vinfos[4].foffset = j4;
1045vinfos[4].indices[0] = _ij4[0];
1046vinfos[4].indices[1] = _ij4[1];
1047vinfos[4].maxsolutions = _nj4;
1048vinfos[5].jointtype = 1;
1049vinfos[5].foffset = j5;
1050vinfos[5].fmul = j5mul;
1051vinfos[5].freeind = 0;
1052vinfos[5].maxsolutions = 0;
1053std::vector<int> vfree(1);
1054vfree[0] = 5;
1055solutions.AddSolution(vinfos,vfree);
1056}
1057
1058}
1059} while(0);
1060if( bgotonextstatement )
1061{
1062bool bgotonextstatement = true;
1063do
1064{
1065evalcond[0]=((IKabs(new_r20))+(IKabs(new_r21)));
1066if( IKabs(evalcond[0]) < 0.0000050000000000 )
1067{
1068bgotonextstatement=false;
1069{
1070IkReal j3eval[1];
1071new_r21=0;
1072new_r20=0;
1073new_r02=0;
1074new_r12=0;
1075IkReal x83=new_r22*new_r22;
1076IkReal x84=((16.0)*new_r10);
1077IkReal x85=((16.0)*new_r01);
1078IkReal x86=((16.0)*new_r22);
1079IkReal x87=((8.0)*new_r11);
1080IkReal x88=((8.0)*new_r00);
1081IkReal x89=(x83*x84);
1082IkReal x90=(x83*x85);
1083j3eval[0]=((IKabs((x89+(((-1.0)*x84)))))+(IKabs((((new_r22*x88))+(((-1.0)*x83*x87)))))+(IKabs(((((16.0)*new_r00))+((new_r11*x86))+(((-32.0)*new_r00*x83)))))+(IKabs((x85+(((-1.0)*x90)))))+(IKabs((((new_r22*x87))+(((-1.0)*x88)))))+(IKabs(((((16.0)*new_r11*x83))+((new_r00*x86))+(((-32.0)*new_r11)))))+(IKabs((x90+(((-1.0)*x85)))))+(IKabs((x84+(((-1.0)*x89))))));
1084if( IKabs(j3eval[0]) < 0.0000000100000000 )
1085{
1086continue; // no branches [j3, j5]
1087
1088} else
1089{
1090IkReal op[4+1], zeror[4];
1091int numroots;
1092IkReal j3evalpoly[1];
1093IkReal x91=new_r22*new_r22;
1094IkReal x92=((16.0)*new_r10);
1095IkReal x93=(new_r11*new_r22);
1096IkReal x94=(x91*x92);
1097IkReal x95=((((8.0)*x93))+(((-8.0)*new_r00)));
1098op[0]=x95;
1099op[1]=(x92+(((-1.0)*x94)));
1100op[2]=((((16.0)*x93))+(((16.0)*new_r00))+(((-32.0)*new_r00*x91)));
1101op[3]=(x94+(((-1.0)*x92)));
1102op[4]=x95;
1103polyroots4(op,zeror,numroots);
1104IkReal j3array[4], cj3array[4], sj3array[4], tempj3array[1];
1105int numsolutions = 0;
1106for(int ij3 = 0; ij3 < numroots; ++ij3)
1107{
1108IkReal htj3 = zeror[ij3];
1109tempj3array[0]=((2.0)*(atan(htj3)));
1110for(int kj3 = 0; kj3 < 1; ++kj3)
1111{
1112j3array[numsolutions] = tempj3array[kj3];
1113if( j3array[numsolutions] > IKPI )
1114{
1115 j3array[numsolutions]-=IK2PI;
1116}
1117else if( j3array[numsolutions] < -IKPI )
1118{
1119 j3array[numsolutions]+=IK2PI;
1120}
1121sj3array[numsolutions] = IKsin(j3array[numsolutions]);
1122cj3array[numsolutions] = IKcos(j3array[numsolutions]);
1123numsolutions++;
1124}
1125}
1126bool j3valid[4]={true,true,true,true};
1127_nj3 = 4;
1128for(int ij3 = 0; ij3 < numsolutions; ++ij3)
1129 {
1130if( !j3valid[ij3] )
1131{
1132 continue;
1133}
1134 j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
1135htj3 = IKtan(j3/2);
1136
1137IkReal x96=((16.0)*new_r01);
1138IkReal x97=new_r22*new_r22;
1139IkReal x98=(new_r00*new_r22);
1140IkReal x99=((8.0)*x98);
1141IkReal x100=(new_r11*x97);
1142IkReal x101=(x96*x97);
1143IkReal x102=((8.0)*x100);
1144j3evalpoly[0]=((((-1.0)*x102))+(((htj3*htj3*htj3)*(((((-1.0)*x101))+x96))))+(((htj3*htj3*htj3*htj3)*(((((-1.0)*x102))+x99))))+((htj3*((x101+(((-1.0)*x96))))))+(((htj3*htj3)*(((((16.0)*x98))+(((16.0)*x100))+(((-32.0)*new_r11))))))+x99);
1145if( IKabs(j3evalpoly[0]) > 0.0000001000000000 )
1146{
1147 continue;
1148}
1149_ij3[0] = ij3; _ij3[1] = -1;
1150for(int iij3 = ij3+1; iij3 < numsolutions; ++iij3)
1151{
1152if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
1153{
1154 j3valid[iij3]=false; _ij3[1] = iij3; break;
1155}
1156}
1157{
1158IkReal j5eval[3];
1159new_r21=0;
1160new_r20=0;
1161new_r02=0;
1162new_r12=0;
1163IkReal x103=cj3*cj3;
1164IkReal x104=(cj3*new_r22);
1165IkReal x105=((-1.0)+x103+(((-1.0)*x103*(new_r22*new_r22))));
1166j5eval[0]=x105;
1167j5eval[1]=((IKabs((((new_r01*sj3))+(((-1.0)*new_r00*x104)))))+(IKabs((((new_r00*sj3))+((new_r01*x104))))));
1168j5eval[2]=IKsign(x105);
1169if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
1170{
1171{
1172IkReal j5eval[1];
1173new_r21=0;
1174new_r20=0;
1175new_r02=0;
1176new_r12=0;
1177j5eval[0]=new_r22;
1178if( IKabs(j5eval[0]) < 0.0000010000000000 )
1179{
1180{
1181IkReal j5eval[1];
1182new_r21=0;
1183new_r20=0;
1184new_r02=0;
1185new_r12=0;
1186j5eval[0]=sj3;
1187if( IKabs(j5eval[0]) < 0.0000010000000000 )
1188{
1189{
1190IkReal evalcond[1];
1191bool bgotonextstatement = true;
1192do
1193{
1194evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j3))), 6.28318530717959)));
1195if( IKabs(evalcond[0]) < 0.0000050000000000 )
1196{
1197bgotonextstatement=false;
1198{
1199IkReal j5array[1], cj5array[1], sj5array[1];
1200bool j5valid[1]={false};
1201_nj5 = 1;
1203 continue;
1204j5array[0]=IKatan2(new_r10, new_r11);
1205sj5array[0]=IKsin(j5array[0]);
1206cj5array[0]=IKcos(j5array[0]);
1207if( j5array[0] > IKPI )
1208{
1209 j5array[0]-=IK2PI;
1210}
1211else if( j5array[0] < -IKPI )
1212{ j5array[0]+=IK2PI;
1213}
1214j5valid[0] = true;
1215for(int ij5 = 0; ij5 < 1; ++ij5)
1216{
1217if( !j5valid[ij5] )
1218{
1219 continue;
1220}
1221_ij5[0] = ij5; _ij5[1] = -1;
1222for(int iij5 = ij5+1; iij5 < 1; ++iij5)
1223{
1224if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
1225{
1226 j5valid[iij5]=false; _ij5[1] = iij5; break;
1227}
1228}
1229j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
1230{
1231IkReal evalcond[4];
1232IkReal x106=IKsin(j5);
1233IkReal x107=IKcos(j5);
1234evalcond[0]=x107;
1235evalcond[1]=((-1.0)*x106);
1236evalcond[2]=(x106+(((-1.0)*new_r10)));
1237evalcond[3]=(x107+(((-1.0)*new_r11)));
1238if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
1239{
1240continue;
1241}
1242}
1243
1244{
1245std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
1246vinfos[0].jointtype = 1;
1247vinfos[0].foffset = j0;
1248vinfos[0].indices[0] = _ij0[0];
1249vinfos[0].indices[1] = _ij0[1];
1250vinfos[0].maxsolutions = _nj0;
1251vinfos[1].jointtype = 1;
1252vinfos[1].foffset = j1;
1253vinfos[1].indices[0] = _ij1[0];
1254vinfos[1].indices[1] = _ij1[1];
1255vinfos[1].maxsolutions = _nj1;
1256vinfos[2].jointtype = 1;
1257vinfos[2].foffset = j2;
1258vinfos[2].indices[0] = _ij2[0];
1259vinfos[2].indices[1] = _ij2[1];
1260vinfos[2].maxsolutions = _nj2;
1261vinfos[3].jointtype = 1;
1262vinfos[3].foffset = j3;
1263vinfos[3].indices[0] = _ij3[0];
1264vinfos[3].indices[1] = _ij3[1];
1265vinfos[3].maxsolutions = _nj3;
1266vinfos[4].jointtype = 1;
1267vinfos[4].foffset = j4;
1268vinfos[4].indices[0] = _ij4[0];
1269vinfos[4].indices[1] = _ij4[1];
1270vinfos[4].maxsolutions = _nj4;
1271vinfos[5].jointtype = 1;
1272vinfos[5].foffset = j5;
1273vinfos[5].indices[0] = _ij5[0];
1274vinfos[5].indices[1] = _ij5[1];
1275vinfos[5].maxsolutions = _nj5;
1276std::vector<int> vfree(0);
1277solutions.AddSolution(vinfos,vfree);
1278}
1279}
1280}
1281
1282}
1283} while(0);
1284if( bgotonextstatement )
1285{
1286bool bgotonextstatement = true;
1287do
1288{
1289evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j3)))), 6.28318530717959)));
1290if( IKabs(evalcond[0]) < 0.0000050000000000 )
1291{
1292bgotonextstatement=false;
1293{
1294IkReal j5array[1], cj5array[1], sj5array[1];
1295bool j5valid[1]={false};
1296_nj5 = 1;
1297if( IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r10))+IKsqr(((-1.0)*new_r11))-1) <= IKFAST_SINCOS_THRESH )
1298 continue;
1299j5array[0]=IKatan2(((-1.0)*new_r10), ((-1.0)*new_r11));
1300sj5array[0]=IKsin(j5array[0]);
1301cj5array[0]=IKcos(j5array[0]);
1302if( j5array[0] > IKPI )
1303{
1304 j5array[0]-=IK2PI;
1305}
1306else if( j5array[0] < -IKPI )
1307{ j5array[0]+=IK2PI;
1308}
1309j5valid[0] = true;
1310for(int ij5 = 0; ij5 < 1; ++ij5)
1311{
1312if( !j5valid[ij5] )
1313{
1314 continue;
1315}
1316_ij5[0] = ij5; _ij5[1] = -1;
1317for(int iij5 = ij5+1; iij5 < 1; ++iij5)
1318{
1319if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
1320{
1321 j5valid[iij5]=false; _ij5[1] = iij5; break;
1322}
1323}
1324j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
1325{
1326IkReal evalcond[4];
1327IkReal x108=IKcos(j5);
1328IkReal x109=IKsin(j5);
1329evalcond[0]=x108;
1330evalcond[1]=(x109+new_r10);
1331evalcond[2]=(x108+new_r11);
1332evalcond[3]=((-1.0)*x109);
1333if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH )
1334{
1335continue;
1336}
1337}
1338
1339{
1340std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
1341vinfos[0].jointtype = 1;
1342vinfos[0].foffset = j0;
1343vinfos[0].indices[0] = _ij0[0];
1344vinfos[0].indices[1] = _ij0[1];
1345vinfos[0].maxsolutions = _nj0;
1346vinfos[1].jointtype = 1;
1347vinfos[1].foffset = j1;
1348vinfos[1].indices[0] = _ij1[0];
1349vinfos[1].indices[1] = _ij1[1];
1350vinfos[1].maxsolutions = _nj1;
1351vinfos[2].jointtype = 1;
1352vinfos[2].foffset = j2;
1353vinfos[2].indices[0] = _ij2[0];
1354vinfos[2].indices[1] = _ij2[1];
1355vinfos[2].maxsolutions = _nj2;
1356vinfos[3].jointtype = 1;
1357vinfos[3].foffset = j3;
1358vinfos[3].indices[0] = _ij3[0];
1359vinfos[3].indices[1] = _ij3[1];
1360vinfos[3].maxsolutions = _nj3;
1361vinfos[4].jointtype = 1;
1362vinfos[4].foffset = j4;
1363vinfos[4].indices[0] = _ij4[0];
1364vinfos[4].indices[1] = _ij4[1];
1365vinfos[4].maxsolutions = _nj4;
1366vinfos[5].jointtype = 1;
1367vinfos[5].foffset = j5;
1368vinfos[5].indices[0] = _ij5[0];
1369vinfos[5].indices[1] = _ij5[1];
1370vinfos[5].maxsolutions = _nj5;
1371std::vector<int> vfree(0);
1372solutions.AddSolution(vinfos,vfree);
1373}
1374}
1375}
1376
1377}
1378} while(0);
1379if( bgotonextstatement )
1380{
1381bool bgotonextstatement = true;
1382do
1383{
1384CheckValue<IkReal> x110=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
1385if(!x110.valid){
1386continue;
1387}
1388if((x110.value) < -0.00001)
1389continue;
1390IkReal gconst18=((-1.0)*(IKsqrt(x110.value)));
1391evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.0)+(IKsign(sj3)))))+(IKabs((cj3+(((-1.0)*gconst18)))))), 6.28318530717959)));
1392if( IKabs(evalcond[0]) < 0.0000050000000000 )
1393{
1394bgotonextstatement=false;
1395{
1396IkReal j5eval[1];
1397new_r21=0;
1398new_r20=0;
1399new_r02=0;
1400new_r12=0;
1401if((((1.0)+(((-1.0)*(gconst18*gconst18))))) < -0.00001)
1402continue;
1403sj3=IKsqrt(((1.0)+(((-1.0)*(gconst18*gconst18)))));
1404cj3=gconst18;
1405if( (gconst18) < -1-IKFAST_SINCOS_THRESH || (gconst18) > 1+IKFAST_SINCOS_THRESH )
1406 continue;
1407j3=IKacos(gconst18);
1408CheckValue<IkReal> x111=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
1409if(!x111.valid){
1410continue;
1411}
1412if((x111.value) < -0.00001)
1413continue;
1414IkReal gconst18=((-1.0)*(IKsqrt(x111.value)));
1415j5eval[0]=((IKabs(new_r11))+(IKabs(new_r10)));
1416if( IKabs(j5eval[0]) < 0.0000010000000000 )
1417{
1418{
1419IkReal j5array[1], cj5array[1], sj5array[1];
1420bool j5valid[1]={false};
1421_nj5 = 1;
1422if((((1.0)+(((-1.0)*(gconst18*gconst18))))) < -0.00001)
1423continue;
1425if(!x112.valid){
1426continue;
1427}
1428if( IKabs((((gconst18*new_r10))+(((-1.0)*new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst18*gconst18)))))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r11*(x112.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((gconst18*new_r10))+(((-1.0)*new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst18*gconst18))))))))))+IKsqr((new_r11*(x112.value)))-1) <= IKFAST_SINCOS_THRESH )
1429 continue;
1430j5array[0]=IKatan2((((gconst18*new_r10))+(((-1.0)*new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst18*gconst18))))))))), (new_r11*(x112.value)));
1431sj5array[0]=IKsin(j5array[0]);
1432cj5array[0]=IKcos(j5array[0]);
1433if( j5array[0] > IKPI )
1434{
1435 j5array[0]-=IK2PI;
1436}
1437else if( j5array[0] < -IKPI )
1438{ j5array[0]+=IK2PI;
1439}
1440j5valid[0] = true;
1441for(int ij5 = 0; ij5 < 1; ++ij5)
1442{
1443if( !j5valid[ij5] )
1444{
1445 continue;
1446}
1447_ij5[0] = ij5; _ij5[1] = -1;
1448for(int iij5 = ij5+1; iij5 < 1; ++iij5)
1449{
1450if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
1451{
1452 j5valid[iij5]=false; _ij5[1] = iij5; break;
1453}
1454}
1455j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
1456{
1457IkReal evalcond[8];
1458IkReal x113=IKcos(j5);
1459IkReal x114=IKsin(j5);
1460IkReal x115=((1.0)*gconst18);
1461if((((1.0)+(((-1.0)*gconst18*x115)))) < -0.00001)
1462continue;
1463IkReal x116=IKsqrt(((1.0)+(((-1.0)*gconst18*x115))));
1464evalcond[0]=x113;
1465evalcond[1]=((-1.0)*x114);
1466evalcond[2]=((((-1.0)*x113*x115))+new_r11);
1467evalcond[3]=((((-1.0)*x114*x115))+new_r10);
1468evalcond[4]=(((x113*x116))+new_r01);
1469evalcond[5]=(((x114*x116))+new_r00);
1470evalcond[6]=((((-1.0)*new_r10*x115))+x114+((new_r00*x116)));
1471evalcond[7]=((((-1.0)*new_r11*x115))+x113+((new_r01*x116)));
1472if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
1473{
1474continue;
1475}
1476}
1477
1478{
1479std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
1480vinfos[0].jointtype = 1;
1481vinfos[0].foffset = j0;
1482vinfos[0].indices[0] = _ij0[0];
1483vinfos[0].indices[1] = _ij0[1];
1484vinfos[0].maxsolutions = _nj0;
1485vinfos[1].jointtype = 1;
1486vinfos[1].foffset = j1;
1487vinfos[1].indices[0] = _ij1[0];
1488vinfos[1].indices[1] = _ij1[1];
1489vinfos[1].maxsolutions = _nj1;
1490vinfos[2].jointtype = 1;
1491vinfos[2].foffset = j2;
1492vinfos[2].indices[0] = _ij2[0];
1493vinfos[2].indices[1] = _ij2[1];
1494vinfos[2].maxsolutions = _nj2;
1495vinfos[3].jointtype = 1;
1496vinfos[3].foffset = j3;
1497vinfos[3].indices[0] = _ij3[0];
1498vinfos[3].indices[1] = _ij3[1];
1499vinfos[3].maxsolutions = _nj3;
1500vinfos[4].jointtype = 1;
1501vinfos[4].foffset = j4;
1502vinfos[4].indices[0] = _ij4[0];
1503vinfos[4].indices[1] = _ij4[1];
1504vinfos[4].maxsolutions = _nj4;
1505vinfos[5].jointtype = 1;
1506vinfos[5].foffset = j5;
1507vinfos[5].indices[0] = _ij5[0];
1508vinfos[5].indices[1] = _ij5[1];
1509vinfos[5].maxsolutions = _nj5;
1510std::vector<int> vfree(0);
1511solutions.AddSolution(vinfos,vfree);
1512}
1513}
1514}
1515
1516} else
1517{
1518{
1519IkReal j5array[1], cj5array[1], sj5array[1];
1520bool j5valid[1]={false};
1521_nj5 = 1;
1523if(!x117.valid){
1524continue;
1525}
1527if(!x118.valid){
1528continue;
1529}
1530j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x117.value)))+(x118.value));
1531sj5array[0]=IKsin(j5array[0]);
1532cj5array[0]=IKcos(j5array[0]);
1533if( j5array[0] > IKPI )
1534{
1535 j5array[0]-=IK2PI;
1536}
1537else if( j5array[0] < -IKPI )
1538{ j5array[0]+=IK2PI;
1539}
1540j5valid[0] = true;
1541for(int ij5 = 0; ij5 < 1; ++ij5)
1542{
1543if( !j5valid[ij5] )
1544{
1545 continue;
1546}
1547_ij5[0] = ij5; _ij5[1] = -1;
1548for(int iij5 = ij5+1; iij5 < 1; ++iij5)
1549{
1550if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
1551{
1552 j5valid[iij5]=false; _ij5[1] = iij5; break;
1553}
1554}
1555j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
1556{
1557IkReal evalcond[8];
1558IkReal x119=IKcos(j5);
1559IkReal x120=IKsin(j5);
1560IkReal x121=((1.0)*gconst18);
1561if((((1.0)+(((-1.0)*gconst18*x121)))) < -0.00001)
1562continue;
1563IkReal x122=IKsqrt(((1.0)+(((-1.0)*gconst18*x121))));
1564evalcond[0]=x119;
1565evalcond[1]=((-1.0)*x120);
1566evalcond[2]=((((-1.0)*x119*x121))+new_r11);
1567evalcond[3]=((((-1.0)*x120*x121))+new_r10);
1568evalcond[4]=(new_r01+((x119*x122)));
1569evalcond[5]=(((x120*x122))+new_r00);
1570evalcond[6]=((((-1.0)*new_r10*x121))+((new_r00*x122))+x120);
1571evalcond[7]=(((new_r01*x122))+x119+(((-1.0)*new_r11*x121)));
1572if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
1573{
1574continue;
1575}
1576}
1577
1578{
1579std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
1580vinfos[0].jointtype = 1;
1581vinfos[0].foffset = j0;
1582vinfos[0].indices[0] = _ij0[0];
1583vinfos[0].indices[1] = _ij0[1];
1584vinfos[0].maxsolutions = _nj0;
1585vinfos[1].jointtype = 1;
1586vinfos[1].foffset = j1;
1587vinfos[1].indices[0] = _ij1[0];
1588vinfos[1].indices[1] = _ij1[1];
1589vinfos[1].maxsolutions = _nj1;
1590vinfos[2].jointtype = 1;
1591vinfos[2].foffset = j2;
1592vinfos[2].indices[0] = _ij2[0];
1593vinfos[2].indices[1] = _ij2[1];
1594vinfos[2].maxsolutions = _nj2;
1595vinfos[3].jointtype = 1;
1596vinfos[3].foffset = j3;
1597vinfos[3].indices[0] = _ij3[0];
1598vinfos[3].indices[1] = _ij3[1];
1599vinfos[3].maxsolutions = _nj3;
1600vinfos[4].jointtype = 1;
1601vinfos[4].foffset = j4;
1602vinfos[4].indices[0] = _ij4[0];
1603vinfos[4].indices[1] = _ij4[1];
1604vinfos[4].maxsolutions = _nj4;
1605vinfos[5].jointtype = 1;
1606vinfos[5].foffset = j5;
1607vinfos[5].indices[0] = _ij5[0];
1608vinfos[5].indices[1] = _ij5[1];
1609vinfos[5].maxsolutions = _nj5;
1610std::vector<int> vfree(0);
1611solutions.AddSolution(vinfos,vfree);
1612}
1613}
1614}
1615
1616}
1617
1618}
1619
1620}
1621} while(0);
1622if( bgotonextstatement )
1623{
1624bool bgotonextstatement = true;
1625do
1626{
1627CheckValue<IkReal> x123=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
1628if(!x123.valid){
1629continue;
1630}
1631if((x123.value) < -0.00001)
1632continue;
1633IkReal gconst18=((-1.0)*(IKsqrt(x123.value)));
1634evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.0)+(IKsign(sj3)))))+(IKabs((cj3+(((-1.0)*gconst18)))))), 6.28318530717959)));
1635if( IKabs(evalcond[0]) < 0.0000050000000000 )
1636{
1637bgotonextstatement=false;
1638{
1639IkReal j5eval[1];
1640new_r21=0;
1641new_r20=0;
1642new_r02=0;
1643new_r12=0;
1644if((((1.0)+(((-1.0)*(gconst18*gconst18))))) < -0.00001)
1645continue;
1646sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst18*gconst18)))))));
1647cj3=gconst18;
1648if( (gconst18) < -1-IKFAST_SINCOS_THRESH || (gconst18) > 1+IKFAST_SINCOS_THRESH )
1649 continue;
1650j3=((-1.0)*(IKacos(gconst18)));
1651CheckValue<IkReal> x124=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
1652if(!x124.valid){
1653continue;
1654}
1655if((x124.value) < -0.00001)
1656continue;
1657IkReal gconst18=((-1.0)*(IKsqrt(x124.value)));
1658j5eval[0]=((IKabs(new_r11))+(IKabs(new_r10)));
1659if( IKabs(j5eval[0]) < 0.0000010000000000 )
1660{
1661{
1662IkReal j5array[1], cj5array[1], sj5array[1];
1663bool j5valid[1]={false};
1664_nj5 = 1;
1665if((((1.0)+(((-1.0)*(gconst18*gconst18))))) < -0.00001)
1666continue;
1668if(!x125.valid){
1669continue;
1670}
1671if( IKabs((((gconst18*new_r10))+((new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst18*gconst18)))))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r11*(x125.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((gconst18*new_r10))+((new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst18*gconst18))))))))))+IKsqr((new_r11*(x125.value)))-1) <= IKFAST_SINCOS_THRESH )
1672 continue;
1673j5array[0]=IKatan2((((gconst18*new_r10))+((new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst18*gconst18))))))))), (new_r11*(x125.value)));
1674sj5array[0]=IKsin(j5array[0]);
1675cj5array[0]=IKcos(j5array[0]);
1676if( j5array[0] > IKPI )
1677{
1678 j5array[0]-=IK2PI;
1679}
1680else if( j5array[0] < -IKPI )
1681{ j5array[0]+=IK2PI;
1682}
1683j5valid[0] = true;
1684for(int ij5 = 0; ij5 < 1; ++ij5)
1685{
1686if( !j5valid[ij5] )
1687{
1688 continue;
1689}
1690_ij5[0] = ij5; _ij5[1] = -1;
1691for(int iij5 = ij5+1; iij5 < 1; ++iij5)
1692{
1693if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
1694{
1695 j5valid[iij5]=false; _ij5[1] = iij5; break;
1696}
1697}
1698j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
1699{
1700IkReal evalcond[8];
1701IkReal x126=IKcos(j5);
1702IkReal x127=IKsin(j5);
1703IkReal x128=((1.0)*gconst18);
1704if((((1.0)+(((-1.0)*gconst18*x128)))) < -0.00001)
1705continue;
1706IkReal x129=IKsqrt(((1.0)+(((-1.0)*gconst18*x128))));
1707IkReal x130=((1.0)*x129);
1708evalcond[0]=x126;
1709evalcond[1]=((-1.0)*x127);
1710evalcond[2]=((((-1.0)*x126*x128))+new_r11);
1711evalcond[3]=(new_r10+(((-1.0)*x127*x128)));
1712evalcond[4]=((((-1.0)*x126*x130))+new_r01);
1713evalcond[5]=(new_r00+(((-1.0)*x127*x130)));
1714evalcond[6]=((((-1.0)*new_r10*x128))+(((-1.0)*new_r00*x130))+x127);
1715evalcond[7]=((((-1.0)*new_r01*x130))+x126+(((-1.0)*new_r11*x128)));
1716if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
1717{
1718continue;
1719}
1720}
1721
1722{
1723std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
1724vinfos[0].jointtype = 1;
1725vinfos[0].foffset = j0;
1726vinfos[0].indices[0] = _ij0[0];
1727vinfos[0].indices[1] = _ij0[1];
1728vinfos[0].maxsolutions = _nj0;
1729vinfos[1].jointtype = 1;
1730vinfos[1].foffset = j1;
1731vinfos[1].indices[0] = _ij1[0];
1732vinfos[1].indices[1] = _ij1[1];
1733vinfos[1].maxsolutions = _nj1;
1734vinfos[2].jointtype = 1;
1735vinfos[2].foffset = j2;
1736vinfos[2].indices[0] = _ij2[0];
1737vinfos[2].indices[1] = _ij2[1];
1738vinfos[2].maxsolutions = _nj2;
1739vinfos[3].jointtype = 1;
1740vinfos[3].foffset = j3;
1741vinfos[3].indices[0] = _ij3[0];
1742vinfos[3].indices[1] = _ij3[1];
1743vinfos[3].maxsolutions = _nj3;
1744vinfos[4].jointtype = 1;
1745vinfos[4].foffset = j4;
1746vinfos[4].indices[0] = _ij4[0];
1747vinfos[4].indices[1] = _ij4[1];
1748vinfos[4].maxsolutions = _nj4;
1749vinfos[5].jointtype = 1;
1750vinfos[5].foffset = j5;
1751vinfos[5].indices[0] = _ij5[0];
1752vinfos[5].indices[1] = _ij5[1];
1753vinfos[5].maxsolutions = _nj5;
1754std::vector<int> vfree(0);
1755solutions.AddSolution(vinfos,vfree);
1756}
1757}
1758}
1759
1760} else
1761{
1762{
1763IkReal j5array[1], cj5array[1], sj5array[1];
1764bool j5valid[1]={false};
1765_nj5 = 1;
1767if(!x131.valid){
1768continue;
1769}
1771if(!x132.valid){
1772continue;
1773}
1774j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x131.value)))+(x132.value));
1775sj5array[0]=IKsin(j5array[0]);
1776cj5array[0]=IKcos(j5array[0]);
1777if( j5array[0] > IKPI )
1778{
1779 j5array[0]-=IK2PI;
1780}
1781else if( j5array[0] < -IKPI )
1782{ j5array[0]+=IK2PI;
1783}
1784j5valid[0] = true;
1785for(int ij5 = 0; ij5 < 1; ++ij5)
1786{
1787if( !j5valid[ij5] )
1788{
1789 continue;
1790}
1791_ij5[0] = ij5; _ij5[1] = -1;
1792for(int iij5 = ij5+1; iij5 < 1; ++iij5)
1793{
1794if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
1795{
1796 j5valid[iij5]=false; _ij5[1] = iij5; break;
1797}
1798}
1799j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
1800{
1801IkReal evalcond[8];
1802IkReal x133=IKcos(j5);
1803IkReal x134=IKsin(j5);
1804IkReal x135=((1.0)*gconst18);
1805if((((1.0)+(((-1.0)*gconst18*x135)))) < -0.00001)
1806continue;
1807IkReal x136=IKsqrt(((1.0)+(((-1.0)*gconst18*x135))));
1808IkReal x137=((1.0)*x136);
1809evalcond[0]=x133;
1810evalcond[1]=((-1.0)*x134);
1811evalcond[2]=((((-1.0)*x133*x135))+new_r11);
1812evalcond[3]=((((-1.0)*x134*x135))+new_r10);
1813evalcond[4]=((((-1.0)*x133*x137))+new_r01);
1814evalcond[5]=((((-1.0)*x134*x137))+new_r00);
1815evalcond[6]=((((-1.0)*new_r10*x135))+(((-1.0)*new_r00*x137))+x134);
1816evalcond[7]=((((-1.0)*new_r11*x135))+(((-1.0)*new_r01*x137))+x133);
1817if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
1818{
1819continue;
1820}
1821}
1822
1823{
1824std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
1825vinfos[0].jointtype = 1;
1826vinfos[0].foffset = j0;
1827vinfos[0].indices[0] = _ij0[0];
1828vinfos[0].indices[1] = _ij0[1];
1829vinfos[0].maxsolutions = _nj0;
1830vinfos[1].jointtype = 1;
1831vinfos[1].foffset = j1;
1832vinfos[1].indices[0] = _ij1[0];
1833vinfos[1].indices[1] = _ij1[1];
1834vinfos[1].maxsolutions = _nj1;
1835vinfos[2].jointtype = 1;
1836vinfos[2].foffset = j2;
1837vinfos[2].indices[0] = _ij2[0];
1838vinfos[2].indices[1] = _ij2[1];
1839vinfos[2].maxsolutions = _nj2;
1840vinfos[3].jointtype = 1;
1841vinfos[3].foffset = j3;
1842vinfos[3].indices[0] = _ij3[0];
1843vinfos[3].indices[1] = _ij3[1];
1844vinfos[3].maxsolutions = _nj3;
1845vinfos[4].jointtype = 1;
1846vinfos[4].foffset = j4;
1847vinfos[4].indices[0] = _ij4[0];
1848vinfos[4].indices[1] = _ij4[1];
1849vinfos[4].maxsolutions = _nj4;
1850vinfos[5].jointtype = 1;
1851vinfos[5].foffset = j5;
1852vinfos[5].indices[0] = _ij5[0];
1853vinfos[5].indices[1] = _ij5[1];
1854vinfos[5].maxsolutions = _nj5;
1855std::vector<int> vfree(0);
1856solutions.AddSolution(vinfos,vfree);
1857}
1858}
1859}
1860
1861}
1862
1863}
1864
1865}
1866} while(0);
1867if( bgotonextstatement )
1868{
1869bool bgotonextstatement = true;
1870do
1871{
1872CheckValue<IkReal> x138=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
1873if(!x138.valid){
1874continue;
1875}
1876if((x138.value) < -0.00001)
1877continue;
1878IkReal gconst19=IKsqrt(x138.value);
1879evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.0)+(IKsign(sj3)))))+(IKabs((cj3+(((-1.0)*gconst19)))))), 6.28318530717959)));
1880if( IKabs(evalcond[0]) < 0.0000050000000000 )
1881{
1882bgotonextstatement=false;
1883{
1884IkReal j5eval[1];
1885new_r21=0;
1886new_r20=0;
1887new_r02=0;
1888new_r12=0;
1889if((((1.0)+(((-1.0)*(gconst19*gconst19))))) < -0.00001)
1890continue;
1891sj3=IKsqrt(((1.0)+(((-1.0)*(gconst19*gconst19)))));
1892cj3=gconst19;
1893if( (gconst19) < -1-IKFAST_SINCOS_THRESH || (gconst19) > 1+IKFAST_SINCOS_THRESH )
1894 continue;
1895j3=IKacos(gconst19);
1896CheckValue<IkReal> x139=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
1897if(!x139.valid){
1898continue;
1899}
1900if((x139.value) < -0.00001)
1901continue;
1902IkReal gconst19=IKsqrt(x139.value);
1903j5eval[0]=((IKabs(new_r11))+(IKabs(new_r10)));
1904if( IKabs(j5eval[0]) < 0.0000010000000000 )
1905{
1906{
1907IkReal j5array[1], cj5array[1], sj5array[1];
1908bool j5valid[1]={false};
1909_nj5 = 1;
1910if((((1.0)+(((-1.0)*(gconst19*gconst19))))) < -0.00001)
1911continue;
1913if(!x140.valid){
1914continue;
1915}
1916if( IKabs((((gconst19*new_r10))+(((-1.0)*new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst19*gconst19)))))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r11*(x140.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((gconst19*new_r10))+(((-1.0)*new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst19*gconst19))))))))))+IKsqr((new_r11*(x140.value)))-1) <= IKFAST_SINCOS_THRESH )
1917 continue;
1918j5array[0]=IKatan2((((gconst19*new_r10))+(((-1.0)*new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst19*gconst19))))))))), (new_r11*(x140.value)));
1919sj5array[0]=IKsin(j5array[0]);
1920cj5array[0]=IKcos(j5array[0]);
1921if( j5array[0] > IKPI )
1922{
1923 j5array[0]-=IK2PI;
1924}
1925else if( j5array[0] < -IKPI )
1926{ j5array[0]+=IK2PI;
1927}
1928j5valid[0] = true;
1929for(int ij5 = 0; ij5 < 1; ++ij5)
1930{
1931if( !j5valid[ij5] )
1932{
1933 continue;
1934}
1935_ij5[0] = ij5; _ij5[1] = -1;
1936for(int iij5 = ij5+1; iij5 < 1; ++iij5)
1937{
1938if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
1939{
1940 j5valid[iij5]=false; _ij5[1] = iij5; break;
1941}
1942}
1943j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
1944{
1945IkReal evalcond[8];
1946IkReal x141=IKcos(j5);
1947IkReal x142=IKsin(j5);
1948IkReal x143=((1.0)*gconst19);
1949if((((1.0)+(((-1.0)*gconst19*x143)))) < -0.00001)
1950continue;
1951IkReal x144=IKsqrt(((1.0)+(((-1.0)*gconst19*x143))));
1952evalcond[0]=x141;
1953evalcond[1]=((-1.0)*x142);
1954evalcond[2]=((((-1.0)*x141*x143))+new_r11);
1955evalcond[3]=((((-1.0)*x142*x143))+new_r10);
1956evalcond[4]=(((x141*x144))+new_r01);
1957evalcond[5]=(((x142*x144))+new_r00);
1958evalcond[6]=(((new_r00*x144))+x142+(((-1.0)*new_r10*x143)));
1959evalcond[7]=(((new_r01*x144))+(((-1.0)*new_r11*x143))+x141);
1960if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
1961{
1962continue;
1963}
1964}
1965
1966{
1967std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
1968vinfos[0].jointtype = 1;
1969vinfos[0].foffset = j0;
1970vinfos[0].indices[0] = _ij0[0];
1971vinfos[0].indices[1] = _ij0[1];
1972vinfos[0].maxsolutions = _nj0;
1973vinfos[1].jointtype = 1;
1974vinfos[1].foffset = j1;
1975vinfos[1].indices[0] = _ij1[0];
1976vinfos[1].indices[1] = _ij1[1];
1977vinfos[1].maxsolutions = _nj1;
1978vinfos[2].jointtype = 1;
1979vinfos[2].foffset = j2;
1980vinfos[2].indices[0] = _ij2[0];
1981vinfos[2].indices[1] = _ij2[1];
1982vinfos[2].maxsolutions = _nj2;
1983vinfos[3].jointtype = 1;
1984vinfos[3].foffset = j3;
1985vinfos[3].indices[0] = _ij3[0];
1986vinfos[3].indices[1] = _ij3[1];
1987vinfos[3].maxsolutions = _nj3;
1988vinfos[4].jointtype = 1;
1989vinfos[4].foffset = j4;
1990vinfos[4].indices[0] = _ij4[0];
1991vinfos[4].indices[1] = _ij4[1];
1992vinfos[4].maxsolutions = _nj4;
1993vinfos[5].jointtype = 1;
1994vinfos[5].foffset = j5;
1995vinfos[5].indices[0] = _ij5[0];
1996vinfos[5].indices[1] = _ij5[1];
1997vinfos[5].maxsolutions = _nj5;
1998std::vector<int> vfree(0);
1999solutions.AddSolution(vinfos,vfree);
2000}
2001}
2002}
2003
2004} else
2005{
2006{
2007IkReal j5array[1], cj5array[1], sj5array[1];
2008bool j5valid[1]={false};
2009_nj5 = 1;
2011if(!x145.valid){
2012continue;
2013}
2015if(!x146.valid){
2016continue;
2017}
2018j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x145.value)))+(x146.value));
2019sj5array[0]=IKsin(j5array[0]);
2020cj5array[0]=IKcos(j5array[0]);
2021if( j5array[0] > IKPI )
2022{
2023 j5array[0]-=IK2PI;
2024}
2025else if( j5array[0] < -IKPI )
2026{ j5array[0]+=IK2PI;
2027}
2028j5valid[0] = true;
2029for(int ij5 = 0; ij5 < 1; ++ij5)
2030{
2031if( !j5valid[ij5] )
2032{
2033 continue;
2034}
2035_ij5[0] = ij5; _ij5[1] = -1;
2036for(int iij5 = ij5+1; iij5 < 1; ++iij5)
2037{
2038if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
2039{
2040 j5valid[iij5]=false; _ij5[1] = iij5; break;
2041}
2042}
2043j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
2044{
2045IkReal evalcond[8];
2046IkReal x147=IKcos(j5);
2047IkReal x148=IKsin(j5);
2048IkReal x149=((1.0)*gconst19);
2049if((((1.0)+(((-1.0)*gconst19*x149)))) < -0.00001)
2050continue;
2051IkReal x150=IKsqrt(((1.0)+(((-1.0)*gconst19*x149))));
2052evalcond[0]=x147;
2053evalcond[1]=((-1.0)*x148);
2054evalcond[2]=((((-1.0)*x147*x149))+new_r11);
2055evalcond[3]=((((-1.0)*x148*x149))+new_r10);
2056evalcond[4]=(((x147*x150))+new_r01);
2057evalcond[5]=(((x148*x150))+new_r00);
2058evalcond[6]=(((new_r00*x150))+x148+(((-1.0)*new_r10*x149)));
2059evalcond[7]=(((new_r01*x150))+(((-1.0)*new_r11*x149))+x147);
2060if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
2061{
2062continue;
2063}
2064}
2065
2066{
2067std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
2068vinfos[0].jointtype = 1;
2069vinfos[0].foffset = j0;
2070vinfos[0].indices[0] = _ij0[0];
2071vinfos[0].indices[1] = _ij0[1];
2072vinfos[0].maxsolutions = _nj0;
2073vinfos[1].jointtype = 1;
2074vinfos[1].foffset = j1;
2075vinfos[1].indices[0] = _ij1[0];
2076vinfos[1].indices[1] = _ij1[1];
2077vinfos[1].maxsolutions = _nj1;
2078vinfos[2].jointtype = 1;
2079vinfos[2].foffset = j2;
2080vinfos[2].indices[0] = _ij2[0];
2081vinfos[2].indices[1] = _ij2[1];
2082vinfos[2].maxsolutions = _nj2;
2083vinfos[3].jointtype = 1;
2084vinfos[3].foffset = j3;
2085vinfos[3].indices[0] = _ij3[0];
2086vinfos[3].indices[1] = _ij3[1];
2087vinfos[3].maxsolutions = _nj3;
2088vinfos[4].jointtype = 1;
2089vinfos[4].foffset = j4;
2090vinfos[4].indices[0] = _ij4[0];
2091vinfos[4].indices[1] = _ij4[1];
2092vinfos[4].maxsolutions = _nj4;
2093vinfos[5].jointtype = 1;
2094vinfos[5].foffset = j5;
2095vinfos[5].indices[0] = _ij5[0];
2096vinfos[5].indices[1] = _ij5[1];
2097vinfos[5].maxsolutions = _nj5;
2098std::vector<int> vfree(0);
2099solutions.AddSolution(vinfos,vfree);
2100}
2101}
2102}
2103
2104}
2105
2106}
2107
2108}
2109} while(0);
2110if( bgotonextstatement )
2111{
2112bool bgotonextstatement = true;
2113do
2114{
2115CheckValue<IkReal> x151=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
2116if(!x151.valid){
2117continue;
2118}
2119if((x151.value) < -0.00001)
2120continue;
2121IkReal gconst19=IKsqrt(x151.value);
2122evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.0)+(IKsign(sj3)))))+(IKabs((cj3+(((-1.0)*gconst19)))))), 6.28318530717959)));
2123if( IKabs(evalcond[0]) < 0.0000050000000000 )
2124{
2125bgotonextstatement=false;
2126{
2127IkReal j5eval[1];
2128new_r21=0;
2129new_r20=0;
2130new_r02=0;
2131new_r12=0;
2132if((((1.0)+(((-1.0)*(gconst19*gconst19))))) < -0.00001)
2133continue;
2134sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst19*gconst19)))))));
2135cj3=gconst19;
2136if( (gconst19) < -1-IKFAST_SINCOS_THRESH || (gconst19) > 1+IKFAST_SINCOS_THRESH )
2137 continue;
2138j3=((-1.0)*(IKacos(gconst19)));
2139CheckValue<IkReal> x152=IKPowWithIntegerCheck(((1.0)+(((-1.0)*(new_r22*new_r22)))),-1);
2140if(!x152.valid){
2141continue;
2142}
2143if((x152.value) < -0.00001)
2144continue;
2145IkReal gconst19=IKsqrt(x152.value);
2146j5eval[0]=((IKabs(new_r11))+(IKabs(new_r10)));
2147if( IKabs(j5eval[0]) < 0.0000010000000000 )
2148{
2149{
2150IkReal j5array[1], cj5array[1], sj5array[1];
2151bool j5valid[1]={false};
2152_nj5 = 1;
2153if((((1.0)+(((-1.0)*(gconst19*gconst19))))) < -0.00001)
2154continue;
2156if(!x153.valid){
2157continue;
2158}
2159if( IKabs((((new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst19*gconst19))))))))+((gconst19*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r11*(x153.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst19*gconst19))))))))+((gconst19*new_r10))))+IKsqr((new_r11*(x153.value)))-1) <= IKFAST_SINCOS_THRESH )
2160 continue;
2161j5array[0]=IKatan2((((new_r00*(IKsqrt(((1.0)+(((-1.0)*(gconst19*gconst19))))))))+((gconst19*new_r10))), (new_r11*(x153.value)));
2162sj5array[0]=IKsin(j5array[0]);
2163cj5array[0]=IKcos(j5array[0]);
2164if( j5array[0] > IKPI )
2165{
2166 j5array[0]-=IK2PI;
2167}
2168else if( j5array[0] < -IKPI )
2169{ j5array[0]+=IK2PI;
2170}
2171j5valid[0] = true;
2172for(int ij5 = 0; ij5 < 1; ++ij5)
2173{
2174if( !j5valid[ij5] )
2175{
2176 continue;
2177}
2178_ij5[0] = ij5; _ij5[1] = -1;
2179for(int iij5 = ij5+1; iij5 < 1; ++iij5)
2180{
2181if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
2182{
2183 j5valid[iij5]=false; _ij5[1] = iij5; break;
2184}
2185}
2186j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
2187{
2188IkReal evalcond[8];
2189IkReal x154=IKcos(j5);
2190IkReal x155=IKsin(j5);
2191IkReal x156=((1.0)*gconst19);
2192if((((1.0)+(((-1.0)*gconst19*x156)))) < -0.00001)
2193continue;
2194IkReal x157=IKsqrt(((1.0)+(((-1.0)*gconst19*x156))));
2195IkReal x158=((1.0)*x157);
2196evalcond[0]=x154;
2197evalcond[1]=((-1.0)*x155);
2198evalcond[2]=((((-1.0)*x154*x156))+new_r11);
2199evalcond[3]=((((-1.0)*x155*x156))+new_r10);
2200evalcond[4]=((((-1.0)*x154*x158))+new_r01);
2201evalcond[5]=((((-1.0)*x155*x158))+new_r00);
2202evalcond[6]=(x155+(((-1.0)*new_r10*x156))+(((-1.0)*new_r00*x158)));
2203evalcond[7]=(x154+(((-1.0)*new_r11*x156))+(((-1.0)*new_r01*x158)));
2204if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
2205{
2206continue;
2207}
2208}
2209
2210{
2211std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
2212vinfos[0].jointtype = 1;
2213vinfos[0].foffset = j0;
2214vinfos[0].indices[0] = _ij0[0];
2215vinfos[0].indices[1] = _ij0[1];
2216vinfos[0].maxsolutions = _nj0;
2217vinfos[1].jointtype = 1;
2218vinfos[1].foffset = j1;
2219vinfos[1].indices[0] = _ij1[0];
2220vinfos[1].indices[1] = _ij1[1];
2221vinfos[1].maxsolutions = _nj1;
2222vinfos[2].jointtype = 1;
2223vinfos[2].foffset = j2;
2224vinfos[2].indices[0] = _ij2[0];
2225vinfos[2].indices[1] = _ij2[1];
2226vinfos[2].maxsolutions = _nj2;
2227vinfos[3].jointtype = 1;
2228vinfos[3].foffset = j3;
2229vinfos[3].indices[0] = _ij3[0];
2230vinfos[3].indices[1] = _ij3[1];
2231vinfos[3].maxsolutions = _nj3;
2232vinfos[4].jointtype = 1;
2233vinfos[4].foffset = j4;
2234vinfos[4].indices[0] = _ij4[0];
2235vinfos[4].indices[1] = _ij4[1];
2236vinfos[4].maxsolutions = _nj4;
2237vinfos[5].jointtype = 1;
2238vinfos[5].foffset = j5;
2239vinfos[5].indices[0] = _ij5[0];
2240vinfos[5].indices[1] = _ij5[1];
2241vinfos[5].maxsolutions = _nj5;
2242std::vector<int> vfree(0);
2243solutions.AddSolution(vinfos,vfree);
2244}
2245}
2246}
2247
2248} else
2249{
2250{
2251IkReal j5array[1], cj5array[1], sj5array[1];
2252bool j5valid[1]={false};
2253_nj5 = 1;
2255if(!x159.valid){
2256continue;
2257}
2259if(!x160.valid){
2260continue;
2261}
2262j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x159.value)))+(x160.value));
2263sj5array[0]=IKsin(j5array[0]);
2264cj5array[0]=IKcos(j5array[0]);
2265if( j5array[0] > IKPI )
2266{
2267 j5array[0]-=IK2PI;
2268}
2269else if( j5array[0] < -IKPI )
2270{ j5array[0]+=IK2PI;
2271}
2272j5valid[0] = true;
2273for(int ij5 = 0; ij5 < 1; ++ij5)
2274{
2275if( !j5valid[ij5] )
2276{
2277 continue;
2278}
2279_ij5[0] = ij5; _ij5[1] = -1;
2280for(int iij5 = ij5+1; iij5 < 1; ++iij5)
2281{
2282if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
2283{
2284 j5valid[iij5]=false; _ij5[1] = iij5; break;
2285}
2286}
2287j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
2288{
2289IkReal evalcond[8];
2290IkReal x161=IKcos(j5);
2291IkReal x162=IKsin(j5);
2292IkReal x163=((1.0)*gconst19);
2293if((((1.0)+(((-1.0)*gconst19*x163)))) < -0.00001)
2294continue;
2295IkReal x164=IKsqrt(((1.0)+(((-1.0)*gconst19*x163))));
2296IkReal x165=((1.0)*x164);
2297evalcond[0]=x161;
2298evalcond[1]=((-1.0)*x162);
2299evalcond[2]=((((-1.0)*x161*x163))+new_r11);
2300evalcond[3]=((((-1.0)*x162*x163))+new_r10);
2301evalcond[4]=((((-1.0)*x161*x165))+new_r01);
2302evalcond[5]=((((-1.0)*x162*x165))+new_r00);
2303evalcond[6]=((((-1.0)*new_r00*x165))+(((-1.0)*new_r10*x163))+x162);
2304evalcond[7]=((((-1.0)*new_r11*x163))+x161+(((-1.0)*new_r01*x165)));
2305if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
2306{
2307continue;
2308}
2309}
2310
2311{
2312std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
2313vinfos[0].jointtype = 1;
2314vinfos[0].foffset = j0;
2315vinfos[0].indices[0] = _ij0[0];
2316vinfos[0].indices[1] = _ij0[1];
2317vinfos[0].maxsolutions = _nj0;
2318vinfos[1].jointtype = 1;
2319vinfos[1].foffset = j1;
2320vinfos[1].indices[0] = _ij1[0];
2321vinfos[1].indices[1] = _ij1[1];
2322vinfos[1].maxsolutions = _nj1;
2323vinfos[2].jointtype = 1;
2324vinfos[2].foffset = j2;
2325vinfos[2].indices[0] = _ij2[0];
2326vinfos[2].indices[1] = _ij2[1];
2327vinfos[2].maxsolutions = _nj2;
2328vinfos[3].jointtype = 1;
2329vinfos[3].foffset = j3;
2330vinfos[3].indices[0] = _ij3[0];
2331vinfos[3].indices[1] = _ij3[1];
2332vinfos[3].maxsolutions = _nj3;
2333vinfos[4].jointtype = 1;
2334vinfos[4].foffset = j4;
2335vinfos[4].indices[0] = _ij4[0];
2336vinfos[4].indices[1] = _ij4[1];
2337vinfos[4].maxsolutions = _nj4;
2338vinfos[5].jointtype = 1;
2339vinfos[5].foffset = j5;
2340vinfos[5].indices[0] = _ij5[0];
2341vinfos[5].indices[1] = _ij5[1];
2342vinfos[5].maxsolutions = _nj5;
2343std::vector<int> vfree(0);
2344solutions.AddSolution(vinfos,vfree);
2345}
2346}
2347}
2348
2349}
2350
2351}
2352
2353}
2354} while(0);
2355if( bgotonextstatement )
2356{
2357bool bgotonextstatement = true;
2358do
2359{
2360if( 1 )
2361{
2362bgotonextstatement=false;
2363continue; // branch miss [j5]
2364
2365}
2366} while(0);
2367if( bgotonextstatement )
2368{
2369}
2370}
2371}
2372}
2373}
2374}
2375}
2376}
2377
2378} else
2379{
2380{
2381IkReal j5array[1], cj5array[1], sj5array[1];
2382bool j5valid[1]={false};
2383_nj5 = 1;
2384IkReal x166=(new_r00*sj3);
2386if(!x167.valid){
2387continue;
2388}
2389if( IKabs(((((-1.0)*x166))+((cj3*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((x167.value)*((((cj3*new_r22*x166))+(((-1.0)*new_r01))+(((-1.0)*new_r10*new_r22*(cj3*cj3))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*x166))+((cj3*new_r10))))+IKsqr(((x167.value)*((((cj3*new_r22*x166))+(((-1.0)*new_r01))+(((-1.0)*new_r10*new_r22*(cj3*cj3)))))))-1) <= IKFAST_SINCOS_THRESH )
2390 continue;
2391j5array[0]=IKatan2(((((-1.0)*x166))+((cj3*new_r10))), ((x167.value)*((((cj3*new_r22*x166))+(((-1.0)*new_r01))+(((-1.0)*new_r10*new_r22*(cj3*cj3)))))));
2392sj5array[0]=IKsin(j5array[0]);
2393cj5array[0]=IKcos(j5array[0]);
2394if( j5array[0] > IKPI )
2395{
2396 j5array[0]-=IK2PI;
2397}
2398else if( j5array[0] < -IKPI )
2399{ j5array[0]+=IK2PI;
2400}
2401j5valid[0] = true;
2402for(int ij5 = 0; ij5 < 1; ++ij5)
2403{
2404if( !j5valid[ij5] )
2405{
2406 continue;
2407}
2408_ij5[0] = ij5; _ij5[1] = -1;
2409for(int iij5 = ij5+1; iij5 < 1; ++iij5)
2410{
2411if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
2412{
2413 j5valid[iij5]=false; _ij5[1] = iij5; break;
2414}
2415}
2416j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
2417{
2418IkReal evalcond[10];
2419IkReal x168=IKsin(j5);
2420IkReal x169=IKcos(j5);
2421IkReal x170=((1.0)*new_r11);
2422IkReal x171=(new_r22*sj3);
2423IkReal x172=((1.0)*new_r10);
2424IkReal x173=((1.0)*cj3*new_r22);
2425IkReal x174=(sj3*x168);
2426IkReal x175=(new_r22*x168);
2427IkReal x176=((1.0)*x169);
2428IkReal x177=((1.0)*x168);
2429evalcond[0]=(((new_r00*sj3))+x168+(((-1.0)*cj3*x172)));
2430evalcond[1]=(((new_r01*sj3))+x169+(((-1.0)*cj3*x170)));
2431evalcond[2]=(((new_r11*sj3))+x175+((cj3*new_r01)));
2432evalcond[3]=(((sj3*x169))+((cj3*x175))+new_r01);
2433evalcond[4]=(((new_r10*sj3))+(((-1.0)*new_r22*x176))+((cj3*new_r00)));
2434evalcond[5]=(x174+new_r00+(((-1.0)*x169*x173)));
2435evalcond[6]=(((x168*x171))+(((-1.0)*cj3*x176))+new_r11);
2436evalcond[7]=(x169+(((-1.0)*x171*x172))+(((-1.0)*new_r00*x173)));
2437evalcond[8]=((((-1.0)*cj3*x177))+(((-1.0)*x171*x176))+new_r10);
2438evalcond[9]=((((-1.0)*x177))+(((-1.0)*x170*x171))+(((-1.0)*new_r01*x173)));
2439if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH )
2440{
2441continue;
2442}
2443}
2444
2445{
2446std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
2447vinfos[0].jointtype = 1;
2448vinfos[0].foffset = j0;
2449vinfos[0].indices[0] = _ij0[0];
2450vinfos[0].indices[1] = _ij0[1];
2451vinfos[0].maxsolutions = _nj0;
2452vinfos[1].jointtype = 1;
2453vinfos[1].foffset = j1;
2454vinfos[1].indices[0] = _ij1[0];
2455vinfos[1].indices[1] = _ij1[1];
2456vinfos[1].maxsolutions = _nj1;
2457vinfos[2].jointtype = 1;
2458vinfos[2].foffset = j2;
2459vinfos[2].indices[0] = _ij2[0];
2460vinfos[2].indices[1] = _ij2[1];
2461vinfos[2].maxsolutions = _nj2;
2462vinfos[3].jointtype = 1;
2463vinfos[3].foffset = j3;
2464vinfos[3].indices[0] = _ij3[0];
2465vinfos[3].indices[1] = _ij3[1];
2466vinfos[3].maxsolutions = _nj3;
2467vinfos[4].jointtype = 1;
2468vinfos[4].foffset = j4;
2469vinfos[4].indices[0] = _ij4[0];
2470vinfos[4].indices[1] = _ij4[1];
2471vinfos[4].maxsolutions = _nj4;
2472vinfos[5].jointtype = 1;
2473vinfos[5].foffset = j5;
2474vinfos[5].indices[0] = _ij5[0];
2475vinfos[5].indices[1] = _ij5[1];
2476vinfos[5].maxsolutions = _nj5;
2477std::vector<int> vfree(0);
2478solutions.AddSolution(vinfos,vfree);
2479}
2480}
2481}
2482
2483}
2484
2485}
2486
2487} else
2488{
2489{
2490IkReal j5array[1], cj5array[1], sj5array[1];
2491bool j5valid[1]={false};
2492_nj5 = 1;
2493IkReal x178=((1.0)*new_r01);
2495if(!x179.valid){
2496continue;
2497}
2498if( IKabs(((x179.value)*(((((-1.0)*cj3*x178))+(((-1.0)*new_r11*sj3)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj3*new_r11))+(((-1.0)*sj3*x178)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x179.value)*(((((-1.0)*cj3*x178))+(((-1.0)*new_r11*sj3))))))+IKsqr((((cj3*new_r11))+(((-1.0)*sj3*x178))))-1) <= IKFAST_SINCOS_THRESH )
2499 continue;
2500j5array[0]=IKatan2(((x179.value)*(((((-1.0)*cj3*x178))+(((-1.0)*new_r11*sj3))))), (((cj3*new_r11))+(((-1.0)*sj3*x178))));
2501sj5array[0]=IKsin(j5array[0]);
2502cj5array[0]=IKcos(j5array[0]);
2503if( j5array[0] > IKPI )
2504{
2505 j5array[0]-=IK2PI;
2506}
2507else if( j5array[0] < -IKPI )
2508{ j5array[0]+=IK2PI;
2509}
2510j5valid[0] = true;
2511for(int ij5 = 0; ij5 < 1; ++ij5)
2512{
2513if( !j5valid[ij5] )
2514{
2515 continue;
2516}
2517_ij5[0] = ij5; _ij5[1] = -1;
2518for(int iij5 = ij5+1; iij5 < 1; ++iij5)
2519{
2520if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
2521{
2522 j5valid[iij5]=false; _ij5[1] = iij5; break;
2523}
2524}
2525j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
2526{
2527IkReal evalcond[10];
2528IkReal x180=IKsin(j5);
2529IkReal x181=IKcos(j5);
2530IkReal x182=((1.0)*new_r11);
2531IkReal x183=(new_r22*sj3);
2532IkReal x184=((1.0)*new_r10);
2533IkReal x185=((1.0)*cj3*new_r22);
2534IkReal x186=(sj3*x180);
2535IkReal x187=(new_r22*x180);
2536IkReal x188=((1.0)*x181);
2537IkReal x189=((1.0)*x180);
2538evalcond[0]=(((new_r00*sj3))+x180+(((-1.0)*cj3*x184)));
2539evalcond[1]=(((new_r01*sj3))+x181+(((-1.0)*cj3*x182)));
2540evalcond[2]=(((new_r11*sj3))+x187+((cj3*new_r01)));
2541evalcond[3]=(((sj3*x181))+((cj3*x187))+new_r01);
2542evalcond[4]=(((new_r10*sj3))+(((-1.0)*new_r22*x188))+((cj3*new_r00)));
2543evalcond[5]=(x186+new_r00+(((-1.0)*x181*x185)));
2544evalcond[6]=(((x180*x183))+new_r11+(((-1.0)*cj3*x188)));
2545evalcond[7]=(x181+(((-1.0)*new_r00*x185))+(((-1.0)*x183*x184)));
2546evalcond[8]=(new_r10+(((-1.0)*x183*x188))+(((-1.0)*cj3*x189)));
2547evalcond[9]=((((-1.0)*x189))+(((-1.0)*new_r01*x185))+(((-1.0)*x182*x183)));
2548if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH )
2549{
2550continue;
2551}
2552}
2553
2554{
2555std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
2556vinfos[0].jointtype = 1;
2557vinfos[0].foffset = j0;
2558vinfos[0].indices[0] = _ij0[0];
2559vinfos[0].indices[1] = _ij0[1];
2560vinfos[0].maxsolutions = _nj0;
2561vinfos[1].jointtype = 1;
2562vinfos[1].foffset = j1;
2563vinfos[1].indices[0] = _ij1[0];
2564vinfos[1].indices[1] = _ij1[1];
2565vinfos[1].maxsolutions = _nj1;
2566vinfos[2].jointtype = 1;
2567vinfos[2].foffset = j2;
2568vinfos[2].indices[0] = _ij2[0];
2569vinfos[2].indices[1] = _ij2[1];
2570vinfos[2].maxsolutions = _nj2;
2571vinfos[3].jointtype = 1;
2572vinfos[3].foffset = j3;
2573vinfos[3].indices[0] = _ij3[0];
2574vinfos[3].indices[1] = _ij3[1];
2575vinfos[3].maxsolutions = _nj3;
2576vinfos[4].jointtype = 1;
2577vinfos[4].foffset = j4;
2578vinfos[4].indices[0] = _ij4[0];
2579vinfos[4].indices[1] = _ij4[1];
2580vinfos[4].maxsolutions = _nj4;
2581vinfos[5].jointtype = 1;
2582vinfos[5].foffset = j5;
2583vinfos[5].indices[0] = _ij5[0];
2584vinfos[5].indices[1] = _ij5[1];
2585vinfos[5].maxsolutions = _nj5;
2586std::vector<int> vfree(0);
2587solutions.AddSolution(vinfos,vfree);
2588}
2589}
2590}
2591
2592}
2593
2594}
2595
2596} else
2597{
2598{
2599IkReal j5array[1], cj5array[1], sj5array[1];
2600bool j5valid[1]={false};
2601_nj5 = 1;
2602IkReal x190=cj3*cj3;
2603IkReal x191=(cj3*new_r22);
2604CheckValue<IkReal> x192=IKPowWithIntegerCheck(IKsign(((-1.0)+(((-1.0)*x190*(new_r22*new_r22)))+x190)),-1);
2605if(!x192.valid){
2606continue;
2607}
2608CheckValue<IkReal> x193 = IKatan2WithCheck(IkReal((((new_r01*x191))+((new_r00*sj3)))),IkReal((((new_r01*sj3))+(((-1.0)*new_r00*x191)))),IKFAST_ATAN2_MAGTHRESH);
2609if(!x193.valid){
2610continue;
2611}
2612j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x192.value)))+(x193.value));
2613sj5array[0]=IKsin(j5array[0]);
2614cj5array[0]=IKcos(j5array[0]);
2615if( j5array[0] > IKPI )
2616{
2617 j5array[0]-=IK2PI;
2618}
2619else if( j5array[0] < -IKPI )
2620{ j5array[0]+=IK2PI;
2621}
2622j5valid[0] = true;
2623for(int ij5 = 0; ij5 < 1; ++ij5)
2624{
2625if( !j5valid[ij5] )
2626{
2627 continue;
2628}
2629_ij5[0] = ij5; _ij5[1] = -1;
2630for(int iij5 = ij5+1; iij5 < 1; ++iij5)
2631{
2632if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
2633{
2634 j5valid[iij5]=false; _ij5[1] = iij5; break;
2635}
2636}
2637j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
2638{
2639IkReal evalcond[10];
2640IkReal x194=IKsin(j5);
2641IkReal x195=IKcos(j5);
2642IkReal x196=((1.0)*new_r11);
2643IkReal x197=(new_r22*sj3);
2644IkReal x198=((1.0)*new_r10);
2645IkReal x199=((1.0)*cj3*new_r22);
2646IkReal x200=(sj3*x194);
2647IkReal x201=(new_r22*x194);
2648IkReal x202=((1.0)*x195);
2649IkReal x203=((1.0)*x194);
2650evalcond[0]=(((new_r00*sj3))+x194+(((-1.0)*cj3*x198)));
2651evalcond[1]=(((new_r01*sj3))+x195+(((-1.0)*cj3*x196)));
2652evalcond[2]=(((new_r11*sj3))+x201+((cj3*new_r01)));
2653evalcond[3]=(((sj3*x195))+((cj3*x201))+new_r01);
2654evalcond[4]=((((-1.0)*new_r22*x202))+((new_r10*sj3))+((cj3*new_r00)));
2655evalcond[5]=((((-1.0)*x195*x199))+x200+new_r00);
2656evalcond[6]=(((x194*x197))+new_r11+(((-1.0)*cj3*x202)));
2657evalcond[7]=((((-1.0)*x197*x198))+x195+(((-1.0)*new_r00*x199)));
2658evalcond[8]=((((-1.0)*x197*x202))+new_r10+(((-1.0)*cj3*x203)));
2659evalcond[9]=((((-1.0)*x196*x197))+(((-1.0)*x203))+(((-1.0)*new_r01*x199)));
2660if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH )
2661{
2662continue;
2663}
2664}
2665
2666{
2667std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
2668vinfos[0].jointtype = 1;
2669vinfos[0].foffset = j0;
2670vinfos[0].indices[0] = _ij0[0];
2671vinfos[0].indices[1] = _ij0[1];
2672vinfos[0].maxsolutions = _nj0;
2673vinfos[1].jointtype = 1;
2674vinfos[1].foffset = j1;
2675vinfos[1].indices[0] = _ij1[0];
2676vinfos[1].indices[1] = _ij1[1];
2677vinfos[1].maxsolutions = _nj1;
2678vinfos[2].jointtype = 1;
2679vinfos[2].foffset = j2;
2680vinfos[2].indices[0] = _ij2[0];
2681vinfos[2].indices[1] = _ij2[1];
2682vinfos[2].maxsolutions = _nj2;
2683vinfos[3].jointtype = 1;
2684vinfos[3].foffset = j3;
2685vinfos[3].indices[0] = _ij3[0];
2686vinfos[3].indices[1] = _ij3[1];
2687vinfos[3].maxsolutions = _nj3;
2688vinfos[4].jointtype = 1;
2689vinfos[4].foffset = j4;
2690vinfos[4].indices[0] = _ij4[0];
2691vinfos[4].indices[1] = _ij4[1];
2692vinfos[4].maxsolutions = _nj4;
2693vinfos[5].jointtype = 1;
2694vinfos[5].foffset = j5;
2695vinfos[5].indices[0] = _ij5[0];
2696vinfos[5].indices[1] = _ij5[1];
2697vinfos[5].maxsolutions = _nj5;
2698std::vector<int> vfree(0);
2699solutions.AddSolution(vinfos,vfree);
2700}
2701}
2702}
2703
2704}
2705
2706}
2707 }
2708
2709}
2710
2711}
2712
2713}
2714} while(0);
2715if( bgotonextstatement )
2716{
2717bool bgotonextstatement = true;
2718do
2719{
2720if( 1 )
2721{
2722bgotonextstatement=false;
2723continue; // branch miss [j3, j5]
2724
2725}
2726} while(0);
2727if( bgotonextstatement )
2728{
2729}
2730}
2731}
2732}
2733}
2734
2735} else
2736{
2737{
2738IkReal j3array[1], cj3array[1], sj3array[1];
2739bool j3valid[1]={false};
2740_nj3 = 1;
2742if(!x205.valid){
2743continue;
2744}
2745IkReal x204=x205.value;
2747if(!x206.valid){
2748continue;
2749}
2750if( IKabs((x204*(x206.value)*(((-1.0)+(new_r02*new_r02)+(cj4*cj4))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r02*x204)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x204*(x206.value)*(((-1.0)+(new_r02*new_r02)+(cj4*cj4)))))+IKsqr(((-1.0)*new_r02*x204))-1) <= IKFAST_SINCOS_THRESH )
2751 continue;
2752j3array[0]=IKatan2((x204*(x206.value)*(((-1.0)+(new_r02*new_r02)+(cj4*cj4)))), ((-1.0)*new_r02*x204));
2753sj3array[0]=IKsin(j3array[0]);
2754cj3array[0]=IKcos(j3array[0]);
2755if( j3array[0] > IKPI )
2756{
2757 j3array[0]-=IK2PI;
2758}
2759else if( j3array[0] < -IKPI )
2760{ j3array[0]+=IK2PI;
2761}
2762j3valid[0] = true;
2763for(int ij3 = 0; ij3 < 1; ++ij3)
2764{
2765if( !j3valid[ij3] )
2766{
2767 continue;
2768}
2769_ij3[0] = ij3; _ij3[1] = -1;
2770for(int iij3 = ij3+1; iij3 < 1; ++iij3)
2771{
2772if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
2773{
2774 j3valid[iij3]=false; _ij3[1] = iij3; break;
2775}
2776}
2777j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
2778{
2779IkReal evalcond[8];
2780IkReal x207=IKcos(j3);
2781IkReal x208=IKsin(j3);
2782IkReal x209=((1.0)*cj4);
2783IkReal x210=(sj4*x208);
2784IkReal x211=(new_r12*x208);
2785IkReal x212=(sj4*x207);
2786IkReal x213=(new_r02*x207);
2787evalcond[0]=(x212+new_r02);
2788evalcond[1]=(x210+new_r12);
2789evalcond[2]=((((-1.0)*new_r02*x208))+((new_r12*x207)));
2790evalcond[3]=(sj4+x211+x213);
2791evalcond[4]=((((-1.0)*new_r20*x209))+((new_r00*x212))+((new_r10*x210)));
2792evalcond[5]=((((-1.0)*new_r21*x209))+((new_r01*x212))+((new_r11*x210)));
2793evalcond[6]=((1.0)+(((-1.0)*new_r22*x209))+((new_r02*x212))+((new_r12*x210)));
2794evalcond[7]=((((-1.0)*new_r22*sj4))+(((-1.0)*x209*x213))+(((-1.0)*x209*x211)));
2795if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
2796{
2797continue;
2798}
2799}
2800
2801{
2802IkReal j5eval[3];
2803j5eval[0]=sj4;
2804j5eval[1]=IKsign(sj4);
2805j5eval[2]=((IKabs(new_r20))+(IKabs(new_r21)));
2806if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
2807{
2808{
2809IkReal j5eval[2];
2810j5eval[0]=sj4;
2811j5eval[1]=sj3;
2812if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 )
2813{
2814{
2815IkReal j5eval[2];
2816j5eval[0]=sj4;
2817j5eval[1]=cj3;
2818if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 )
2819{
2820{
2821IkReal evalcond[5];
2822bool bgotonextstatement = true;
2823do
2824{
2825evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j4))), 6.28318530717959)));
2826evalcond[1]=new_r02;
2827evalcond[2]=new_r12;
2828evalcond[3]=new_r21;
2829evalcond[4]=new_r20;
2830if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
2831{
2832bgotonextstatement=false;
2833{
2834IkReal j5array[1], cj5array[1], sj5array[1];
2835bool j5valid[1]={false};
2836_nj5 = 1;
2837IkReal x214=((1.0)*new_r01);
2838if( IKabs(((((-1.0)*cj3*x214))+(((-1.0)*new_r00*sj3)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*sj3*x214))+((cj3*new_r00)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*cj3*x214))+(((-1.0)*new_r00*sj3))))+IKsqr(((((-1.0)*sj3*x214))+((cj3*new_r00))))-1) <= IKFAST_SINCOS_THRESH )
2839 continue;
2840j5array[0]=IKatan2(((((-1.0)*cj3*x214))+(((-1.0)*new_r00*sj3))), ((((-1.0)*sj3*x214))+((cj3*new_r00))));
2841sj5array[0]=IKsin(j5array[0]);
2842cj5array[0]=IKcos(j5array[0]);
2843if( j5array[0] > IKPI )
2844{
2845 j5array[0]-=IK2PI;
2846}
2847else if( j5array[0] < -IKPI )
2848{ j5array[0]+=IK2PI;
2849}
2850j5valid[0] = true;
2851for(int ij5 = 0; ij5 < 1; ++ij5)
2852{
2853if( !j5valid[ij5] )
2854{
2855 continue;
2856}
2857_ij5[0] = ij5; _ij5[1] = -1;
2858for(int iij5 = ij5+1; iij5 < 1; ++iij5)
2859{
2860if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
2861{
2862 j5valid[iij5]=false; _ij5[1] = iij5; break;
2863}
2864}
2865j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
2866{
2867IkReal evalcond[8];
2868IkReal x215=IKsin(j5);
2869IkReal x216=IKcos(j5);
2870IkReal x217=((1.0)*cj3);
2871IkReal x218=(sj3*x215);
2872IkReal x219=((1.0)*x216);
2873IkReal x220=(x216*x217);
2874evalcond[0]=(((new_r11*sj3))+x215+((cj3*new_r01)));
2875evalcond[1]=(((new_r00*sj3))+(((-1.0)*new_r10*x217))+x215);
2876evalcond[2]=((((-1.0)*new_r11*x217))+((new_r01*sj3))+x216);
2877evalcond[3]=(((sj3*x216))+((cj3*x215))+new_r01);
2878evalcond[4]=(((new_r10*sj3))+((cj3*new_r00))+(((-1.0)*x219)));
2879evalcond[5]=(x218+new_r00+(((-1.0)*x220)));
2880evalcond[6]=(x218+new_r11+(((-1.0)*x220)));
2881evalcond[7]=((((-1.0)*sj3*x219))+new_r10+(((-1.0)*x215*x217)));
2882if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
2883{
2884continue;
2885}
2886}
2887
2888{
2889std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
2890vinfos[0].jointtype = 1;
2891vinfos[0].foffset = j0;
2892vinfos[0].indices[0] = _ij0[0];
2893vinfos[0].indices[1] = _ij0[1];
2894vinfos[0].maxsolutions = _nj0;
2895vinfos[1].jointtype = 1;
2896vinfos[1].foffset = j1;
2897vinfos[1].indices[0] = _ij1[0];
2898vinfos[1].indices[1] = _ij1[1];
2899vinfos[1].maxsolutions = _nj1;
2900vinfos[2].jointtype = 1;
2901vinfos[2].foffset = j2;
2902vinfos[2].indices[0] = _ij2[0];
2903vinfos[2].indices[1] = _ij2[1];
2904vinfos[2].maxsolutions = _nj2;
2905vinfos[3].jointtype = 1;
2906vinfos[3].foffset = j3;
2907vinfos[3].indices[0] = _ij3[0];
2908vinfos[3].indices[1] = _ij3[1];
2909vinfos[3].maxsolutions = _nj3;
2910vinfos[4].jointtype = 1;
2911vinfos[4].foffset = j4;
2912vinfos[4].indices[0] = _ij4[0];
2913vinfos[4].indices[1] = _ij4[1];
2914vinfos[4].maxsolutions = _nj4;
2915vinfos[5].jointtype = 1;
2916vinfos[5].foffset = j5;
2917vinfos[5].indices[0] = _ij5[0];
2918vinfos[5].indices[1] = _ij5[1];
2919vinfos[5].maxsolutions = _nj5;
2920std::vector<int> vfree(0);
2921solutions.AddSolution(vinfos,vfree);
2922}
2923}
2924}
2925
2926}
2927} while(0);
2928if( bgotonextstatement )
2929{
2930bool bgotonextstatement = true;
2931do
2932{
2933evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j4)))), 6.28318530717959)));
2934evalcond[1]=new_r02;
2935evalcond[2]=new_r12;
2936evalcond[3]=new_r21;
2937evalcond[4]=new_r20;
2938if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
2939{
2940bgotonextstatement=false;
2941{
2942IkReal j5array[1], cj5array[1], sj5array[1];
2943bool j5valid[1]={false};
2944_nj5 = 1;
2945IkReal x221=((1.0)*sj3);
2946if( IKabs((((cj3*new_r01))+(((-1.0)*new_r00*x221)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*new_r01*x221))+(((-1.0)*cj3*new_r00)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((cj3*new_r01))+(((-1.0)*new_r00*x221))))+IKsqr(((((-1.0)*new_r01*x221))+(((-1.0)*cj3*new_r00))))-1) <= IKFAST_SINCOS_THRESH )
2947 continue;
2948j5array[0]=IKatan2((((cj3*new_r01))+(((-1.0)*new_r00*x221))), ((((-1.0)*new_r01*x221))+(((-1.0)*cj3*new_r00))));
2949sj5array[0]=IKsin(j5array[0]);
2950cj5array[0]=IKcos(j5array[0]);
2951if( j5array[0] > IKPI )
2952{
2953 j5array[0]-=IK2PI;
2954}
2955else if( j5array[0] < -IKPI )
2956{ j5array[0]+=IK2PI;
2957}
2958j5valid[0] = true;
2959for(int ij5 = 0; ij5 < 1; ++ij5)
2960{
2961if( !j5valid[ij5] )
2962{
2963 continue;
2964}
2965_ij5[0] = ij5; _ij5[1] = -1;
2966for(int iij5 = ij5+1; iij5 < 1; ++iij5)
2967{
2968if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
2969{
2970 j5valid[iij5]=false; _ij5[1] = iij5; break;
2971}
2972}
2973j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
2974{
2975IkReal evalcond[8];
2976IkReal x222=IKcos(j5);
2977IkReal x223=IKsin(j5);
2978IkReal x224=((1.0)*cj3);
2979IkReal x225=(sj3*x222);
2980IkReal x226=((1.0)*x223);
2981IkReal x227=(x223*x224);
2982evalcond[0]=(((new_r10*sj3))+x222+((cj3*new_r00)));
2983evalcond[1]=((((-1.0)*new_r10*x224))+((new_r00*sj3))+x223);
2984evalcond[2]=((((-1.0)*new_r11*x224))+((new_r01*sj3))+x222);
2985evalcond[3]=(((new_r11*sj3))+((cj3*new_r01))+(((-1.0)*x226)));
2986evalcond[4]=(((cj3*x222))+((sj3*x223))+new_r00);
2987evalcond[5]=(x225+new_r01+(((-1.0)*x227)));
2988evalcond[6]=(x225+new_r10+(((-1.0)*x227)));
2989evalcond[7]=((((-1.0)*x222*x224))+(((-1.0)*sj3*x226))+new_r11);
2990if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
2991{
2992continue;
2993}
2994}
2995
2996{
2997std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
2998vinfos[0].jointtype = 1;
2999vinfos[0].foffset = j0;
3000vinfos[0].indices[0] = _ij0[0];
3001vinfos[0].indices[1] = _ij0[1];
3002vinfos[0].maxsolutions = _nj0;
3003vinfos[1].jointtype = 1;
3004vinfos[1].foffset = j1;
3005vinfos[1].indices[0] = _ij1[0];
3006vinfos[1].indices[1] = _ij1[1];
3007vinfos[1].maxsolutions = _nj1;
3008vinfos[2].jointtype = 1;
3009vinfos[2].foffset = j2;
3010vinfos[2].indices[0] = _ij2[0];
3011vinfos[2].indices[1] = _ij2[1];
3012vinfos[2].maxsolutions = _nj2;
3013vinfos[3].jointtype = 1;
3014vinfos[3].foffset = j3;
3015vinfos[3].indices[0] = _ij3[0];
3016vinfos[3].indices[1] = _ij3[1];
3017vinfos[3].maxsolutions = _nj3;
3018vinfos[4].jointtype = 1;
3019vinfos[4].foffset = j4;
3020vinfos[4].indices[0] = _ij4[0];
3021vinfos[4].indices[1] = _ij4[1];
3022vinfos[4].maxsolutions = _nj4;
3023vinfos[5].jointtype = 1;
3024vinfos[5].foffset = j5;
3025vinfos[5].indices[0] = _ij5[0];
3026vinfos[5].indices[1] = _ij5[1];
3027vinfos[5].maxsolutions = _nj5;
3028std::vector<int> vfree(0);
3029solutions.AddSolution(vinfos,vfree);
3030}
3031}
3032}
3033
3034}
3035} while(0);
3036if( bgotonextstatement )
3037{
3038bool bgotonextstatement = true;
3039do
3040{
3041evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j3)))), 6.28318530717959)));
3042evalcond[1]=new_r02;
3043if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
3044{
3045bgotonextstatement=false;
3046{
3047IkReal j5array[1], cj5array[1], sj5array[1];
3048bool j5valid[1]={false};
3049_nj5 = 1;
3050if( IKabs(((-1.0)*new_r00)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r00))+IKsqr(((-1.0)*new_r01))-1) <= IKFAST_SINCOS_THRESH )
3051 continue;
3052j5array[0]=IKatan2(((-1.0)*new_r00), ((-1.0)*new_r01));
3053sj5array[0]=IKsin(j5array[0]);
3054cj5array[0]=IKcos(j5array[0]);
3055if( j5array[0] > IKPI )
3056{
3057 j5array[0]-=IK2PI;
3058}
3059else if( j5array[0] < -IKPI )
3060{ j5array[0]+=IK2PI;
3061}
3062j5valid[0] = true;
3063for(int ij5 = 0; ij5 < 1; ++ij5)
3064{
3065if( !j5valid[ij5] )
3066{
3067 continue;
3068}
3069_ij5[0] = ij5; _ij5[1] = -1;
3070for(int iij5 = ij5+1; iij5 < 1; ++iij5)
3071{
3072if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
3073{
3074 j5valid[iij5]=false; _ij5[1] = iij5; break;
3075}
3076}
3077j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
3078{
3079IkReal evalcond[8];
3080IkReal x228=IKsin(j5);
3081IkReal x229=IKcos(j5);
3082IkReal x230=((1.0)*cj4);
3083IkReal x231=((1.0)*sj4);
3084evalcond[0]=(x228+new_r00);
3085evalcond[1]=(x229+new_r01);
3086evalcond[2]=(((sj4*x228))+new_r21);
3087evalcond[3]=(((cj4*x228))+new_r11);
3088evalcond[4]=(new_r20+(((-1.0)*x229*x231)));
3089evalcond[5]=(new_r10+(((-1.0)*x229*x230)));
3090evalcond[6]=((((-1.0)*new_r20*x231))+x229+(((-1.0)*new_r10*x230)));
3091evalcond[7]=((((-1.0)*new_r21*x231))+(((-1.0)*new_r11*x230))+(((-1.0)*x228)));
3092if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
3093{
3094continue;
3095}
3096}
3097
3098{
3099std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
3100vinfos[0].jointtype = 1;
3101vinfos[0].foffset = j0;
3102vinfos[0].indices[0] = _ij0[0];
3103vinfos[0].indices[1] = _ij0[1];
3104vinfos[0].maxsolutions = _nj0;
3105vinfos[1].jointtype = 1;
3106vinfos[1].foffset = j1;
3107vinfos[1].indices[0] = _ij1[0];
3108vinfos[1].indices[1] = _ij1[1];
3109vinfos[1].maxsolutions = _nj1;
3110vinfos[2].jointtype = 1;
3111vinfos[2].foffset = j2;
3112vinfos[2].indices[0] = _ij2[0];
3113vinfos[2].indices[1] = _ij2[1];
3114vinfos[2].maxsolutions = _nj2;
3115vinfos[3].jointtype = 1;
3116vinfos[3].foffset = j3;
3117vinfos[3].indices[0] = _ij3[0];
3118vinfos[3].indices[1] = _ij3[1];
3119vinfos[3].maxsolutions = _nj3;
3120vinfos[4].jointtype = 1;
3121vinfos[4].foffset = j4;
3122vinfos[4].indices[0] = _ij4[0];
3123vinfos[4].indices[1] = _ij4[1];
3124vinfos[4].maxsolutions = _nj4;
3125vinfos[5].jointtype = 1;
3126vinfos[5].foffset = j5;
3127vinfos[5].indices[0] = _ij5[0];
3128vinfos[5].indices[1] = _ij5[1];
3129vinfos[5].maxsolutions = _nj5;
3130std::vector<int> vfree(0);
3131solutions.AddSolution(vinfos,vfree);
3132}
3133}
3134}
3135
3136}
3137} while(0);
3138if( bgotonextstatement )
3139{
3140bool bgotonextstatement = true;
3141do
3142{
3143evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j3)))), 6.28318530717959)));
3144evalcond[1]=new_r02;
3145if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
3146{
3147bgotonextstatement=false;
3148{
3149IkReal j5array[1], cj5array[1], sj5array[1];
3150bool j5valid[1]={false};
3151_nj5 = 1;
3153 continue;
3154j5array[0]=IKatan2(new_r00, new_r01);
3155sj5array[0]=IKsin(j5array[0]);
3156cj5array[0]=IKcos(j5array[0]);
3157if( j5array[0] > IKPI )
3158{
3159 j5array[0]-=IK2PI;
3160}
3161else if( j5array[0] < -IKPI )
3162{ j5array[0]+=IK2PI;
3163}
3164j5valid[0] = true;
3165for(int ij5 = 0; ij5 < 1; ++ij5)
3166{
3167if( !j5valid[ij5] )
3168{
3169 continue;
3170}
3171_ij5[0] = ij5; _ij5[1] = -1;
3172for(int iij5 = ij5+1; iij5 < 1; ++iij5)
3173{
3174if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
3175{
3176 j5valid[iij5]=false; _ij5[1] = iij5; break;
3177}
3178}
3179j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
3180{
3181IkReal evalcond[8];
3182IkReal x232=IKsin(j5);
3183IkReal x233=IKcos(j5);
3184IkReal x234=((1.0)*sj4);
3185IkReal x235=((1.0)*x233);
3186evalcond[0]=(((sj4*x232))+new_r21);
3187evalcond[1]=(x232+(((-1.0)*new_r00)));
3188evalcond[2]=(x233+(((-1.0)*new_r01)));
3189evalcond[3]=((((-1.0)*x233*x234))+new_r20);
3190evalcond[4]=(((cj4*x232))+(((-1.0)*new_r11)));
3191evalcond[5]=((((-1.0)*cj4*x235))+(((-1.0)*new_r10)));
3192evalcond[6]=((((-1.0)*new_r20*x234))+((cj4*new_r10))+x233);
3193evalcond[7]=((((-1.0)*new_r21*x234))+((cj4*new_r11))+(((-1.0)*x232)));
3194if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
3195{
3196continue;
3197}
3198}
3199
3200{
3201std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
3202vinfos[0].jointtype = 1;
3203vinfos[0].foffset = j0;
3204vinfos[0].indices[0] = _ij0[0];
3205vinfos[0].indices[1] = _ij0[1];
3206vinfos[0].maxsolutions = _nj0;
3207vinfos[1].jointtype = 1;
3208vinfos[1].foffset = j1;
3209vinfos[1].indices[0] = _ij1[0];
3210vinfos[1].indices[1] = _ij1[1];
3211vinfos[1].maxsolutions = _nj1;
3212vinfos[2].jointtype = 1;
3213vinfos[2].foffset = j2;
3214vinfos[2].indices[0] = _ij2[0];
3215vinfos[2].indices[1] = _ij2[1];
3216vinfos[2].maxsolutions = _nj2;
3217vinfos[3].jointtype = 1;
3218vinfos[3].foffset = j3;
3219vinfos[3].indices[0] = _ij3[0];
3220vinfos[3].indices[1] = _ij3[1];
3221vinfos[3].maxsolutions = _nj3;
3222vinfos[4].jointtype = 1;
3223vinfos[4].foffset = j4;
3224vinfos[4].indices[0] = _ij4[0];
3225vinfos[4].indices[1] = _ij4[1];
3226vinfos[4].maxsolutions = _nj4;
3227vinfos[5].jointtype = 1;
3228vinfos[5].foffset = j5;
3229vinfos[5].indices[0] = _ij5[0];
3230vinfos[5].indices[1] = _ij5[1];
3231vinfos[5].maxsolutions = _nj5;
3232std::vector<int> vfree(0);
3233solutions.AddSolution(vinfos,vfree);
3234}
3235}
3236}
3237
3238}
3239} while(0);
3240if( bgotonextstatement )
3241{
3242bool bgotonextstatement = true;
3243do
3244{
3245evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j3))), 6.28318530717959)));
3246evalcond[1]=new_r12;
3247if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
3248{
3249bgotonextstatement=false;
3250{
3251IkReal j5array[1], cj5array[1], sj5array[1];
3252bool j5valid[1]={false};
3253_nj5 = 1;
3255 continue;
3256j5array[0]=IKatan2(new_r10, new_r11);
3257sj5array[0]=IKsin(j5array[0]);
3258cj5array[0]=IKcos(j5array[0]);
3259if( j5array[0] > IKPI )
3260{
3261 j5array[0]-=IK2PI;
3262}
3263else if( j5array[0] < -IKPI )
3264{ j5array[0]+=IK2PI;
3265}
3266j5valid[0] = true;
3267for(int ij5 = 0; ij5 < 1; ++ij5)
3268{
3269if( !j5valid[ij5] )
3270{
3271 continue;
3272}
3273_ij5[0] = ij5; _ij5[1] = -1;
3274for(int iij5 = ij5+1; iij5 < 1; ++iij5)
3275{
3276if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
3277{
3278 j5valid[iij5]=false; _ij5[1] = iij5; break;
3279}
3280}
3281j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
3282{
3283IkReal evalcond[8];
3284IkReal x236=IKcos(j5);
3285IkReal x237=IKsin(j5);
3286IkReal x238=((1.0)*cj4);
3287IkReal x239=((1.0)*sj4);
3288IkReal x240=((1.0)*x237);
3289evalcond[0]=(((new_r02*x236))+new_r20);
3290evalcond[1]=(x237+(((-1.0)*new_r10)));
3291evalcond[2]=(x236+(((-1.0)*new_r11)));
3292evalcond[3]=(((cj4*x237))+new_r01);
3293evalcond[4]=((((-1.0)*new_r02*x240))+new_r21);
3294evalcond[5]=((((-1.0)*x236*x238))+new_r00);
3295evalcond[6]=((((-1.0)*new_r20*x239))+x236+(((-1.0)*new_r00*x238)));
3296evalcond[7]=((((-1.0)*new_r21*x239))+(((-1.0)*x240))+(((-1.0)*new_r01*x238)));
3297if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
3298{
3299continue;
3300}
3301}
3302
3303{
3304std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
3305vinfos[0].jointtype = 1;
3306vinfos[0].foffset = j0;
3307vinfos[0].indices[0] = _ij0[0];
3308vinfos[0].indices[1] = _ij0[1];
3309vinfos[0].maxsolutions = _nj0;
3310vinfos[1].jointtype = 1;
3311vinfos[1].foffset = j1;
3312vinfos[1].indices[0] = _ij1[0];
3313vinfos[1].indices[1] = _ij1[1];
3314vinfos[1].maxsolutions = _nj1;
3315vinfos[2].jointtype = 1;
3316vinfos[2].foffset = j2;
3317vinfos[2].indices[0] = _ij2[0];
3318vinfos[2].indices[1] = _ij2[1];
3319vinfos[2].maxsolutions = _nj2;
3320vinfos[3].jointtype = 1;
3321vinfos[3].foffset = j3;
3322vinfos[3].indices[0] = _ij3[0];
3323vinfos[3].indices[1] = _ij3[1];
3324vinfos[3].maxsolutions = _nj3;
3325vinfos[4].jointtype = 1;
3326vinfos[4].foffset = j4;
3327vinfos[4].indices[0] = _ij4[0];
3328vinfos[4].indices[1] = _ij4[1];
3329vinfos[4].maxsolutions = _nj4;
3330vinfos[5].jointtype = 1;
3331vinfos[5].foffset = j5;
3332vinfos[5].indices[0] = _ij5[0];
3333vinfos[5].indices[1] = _ij5[1];
3334vinfos[5].maxsolutions = _nj5;
3335std::vector<int> vfree(0);
3336solutions.AddSolution(vinfos,vfree);
3337}
3338}
3339}
3340
3341}
3342} while(0);
3343if( bgotonextstatement )
3344{
3345bool bgotonextstatement = true;
3346do
3347{
3348evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j3)))), 6.28318530717959)));
3349evalcond[1]=new_r12;
3350if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
3351{
3352bgotonextstatement=false;
3353{
3354IkReal j5array[1], cj5array[1], sj5array[1];
3355bool j5valid[1]={false};
3356_nj5 = 1;
3357if( IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r10))+IKsqr(((-1.0)*new_r11))-1) <= IKFAST_SINCOS_THRESH )
3358 continue;
3359j5array[0]=IKatan2(((-1.0)*new_r10), ((-1.0)*new_r11));
3360sj5array[0]=IKsin(j5array[0]);
3361cj5array[0]=IKcos(j5array[0]);
3362if( j5array[0] > IKPI )
3363{
3364 j5array[0]-=IK2PI;
3365}
3366else if( j5array[0] < -IKPI )
3367{ j5array[0]+=IK2PI;
3368}
3369j5valid[0] = true;
3370for(int ij5 = 0; ij5 < 1; ++ij5)
3371{
3372if( !j5valid[ij5] )
3373{
3374 continue;
3375}
3376_ij5[0] = ij5; _ij5[1] = -1;
3377for(int iij5 = ij5+1; iij5 < 1; ++iij5)
3378{
3379if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
3380{
3381 j5valid[iij5]=false; _ij5[1] = iij5; break;
3382}
3383}
3384j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
3385{
3386IkReal evalcond[8];
3387IkReal x241=IKsin(j5);
3388IkReal x242=IKcos(j5);
3389IkReal x243=((1.0)*sj4);
3390IkReal x244=((1.0)*x242);
3391evalcond[0]=(x241+new_r10);
3392evalcond[1]=(x242+new_r11);
3393evalcond[2]=(new_r21+((new_r02*x241)));
3394evalcond[3]=((((-1.0)*new_r02*x244))+new_r20);
3395evalcond[4]=(((cj4*x241))+(((-1.0)*new_r01)));
3396evalcond[5]=((((-1.0)*cj4*x244))+(((-1.0)*new_r00)));
3397evalcond[6]=(((cj4*new_r00))+x242+(((-1.0)*new_r20*x243)));
3398evalcond[7]=(((cj4*new_r01))+(((-1.0)*x241))+(((-1.0)*new_r21*x243)));
3399if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
3400{
3401continue;
3402}
3403}
3404
3405{
3406std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
3407vinfos[0].jointtype = 1;
3408vinfos[0].foffset = j0;
3409vinfos[0].indices[0] = _ij0[0];
3410vinfos[0].indices[1] = _ij0[1];
3411vinfos[0].maxsolutions = _nj0;
3412vinfos[1].jointtype = 1;
3413vinfos[1].foffset = j1;
3414vinfos[1].indices[0] = _ij1[0];
3415vinfos[1].indices[1] = _ij1[1];
3416vinfos[1].maxsolutions = _nj1;
3417vinfos[2].jointtype = 1;
3418vinfos[2].foffset = j2;
3419vinfos[2].indices[0] = _ij2[0];
3420vinfos[2].indices[1] = _ij2[1];
3421vinfos[2].maxsolutions = _nj2;
3422vinfos[3].jointtype = 1;
3423vinfos[3].foffset = j3;
3424vinfos[3].indices[0] = _ij3[0];
3425vinfos[3].indices[1] = _ij3[1];
3426vinfos[3].maxsolutions = _nj3;
3427vinfos[4].jointtype = 1;
3428vinfos[4].foffset = j4;
3429vinfos[4].indices[0] = _ij4[0];
3430vinfos[4].indices[1] = _ij4[1];
3431vinfos[4].maxsolutions = _nj4;
3432vinfos[5].jointtype = 1;
3433vinfos[5].foffset = j5;
3434vinfos[5].indices[0] = _ij5[0];
3435vinfos[5].indices[1] = _ij5[1];
3436vinfos[5].maxsolutions = _nj5;
3437std::vector<int> vfree(0);
3438solutions.AddSolution(vinfos,vfree);
3439}
3440}
3441}
3442
3443}
3444} while(0);
3445if( bgotonextstatement )
3446{
3447bool bgotonextstatement = true;
3448do
3449{
3450evalcond[0]=((IKabs(new_r20))+(IKabs(new_r21)));
3451if( IKabs(evalcond[0]) < 0.0000050000000000 )
3452{
3453bgotonextstatement=false;
3454{
3455IkReal j5eval[1];
3456new_r21=0;
3457new_r20=0;
3458new_r02=0;
3459new_r12=0;
3460j5eval[0]=1.0;
3461if( IKabs(j5eval[0]) < 0.0000000100000000 )
3462{
3463continue; // no branches [j5]
3464
3465} else
3466{
3467IkReal op[2+1], zeror[2];
3468int numroots;
3469op[0]=-1.0;
3470op[1]=0;
3471op[2]=1.0;
3472polyroots2(op,zeror,numroots);
3473IkReal j5array[2], cj5array[2], sj5array[2], tempj5array[1];
3474int numsolutions = 0;
3475for(int ij5 = 0; ij5 < numroots; ++ij5)
3476{
3477IkReal htj5 = zeror[ij5];
3478tempj5array[0]=((2.0)*(atan(htj5)));
3479for(int kj5 = 0; kj5 < 1; ++kj5)
3480{
3481j5array[numsolutions] = tempj5array[kj5];
3482if( j5array[numsolutions] > IKPI )
3483{
3484 j5array[numsolutions]-=IK2PI;
3485}
3486else if( j5array[numsolutions] < -IKPI )
3487{
3488 j5array[numsolutions]+=IK2PI;
3489}
3490sj5array[numsolutions] = IKsin(j5array[numsolutions]);
3491cj5array[numsolutions] = IKcos(j5array[numsolutions]);
3492numsolutions++;
3493}
3494}
3495bool j5valid[2]={true,true};
3496_nj5 = 2;
3497for(int ij5 = 0; ij5 < numsolutions; ++ij5)
3498 {
3499if( !j5valid[ij5] )
3500{
3501 continue;
3502}
3503 j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
3504htj5 = IKtan(j5/2);
3505
3506_ij5[0] = ij5; _ij5[1] = -1;
3507for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5)
3508{
3509if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
3510{
3511 j5valid[iij5]=false; _ij5[1] = iij5; break;
3512}
3513}
3514{
3515std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
3516vinfos[0].jointtype = 1;
3517vinfos[0].foffset = j0;
3518vinfos[0].indices[0] = _ij0[0];
3519vinfos[0].indices[1] = _ij0[1];
3520vinfos[0].maxsolutions = _nj0;
3521vinfos[1].jointtype = 1;
3522vinfos[1].foffset = j1;
3523vinfos[1].indices[0] = _ij1[0];
3524vinfos[1].indices[1] = _ij1[1];
3525vinfos[1].maxsolutions = _nj1;
3526vinfos[2].jointtype = 1;
3527vinfos[2].foffset = j2;
3528vinfos[2].indices[0] = _ij2[0];
3529vinfos[2].indices[1] = _ij2[1];
3530vinfos[2].maxsolutions = _nj2;
3531vinfos[3].jointtype = 1;
3532vinfos[3].foffset = j3;
3533vinfos[3].indices[0] = _ij3[0];
3534vinfos[3].indices[1] = _ij3[1];
3535vinfos[3].maxsolutions = _nj3;
3536vinfos[4].jointtype = 1;
3537vinfos[4].foffset = j4;
3538vinfos[4].indices[0] = _ij4[0];
3539vinfos[4].indices[1] = _ij4[1];
3540vinfos[4].maxsolutions = _nj4;
3541vinfos[5].jointtype = 1;
3542vinfos[5].foffset = j5;
3543vinfos[5].indices[0] = _ij5[0];
3544vinfos[5].indices[1] = _ij5[1];
3545vinfos[5].maxsolutions = _nj5;
3546std::vector<int> vfree(0);
3547solutions.AddSolution(vinfos,vfree);
3548}
3549 }
3550
3551}
3552
3553}
3554
3555}
3556} while(0);
3557if( bgotonextstatement )
3558{
3559bool bgotonextstatement = true;
3560do
3561{
3562if( 1 )
3563{
3564bgotonextstatement=false;
3565continue; // branch miss [j5]
3566
3567}
3568} while(0);
3569if( bgotonextstatement )
3570{
3571}
3572}
3573}
3574}
3575}
3576}
3577}
3578}
3579}
3580
3581} else
3582{
3583{
3584IkReal j5array[1], cj5array[1], sj5array[1];
3585bool j5valid[1]={false};
3586_nj5 = 1;
3588if(!x246.valid){
3589continue;
3590}
3591IkReal x245=x246.value;
3593if(!x247.valid){
3594continue;
3595}
3596if( IKabs(((-1.0)*new_r21*x245)) < IKFAST_ATAN2_MAGTHRESH && IKabs((x245*(x247.value)*((((new_r11*sj4))+(((-1.0)*cj4*new_r21*sj3)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21*x245))+IKsqr((x245*(x247.value)*((((new_r11*sj4))+(((-1.0)*cj4*new_r21*sj3))))))-1) <= IKFAST_SINCOS_THRESH )
3597 continue;
3598j5array[0]=IKatan2(((-1.0)*new_r21*x245), (x245*(x247.value)*((((new_r11*sj4))+(((-1.0)*cj4*new_r21*sj3))))));
3599sj5array[0]=IKsin(j5array[0]);
3600cj5array[0]=IKcos(j5array[0]);
3601if( j5array[0] > IKPI )
3602{
3603 j5array[0]-=IK2PI;
3604}
3605else if( j5array[0] < -IKPI )
3606{ j5array[0]+=IK2PI;
3607}
3608j5valid[0] = true;
3609for(int ij5 = 0; ij5 < 1; ++ij5)
3610{
3611if( !j5valid[ij5] )
3612{
3613 continue;
3614}
3615_ij5[0] = ij5; _ij5[1] = -1;
3616for(int iij5 = ij5+1; iij5 < 1; ++iij5)
3617{
3618if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
3619{
3620 j5valid[iij5]=false; _ij5[1] = iij5; break;
3621}
3622}
3623j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
3624{
3625IkReal evalcond[12];
3626IkReal x248=IKsin(j5);
3627IkReal x249=IKcos(j5);
3628IkReal x250=(cj3*new_r00);
3629IkReal x251=(cj3*cj4);
3630IkReal x252=((1.0)*cj3);
3631IkReal x253=(new_r11*sj3);
3632IkReal x254=((1.0)*cj4);
3633IkReal x255=(new_r10*sj3);
3634IkReal x256=((1.0)*sj4);
3635IkReal x257=(sj3*x248);
3636IkReal x258=((1.0)*x249);
3637IkReal x259=(sj3*x249);
3638evalcond[0]=(new_r21+((sj4*x248)));
3639evalcond[1]=((((-1.0)*x249*x256))+new_r20);
3640evalcond[2]=((((-1.0)*new_r10*x252))+((new_r00*sj3))+x248);
3641evalcond[3]=((((-1.0)*new_r11*x252))+((new_r01*sj3))+x249);
3642evalcond[4]=(((cj4*x248))+x253+((cj3*new_r01)));
3643evalcond[5]=(((x248*x251))+x259+new_r01);
3644evalcond[6]=(x255+x250+(((-1.0)*x249*x254)));
3645evalcond[7]=((((-1.0)*x251*x258))+x257+new_r00);
3646evalcond[8]=((((-1.0)*x249*x252))+new_r11+((cj4*x257)));
3647evalcond[9]=((((-1.0)*x254*x259))+(((-1.0)*x248*x252))+new_r10);
3648evalcond[10]=((((-1.0)*x250*x254))+(((-1.0)*x254*x255))+x249+(((-1.0)*new_r20*x256)));
3649evalcond[11]=((((-1.0)*new_r21*x256))+(((-1.0)*x248))+(((-1.0)*x253*x254))+(((-1.0)*new_r01*x251)));
3650if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH )
3651{
3652continue;
3653}
3654}
3655
3656{
3657std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
3658vinfos[0].jointtype = 1;
3659vinfos[0].foffset = j0;
3660vinfos[0].indices[0] = _ij0[0];
3661vinfos[0].indices[1] = _ij0[1];
3662vinfos[0].maxsolutions = _nj0;
3663vinfos[1].jointtype = 1;
3664vinfos[1].foffset = j1;
3665vinfos[1].indices[0] = _ij1[0];
3666vinfos[1].indices[1] = _ij1[1];
3667vinfos[1].maxsolutions = _nj1;
3668vinfos[2].jointtype = 1;
3669vinfos[2].foffset = j2;
3670vinfos[2].indices[0] = _ij2[0];
3671vinfos[2].indices[1] = _ij2[1];
3672vinfos[2].maxsolutions = _nj2;
3673vinfos[3].jointtype = 1;
3674vinfos[3].foffset = j3;
3675vinfos[3].indices[0] = _ij3[0];
3676vinfos[3].indices[1] = _ij3[1];
3677vinfos[3].maxsolutions = _nj3;
3678vinfos[4].jointtype = 1;
3679vinfos[4].foffset = j4;
3680vinfos[4].indices[0] = _ij4[0];
3681vinfos[4].indices[1] = _ij4[1];
3682vinfos[4].maxsolutions = _nj4;
3683vinfos[5].jointtype = 1;
3684vinfos[5].foffset = j5;
3685vinfos[5].indices[0] = _ij5[0];
3686vinfos[5].indices[1] = _ij5[1];
3687vinfos[5].maxsolutions = _nj5;
3688std::vector<int> vfree(0);
3689solutions.AddSolution(vinfos,vfree);
3690}
3691}
3692}
3693
3694}
3695
3696}
3697
3698} else
3699{
3700{
3701IkReal j5array[1], cj5array[1], sj5array[1];
3702bool j5valid[1]={false};
3703_nj5 = 1;
3705if(!x261.valid){
3706continue;
3707}
3708IkReal x260=x261.value;
3710if(!x262.valid){
3711continue;
3712}
3713if( IKabs(((-1.0)*new_r21*x260)) < IKFAST_ATAN2_MAGTHRESH && IKabs((x260*(x262.value)*(((((-1.0)*new_r01*sj4))+((cj3*cj4*new_r21)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21*x260))+IKsqr((x260*(x262.value)*(((((-1.0)*new_r01*sj4))+((cj3*cj4*new_r21))))))-1) <= IKFAST_SINCOS_THRESH )
3714 continue;
3715j5array[0]=IKatan2(((-1.0)*new_r21*x260), (x260*(x262.value)*(((((-1.0)*new_r01*sj4))+((cj3*cj4*new_r21))))));
3716sj5array[0]=IKsin(j5array[0]);
3717cj5array[0]=IKcos(j5array[0]);
3718if( j5array[0] > IKPI )
3719{
3720 j5array[0]-=IK2PI;
3721}
3722else if( j5array[0] < -IKPI )
3723{ j5array[0]+=IK2PI;
3724}
3725j5valid[0] = true;
3726for(int ij5 = 0; ij5 < 1; ++ij5)
3727{
3728if( !j5valid[ij5] )
3729{
3730 continue;
3731}
3732_ij5[0] = ij5; _ij5[1] = -1;
3733for(int iij5 = ij5+1; iij5 < 1; ++iij5)
3734{
3735if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
3736{
3737 j5valid[iij5]=false; _ij5[1] = iij5; break;
3738}
3739}
3740j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
3741{
3742IkReal evalcond[12];
3743IkReal x263=IKsin(j5);
3744IkReal x264=IKcos(j5);
3745IkReal x265=(cj3*new_r00);
3746IkReal x266=(cj3*cj4);
3747IkReal x267=((1.0)*cj3);
3748IkReal x268=(new_r11*sj3);
3749IkReal x269=((1.0)*cj4);
3750IkReal x270=(new_r10*sj3);
3751IkReal x271=((1.0)*sj4);
3752IkReal x272=(sj3*x263);
3753IkReal x273=((1.0)*x264);
3754IkReal x274=(sj3*x264);
3755evalcond[0]=(new_r21+((sj4*x263)));
3756evalcond[1]=(new_r20+(((-1.0)*x264*x271)));
3757evalcond[2]=(((new_r00*sj3))+x263+(((-1.0)*new_r10*x267)));
3758evalcond[3]=(((new_r01*sj3))+x264+(((-1.0)*new_r11*x267)));
3759evalcond[4]=(((cj4*x263))+x268+((cj3*new_r01)));
3760evalcond[5]=(((x263*x266))+x274+new_r01);
3761evalcond[6]=(x265+x270+(((-1.0)*x264*x269)));
3762evalcond[7]=(x272+(((-1.0)*x266*x273))+new_r00);
3763evalcond[8]=(((cj4*x272))+new_r11+(((-1.0)*x264*x267)));
3764evalcond[9]=((((-1.0)*x263*x267))+(((-1.0)*x269*x274))+new_r10);
3765evalcond[10]=((((-1.0)*x269*x270))+x264+(((-1.0)*new_r20*x271))+(((-1.0)*x265*x269)));
3766evalcond[11]=((((-1.0)*x263))+(((-1.0)*new_r01*x266))+(((-1.0)*new_r21*x271))+(((-1.0)*x268*x269)));
3767if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH )
3768{
3769continue;
3770}
3771}
3772
3773{
3774std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
3775vinfos[0].jointtype = 1;
3776vinfos[0].foffset = j0;
3777vinfos[0].indices[0] = _ij0[0];
3778vinfos[0].indices[1] = _ij0[1];
3779vinfos[0].maxsolutions = _nj0;
3780vinfos[1].jointtype = 1;
3781vinfos[1].foffset = j1;
3782vinfos[1].indices[0] = _ij1[0];
3783vinfos[1].indices[1] = _ij1[1];
3784vinfos[1].maxsolutions = _nj1;
3785vinfos[2].jointtype = 1;
3786vinfos[2].foffset = j2;
3787vinfos[2].indices[0] = _ij2[0];
3788vinfos[2].indices[1] = _ij2[1];
3789vinfos[2].maxsolutions = _nj2;
3790vinfos[3].jointtype = 1;
3791vinfos[3].foffset = j3;
3792vinfos[3].indices[0] = _ij3[0];
3793vinfos[3].indices[1] = _ij3[1];
3794vinfos[3].maxsolutions = _nj3;
3795vinfos[4].jointtype = 1;
3796vinfos[4].foffset = j4;
3797vinfos[4].indices[0] = _ij4[0];
3798vinfos[4].indices[1] = _ij4[1];
3799vinfos[4].maxsolutions = _nj4;
3800vinfos[5].jointtype = 1;
3801vinfos[5].foffset = j5;
3802vinfos[5].indices[0] = _ij5[0];
3803vinfos[5].indices[1] = _ij5[1];
3804vinfos[5].maxsolutions = _nj5;
3805std::vector<int> vfree(0);
3806solutions.AddSolution(vinfos,vfree);
3807}
3808}
3809}
3810
3811}
3812
3813}
3814
3815} else
3816{
3817{
3818IkReal j5array[1], cj5array[1], sj5array[1];
3819bool j5valid[1]={false};
3820_nj5 = 1;
3822if(!x275.valid){
3823continue;
3824}
3826if(!x276.valid){
3827continue;
3828}
3829j5array[0]=((-1.5707963267949)+(x275.value)+(((1.5707963267949)*(x276.value))));
3830sj5array[0]=IKsin(j5array[0]);
3831cj5array[0]=IKcos(j5array[0]);
3832if( j5array[0] > IKPI )
3833{
3834 j5array[0]-=IK2PI;
3835}
3836else if( j5array[0] < -IKPI )
3837{ j5array[0]+=IK2PI;
3838}
3839j5valid[0] = true;
3840for(int ij5 = 0; ij5 < 1; ++ij5)
3841{
3842if( !j5valid[ij5] )
3843{
3844 continue;
3845}
3846_ij5[0] = ij5; _ij5[1] = -1;
3847for(int iij5 = ij5+1; iij5 < 1; ++iij5)
3848{
3849if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
3850{
3851 j5valid[iij5]=false; _ij5[1] = iij5; break;
3852}
3853}
3854j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
3855{
3856IkReal evalcond[12];
3857IkReal x277=IKsin(j5);
3858IkReal x278=IKcos(j5);
3859IkReal x279=(cj3*new_r00);
3860IkReal x280=(cj3*cj4);
3861IkReal x281=((1.0)*cj3);
3862IkReal x282=(new_r11*sj3);
3863IkReal x283=((1.0)*cj4);
3864IkReal x284=(new_r10*sj3);
3865IkReal x285=((1.0)*sj4);
3866IkReal x286=(sj3*x277);
3867IkReal x287=((1.0)*x278);
3868IkReal x288=(sj3*x278);
3869evalcond[0]=(new_r21+((sj4*x277)));
3870evalcond[1]=(new_r20+(((-1.0)*x278*x285)));
3871evalcond[2]=(((new_r00*sj3))+x277+(((-1.0)*new_r10*x281)));
3872evalcond[3]=(((new_r01*sj3))+x278+(((-1.0)*new_r11*x281)));
3873evalcond[4]=(((cj4*x277))+x282+((cj3*new_r01)));
3874evalcond[5]=(x288+new_r01+((x277*x280)));
3875evalcond[6]=(x279+x284+(((-1.0)*x278*x283)));
3876evalcond[7]=((((-1.0)*x280*x287))+x286+new_r00);
3877evalcond[8]=(new_r11+((cj4*x286))+(((-1.0)*x278*x281)));
3878evalcond[9]=((((-1.0)*x277*x281))+new_r10+(((-1.0)*x283*x288)));
3879evalcond[10]=(x278+(((-1.0)*new_r20*x285))+(((-1.0)*x279*x283))+(((-1.0)*x283*x284)));
3880evalcond[11]=((((-1.0)*x277))+(((-1.0)*x282*x283))+(((-1.0)*new_r01*x280))+(((-1.0)*new_r21*x285)));
3881if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH )
3882{
3883continue;
3884}
3885}
3886
3887{
3888std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
3889vinfos[0].jointtype = 1;
3890vinfos[0].foffset = j0;
3891vinfos[0].indices[0] = _ij0[0];
3892vinfos[0].indices[1] = _ij0[1];
3893vinfos[0].maxsolutions = _nj0;
3894vinfos[1].jointtype = 1;
3895vinfos[1].foffset = j1;
3896vinfos[1].indices[0] = _ij1[0];
3897vinfos[1].indices[1] = _ij1[1];
3898vinfos[1].maxsolutions = _nj1;
3899vinfos[2].jointtype = 1;
3900vinfos[2].foffset = j2;
3901vinfos[2].indices[0] = _ij2[0];
3902vinfos[2].indices[1] = _ij2[1];
3903vinfos[2].maxsolutions = _nj2;
3904vinfos[3].jointtype = 1;
3905vinfos[3].foffset = j3;
3906vinfos[3].indices[0] = _ij3[0];
3907vinfos[3].indices[1] = _ij3[1];
3908vinfos[3].maxsolutions = _nj3;
3909vinfos[4].jointtype = 1;
3910vinfos[4].foffset = j4;
3911vinfos[4].indices[0] = _ij4[0];
3912vinfos[4].indices[1] = _ij4[1];
3913vinfos[4].maxsolutions = _nj4;
3914vinfos[5].jointtype = 1;
3915vinfos[5].foffset = j5;
3916vinfos[5].indices[0] = _ij5[0];
3917vinfos[5].indices[1] = _ij5[1];
3918vinfos[5].maxsolutions = _nj5;
3919std::vector<int> vfree(0);
3920solutions.AddSolution(vinfos,vfree);
3921}
3922}
3923}
3924
3925}
3926
3927}
3928}
3929}
3930
3931}
3932
3933}
3934
3935} else
3936{
3937{
3938IkReal j3array[1], cj3array[1], sj3array[1];
3939bool j3valid[1]={false};
3940_nj3 = 1;
3942if(!x289.valid){
3943continue;
3944}
3945CheckValue<IkReal> x290 = IKatan2WithCheck(IkReal(((-1.0)*new_r12)),IkReal(((-1.0)*new_r02)),IKFAST_ATAN2_MAGTHRESH);
3946if(!x290.valid){
3947continue;
3948}
3949j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x289.value)))+(x290.value));
3950sj3array[0]=IKsin(j3array[0]);
3951cj3array[0]=IKcos(j3array[0]);
3952if( j3array[0] > IKPI )
3953{
3954 j3array[0]-=IK2PI;
3955}
3956else if( j3array[0] < -IKPI )
3957{ j3array[0]+=IK2PI;
3958}
3959j3valid[0] = true;
3960for(int ij3 = 0; ij3 < 1; ++ij3)
3961{
3962if( !j3valid[ij3] )
3963{
3964 continue;
3965}
3966_ij3[0] = ij3; _ij3[1] = -1;
3967for(int iij3 = ij3+1; iij3 < 1; ++iij3)
3968{
3969if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
3970{
3971 j3valid[iij3]=false; _ij3[1] = iij3; break;
3972}
3973}
3974j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
3975{
3976IkReal evalcond[8];
3977IkReal x291=IKcos(j3);
3978IkReal x292=IKsin(j3);
3979IkReal x293=((1.0)*cj4);
3980IkReal x294=(sj4*x292);
3981IkReal x295=(new_r12*x292);
3982IkReal x296=(sj4*x291);
3983IkReal x297=(new_r02*x291);
3984evalcond[0]=(x296+new_r02);
3985evalcond[1]=(x294+new_r12);
3986evalcond[2]=(((new_r12*x291))+(((-1.0)*new_r02*x292)));
3987evalcond[3]=(sj4+x295+x297);
3988evalcond[4]=((((-1.0)*new_r20*x293))+((new_r10*x294))+((new_r00*x296)));
3989evalcond[5]=((((-1.0)*new_r21*x293))+((new_r11*x294))+((new_r01*x296)));
3990evalcond[6]=((1.0)+((new_r02*x296))+((new_r12*x294))+(((-1.0)*new_r22*x293)));
3991evalcond[7]=((((-1.0)*x293*x297))+(((-1.0)*x293*x295))+(((-1.0)*new_r22*sj4)));
3992if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
3993{
3994continue;
3995}
3996}
3997
3998{
3999IkReal j5eval[3];
4000j5eval[0]=sj4;
4001j5eval[1]=IKsign(sj4);
4002j5eval[2]=((IKabs(new_r20))+(IKabs(new_r21)));
4003if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 )
4004{
4005{
4006IkReal j5eval[2];
4007j5eval[0]=sj4;
4008j5eval[1]=sj3;
4009if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 )
4010{
4011{
4012IkReal j5eval[2];
4013j5eval[0]=sj4;
4014j5eval[1]=cj3;
4015if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 )
4016{
4017{
4018IkReal evalcond[5];
4019bool bgotonextstatement = true;
4020do
4021{
4022evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j4))), 6.28318530717959)));
4023evalcond[1]=new_r02;
4024evalcond[2]=new_r12;
4025evalcond[3]=new_r21;
4026evalcond[4]=new_r20;
4027if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
4028{
4029bgotonextstatement=false;
4030{
4031IkReal j5array[1], cj5array[1], sj5array[1];
4032bool j5valid[1]={false};
4033_nj5 = 1;
4034IkReal x298=((1.0)*new_r01);
4035if( IKabs(((((-1.0)*cj3*x298))+(((-1.0)*new_r00*sj3)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*sj3*x298))+((cj3*new_r00)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*cj3*x298))+(((-1.0)*new_r00*sj3))))+IKsqr(((((-1.0)*sj3*x298))+((cj3*new_r00))))-1) <= IKFAST_SINCOS_THRESH )
4036 continue;
4037j5array[0]=IKatan2(((((-1.0)*cj3*x298))+(((-1.0)*new_r00*sj3))), ((((-1.0)*sj3*x298))+((cj3*new_r00))));
4038sj5array[0]=IKsin(j5array[0]);
4039cj5array[0]=IKcos(j5array[0]);
4040if( j5array[0] > IKPI )
4041{
4042 j5array[0]-=IK2PI;
4043}
4044else if( j5array[0] < -IKPI )
4045{ j5array[0]+=IK2PI;
4046}
4047j5valid[0] = true;
4048for(int ij5 = 0; ij5 < 1; ++ij5)
4049{
4050if( !j5valid[ij5] )
4051{
4052 continue;
4053}
4054_ij5[0] = ij5; _ij5[1] = -1;
4055for(int iij5 = ij5+1; iij5 < 1; ++iij5)
4056{
4057if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
4058{
4059 j5valid[iij5]=false; _ij5[1] = iij5; break;
4060}
4061}
4062j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
4063{
4064IkReal evalcond[8];
4065IkReal x299=IKsin(j5);
4066IkReal x300=IKcos(j5);
4067IkReal x301=((1.0)*cj3);
4068IkReal x302=(sj3*x299);
4069IkReal x303=((1.0)*x300);
4070IkReal x304=(x300*x301);
4071evalcond[0]=(((new_r11*sj3))+x299+((cj3*new_r01)));
4072evalcond[1]=(((new_r00*sj3))+x299+(((-1.0)*new_r10*x301)));
4073evalcond[2]=(((new_r01*sj3))+x300+(((-1.0)*new_r11*x301)));
4074evalcond[3]=(((cj3*x299))+((sj3*x300))+new_r01);
4075evalcond[4]=(((new_r10*sj3))+((cj3*new_r00))+(((-1.0)*x303)));
4076evalcond[5]=(x302+new_r00+(((-1.0)*x304)));
4077evalcond[6]=(x302+new_r11+(((-1.0)*x304)));
4078evalcond[7]=((((-1.0)*sj3*x303))+(((-1.0)*x299*x301))+new_r10);
4079if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
4080{
4081continue;
4082}
4083}
4084
4085{
4086std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
4087vinfos[0].jointtype = 1;
4088vinfos[0].foffset = j0;
4089vinfos[0].indices[0] = _ij0[0];
4090vinfos[0].indices[1] = _ij0[1];
4091vinfos[0].maxsolutions = _nj0;
4092vinfos[1].jointtype = 1;
4093vinfos[1].foffset = j1;
4094vinfos[1].indices[0] = _ij1[0];
4095vinfos[1].indices[1] = _ij1[1];
4096vinfos[1].maxsolutions = _nj1;
4097vinfos[2].jointtype = 1;
4098vinfos[2].foffset = j2;
4099vinfos[2].indices[0] = _ij2[0];
4100vinfos[2].indices[1] = _ij2[1];
4101vinfos[2].maxsolutions = _nj2;
4102vinfos[3].jointtype = 1;
4103vinfos[3].foffset = j3;
4104vinfos[3].indices[0] = _ij3[0];
4105vinfos[3].indices[1] = _ij3[1];
4106vinfos[3].maxsolutions = _nj3;
4107vinfos[4].jointtype = 1;
4108vinfos[4].foffset = j4;
4109vinfos[4].indices[0] = _ij4[0];
4110vinfos[4].indices[1] = _ij4[1];
4111vinfos[4].maxsolutions = _nj4;
4112vinfos[5].jointtype = 1;
4113vinfos[5].foffset = j5;
4114vinfos[5].indices[0] = _ij5[0];
4115vinfos[5].indices[1] = _ij5[1];
4116vinfos[5].maxsolutions = _nj5;
4117std::vector<int> vfree(0);
4118solutions.AddSolution(vinfos,vfree);
4119}
4120}
4121}
4122
4123}
4124} while(0);
4125if( bgotonextstatement )
4126{
4127bool bgotonextstatement = true;
4128do
4129{
4130evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j4)))), 6.28318530717959)));
4131evalcond[1]=new_r02;
4132evalcond[2]=new_r12;
4133evalcond[3]=new_r21;
4134evalcond[4]=new_r20;
4135if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
4136{
4137bgotonextstatement=false;
4138{
4139IkReal j5array[1], cj5array[1], sj5array[1];
4140bool j5valid[1]={false};
4141_nj5 = 1;
4142IkReal x305=((1.0)*sj3);
4143if( IKabs((((cj3*new_r01))+(((-1.0)*new_r00*x305)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((((-1.0)*cj3*new_r00))+(((-1.0)*new_r01*x305)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((cj3*new_r01))+(((-1.0)*new_r00*x305))))+IKsqr(((((-1.0)*cj3*new_r00))+(((-1.0)*new_r01*x305))))-1) <= IKFAST_SINCOS_THRESH )
4144 continue;
4145j5array[0]=IKatan2((((cj3*new_r01))+(((-1.0)*new_r00*x305))), ((((-1.0)*cj3*new_r00))+(((-1.0)*new_r01*x305))));
4146sj5array[0]=IKsin(j5array[0]);
4147cj5array[0]=IKcos(j5array[0]);
4148if( j5array[0] > IKPI )
4149{
4150 j5array[0]-=IK2PI;
4151}
4152else if( j5array[0] < -IKPI )
4153{ j5array[0]+=IK2PI;
4154}
4155j5valid[0] = true;
4156for(int ij5 = 0; ij5 < 1; ++ij5)
4157{
4158if( !j5valid[ij5] )
4159{
4160 continue;
4161}
4162_ij5[0] = ij5; _ij5[1] = -1;
4163for(int iij5 = ij5+1; iij5 < 1; ++iij5)
4164{
4165if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
4166{
4167 j5valid[iij5]=false; _ij5[1] = iij5; break;
4168}
4169}
4170j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
4171{
4172IkReal evalcond[8];
4173IkReal x306=IKcos(j5);
4174IkReal x307=IKsin(j5);
4175IkReal x308=((1.0)*cj3);
4176IkReal x309=(sj3*x306);
4177IkReal x310=((1.0)*x307);
4178IkReal x311=(x307*x308);
4179evalcond[0]=(((new_r10*sj3))+x306+((cj3*new_r00)));
4180evalcond[1]=(((new_r00*sj3))+x307+(((-1.0)*new_r10*x308)));
4181evalcond[2]=(((new_r01*sj3))+x306+(((-1.0)*new_r11*x308)));
4182evalcond[3]=(((new_r11*sj3))+(((-1.0)*x310))+((cj3*new_r01)));
4183evalcond[4]=(((sj3*x307))+((cj3*x306))+new_r00);
4184evalcond[5]=(x309+(((-1.0)*x311))+new_r01);
4185evalcond[6]=(x309+(((-1.0)*x311))+new_r10);
4186evalcond[7]=((((-1.0)*sj3*x310))+(((-1.0)*x306*x308))+new_r11);
4187if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
4188{
4189continue;
4190}
4191}
4192
4193{
4194std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
4195vinfos[0].jointtype = 1;
4196vinfos[0].foffset = j0;
4197vinfos[0].indices[0] = _ij0[0];
4198vinfos[0].indices[1] = _ij0[1];
4199vinfos[0].maxsolutions = _nj0;
4200vinfos[1].jointtype = 1;
4201vinfos[1].foffset = j1;
4202vinfos[1].indices[0] = _ij1[0];
4203vinfos[1].indices[1] = _ij1[1];
4204vinfos[1].maxsolutions = _nj1;
4205vinfos[2].jointtype = 1;
4206vinfos[2].foffset = j2;
4207vinfos[2].indices[0] = _ij2[0];
4208vinfos[2].indices[1] = _ij2[1];
4209vinfos[2].maxsolutions = _nj2;
4210vinfos[3].jointtype = 1;
4211vinfos[3].foffset = j3;
4212vinfos[3].indices[0] = _ij3[0];
4213vinfos[3].indices[1] = _ij3[1];
4214vinfos[3].maxsolutions = _nj3;
4215vinfos[4].jointtype = 1;
4216vinfos[4].foffset = j4;
4217vinfos[4].indices[0] = _ij4[0];
4218vinfos[4].indices[1] = _ij4[1];
4219vinfos[4].maxsolutions = _nj4;
4220vinfos[5].jointtype = 1;
4221vinfos[5].foffset = j5;
4222vinfos[5].indices[0] = _ij5[0];
4223vinfos[5].indices[1] = _ij5[1];
4224vinfos[5].maxsolutions = _nj5;
4225std::vector<int> vfree(0);
4226solutions.AddSolution(vinfos,vfree);
4227}
4228}
4229}
4230
4231}
4232} while(0);
4233if( bgotonextstatement )
4234{
4235bool bgotonextstatement = true;
4236do
4237{
4238evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j3)))), 6.28318530717959)));
4239evalcond[1]=new_r02;
4240if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
4241{
4242bgotonextstatement=false;
4243{
4244IkReal j5array[1], cj5array[1], sj5array[1];
4245bool j5valid[1]={false};
4246_nj5 = 1;
4247if( IKabs(((-1.0)*new_r00)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r00))+IKsqr(((-1.0)*new_r01))-1) <= IKFAST_SINCOS_THRESH )
4248 continue;
4249j5array[0]=IKatan2(((-1.0)*new_r00), ((-1.0)*new_r01));
4250sj5array[0]=IKsin(j5array[0]);
4251cj5array[0]=IKcos(j5array[0]);
4252if( j5array[0] > IKPI )
4253{
4254 j5array[0]-=IK2PI;
4255}
4256else if( j5array[0] < -IKPI )
4257{ j5array[0]+=IK2PI;
4258}
4259j5valid[0] = true;
4260for(int ij5 = 0; ij5 < 1; ++ij5)
4261{
4262if( !j5valid[ij5] )
4263{
4264 continue;
4265}
4266_ij5[0] = ij5; _ij5[1] = -1;
4267for(int iij5 = ij5+1; iij5 < 1; ++iij5)
4268{
4269if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
4270{
4271 j5valid[iij5]=false; _ij5[1] = iij5; break;
4272}
4273}
4274j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
4275{
4276IkReal evalcond[8];
4277IkReal x312=IKsin(j5);
4278IkReal x313=IKcos(j5);
4279IkReal x314=((1.0)*cj4);
4280IkReal x315=((1.0)*sj4);
4281evalcond[0]=(x312+new_r00);
4282evalcond[1]=(x313+new_r01);
4283evalcond[2]=(((sj4*x312))+new_r21);
4284evalcond[3]=(((cj4*x312))+new_r11);
4285evalcond[4]=((((-1.0)*x313*x315))+new_r20);
4286evalcond[5]=((((-1.0)*x313*x314))+new_r10);
4287evalcond[6]=((((-1.0)*new_r20*x315))+x313+(((-1.0)*new_r10*x314)));
4288evalcond[7]=((((-1.0)*new_r21*x315))+(((-1.0)*new_r11*x314))+(((-1.0)*x312)));
4289if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
4290{
4291continue;
4292}
4293}
4294
4295{
4296std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
4297vinfos[0].jointtype = 1;
4298vinfos[0].foffset = j0;
4299vinfos[0].indices[0] = _ij0[0];
4300vinfos[0].indices[1] = _ij0[1];
4301vinfos[0].maxsolutions = _nj0;
4302vinfos[1].jointtype = 1;
4303vinfos[1].foffset = j1;
4304vinfos[1].indices[0] = _ij1[0];
4305vinfos[1].indices[1] = _ij1[1];
4306vinfos[1].maxsolutions = _nj1;
4307vinfos[2].jointtype = 1;
4308vinfos[2].foffset = j2;
4309vinfos[2].indices[0] = _ij2[0];
4310vinfos[2].indices[1] = _ij2[1];
4311vinfos[2].maxsolutions = _nj2;
4312vinfos[3].jointtype = 1;
4313vinfos[3].foffset = j3;
4314vinfos[3].indices[0] = _ij3[0];
4315vinfos[3].indices[1] = _ij3[1];
4316vinfos[3].maxsolutions = _nj3;
4317vinfos[4].jointtype = 1;
4318vinfos[4].foffset = j4;
4319vinfos[4].indices[0] = _ij4[0];
4320vinfos[4].indices[1] = _ij4[1];
4321vinfos[4].maxsolutions = _nj4;
4322vinfos[5].jointtype = 1;
4323vinfos[5].foffset = j5;
4324vinfos[5].indices[0] = _ij5[0];
4325vinfos[5].indices[1] = _ij5[1];
4326vinfos[5].maxsolutions = _nj5;
4327std::vector<int> vfree(0);
4328solutions.AddSolution(vinfos,vfree);
4329}
4330}
4331}
4332
4333}
4334} while(0);
4335if( bgotonextstatement )
4336{
4337bool bgotonextstatement = true;
4338do
4339{
4340evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j3)))), 6.28318530717959)));
4341evalcond[1]=new_r02;
4342if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
4343{
4344bgotonextstatement=false;
4345{
4346IkReal j5array[1], cj5array[1], sj5array[1];
4347bool j5valid[1]={false};
4348_nj5 = 1;
4350 continue;
4351j5array[0]=IKatan2(new_r00, new_r01);
4352sj5array[0]=IKsin(j5array[0]);
4353cj5array[0]=IKcos(j5array[0]);
4354if( j5array[0] > IKPI )
4355{
4356 j5array[0]-=IK2PI;
4357}
4358else if( j5array[0] < -IKPI )
4359{ j5array[0]+=IK2PI;
4360}
4361j5valid[0] = true;
4362for(int ij5 = 0; ij5 < 1; ++ij5)
4363{
4364if( !j5valid[ij5] )
4365{
4366 continue;
4367}
4368_ij5[0] = ij5; _ij5[1] = -1;
4369for(int iij5 = ij5+1; iij5 < 1; ++iij5)
4370{
4371if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
4372{
4373 j5valid[iij5]=false; _ij5[1] = iij5; break;
4374}
4375}
4376j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
4377{
4378IkReal evalcond[8];
4379IkReal x316=IKsin(j5);
4380IkReal x317=IKcos(j5);
4381IkReal x318=((1.0)*sj4);
4382IkReal x319=((1.0)*x317);
4383evalcond[0]=(((sj4*x316))+new_r21);
4384evalcond[1]=(x316+(((-1.0)*new_r00)));
4385evalcond[2]=(x317+(((-1.0)*new_r01)));
4386evalcond[3]=(new_r20+(((-1.0)*x317*x318)));
4387evalcond[4]=(((cj4*x316))+(((-1.0)*new_r11)));
4388evalcond[5]=((((-1.0)*cj4*x319))+(((-1.0)*new_r10)));
4389evalcond[6]=((((-1.0)*new_r20*x318))+((cj4*new_r10))+x317);
4390evalcond[7]=((((-1.0)*new_r21*x318))+((cj4*new_r11))+(((-1.0)*x316)));
4391if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
4392{
4393continue;
4394}
4395}
4396
4397{
4398std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
4399vinfos[0].jointtype = 1;
4400vinfos[0].foffset = j0;
4401vinfos[0].indices[0] = _ij0[0];
4402vinfos[0].indices[1] = _ij0[1];
4403vinfos[0].maxsolutions = _nj0;
4404vinfos[1].jointtype = 1;
4405vinfos[1].foffset = j1;
4406vinfos[1].indices[0] = _ij1[0];
4407vinfos[1].indices[1] = _ij1[1];
4408vinfos[1].maxsolutions = _nj1;
4409vinfos[2].jointtype = 1;
4410vinfos[2].foffset = j2;
4411vinfos[2].indices[0] = _ij2[0];
4412vinfos[2].indices[1] = _ij2[1];
4413vinfos[2].maxsolutions = _nj2;
4414vinfos[3].jointtype = 1;
4415vinfos[3].foffset = j3;
4416vinfos[3].indices[0] = _ij3[0];
4417vinfos[3].indices[1] = _ij3[1];
4418vinfos[3].maxsolutions = _nj3;
4419vinfos[4].jointtype = 1;
4420vinfos[4].foffset = j4;
4421vinfos[4].indices[0] = _ij4[0];
4422vinfos[4].indices[1] = _ij4[1];
4423vinfos[4].maxsolutions = _nj4;
4424vinfos[5].jointtype = 1;
4425vinfos[5].foffset = j5;
4426vinfos[5].indices[0] = _ij5[0];
4427vinfos[5].indices[1] = _ij5[1];
4428vinfos[5].maxsolutions = _nj5;
4429std::vector<int> vfree(0);
4430solutions.AddSolution(vinfos,vfree);
4431}
4432}
4433}
4434
4435}
4436} while(0);
4437if( bgotonextstatement )
4438{
4439bool bgotonextstatement = true;
4440do
4441{
4442evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j3))), 6.28318530717959)));
4443evalcond[1]=new_r12;
4444if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
4445{
4446bgotonextstatement=false;
4447{
4448IkReal j5array[1], cj5array[1], sj5array[1];
4449bool j5valid[1]={false};
4450_nj5 = 1;
4452 continue;
4453j5array[0]=IKatan2(new_r10, new_r11);
4454sj5array[0]=IKsin(j5array[0]);
4455cj5array[0]=IKcos(j5array[0]);
4456if( j5array[0] > IKPI )
4457{
4458 j5array[0]-=IK2PI;
4459}
4460else if( j5array[0] < -IKPI )
4461{ j5array[0]+=IK2PI;
4462}
4463j5valid[0] = true;
4464for(int ij5 = 0; ij5 < 1; ++ij5)
4465{
4466if( !j5valid[ij5] )
4467{
4468 continue;
4469}
4470_ij5[0] = ij5; _ij5[1] = -1;
4471for(int iij5 = ij5+1; iij5 < 1; ++iij5)
4472{
4473if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
4474{
4475 j5valid[iij5]=false; _ij5[1] = iij5; break;
4476}
4477}
4478j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
4479{
4480IkReal evalcond[8];
4481IkReal x320=IKcos(j5);
4482IkReal x321=IKsin(j5);
4483IkReal x322=((1.0)*cj4);
4484IkReal x323=((1.0)*sj4);
4485IkReal x324=((1.0)*x321);
4486evalcond[0]=(new_r20+((new_r02*x320)));
4487evalcond[1]=(x321+(((-1.0)*new_r10)));
4488evalcond[2]=(x320+(((-1.0)*new_r11)));
4489evalcond[3]=(((cj4*x321))+new_r01);
4490evalcond[4]=((((-1.0)*new_r02*x324))+new_r21);
4491evalcond[5]=((((-1.0)*x320*x322))+new_r00);
4492evalcond[6]=(x320+(((-1.0)*new_r00*x322))+(((-1.0)*new_r20*x323)));
4493evalcond[7]=((((-1.0)*x324))+(((-1.0)*new_r01*x322))+(((-1.0)*new_r21*x323)));
4494if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
4495{
4496continue;
4497}
4498}
4499
4500{
4501std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
4502vinfos[0].jointtype = 1;
4503vinfos[0].foffset = j0;
4504vinfos[0].indices[0] = _ij0[0];
4505vinfos[0].indices[1] = _ij0[1];
4506vinfos[0].maxsolutions = _nj0;
4507vinfos[1].jointtype = 1;
4508vinfos[1].foffset = j1;
4509vinfos[1].indices[0] = _ij1[0];
4510vinfos[1].indices[1] = _ij1[1];
4511vinfos[1].maxsolutions = _nj1;
4512vinfos[2].jointtype = 1;
4513vinfos[2].foffset = j2;
4514vinfos[2].indices[0] = _ij2[0];
4515vinfos[2].indices[1] = _ij2[1];
4516vinfos[2].maxsolutions = _nj2;
4517vinfos[3].jointtype = 1;
4518vinfos[3].foffset = j3;
4519vinfos[3].indices[0] = _ij3[0];
4520vinfos[3].indices[1] = _ij3[1];
4521vinfos[3].maxsolutions = _nj3;
4522vinfos[4].jointtype = 1;
4523vinfos[4].foffset = j4;
4524vinfos[4].indices[0] = _ij4[0];
4525vinfos[4].indices[1] = _ij4[1];
4526vinfos[4].maxsolutions = _nj4;
4527vinfos[5].jointtype = 1;
4528vinfos[5].foffset = j5;
4529vinfos[5].indices[0] = _ij5[0];
4530vinfos[5].indices[1] = _ij5[1];
4531vinfos[5].maxsolutions = _nj5;
4532std::vector<int> vfree(0);
4533solutions.AddSolution(vinfos,vfree);
4534}
4535}
4536}
4537
4538}
4539} while(0);
4540if( bgotonextstatement )
4541{
4542bool bgotonextstatement = true;
4543do
4544{
4545evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j3)))), 6.28318530717959)));
4546evalcond[1]=new_r12;
4547if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
4548{
4549bgotonextstatement=false;
4550{
4551IkReal j5array[1], cj5array[1], sj5array[1];
4552bool j5valid[1]={false};
4553_nj5 = 1;
4554if( IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r10))+IKsqr(((-1.0)*new_r11))-1) <= IKFAST_SINCOS_THRESH )
4555 continue;
4556j5array[0]=IKatan2(((-1.0)*new_r10), ((-1.0)*new_r11));
4557sj5array[0]=IKsin(j5array[0]);
4558cj5array[0]=IKcos(j5array[0]);
4559if( j5array[0] > IKPI )
4560{
4561 j5array[0]-=IK2PI;
4562}
4563else if( j5array[0] < -IKPI )
4564{ j5array[0]+=IK2PI;
4565}
4566j5valid[0] = true;
4567for(int ij5 = 0; ij5 < 1; ++ij5)
4568{
4569if( !j5valid[ij5] )
4570{
4571 continue;
4572}
4573_ij5[0] = ij5; _ij5[1] = -1;
4574for(int iij5 = ij5+1; iij5 < 1; ++iij5)
4575{
4576if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
4577{
4578 j5valid[iij5]=false; _ij5[1] = iij5; break;
4579}
4580}
4581j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
4582{
4583IkReal evalcond[8];
4584IkReal x325=IKsin(j5);
4585IkReal x326=IKcos(j5);
4586IkReal x327=((1.0)*sj4);
4587IkReal x328=((1.0)*x326);
4588evalcond[0]=(x325+new_r10);
4589evalcond[1]=(x326+new_r11);
4590evalcond[2]=(new_r21+((new_r02*x325)));
4591evalcond[3]=((((-1.0)*new_r02*x328))+new_r20);
4592evalcond[4]=(((cj4*x325))+(((-1.0)*new_r01)));
4593evalcond[5]=((((-1.0)*new_r00))+(((-1.0)*cj4*x328)));
4594evalcond[6]=(((cj4*new_r00))+x326+(((-1.0)*new_r20*x327)));
4595evalcond[7]=(((cj4*new_r01))+(((-1.0)*x325))+(((-1.0)*new_r21*x327)));
4596if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
4597{
4598continue;
4599}
4600}
4601
4602{
4603std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
4604vinfos[0].jointtype = 1;
4605vinfos[0].foffset = j0;
4606vinfos[0].indices[0] = _ij0[0];
4607vinfos[0].indices[1] = _ij0[1];
4608vinfos[0].maxsolutions = _nj0;
4609vinfos[1].jointtype = 1;
4610vinfos[1].foffset = j1;
4611vinfos[1].indices[0] = _ij1[0];
4612vinfos[1].indices[1] = _ij1[1];
4613vinfos[1].maxsolutions = _nj1;
4614vinfos[2].jointtype = 1;
4615vinfos[2].foffset = j2;
4616vinfos[2].indices[0] = _ij2[0];
4617vinfos[2].indices[1] = _ij2[1];
4618vinfos[2].maxsolutions = _nj2;
4619vinfos[3].jointtype = 1;
4620vinfos[3].foffset = j3;
4621vinfos[3].indices[0] = _ij3[0];
4622vinfos[3].indices[1] = _ij3[1];
4623vinfos[3].maxsolutions = _nj3;
4624vinfos[4].jointtype = 1;
4625vinfos[4].foffset = j4;
4626vinfos[4].indices[0] = _ij4[0];
4627vinfos[4].indices[1] = _ij4[1];
4628vinfos[4].maxsolutions = _nj4;
4629vinfos[5].jointtype = 1;
4630vinfos[5].foffset = j5;
4631vinfos[5].indices[0] = _ij5[0];
4632vinfos[5].indices[1] = _ij5[1];
4633vinfos[5].maxsolutions = _nj5;
4634std::vector<int> vfree(0);
4635solutions.AddSolution(vinfos,vfree);
4636}
4637}
4638}
4639
4640}
4641} while(0);
4642if( bgotonextstatement )
4643{
4644bool bgotonextstatement = true;
4645do
4646{
4647evalcond[0]=((IKabs(new_r20))+(IKabs(new_r21)));
4648if( IKabs(evalcond[0]) < 0.0000050000000000 )
4649{
4650bgotonextstatement=false;
4651{
4652IkReal j5eval[1];
4653new_r21=0;
4654new_r20=0;
4655new_r02=0;
4656new_r12=0;
4657j5eval[0]=1.0;
4658if( IKabs(j5eval[0]) < 0.0000000100000000 )
4659{
4660continue; // no branches [j5]
4661
4662} else
4663{
4664IkReal op[2+1], zeror[2];
4665int numroots;
4666op[0]=-1.0;
4667op[1]=0;
4668op[2]=1.0;
4669polyroots2(op,zeror,numroots);
4670IkReal j5array[2], cj5array[2], sj5array[2], tempj5array[1];
4671int numsolutions = 0;
4672for(int ij5 = 0; ij5 < numroots; ++ij5)
4673{
4674IkReal htj5 = zeror[ij5];
4675tempj5array[0]=((2.0)*(atan(htj5)));
4676for(int kj5 = 0; kj5 < 1; ++kj5)
4677{
4678j5array[numsolutions] = tempj5array[kj5];
4679if( j5array[numsolutions] > IKPI )
4680{
4681 j5array[numsolutions]-=IK2PI;
4682}
4683else if( j5array[numsolutions] < -IKPI )
4684{
4685 j5array[numsolutions]+=IK2PI;
4686}
4687sj5array[numsolutions] = IKsin(j5array[numsolutions]);
4688cj5array[numsolutions] = IKcos(j5array[numsolutions]);
4689numsolutions++;
4690}
4691}
4692bool j5valid[2]={true,true};
4693_nj5 = 2;
4694for(int ij5 = 0; ij5 < numsolutions; ++ij5)
4695 {
4696if( !j5valid[ij5] )
4697{
4698 continue;
4699}
4700 j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
4701htj5 = IKtan(j5/2);
4702
4703_ij5[0] = ij5; _ij5[1] = -1;
4704for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5)
4705{
4706if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
4707{
4708 j5valid[iij5]=false; _ij5[1] = iij5; break;
4709}
4710}
4711{
4712std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
4713vinfos[0].jointtype = 1;
4714vinfos[0].foffset = j0;
4715vinfos[0].indices[0] = _ij0[0];
4716vinfos[0].indices[1] = _ij0[1];
4717vinfos[0].maxsolutions = _nj0;
4718vinfos[1].jointtype = 1;
4719vinfos[1].foffset = j1;
4720vinfos[1].indices[0] = _ij1[0];
4721vinfos[1].indices[1] = _ij1[1];
4722vinfos[1].maxsolutions = _nj1;
4723vinfos[2].jointtype = 1;
4724vinfos[2].foffset = j2;
4725vinfos[2].indices[0] = _ij2[0];
4726vinfos[2].indices[1] = _ij2[1];
4727vinfos[2].maxsolutions = _nj2;
4728vinfos[3].jointtype = 1;
4729vinfos[3].foffset = j3;
4730vinfos[3].indices[0] = _ij3[0];
4731vinfos[3].indices[1] = _ij3[1];
4732vinfos[3].maxsolutions = _nj3;
4733vinfos[4].jointtype = 1;
4734vinfos[4].foffset = j4;
4735vinfos[4].indices[0] = _ij4[0];
4736vinfos[4].indices[1] = _ij4[1];
4737vinfos[4].maxsolutions = _nj4;
4738vinfos[5].jointtype = 1;
4739vinfos[5].foffset = j5;
4740vinfos[5].indices[0] = _ij5[0];
4741vinfos[5].indices[1] = _ij5[1];
4742vinfos[5].maxsolutions = _nj5;
4743std::vector<int> vfree(0);
4744solutions.AddSolution(vinfos,vfree);
4745}
4746 }
4747
4748}
4749
4750}
4751
4752}
4753} while(0);
4754if( bgotonextstatement )
4755{
4756bool bgotonextstatement = true;
4757do
4758{
4759if( 1 )
4760{
4761bgotonextstatement=false;
4762continue; // branch miss [j5]
4763
4764}
4765} while(0);
4766if( bgotonextstatement )
4767{
4768}
4769}
4770}
4771}
4772}
4773}
4774}
4775}
4776}
4777
4778} else
4779{
4780{
4781IkReal j5array[1], cj5array[1], sj5array[1];
4782bool j5valid[1]={false};
4783_nj5 = 1;
4785if(!x330.valid){
4786continue;
4787}
4788IkReal x329=x330.value;
4790if(!x331.valid){
4791continue;
4792}
4793if( IKabs(((-1.0)*new_r21*x329)) < IKFAST_ATAN2_MAGTHRESH && IKabs((x329*(x331.value)*((((new_r11*sj4))+(((-1.0)*cj4*new_r21*sj3)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21*x329))+IKsqr((x329*(x331.value)*((((new_r11*sj4))+(((-1.0)*cj4*new_r21*sj3))))))-1) <= IKFAST_SINCOS_THRESH )
4794 continue;
4795j5array[0]=IKatan2(((-1.0)*new_r21*x329), (x329*(x331.value)*((((new_r11*sj4))+(((-1.0)*cj4*new_r21*sj3))))));
4796sj5array[0]=IKsin(j5array[0]);
4797cj5array[0]=IKcos(j5array[0]);
4798if( j5array[0] > IKPI )
4799{
4800 j5array[0]-=IK2PI;
4801}
4802else if( j5array[0] < -IKPI )
4803{ j5array[0]+=IK2PI;
4804}
4805j5valid[0] = true;
4806for(int ij5 = 0; ij5 < 1; ++ij5)
4807{
4808if( !j5valid[ij5] )
4809{
4810 continue;
4811}
4812_ij5[0] = ij5; _ij5[1] = -1;
4813for(int iij5 = ij5+1; iij5 < 1; ++iij5)
4814{
4815if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
4816{
4817 j5valid[iij5]=false; _ij5[1] = iij5; break;
4818}
4819}
4820j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
4821{
4822IkReal evalcond[12];
4823IkReal x332=IKsin(j5);
4824IkReal x333=IKcos(j5);
4825IkReal x334=(cj3*new_r00);
4826IkReal x335=(cj3*cj4);
4827IkReal x336=((1.0)*cj3);
4828IkReal x337=(new_r11*sj3);
4829IkReal x338=((1.0)*cj4);
4830IkReal x339=(new_r10*sj3);
4831IkReal x340=((1.0)*sj4);
4832IkReal x341=(sj3*x332);
4833IkReal x342=((1.0)*x333);
4834IkReal x343=(sj3*x333);
4835evalcond[0]=(((sj4*x332))+new_r21);
4836evalcond[1]=(new_r20+(((-1.0)*x333*x340)));
4837evalcond[2]=((((-1.0)*new_r10*x336))+((new_r00*sj3))+x332);
4838evalcond[3]=((((-1.0)*new_r11*x336))+((new_r01*sj3))+x333);
4839evalcond[4]=(x337+((cj4*x332))+((cj3*new_r01)));
4840evalcond[5]=(((x332*x335))+x343+new_r01);
4841evalcond[6]=((((-1.0)*x333*x338))+x339+x334);
4842evalcond[7]=((((-1.0)*x335*x342))+x341+new_r00);
4843evalcond[8]=((((-1.0)*x333*x336))+((cj4*x341))+new_r11);
4844evalcond[9]=((((-1.0)*x332*x336))+new_r10+(((-1.0)*x338*x343)));
4845evalcond[10]=((((-1.0)*x338*x339))+x333+(((-1.0)*new_r20*x340))+(((-1.0)*x334*x338)));
4846evalcond[11]=((((-1.0)*x337*x338))+(((-1.0)*new_r01*x335))+(((-1.0)*x332))+(((-1.0)*new_r21*x340)));
4847if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH )
4848{
4849continue;
4850}
4851}
4852
4853{
4854std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
4855vinfos[0].jointtype = 1;
4856vinfos[0].foffset = j0;
4857vinfos[0].indices[0] = _ij0[0];
4858vinfos[0].indices[1] = _ij0[1];
4859vinfos[0].maxsolutions = _nj0;
4860vinfos[1].jointtype = 1;
4861vinfos[1].foffset = j1;
4862vinfos[1].indices[0] = _ij1[0];
4863vinfos[1].indices[1] = _ij1[1];
4864vinfos[1].maxsolutions = _nj1;
4865vinfos[2].jointtype = 1;
4866vinfos[2].foffset = j2;
4867vinfos[2].indices[0] = _ij2[0];
4868vinfos[2].indices[1] = _ij2[1];
4869vinfos[2].maxsolutions = _nj2;
4870vinfos[3].jointtype = 1;
4871vinfos[3].foffset = j3;
4872vinfos[3].indices[0] = _ij3[0];
4873vinfos[3].indices[1] = _ij3[1];
4874vinfos[3].maxsolutions = _nj3;
4875vinfos[4].jointtype = 1;
4876vinfos[4].foffset = j4;
4877vinfos[4].indices[0] = _ij4[0];
4878vinfos[4].indices[1] = _ij4[1];
4879vinfos[4].maxsolutions = _nj4;
4880vinfos[5].jointtype = 1;
4881vinfos[5].foffset = j5;
4882vinfos[5].indices[0] = _ij5[0];
4883vinfos[5].indices[1] = _ij5[1];
4884vinfos[5].maxsolutions = _nj5;
4885std::vector<int> vfree(0);
4886solutions.AddSolution(vinfos,vfree);
4887}
4888}
4889}
4890
4891}
4892
4893}
4894
4895} else
4896{
4897{
4898IkReal j5array[1], cj5array[1], sj5array[1];
4899bool j5valid[1]={false};
4900_nj5 = 1;
4902if(!x345.valid){
4903continue;
4904}
4905IkReal x344=x345.value;
4907if(!x346.valid){
4908continue;
4909}
4910if( IKabs(((-1.0)*new_r21*x344)) < IKFAST_ATAN2_MAGTHRESH && IKabs((x344*(x346.value)*(((((-1.0)*new_r01*sj4))+((cj3*cj4*new_r21)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r21*x344))+IKsqr((x344*(x346.value)*(((((-1.0)*new_r01*sj4))+((cj3*cj4*new_r21))))))-1) <= IKFAST_SINCOS_THRESH )
4911 continue;
4912j5array[0]=IKatan2(((-1.0)*new_r21*x344), (x344*(x346.value)*(((((-1.0)*new_r01*sj4))+((cj3*cj4*new_r21))))));
4913sj5array[0]=IKsin(j5array[0]);
4914cj5array[0]=IKcos(j5array[0]);
4915if( j5array[0] > IKPI )
4916{
4917 j5array[0]-=IK2PI;
4918}
4919else if( j5array[0] < -IKPI )
4920{ j5array[0]+=IK2PI;
4921}
4922j5valid[0] = true;
4923for(int ij5 = 0; ij5 < 1; ++ij5)
4924{
4925if( !j5valid[ij5] )
4926{
4927 continue;
4928}
4929_ij5[0] = ij5; _ij5[1] = -1;
4930for(int iij5 = ij5+1; iij5 < 1; ++iij5)
4931{
4932if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
4933{
4934 j5valid[iij5]=false; _ij5[1] = iij5; break;
4935}
4936}
4937j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
4938{
4939IkReal evalcond[12];
4940IkReal x347=IKsin(j5);
4941IkReal x348=IKcos(j5);
4942IkReal x349=(cj3*new_r00);
4943IkReal x350=(cj3*cj4);
4944IkReal x351=((1.0)*cj3);
4945IkReal x352=(new_r11*sj3);
4946IkReal x353=((1.0)*cj4);
4947IkReal x354=(new_r10*sj3);
4948IkReal x355=((1.0)*sj4);
4949IkReal x356=(sj3*x347);
4950IkReal x357=((1.0)*x348);
4951IkReal x358=(sj3*x348);
4952evalcond[0]=(((sj4*x347))+new_r21);
4953evalcond[1]=((((-1.0)*x348*x355))+new_r20);
4954evalcond[2]=(((new_r00*sj3))+x347+(((-1.0)*new_r10*x351)));
4955evalcond[3]=(((new_r01*sj3))+x348+(((-1.0)*new_r11*x351)));
4956evalcond[4]=(x352+((cj4*x347))+((cj3*new_r01)));
4957evalcond[5]=(x358+((x347*x350))+new_r01);
4958evalcond[6]=((((-1.0)*x348*x353))+x354+x349);
4959evalcond[7]=(x356+new_r00+(((-1.0)*x350*x357)));
4960evalcond[8]=((((-1.0)*x348*x351))+((cj4*x356))+new_r11);
4961evalcond[9]=((((-1.0)*x347*x351))+(((-1.0)*x353*x358))+new_r10);
4962evalcond[10]=((((-1.0)*x349*x353))+x348+(((-1.0)*x353*x354))+(((-1.0)*new_r20*x355)));
4963evalcond[11]=((((-1.0)*new_r01*x350))+(((-1.0)*new_r21*x355))+(((-1.0)*x352*x353))+(((-1.0)*x347)));
4964if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH )
4965{
4966continue;
4967}
4968}
4969
4970{
4971std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
4972vinfos[0].jointtype = 1;
4973vinfos[0].foffset = j0;
4974vinfos[0].indices[0] = _ij0[0];
4975vinfos[0].indices[1] = _ij0[1];
4976vinfos[0].maxsolutions = _nj0;
4977vinfos[1].jointtype = 1;
4978vinfos[1].foffset = j1;
4979vinfos[1].indices[0] = _ij1[0];
4980vinfos[1].indices[1] = _ij1[1];
4981vinfos[1].maxsolutions = _nj1;
4982vinfos[2].jointtype = 1;
4983vinfos[2].foffset = j2;
4984vinfos[2].indices[0] = _ij2[0];
4985vinfos[2].indices[1] = _ij2[1];
4986vinfos[2].maxsolutions = _nj2;
4987vinfos[3].jointtype = 1;
4988vinfos[3].foffset = j3;
4989vinfos[3].indices[0] = _ij3[0];
4990vinfos[3].indices[1] = _ij3[1];
4991vinfos[3].maxsolutions = _nj3;
4992vinfos[4].jointtype = 1;
4993vinfos[4].foffset = j4;
4994vinfos[4].indices[0] = _ij4[0];
4995vinfos[4].indices[1] = _ij4[1];
4996vinfos[4].maxsolutions = _nj4;
4997vinfos[5].jointtype = 1;
4998vinfos[5].foffset = j5;
4999vinfos[5].indices[0] = _ij5[0];
5000vinfos[5].indices[1] = _ij5[1];
5001vinfos[5].maxsolutions = _nj5;
5002std::vector<int> vfree(0);
5003solutions.AddSolution(vinfos,vfree);
5004}
5005}
5006}
5007
5008}
5009
5010}
5011
5012} else
5013{
5014{
5015IkReal j5array[1], cj5array[1], sj5array[1];
5016bool j5valid[1]={false};
5017_nj5 = 1;
5019if(!x359.valid){
5020continue;
5021}
5023if(!x360.valid){
5024continue;
5025}
5026j5array[0]=((-1.5707963267949)+(x359.value)+(((1.5707963267949)*(x360.value))));
5027sj5array[0]=IKsin(j5array[0]);
5028cj5array[0]=IKcos(j5array[0]);
5029if( j5array[0] > IKPI )
5030{
5031 j5array[0]-=IK2PI;
5032}
5033else if( j5array[0] < -IKPI )
5034{ j5array[0]+=IK2PI;
5035}
5036j5valid[0] = true;
5037for(int ij5 = 0; ij5 < 1; ++ij5)
5038{
5039if( !j5valid[ij5] )
5040{
5041 continue;
5042}
5043_ij5[0] = ij5; _ij5[1] = -1;
5044for(int iij5 = ij5+1; iij5 < 1; ++iij5)
5045{
5046if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
5047{
5048 j5valid[iij5]=false; _ij5[1] = iij5; break;
5049}
5050}
5051j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
5052{
5053IkReal evalcond[12];
5054IkReal x361=IKsin(j5);
5055IkReal x362=IKcos(j5);
5056IkReal x363=(cj3*new_r00);
5057IkReal x364=(cj3*cj4);
5058IkReal x365=((1.0)*cj3);
5059IkReal x366=(new_r11*sj3);
5060IkReal x367=((1.0)*cj4);
5061IkReal x368=(new_r10*sj3);
5062IkReal x369=((1.0)*sj4);
5063IkReal x370=(sj3*x361);
5064IkReal x371=((1.0)*x362);
5065IkReal x372=(sj3*x362);
5066evalcond[0]=(((sj4*x361))+new_r21);
5067evalcond[1]=((((-1.0)*x362*x369))+new_r20);
5068evalcond[2]=(((new_r00*sj3))+x361+(((-1.0)*new_r10*x365)));
5069evalcond[3]=(((new_r01*sj3))+x362+(((-1.0)*new_r11*x365)));
5070evalcond[4]=(((cj4*x361))+x366+((cj3*new_r01)));
5071evalcond[5]=(((x361*x364))+x372+new_r01);
5072evalcond[6]=((((-1.0)*x362*x367))+x368+x363);
5073evalcond[7]=(x370+new_r00+(((-1.0)*x364*x371)));
5074evalcond[8]=((((-1.0)*x362*x365))+((cj4*x370))+new_r11);
5075evalcond[9]=((((-1.0)*x361*x365))+(((-1.0)*x367*x372))+new_r10);
5076evalcond[10]=((((-1.0)*x363*x367))+(((-1.0)*new_r20*x369))+(((-1.0)*x367*x368))+x362);
5077evalcond[11]=((((-1.0)*x361))+(((-1.0)*x366*x367))+(((-1.0)*new_r01*x364))+(((-1.0)*new_r21*x369)));
5078if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH )
5079{
5080continue;
5081}
5082}
5083
5084{
5085std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
5086vinfos[0].jointtype = 1;
5087vinfos[0].foffset = j0;
5088vinfos[0].indices[0] = _ij0[0];
5089vinfos[0].indices[1] = _ij0[1];
5090vinfos[0].maxsolutions = _nj0;
5091vinfos[1].jointtype = 1;
5092vinfos[1].foffset = j1;
5093vinfos[1].indices[0] = _ij1[0];
5094vinfos[1].indices[1] = _ij1[1];
5095vinfos[1].maxsolutions = _nj1;
5096vinfos[2].jointtype = 1;
5097vinfos[2].foffset = j2;
5098vinfos[2].indices[0] = _ij2[0];
5099vinfos[2].indices[1] = _ij2[1];
5100vinfos[2].maxsolutions = _nj2;
5101vinfos[3].jointtype = 1;
5102vinfos[3].foffset = j3;
5103vinfos[3].indices[0] = _ij3[0];
5104vinfos[3].indices[1] = _ij3[1];
5105vinfos[3].maxsolutions = _nj3;
5106vinfos[4].jointtype = 1;
5107vinfos[4].foffset = j4;
5108vinfos[4].indices[0] = _ij4[0];
5109vinfos[4].indices[1] = _ij4[1];
5110vinfos[4].maxsolutions = _nj4;
5111vinfos[5].jointtype = 1;
5112vinfos[5].foffset = j5;
5113vinfos[5].indices[0] = _ij5[0];
5114vinfos[5].indices[1] = _ij5[1];
5115vinfos[5].maxsolutions = _nj5;
5116std::vector<int> vfree(0);
5117solutions.AddSolution(vinfos,vfree);
5118}
5119}
5120}
5121
5122}
5123
5124}
5125}
5126}
5127
5128}
5129
5130}
5131
5132} else
5133{
5134{
5135IkReal j5array[1], cj5array[1], sj5array[1];
5136bool j5valid[1]={false};
5137_nj5 = 1;
5139if(!x373.valid){
5140continue;
5141}
5143if(!x374.valid){
5144continue;
5145}
5146j5array[0]=((-1.5707963267949)+(x373.value)+(((1.5707963267949)*(x374.value))));
5147sj5array[0]=IKsin(j5array[0]);
5148cj5array[0]=IKcos(j5array[0]);
5149if( j5array[0] > IKPI )
5150{
5151 j5array[0]-=IK2PI;
5152}
5153else if( j5array[0] < -IKPI )
5154{ j5array[0]+=IK2PI;
5155}
5156j5valid[0] = true;
5157for(int ij5 = 0; ij5 < 1; ++ij5)
5158{
5159if( !j5valid[ij5] )
5160{
5161 continue;
5162}
5163_ij5[0] = ij5; _ij5[1] = -1;
5164for(int iij5 = ij5+1; iij5 < 1; ++iij5)
5165{
5166if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH )
5167{
5168 j5valid[iij5]=false; _ij5[1] = iij5; break;
5169}
5170}
5171j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5];
5172{
5173IkReal evalcond[2];
5174evalcond[0]=(((sj4*(IKsin(j5))))+new_r21);
5175evalcond[1]=((((-1.0)*sj4*(IKcos(j5))))+new_r20);
5176if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH )
5177{
5178continue;
5179}
5180}
5181
5182{
5183IkReal j3eval[3];
5184j3eval[0]=sj4;
5185j3eval[1]=IKsign(sj4);
5186j3eval[2]=((IKabs(new_r12))+(IKabs(new_r02)));
5187if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
5188{
5189{
5190IkReal j3eval[2];
5191j3eval[0]=new_r12;
5192j3eval[1]=sj4;
5193if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 )
5194{
5195{
5196IkReal evalcond[5];
5197bool bgotonextstatement = true;
5198do
5199{
5200evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j4))), 6.28318530717959)));
5201evalcond[1]=new_r02;
5202evalcond[2]=new_r12;
5203evalcond[3]=new_r21;
5204evalcond[4]=new_r20;
5205if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
5206{
5207bgotonextstatement=false;
5208{
5209IkReal j3eval[3];
5210sj4=0;
5211cj4=1.0;
5212j4=0;
5213IkReal x375=((1.0)*new_r11);
5214IkReal x376=((((-1.0)*new_r10*x375))+(((-1.0)*new_r00*new_r01)));
5215j3eval[0]=x376;
5216j3eval[1]=((IKabs((((new_r10*sj5))+((new_r01*sj5)))))+(IKabs(((((-1.0)*sj5*x375))+((new_r00*sj5))))));
5217j3eval[2]=IKsign(x376);
5218if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
5219{
5220{
5221IkReal j3eval[3];
5222sj4=0;
5223cj4=1.0;
5224j4=0;
5225IkReal x377=((((-1.0)*(new_r01*new_r01)))+(((-1.0)*(new_r11*new_r11))));
5226j3eval[0]=x377;
5227j3eval[1]=((IKabs((((new_r11*sj5))+((cj5*new_r01)))))+(IKabs((((new_r01*sj5))+(((-1.0)*cj5*new_r11))))));
5228j3eval[2]=IKsign(x377);
5229if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
5230{
5231{
5232IkReal j3eval[3];
5233sj4=0;
5234cj4=1.0;
5235j4=0;
5236IkReal x378=((1.0)*new_r11);
5237IkReal x379=((((-1.0)*cj5*x378))+(((-1.0)*new_r01*sj5)));
5238j3eval[0]=x379;
5239j3eval[1]=IKsign(x379);
5240j3eval[2]=((IKabs((((new_r00*new_r01))+((cj5*sj5)))))+(IKabs(((1.0)+(((-1.0)*new_r00*x378))+(((-1.0)*(cj5*cj5)))))));
5241if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
5242{
5243{
5244IkReal evalcond[1];
5245bool bgotonextstatement = true;
5246do
5247{
5248IkReal x380=((-1.0)*new_r01);
5249IkReal x382 = ((new_r01*new_r01)+(new_r11*new_r11));
5250if(IKabs(x382)==0){
5251continue;
5252}
5253IkReal x381=pow(x382,-0.5);
5254CheckValue<IkReal> x383 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(x380),IKFAST_ATAN2_MAGTHRESH);
5255if(!x383.valid){
5256continue;
5257}
5258IkReal gconst0=((-1.0)*(x383.value));
5259IkReal gconst1=(new_r11*x381);
5260IkReal gconst2=(x380*x381);
5261CheckValue<IkReal> x384 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(((-1.0)*new_r01)),IKFAST_ATAN2_MAGTHRESH);
5262if(!x384.valid){
5263continue;
5264}
5265evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((x384.value)+j5)))), 6.28318530717959)));
5266if( IKabs(evalcond[0]) < 0.0000050000000000 )
5267{
5268bgotonextstatement=false;
5269{
5270IkReal j3eval[3];
5271IkReal x385=((-1.0)*new_r01);
5272CheckValue<IkReal> x388 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(x385),IKFAST_ATAN2_MAGTHRESH);
5273if(!x388.valid){
5274continue;
5275}
5276IkReal x386=((-1.0)*(x388.value));
5277IkReal x387=x381;
5278sj4=0;
5279cj4=1.0;
5280j4=0;
5281sj5=gconst1;
5282cj5=gconst2;
5283j5=x386;
5284IkReal gconst0=x386;
5285IkReal gconst1=(new_r11*x387);
5286IkReal gconst2=(x385*x387);
5287IkReal x389=new_r11*new_r11;
5288IkReal x390=(new_r10*new_r11);
5289IkReal x391=((((-1.0)*x390))+(((-1.0)*new_r00*new_r01)));
5290IkReal x392=x381;
5291IkReal x393=(new_r11*x392);
5292j3eval[0]=x391;
5293j3eval[1]=((IKabs(((((-1.0)*x389*x392))+((new_r00*x393)))))+(IKabs((((new_r01*x393))+((x390*x392))))));
5294j3eval[2]=IKsign(x391);
5295if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
5296{
5297{
5298IkReal j3eval[1];
5299IkReal x394=((-1.0)*new_r01);
5300CheckValue<IkReal> x397 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(x394),IKFAST_ATAN2_MAGTHRESH);
5301if(!x397.valid){
5302continue;
5303}
5304IkReal x395=((-1.0)*(x397.value));
5305IkReal x396=x381;
5306sj4=0;
5307cj4=1.0;
5308j4=0;
5309sj5=gconst1;
5310cj5=gconst2;
5311j5=x395;
5312IkReal gconst0=x395;
5313IkReal gconst1=(new_r11*x396);
5314IkReal gconst2=(x394*x396);
5315IkReal x398=new_r11*new_r11;
5317if(!x401.valid){
5318continue;
5319}
5320IkReal x399=x401.value;
5321IkReal x400=(x398*x399);
5322j3eval[0]=((IKabs((((new_r01*new_r10))+x400)))+(IKabs((((new_r00*new_r01*x400))+((new_r00*x399*(new_r01*new_r01*new_r01)))+((new_r01*new_r11*x399))))));
5323if( IKabs(j3eval[0]) < 0.0000010000000000 )
5324{
5325{
5326IkReal j3eval[1];
5327IkReal x402=((-1.0)*new_r01);
5328CheckValue<IkReal> x405 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(x402),IKFAST_ATAN2_MAGTHRESH);
5329if(!x405.valid){
5330continue;
5331}
5332IkReal x403=((-1.0)*(x405.value));
5333IkReal x404=x381;
5334sj4=0;
5335cj4=1.0;
5336j4=0;
5337sj5=gconst1;
5338cj5=gconst2;
5339j5=x403;
5340IkReal gconst0=x403;
5341IkReal gconst1=(new_r11*x404);
5342IkReal gconst2=(x402*x404);
5343IkReal x406=new_r01*new_r01;
5344IkReal x407=new_r11*new_r11;
5345CheckValue<IkReal> x414=IKPowWithIntegerCheck((x407+x406),-1);
5346if(!x414.valid){
5347continue;
5348}
5349IkReal x408=x414.value;
5350IkReal x409=(x407*x408);
5351CheckValue<IkReal> x415=IKPowWithIntegerCheck(((((-1.0)*x406))+(((-1.0)*x407))),-1);
5352if(!x415.valid){
5353continue;
5354}
5355IkReal x410=x415.value;
5356IkReal x411=((1.0)*x410);
5357IkReal x412=(new_r11*x411);
5358IkReal x413=(new_r01*x411);
5359j3eval[0]=((IKabs((((x406*x409))+((x408*(x406*x406)))+(((-1.0)*x409)))))+(IKabs(((((-1.0)*new_r01*x412*(new_r11*new_r11)))+(((-1.0)*x412*(new_r01*new_r01*new_r01)))+(((-1.0)*new_r01*x412))))));
5360if( IKabs(j3eval[0]) < 0.0000010000000000 )
5361{
5362{
5363IkReal evalcond[3];
5364bool bgotonextstatement = true;
5365do
5366{
5367evalcond[0]=((IKabs(new_r11))+(IKabs(new_r00)));
5368if( IKabs(evalcond[0]) < 0.0000050000000000 )
5369{
5370bgotonextstatement=false;
5371{
5372IkReal j3array[2], cj3array[2], sj3array[2];
5373bool j3valid[2]={false};
5374_nj3 = 2;
5376if(!x416.valid){
5377continue;
5378}
5379sj3array[0]=(new_r10*(x416.value));
5380if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
5381{
5382 j3valid[0] = j3valid[1] = true;
5383 j3array[0] = IKasin(sj3array[0]);
5384 cj3array[0] = IKcos(j3array[0]);
5385 sj3array[1] = sj3array[0];
5386 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
5387 cj3array[1] = -cj3array[0];
5388}
5389else if( isnan(sj3array[0]) )
5390{
5391 // probably any value will work
5392 j3valid[0] = true;
5393 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
5394}
5395for(int ij3 = 0; ij3 < 2; ++ij3)
5396{
5397if( !j3valid[ij3] )
5398{
5399 continue;
5400}
5401_ij3[0] = ij3; _ij3[1] = -1;
5402for(int iij3 = ij3+1; iij3 < 2; ++iij3)
5403{
5404if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
5405{
5406 j3valid[iij3]=false; _ij3[1] = iij3; break;
5407}
5408}
5409j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
5410{
5411IkReal evalcond[6];
5412IkReal x417=IKcos(j3);
5413IkReal x418=IKsin(j3);
5414IkReal x419=((-1.0)*x417);
5415evalcond[0]=(new_r01*x417);
5416evalcond[1]=(new_r10*x419);
5417evalcond[2]=(gconst2*x419);
5418evalcond[3]=(gconst2+((new_r01*x418)));
5419evalcond[4]=(((gconst2*x418))+new_r01);
5420evalcond[5]=((((-1.0)*gconst2))+((new_r10*x418)));
5421if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
5422{
5423continue;
5424}
5425}
5426
5427{
5428std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
5429vinfos[0].jointtype = 1;
5430vinfos[0].foffset = j0;
5431vinfos[0].indices[0] = _ij0[0];
5432vinfos[0].indices[1] = _ij0[1];
5433vinfos[0].maxsolutions = _nj0;
5434vinfos[1].jointtype = 1;
5435vinfos[1].foffset = j1;
5436vinfos[1].indices[0] = _ij1[0];
5437vinfos[1].indices[1] = _ij1[1];
5438vinfos[1].maxsolutions = _nj1;
5439vinfos[2].jointtype = 1;
5440vinfos[2].foffset = j2;
5441vinfos[2].indices[0] = _ij2[0];
5442vinfos[2].indices[1] = _ij2[1];
5443vinfos[2].maxsolutions = _nj2;
5444vinfos[3].jointtype = 1;
5445vinfos[3].foffset = j3;
5446vinfos[3].indices[0] = _ij3[0];
5447vinfos[3].indices[1] = _ij3[1];
5448vinfos[3].maxsolutions = _nj3;
5449vinfos[4].jointtype = 1;
5450vinfos[4].foffset = j4;
5451vinfos[4].indices[0] = _ij4[0];
5452vinfos[4].indices[1] = _ij4[1];
5453vinfos[4].maxsolutions = _nj4;
5454vinfos[5].jointtype = 1;
5455vinfos[5].foffset = j5;
5456vinfos[5].indices[0] = _ij5[0];
5457vinfos[5].indices[1] = _ij5[1];
5458vinfos[5].maxsolutions = _nj5;
5459std::vector<int> vfree(0);
5460solutions.AddSolution(vinfos,vfree);
5461}
5462}
5463}
5464
5465}
5466} while(0);
5467if( bgotonextstatement )
5468{
5469bool bgotonextstatement = true;
5470do
5471{
5472evalcond[0]=((IKabs(new_r10))+(IKabs(new_r00)));
5473evalcond[1]=gconst1;
5474evalcond[2]=gconst2;
5475if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 )
5476{
5477bgotonextstatement=false;
5478{
5479IkReal j3eval[3];
5480IkReal x420=((-1.0)*new_r01);
5481CheckValue<IkReal> x422 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(x420),IKFAST_ATAN2_MAGTHRESH);
5482if(!x422.valid){
5483continue;
5484}
5485IkReal x421=((-1.0)*(x422.value));
5486sj4=0;
5487cj4=1.0;
5488j4=0;
5489sj5=gconst1;
5490cj5=gconst2;
5491j5=x421;
5492new_r00=0;
5493new_r10=0;
5494new_r21=0;
5495new_r22=0;
5496IkReal gconst0=x421;
5497IkReal gconst1=new_r11;
5498IkReal gconst2=x420;
5499j3eval[0]=-1.0;
5500j3eval[1]=-1.0;
5501j3eval[2]=((IKabs((new_r01*new_r11)))+(IKabs(((1.0)+(((-1.0)*(new_r01*new_r01)))))));
5502if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
5503{
5504{
5505IkReal j3eval[3];
5506IkReal x423=((-1.0)*new_r01);
5507CheckValue<IkReal> x425 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(x423),IKFAST_ATAN2_MAGTHRESH);
5508if(!x425.valid){
5509continue;
5510}
5511IkReal x424=((-1.0)*(x425.value));
5512sj4=0;
5513cj4=1.0;
5514j4=0;
5515sj5=gconst1;
5516cj5=gconst2;
5517j5=x424;
5518new_r00=0;
5519new_r10=0;
5520new_r21=0;
5521new_r22=0;
5522IkReal gconst0=x424;
5523IkReal gconst1=new_r11;
5524IkReal gconst2=x423;
5525j3eval[0]=-1.0;
5526j3eval[1]=((IKabs(new_r01*new_r01))+(IKabs((new_r01*new_r11))));
5527j3eval[2]=-1.0;
5528if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
5529{
5530{
5531IkReal j3eval[3];
5532IkReal x426=((-1.0)*new_r01);
5533CheckValue<IkReal> x428 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(x426),IKFAST_ATAN2_MAGTHRESH);
5534if(!x428.valid){
5535continue;
5536}
5537IkReal x427=((-1.0)*(x428.value));
5538sj4=0;
5539cj4=1.0;
5540j4=0;
5541sj5=gconst1;
5542cj5=gconst2;
5543j5=x427;
5544new_r00=0;
5545new_r10=0;
5546new_r21=0;
5547new_r22=0;
5548IkReal gconst0=x427;
5549IkReal gconst1=new_r11;
5550IkReal gconst2=x426;
5551j3eval[0]=1.0;
5552j3eval[1]=1.0;
5553j3eval[2]=((((0.5)*(IKabs(((-1.0)+(((2.0)*(new_r01*new_r01))))))))+(IKabs((new_r01*new_r11))));
5554if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
5555{
5556continue; // 3 cases reached
5557
5558} else
5559{
5560{
5561IkReal j3array[1], cj3array[1], sj3array[1];
5562bool j3valid[1]={false};
5563_nj3 = 1;
5564IkReal x429=((1.0)*new_r01);
5565CheckValue<IkReal> x430 = IKatan2WithCheck(IkReal(((new_r01*new_r01)+(((-1.0)*(gconst1*gconst1))))),IkReal(((((-1.0)*new_r11*x429))+((gconst1*gconst2)))),IKFAST_ATAN2_MAGTHRESH);
5566if(!x430.valid){
5567continue;
5568}
5569CheckValue<IkReal> x431=IKPowWithIntegerCheck(IKsign((((gconst1*new_r11))+(((-1.0)*gconst2*x429)))),-1);
5570if(!x431.valid){
5571continue;
5572}
5573j3array[0]=((-1.5707963267949)+(x430.value)+(((1.5707963267949)*(x431.value))));
5574sj3array[0]=IKsin(j3array[0]);
5575cj3array[0]=IKcos(j3array[0]);
5576if( j3array[0] > IKPI )
5577{
5578 j3array[0]-=IK2PI;
5579}
5580else if( j3array[0] < -IKPI )
5581{ j3array[0]+=IK2PI;
5582}
5583j3valid[0] = true;
5584for(int ij3 = 0; ij3 < 1; ++ij3)
5585{
5586if( !j3valid[ij3] )
5587{
5588 continue;
5589}
5590_ij3[0] = ij3; _ij3[1] = -1;
5591for(int iij3 = ij3+1; iij3 < 1; ++iij3)
5592{
5593if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
5594{
5595 j3valid[iij3]=false; _ij3[1] = iij3; break;
5596}
5597}
5598j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
5599{
5600IkReal evalcond[6];
5601IkReal x432=IKcos(j3);
5602IkReal x433=IKsin(j3);
5603IkReal x434=(gconst1*x433);
5604IkReal x435=(gconst2*x433);
5605IkReal x436=((1.0)*x432);
5606IkReal x437=(gconst2*x436);
5607evalcond[0]=(((new_r01*x432))+gconst1+((new_r11*x433)));
5608evalcond[1]=(((gconst1*x432))+x435+new_r01);
5609evalcond[2]=((((-1.0)*x437))+x434);
5610evalcond[3]=(((new_r01*x433))+gconst2+(((-1.0)*new_r11*x436)));
5611evalcond[4]=((((-1.0)*x437))+x434+new_r11);
5612evalcond[5]=((((-1.0)*x435))+(((-1.0)*gconst1*x436)));
5613if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
5614{
5615continue;
5616}
5617}
5618
5619{
5620std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
5621vinfos[0].jointtype = 1;
5622vinfos[0].foffset = j0;
5623vinfos[0].indices[0] = _ij0[0];
5624vinfos[0].indices[1] = _ij0[1];
5625vinfos[0].maxsolutions = _nj0;
5626vinfos[1].jointtype = 1;
5627vinfos[1].foffset = j1;
5628vinfos[1].indices[0] = _ij1[0];
5629vinfos[1].indices[1] = _ij1[1];
5630vinfos[1].maxsolutions = _nj1;
5631vinfos[2].jointtype = 1;
5632vinfos[2].foffset = j2;
5633vinfos[2].indices[0] = _ij2[0];
5634vinfos[2].indices[1] = _ij2[1];
5635vinfos[2].maxsolutions = _nj2;
5636vinfos[3].jointtype = 1;
5637vinfos[3].foffset = j3;
5638vinfos[3].indices[0] = _ij3[0];
5639vinfos[3].indices[1] = _ij3[1];
5640vinfos[3].maxsolutions = _nj3;
5641vinfos[4].jointtype = 1;
5642vinfos[4].foffset = j4;
5643vinfos[4].indices[0] = _ij4[0];
5644vinfos[4].indices[1] = _ij4[1];
5645vinfos[4].maxsolutions = _nj4;
5646vinfos[5].jointtype = 1;
5647vinfos[5].foffset = j5;
5648vinfos[5].indices[0] = _ij5[0];
5649vinfos[5].indices[1] = _ij5[1];
5650vinfos[5].maxsolutions = _nj5;
5651std::vector<int> vfree(0);
5652solutions.AddSolution(vinfos,vfree);
5653}
5654}
5655}
5656
5657}
5658
5659}
5660
5661} else
5662{
5663{
5664IkReal j3array[1], cj3array[1], sj3array[1];
5665bool j3valid[1]={false};
5666_nj3 = 1;
5667CheckValue<IkReal> x438=IKPowWithIntegerCheck(IKsign(((((-1.0)*(gconst2*gconst2)))+(((-1.0)*(gconst1*gconst1))))),-1);
5668if(!x438.valid){
5669continue;
5670}
5671CheckValue<IkReal> x439 = IKatan2WithCheck(IkReal((gconst2*new_r01)),IkReal((gconst1*new_r01)),IKFAST_ATAN2_MAGTHRESH);
5672if(!x439.valid){
5673continue;
5674}
5675j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x438.value)))+(x439.value));
5676sj3array[0]=IKsin(j3array[0]);
5677cj3array[0]=IKcos(j3array[0]);
5678if( j3array[0] > IKPI )
5679{
5680 j3array[0]-=IK2PI;
5681}
5682else if( j3array[0] < -IKPI )
5683{ j3array[0]+=IK2PI;
5684}
5685j3valid[0] = true;
5686for(int ij3 = 0; ij3 < 1; ++ij3)
5687{
5688if( !j3valid[ij3] )
5689{
5690 continue;
5691}
5692_ij3[0] = ij3; _ij3[1] = -1;
5693for(int iij3 = ij3+1; iij3 < 1; ++iij3)
5694{
5695if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
5696{
5697 j3valid[iij3]=false; _ij3[1] = iij3; break;
5698}
5699}
5700j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
5701{
5702IkReal evalcond[6];
5703IkReal x440=IKcos(j3);
5704IkReal x441=IKsin(j3);
5705IkReal x442=(gconst1*x441);
5706IkReal x443=(gconst2*x441);
5707IkReal x444=((1.0)*x440);
5708IkReal x445=(gconst2*x444);
5709evalcond[0]=(((new_r01*x440))+gconst1+((new_r11*x441)));
5710evalcond[1]=(((gconst1*x440))+x443+new_r01);
5711evalcond[2]=((((-1.0)*x445))+x442);
5712evalcond[3]=(((new_r01*x441))+gconst2+(((-1.0)*new_r11*x444)));
5713evalcond[4]=((((-1.0)*x445))+x442+new_r11);
5714evalcond[5]=((((-1.0)*x443))+(((-1.0)*gconst1*x444)));
5715if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
5716{
5717continue;
5718}
5719}
5720
5721{
5722std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
5723vinfos[0].jointtype = 1;
5724vinfos[0].foffset = j0;
5725vinfos[0].indices[0] = _ij0[0];
5726vinfos[0].indices[1] = _ij0[1];
5727vinfos[0].maxsolutions = _nj0;
5728vinfos[1].jointtype = 1;
5729vinfos[1].foffset = j1;
5730vinfos[1].indices[0] = _ij1[0];
5731vinfos[1].indices[1] = _ij1[1];
5732vinfos[1].maxsolutions = _nj1;
5733vinfos[2].jointtype = 1;
5734vinfos[2].foffset = j2;
5735vinfos[2].indices[0] = _ij2[0];
5736vinfos[2].indices[1] = _ij2[1];
5737vinfos[2].maxsolutions = _nj2;
5738vinfos[3].jointtype = 1;
5739vinfos[3].foffset = j3;
5740vinfos[3].indices[0] = _ij3[0];
5741vinfos[3].indices[1] = _ij3[1];
5742vinfos[3].maxsolutions = _nj3;
5743vinfos[4].jointtype = 1;
5744vinfos[4].foffset = j4;
5745vinfos[4].indices[0] = _ij4[0];
5746vinfos[4].indices[1] = _ij4[1];
5747vinfos[4].maxsolutions = _nj4;
5748vinfos[5].jointtype = 1;
5749vinfos[5].foffset = j5;
5750vinfos[5].indices[0] = _ij5[0];
5751vinfos[5].indices[1] = _ij5[1];
5752vinfos[5].maxsolutions = _nj5;
5753std::vector<int> vfree(0);
5754solutions.AddSolution(vinfos,vfree);
5755}
5756}
5757}
5758
5759}
5760
5761}
5762
5763} else
5764{
5765{
5766IkReal j3array[1], cj3array[1], sj3array[1];
5767bool j3valid[1]={false};
5768_nj3 = 1;
5769CheckValue<IkReal> x446 = IKatan2WithCheck(IkReal(gconst1*gconst1),IkReal(((-1.0)*gconst1*gconst2)),IKFAST_ATAN2_MAGTHRESH);
5770if(!x446.valid){
5771continue;
5772}
5773CheckValue<IkReal> x447=IKPowWithIntegerCheck(IKsign((((gconst2*new_r01))+(((-1.0)*gconst1*new_r11)))),-1);
5774if(!x447.valid){
5775continue;
5776}
5777j3array[0]=((-1.5707963267949)+(x446.value)+(((1.5707963267949)*(x447.value))));
5778sj3array[0]=IKsin(j3array[0]);
5779cj3array[0]=IKcos(j3array[0]);
5780if( j3array[0] > IKPI )
5781{
5782 j3array[0]-=IK2PI;
5783}
5784else if( j3array[0] < -IKPI )
5785{ j3array[0]+=IK2PI;
5786}
5787j3valid[0] = true;
5788for(int ij3 = 0; ij3 < 1; ++ij3)
5789{
5790if( !j3valid[ij3] )
5791{
5792 continue;
5793}
5794_ij3[0] = ij3; _ij3[1] = -1;
5795for(int iij3 = ij3+1; iij3 < 1; ++iij3)
5796{
5797if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
5798{
5799 j3valid[iij3]=false; _ij3[1] = iij3; break;
5800}
5801}
5802j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
5803{
5804IkReal evalcond[6];
5805IkReal x448=IKcos(j3);
5806IkReal x449=IKsin(j3);
5807IkReal x450=(gconst1*x449);
5808IkReal x451=(gconst2*x449);
5809IkReal x452=((1.0)*x448);
5810IkReal x453=(gconst2*x452);
5811evalcond[0]=(((new_r01*x448))+gconst1+((new_r11*x449)));
5812evalcond[1]=(((gconst1*x448))+x451+new_r01);
5813evalcond[2]=((((-1.0)*x453))+x450);
5814evalcond[3]=(((new_r01*x449))+gconst2+(((-1.0)*new_r11*x452)));
5815evalcond[4]=((((-1.0)*x453))+x450+new_r11);
5816evalcond[5]=((((-1.0)*x451))+(((-1.0)*gconst1*x452)));
5817if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
5818{
5819continue;
5820}
5821}
5822
5823{
5824std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
5825vinfos[0].jointtype = 1;
5826vinfos[0].foffset = j0;
5827vinfos[0].indices[0] = _ij0[0];
5828vinfos[0].indices[1] = _ij0[1];
5829vinfos[0].maxsolutions = _nj0;
5830vinfos[1].jointtype = 1;
5831vinfos[1].foffset = j1;
5832vinfos[1].indices[0] = _ij1[0];
5833vinfos[1].indices[1] = _ij1[1];
5834vinfos[1].maxsolutions = _nj1;
5835vinfos[2].jointtype = 1;
5836vinfos[2].foffset = j2;
5837vinfos[2].indices[0] = _ij2[0];
5838vinfos[2].indices[1] = _ij2[1];
5839vinfos[2].maxsolutions = _nj2;
5840vinfos[3].jointtype = 1;
5841vinfos[3].foffset = j3;
5842vinfos[3].indices[0] = _ij3[0];
5843vinfos[3].indices[1] = _ij3[1];
5844vinfos[3].maxsolutions = _nj3;
5845vinfos[4].jointtype = 1;
5846vinfos[4].foffset = j4;
5847vinfos[4].indices[0] = _ij4[0];
5848vinfos[4].indices[1] = _ij4[1];
5849vinfos[4].maxsolutions = _nj4;
5850vinfos[5].jointtype = 1;
5851vinfos[5].foffset = j5;
5852vinfos[5].indices[0] = _ij5[0];
5853vinfos[5].indices[1] = _ij5[1];
5854vinfos[5].maxsolutions = _nj5;
5855std::vector<int> vfree(0);
5856solutions.AddSolution(vinfos,vfree);
5857}
5858}
5859}
5860
5861}
5862
5863}
5864
5865}
5866} while(0);
5867if( bgotonextstatement )
5868{
5869bool bgotonextstatement = true;
5870do
5871{
5872evalcond[0]=((IKabs(new_r10))+(IKabs(new_r01)));
5873if( IKabs(evalcond[0]) < 0.0000050000000000 )
5874{
5875bgotonextstatement=false;
5876{
5877IkReal j3eval[1];
5878CheckValue<IkReal> x455 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
5879if(!x455.valid){
5880continue;
5881}
5882IkReal x454=((-1.0)*(x455.value));
5883sj4=0;
5884cj4=1.0;
5885j4=0;
5886sj5=gconst1;
5887cj5=gconst2;
5888j5=x454;
5889new_r01=0;
5890new_r10=0;
5891IkReal gconst0=x454;
5892IkReal x456 = new_r11*new_r11;
5893if(IKabs(x456)==0){
5894continue;
5895}
5896IkReal gconst1=(new_r11*(pow(x456,-0.5)));
5897IkReal gconst2=0;
5898j3eval[0]=new_r00;
5899if( IKabs(j3eval[0]) < 0.0000010000000000 )
5900{
5901{
5902IkReal j3eval[1];
5903CheckValue<IkReal> x458 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
5904if(!x458.valid){
5905continue;
5906}
5907IkReal x457=((-1.0)*(x458.value));
5908sj4=0;
5909cj4=1.0;
5910j4=0;
5911sj5=gconst1;
5912cj5=gconst2;
5913j5=x457;
5914new_r01=0;
5915new_r10=0;
5916IkReal gconst0=x457;
5917IkReal x459 = new_r11*new_r11;
5918if(IKabs(x459)==0){
5919continue;
5920}
5921IkReal gconst1=(new_r11*(pow(x459,-0.5)));
5922IkReal gconst2=0;
5923j3eval[0]=new_r11;
5924if( IKabs(j3eval[0]) < 0.0000010000000000 )
5925{
5926{
5927IkReal j3array[2], cj3array[2], sj3array[2];
5928bool j3valid[2]={false};
5929_nj3 = 2;
5931if(!x460.valid){
5932continue;
5933}
5934sj3array[0]=((-1.0)*new_r00*(x460.value));
5935if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
5936{
5937 j3valid[0] = j3valid[1] = true;
5938 j3array[0] = IKasin(sj3array[0]);
5939 cj3array[0] = IKcos(j3array[0]);
5940 sj3array[1] = sj3array[0];
5941 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
5942 cj3array[1] = -cj3array[0];
5943}
5944else if( isnan(sj3array[0]) )
5945{
5946 // probably any value will work
5947 j3valid[0] = true;
5948 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
5949}
5950for(int ij3 = 0; ij3 < 2; ++ij3)
5951{
5952if( !j3valid[ij3] )
5953{
5954 continue;
5955}
5956_ij3[0] = ij3; _ij3[1] = -1;
5957for(int iij3 = ij3+1; iij3 < 2; ++iij3)
5958{
5959if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
5960{
5961 j3valid[iij3]=false; _ij3[1] = iij3; break;
5962}
5963}
5964j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
5965{
5966IkReal evalcond[6];
5967IkReal x461=IKcos(j3);
5968IkReal x462=IKsin(j3);
5969evalcond[0]=(gconst1*x461);
5970evalcond[1]=(new_r00*x461);
5971evalcond[2]=((-1.0)*new_r11*x461);
5972evalcond[3]=(((new_r00*x462))+gconst1);
5973evalcond[4]=(((new_r11*x462))+gconst1);
5974evalcond[5]=(((gconst1*x462))+new_r11);
5975if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
5976{
5977continue;
5978}
5979}
5980
5981{
5982std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
5983vinfos[0].jointtype = 1;
5984vinfos[0].foffset = j0;
5985vinfos[0].indices[0] = _ij0[0];
5986vinfos[0].indices[1] = _ij0[1];
5987vinfos[0].maxsolutions = _nj0;
5988vinfos[1].jointtype = 1;
5989vinfos[1].foffset = j1;
5990vinfos[1].indices[0] = _ij1[0];
5991vinfos[1].indices[1] = _ij1[1];
5992vinfos[1].maxsolutions = _nj1;
5993vinfos[2].jointtype = 1;
5994vinfos[2].foffset = j2;
5995vinfos[2].indices[0] = _ij2[0];
5996vinfos[2].indices[1] = _ij2[1];
5997vinfos[2].maxsolutions = _nj2;
5998vinfos[3].jointtype = 1;
5999vinfos[3].foffset = j3;
6000vinfos[3].indices[0] = _ij3[0];
6001vinfos[3].indices[1] = _ij3[1];
6002vinfos[3].maxsolutions = _nj3;
6003vinfos[4].jointtype = 1;
6004vinfos[4].foffset = j4;
6005vinfos[4].indices[0] = _ij4[0];
6006vinfos[4].indices[1] = _ij4[1];
6007vinfos[4].maxsolutions = _nj4;
6008vinfos[5].jointtype = 1;
6009vinfos[5].foffset = j5;
6010vinfos[5].indices[0] = _ij5[0];
6011vinfos[5].indices[1] = _ij5[1];
6012vinfos[5].maxsolutions = _nj5;
6013std::vector<int> vfree(0);
6014solutions.AddSolution(vinfos,vfree);
6015}
6016}
6017}
6018
6019} else
6020{
6021{
6022IkReal j3array[2], cj3array[2], sj3array[2];
6023bool j3valid[2]={false};
6024_nj3 = 2;
6026if(!x463.valid){
6027continue;
6028}
6029sj3array[0]=((-1.0)*gconst1*(x463.value));
6030if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
6031{
6032 j3valid[0] = j3valid[1] = true;
6033 j3array[0] = IKasin(sj3array[0]);
6034 cj3array[0] = IKcos(j3array[0]);
6035 sj3array[1] = sj3array[0];
6036 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
6037 cj3array[1] = -cj3array[0];
6038}
6039else if( isnan(sj3array[0]) )
6040{
6041 // probably any value will work
6042 j3valid[0] = true;
6043 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
6044}
6045for(int ij3 = 0; ij3 < 2; ++ij3)
6046{
6047if( !j3valid[ij3] )
6048{
6049 continue;
6050}
6051_ij3[0] = ij3; _ij3[1] = -1;
6052for(int iij3 = ij3+1; iij3 < 2; ++iij3)
6053{
6054if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
6055{
6056 j3valid[iij3]=false; _ij3[1] = iij3; break;
6057}
6058}
6059j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
6060{
6061IkReal evalcond[6];
6062IkReal x464=IKcos(j3);
6063IkReal x465=IKsin(j3);
6064IkReal x466=(gconst1*x465);
6065evalcond[0]=(gconst1*x464);
6066evalcond[1]=(new_r00*x464);
6067evalcond[2]=((-1.0)*new_r11*x464);
6068evalcond[3]=(((new_r00*x465))+gconst1);
6069evalcond[4]=(x466+new_r00);
6070evalcond[5]=(x466+new_r11);
6071if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
6072{
6073continue;
6074}
6075}
6076
6077{
6078std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
6079vinfos[0].jointtype = 1;
6080vinfos[0].foffset = j0;
6081vinfos[0].indices[0] = _ij0[0];
6082vinfos[0].indices[1] = _ij0[1];
6083vinfos[0].maxsolutions = _nj0;
6084vinfos[1].jointtype = 1;
6085vinfos[1].foffset = j1;
6086vinfos[1].indices[0] = _ij1[0];
6087vinfos[1].indices[1] = _ij1[1];
6088vinfos[1].maxsolutions = _nj1;
6089vinfos[2].jointtype = 1;
6090vinfos[2].foffset = j2;
6091vinfos[2].indices[0] = _ij2[0];
6092vinfos[2].indices[1] = _ij2[1];
6093vinfos[2].maxsolutions = _nj2;
6094vinfos[3].jointtype = 1;
6095vinfos[3].foffset = j3;
6096vinfos[3].indices[0] = _ij3[0];
6097vinfos[3].indices[1] = _ij3[1];
6098vinfos[3].maxsolutions = _nj3;
6099vinfos[4].jointtype = 1;
6100vinfos[4].foffset = j4;
6101vinfos[4].indices[0] = _ij4[0];
6102vinfos[4].indices[1] = _ij4[1];
6103vinfos[4].maxsolutions = _nj4;
6104vinfos[5].jointtype = 1;
6105vinfos[5].foffset = j5;
6106vinfos[5].indices[0] = _ij5[0];
6107vinfos[5].indices[1] = _ij5[1];
6108vinfos[5].maxsolutions = _nj5;
6109std::vector<int> vfree(0);
6110solutions.AddSolution(vinfos,vfree);
6111}
6112}
6113}
6114
6115}
6116
6117}
6118
6119} else
6120{
6121{
6122IkReal j3array[2], cj3array[2], sj3array[2];
6123bool j3valid[2]={false};
6124_nj3 = 2;
6126if(!x467.valid){
6127continue;
6128}
6129sj3array[0]=((-1.0)*gconst1*(x467.value));
6130if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
6131{
6132 j3valid[0] = j3valid[1] = true;
6133 j3array[0] = IKasin(sj3array[0]);
6134 cj3array[0] = IKcos(j3array[0]);
6135 sj3array[1] = sj3array[0];
6136 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
6137 cj3array[1] = -cj3array[0];
6138}
6139else if( isnan(sj3array[0]) )
6140{
6141 // probably any value will work
6142 j3valid[0] = true;
6143 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
6144}
6145for(int ij3 = 0; ij3 < 2; ++ij3)
6146{
6147if( !j3valid[ij3] )
6148{
6149 continue;
6150}
6151_ij3[0] = ij3; _ij3[1] = -1;
6152for(int iij3 = ij3+1; iij3 < 2; ++iij3)
6153{
6154if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
6155{
6156 j3valid[iij3]=false; _ij3[1] = iij3; break;
6157}
6158}
6159j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
6160{
6161IkReal evalcond[6];
6162IkReal x468=IKcos(j3);
6163IkReal x469=IKsin(j3);
6164IkReal x470=(gconst1*x469);
6165evalcond[0]=(gconst1*x468);
6166evalcond[1]=(new_r00*x468);
6167evalcond[2]=((-1.0)*new_r11*x468);
6168evalcond[3]=(((new_r11*x469))+gconst1);
6169evalcond[4]=(x470+new_r00);
6170evalcond[5]=(x470+new_r11);
6171if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
6172{
6173continue;
6174}
6175}
6176
6177{
6178std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
6179vinfos[0].jointtype = 1;
6180vinfos[0].foffset = j0;
6181vinfos[0].indices[0] = _ij0[0];
6182vinfos[0].indices[1] = _ij0[1];
6183vinfos[0].maxsolutions = _nj0;
6184vinfos[1].jointtype = 1;
6185vinfos[1].foffset = j1;
6186vinfos[1].indices[0] = _ij1[0];
6187vinfos[1].indices[1] = _ij1[1];
6188vinfos[1].maxsolutions = _nj1;
6189vinfos[2].jointtype = 1;
6190vinfos[2].foffset = j2;
6191vinfos[2].indices[0] = _ij2[0];
6192vinfos[2].indices[1] = _ij2[1];
6193vinfos[2].maxsolutions = _nj2;
6194vinfos[3].jointtype = 1;
6195vinfos[3].foffset = j3;
6196vinfos[3].indices[0] = _ij3[0];
6197vinfos[3].indices[1] = _ij3[1];
6198vinfos[3].maxsolutions = _nj3;
6199vinfos[4].jointtype = 1;
6200vinfos[4].foffset = j4;
6201vinfos[4].indices[0] = _ij4[0];
6202vinfos[4].indices[1] = _ij4[1];
6203vinfos[4].maxsolutions = _nj4;
6204vinfos[5].jointtype = 1;
6205vinfos[5].foffset = j5;
6206vinfos[5].indices[0] = _ij5[0];
6207vinfos[5].indices[1] = _ij5[1];
6208vinfos[5].maxsolutions = _nj5;
6209std::vector<int> vfree(0);
6210solutions.AddSolution(vinfos,vfree);
6211}
6212}
6213}
6214
6215}
6216
6217}
6218
6219}
6220} while(0);
6221if( bgotonextstatement )
6222{
6223bool bgotonextstatement = true;
6224do
6225{
6226evalcond[0]=IKabs(new_r11);
6227if( IKabs(evalcond[0]) < 0.0000050000000000 )
6228{
6229bgotonextstatement=false;
6230{
6231IkReal j3eval[1];
6232IkReal x471=((-1.0)*new_r01);
6233CheckValue<IkReal> x473 = IKatan2WithCheck(IkReal(0),IkReal(x471),IKFAST_ATAN2_MAGTHRESH);
6234if(!x473.valid){
6235continue;
6236}
6237IkReal x472=((-1.0)*(x473.value));
6238sj4=0;
6239cj4=1.0;
6240j4=0;
6241sj5=gconst1;
6242cj5=gconst2;
6243j5=x472;
6244new_r11=0;
6245IkReal gconst0=x472;
6246IkReal gconst1=0;
6247IkReal x474 = new_r01*new_r01;
6248if(IKabs(x474)==0){
6249continue;
6250}
6251IkReal gconst2=(x471*(pow(x474,-0.5)));
6252j3eval[0]=((IKabs(new_r10))+(IKabs(new_r00)));
6253if( IKabs(j3eval[0]) < 0.0000010000000000 )
6254{
6255{
6256IkReal j3eval[1];
6257IkReal x475=((-1.0)*new_r01);
6258CheckValue<IkReal> x477 = IKatan2WithCheck(IkReal(0),IkReal(x475),IKFAST_ATAN2_MAGTHRESH);
6259if(!x477.valid){
6260continue;
6261}
6262IkReal x476=((-1.0)*(x477.value));
6263sj4=0;
6264cj4=1.0;
6265j4=0;
6266sj5=gconst1;
6267cj5=gconst2;
6268j5=x476;
6269new_r11=0;
6270IkReal gconst0=x476;
6271IkReal gconst1=0;
6272IkReal x478 = new_r01*new_r01;
6273if(IKabs(x478)==0){
6274continue;
6275}
6276IkReal gconst2=(x475*(pow(x478,-0.5)));
6277j3eval[0]=((IKabs(new_r00))+(IKabs(new_r01)));
6278if( IKabs(j3eval[0]) < 0.0000010000000000 )
6279{
6280{
6281IkReal j3eval[1];
6282IkReal x479=((-1.0)*new_r01);
6283CheckValue<IkReal> x481 = IKatan2WithCheck(IkReal(0),IkReal(x479),IKFAST_ATAN2_MAGTHRESH);
6284if(!x481.valid){
6285continue;
6286}
6287IkReal x480=((-1.0)*(x481.value));
6288sj4=0;
6289cj4=1.0;
6290j4=0;
6291sj5=gconst1;
6292cj5=gconst2;
6293j5=x480;
6294new_r11=0;
6295IkReal gconst0=x480;
6296IkReal gconst1=0;
6297IkReal x482 = new_r01*new_r01;
6298if(IKabs(x482)==0){
6299continue;
6300}
6301IkReal gconst2=(x479*(pow(x482,-0.5)));
6302j3eval[0]=new_r01;
6303if( IKabs(j3eval[0]) < 0.0000010000000000 )
6304{
6305continue; // 3 cases reached
6306
6307} else
6308{
6309{
6310IkReal j3array[1], cj3array[1], sj3array[1];
6311bool j3valid[1]={false};
6312_nj3 = 1;
6314if(!x483.valid){
6315continue;
6316}
6318if(!x484.valid){
6319continue;
6320}
6321if( IKabs(((-1.0)*gconst2*(x483.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r00*(x484.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*gconst2*(x483.value)))+IKsqr((new_r00*(x484.value)))-1) <= IKFAST_SINCOS_THRESH )
6322 continue;
6323j3array[0]=IKatan2(((-1.0)*gconst2*(x483.value)), (new_r00*(x484.value)));
6324sj3array[0]=IKsin(j3array[0]);
6325cj3array[0]=IKcos(j3array[0]);
6326if( j3array[0] > IKPI )
6327{
6328 j3array[0]-=IK2PI;
6329}
6330else if( j3array[0] < -IKPI )
6331{ j3array[0]+=IK2PI;
6332}
6333j3valid[0] = true;
6334for(int ij3 = 0; ij3 < 1; ++ij3)
6335{
6336if( !j3valid[ij3] )
6337{
6338 continue;
6339}
6340_ij3[0] = ij3; _ij3[1] = -1;
6341for(int iij3 = ij3+1; iij3 < 1; ++iij3)
6342{
6343if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
6344{
6345 j3valid[iij3]=false; _ij3[1] = iij3; break;
6346}
6347}
6348j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
6349{
6350IkReal evalcond[8];
6351IkReal x485=IKcos(j3);
6352IkReal x486=IKsin(j3);
6353IkReal x487=((1.0)*gconst2);
6354IkReal x488=(gconst2*x486);
6355evalcond[0]=(new_r01*x485);
6356evalcond[1]=((-1.0)*gconst2*x485);
6357evalcond[2]=(gconst2+((new_r01*x486)));
6358evalcond[3]=(x488+new_r01);
6359evalcond[4]=(new_r00+(((-1.0)*x485*x487)));
6360evalcond[5]=((((-1.0)*x486*x487))+new_r10);
6361evalcond[6]=((((-1.0)*new_r10*x485))+((new_r00*x486)));
6362evalcond[7]=((((-1.0)*x487))+((new_r10*x486))+((new_r00*x485)));
6363if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
6364{
6365continue;
6366}
6367}
6368
6369{
6370std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
6371vinfos[0].jointtype = 1;
6372vinfos[0].foffset = j0;
6373vinfos[0].indices[0] = _ij0[0];
6374vinfos[0].indices[1] = _ij0[1];
6375vinfos[0].maxsolutions = _nj0;
6376vinfos[1].jointtype = 1;
6377vinfos[1].foffset = j1;
6378vinfos[1].indices[0] = _ij1[0];
6379vinfos[1].indices[1] = _ij1[1];
6380vinfos[1].maxsolutions = _nj1;
6381vinfos[2].jointtype = 1;
6382vinfos[2].foffset = j2;
6383vinfos[2].indices[0] = _ij2[0];
6384vinfos[2].indices[1] = _ij2[1];
6385vinfos[2].maxsolutions = _nj2;
6386vinfos[3].jointtype = 1;
6387vinfos[3].foffset = j3;
6388vinfos[3].indices[0] = _ij3[0];
6389vinfos[3].indices[1] = _ij3[1];
6390vinfos[3].maxsolutions = _nj3;
6391vinfos[4].jointtype = 1;
6392vinfos[4].foffset = j4;
6393vinfos[4].indices[0] = _ij4[0];
6394vinfos[4].indices[1] = _ij4[1];
6395vinfos[4].maxsolutions = _nj4;
6396vinfos[5].jointtype = 1;
6397vinfos[5].foffset = j5;
6398vinfos[5].indices[0] = _ij5[0];
6399vinfos[5].indices[1] = _ij5[1];
6400vinfos[5].maxsolutions = _nj5;
6401std::vector<int> vfree(0);
6402solutions.AddSolution(vinfos,vfree);
6403}
6404}
6405}
6406
6407}
6408
6409}
6410
6411} else
6412{
6413{
6414IkReal j3array[1], cj3array[1], sj3array[1];
6415bool j3valid[1]={false};
6416_nj3 = 1;
6418if(!x489.valid){
6419continue;
6420}
6422if(!x490.valid){
6423continue;
6424}
6425j3array[0]=((-1.5707963267949)+(x489.value)+(((1.5707963267949)*(x490.value))));
6426sj3array[0]=IKsin(j3array[0]);
6427cj3array[0]=IKcos(j3array[0]);
6428if( j3array[0] > IKPI )
6429{
6430 j3array[0]-=IK2PI;
6431}
6432else if( j3array[0] < -IKPI )
6433{ j3array[0]+=IK2PI;
6434}
6435j3valid[0] = true;
6436for(int ij3 = 0; ij3 < 1; ++ij3)
6437{
6438if( !j3valid[ij3] )
6439{
6440 continue;
6441}
6442_ij3[0] = ij3; _ij3[1] = -1;
6443for(int iij3 = ij3+1; iij3 < 1; ++iij3)
6444{
6445if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
6446{
6447 j3valid[iij3]=false; _ij3[1] = iij3; break;
6448}
6449}
6450j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
6451{
6452IkReal evalcond[8];
6453IkReal x491=IKcos(j3);
6454IkReal x492=IKsin(j3);
6455IkReal x493=((1.0)*gconst2);
6456IkReal x494=(gconst2*x492);
6457evalcond[0]=(new_r01*x491);
6458evalcond[1]=((-1.0)*gconst2*x491);
6459evalcond[2]=(gconst2+((new_r01*x492)));
6460evalcond[3]=(x494+new_r01);
6461evalcond[4]=((((-1.0)*x491*x493))+new_r00);
6462evalcond[5]=(new_r10+(((-1.0)*x492*x493)));
6463evalcond[6]=((((-1.0)*new_r10*x491))+((new_r00*x492)));
6464evalcond[7]=((((-1.0)*x493))+((new_r10*x492))+((new_r00*x491)));
6465if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
6466{
6467continue;
6468}
6469}
6470
6471{
6472std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
6473vinfos[0].jointtype = 1;
6474vinfos[0].foffset = j0;
6475vinfos[0].indices[0] = _ij0[0];
6476vinfos[0].indices[1] = _ij0[1];
6477vinfos[0].maxsolutions = _nj0;
6478vinfos[1].jointtype = 1;
6479vinfos[1].foffset = j1;
6480vinfos[1].indices[0] = _ij1[0];
6481vinfos[1].indices[1] = _ij1[1];
6482vinfos[1].maxsolutions = _nj1;
6483vinfos[2].jointtype = 1;
6484vinfos[2].foffset = j2;
6485vinfos[2].indices[0] = _ij2[0];
6486vinfos[2].indices[1] = _ij2[1];
6487vinfos[2].maxsolutions = _nj2;
6488vinfos[3].jointtype = 1;
6489vinfos[3].foffset = j3;
6490vinfos[3].indices[0] = _ij3[0];
6491vinfos[3].indices[1] = _ij3[1];
6492vinfos[3].maxsolutions = _nj3;
6493vinfos[4].jointtype = 1;
6494vinfos[4].foffset = j4;
6495vinfos[4].indices[0] = _ij4[0];
6496vinfos[4].indices[1] = _ij4[1];
6497vinfos[4].maxsolutions = _nj4;
6498vinfos[5].jointtype = 1;
6499vinfos[5].foffset = j5;
6500vinfos[5].indices[0] = _ij5[0];
6501vinfos[5].indices[1] = _ij5[1];
6502vinfos[5].maxsolutions = _nj5;
6503std::vector<int> vfree(0);
6504solutions.AddSolution(vinfos,vfree);
6505}
6506}
6507}
6508
6509}
6510
6511}
6512
6513} else
6514{
6515{
6516IkReal j3array[1], cj3array[1], sj3array[1];
6517bool j3valid[1]={false};
6518_nj3 = 1;
6520if(!x495.valid){
6521continue;
6522}
6524if(!x496.valid){
6525continue;
6526}
6527j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x495.value)))+(x496.value));
6528sj3array[0]=IKsin(j3array[0]);
6529cj3array[0]=IKcos(j3array[0]);
6530if( j3array[0] > IKPI )
6531{
6532 j3array[0]-=IK2PI;
6533}
6534else if( j3array[0] < -IKPI )
6535{ j3array[0]+=IK2PI;
6536}
6537j3valid[0] = true;
6538for(int ij3 = 0; ij3 < 1; ++ij3)
6539{
6540if( !j3valid[ij3] )
6541{
6542 continue;
6543}
6544_ij3[0] = ij3; _ij3[1] = -1;
6545for(int iij3 = ij3+1; iij3 < 1; ++iij3)
6546{
6547if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
6548{
6549 j3valid[iij3]=false; _ij3[1] = iij3; break;
6550}
6551}
6552j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
6553{
6554IkReal evalcond[8];
6555IkReal x497=IKcos(j3);
6556IkReal x498=IKsin(j3);
6557IkReal x499=((1.0)*gconst2);
6558IkReal x500=(gconst2*x498);
6559evalcond[0]=(new_r01*x497);
6560evalcond[1]=((-1.0)*gconst2*x497);
6561evalcond[2]=(gconst2+((new_r01*x498)));
6562evalcond[3]=(x500+new_r01);
6563evalcond[4]=((((-1.0)*x497*x499))+new_r00);
6564evalcond[5]=((((-1.0)*x498*x499))+new_r10);
6565evalcond[6]=((((-1.0)*new_r10*x497))+((new_r00*x498)));
6566evalcond[7]=((((-1.0)*x499))+((new_r10*x498))+((new_r00*x497)));
6567if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
6568{
6569continue;
6570}
6571}
6572
6573{
6574std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
6575vinfos[0].jointtype = 1;
6576vinfos[0].foffset = j0;
6577vinfos[0].indices[0] = _ij0[0];
6578vinfos[0].indices[1] = _ij0[1];
6579vinfos[0].maxsolutions = _nj0;
6580vinfos[1].jointtype = 1;
6581vinfos[1].foffset = j1;
6582vinfos[1].indices[0] = _ij1[0];
6583vinfos[1].indices[1] = _ij1[1];
6584vinfos[1].maxsolutions = _nj1;
6585vinfos[2].jointtype = 1;
6586vinfos[2].foffset = j2;
6587vinfos[2].indices[0] = _ij2[0];
6588vinfos[2].indices[1] = _ij2[1];
6589vinfos[2].maxsolutions = _nj2;
6590vinfos[3].jointtype = 1;
6591vinfos[3].foffset = j3;
6592vinfos[3].indices[0] = _ij3[0];
6593vinfos[3].indices[1] = _ij3[1];
6594vinfos[3].maxsolutions = _nj3;
6595vinfos[4].jointtype = 1;
6596vinfos[4].foffset = j4;
6597vinfos[4].indices[0] = _ij4[0];
6598vinfos[4].indices[1] = _ij4[1];
6599vinfos[4].maxsolutions = _nj4;
6600vinfos[5].jointtype = 1;
6601vinfos[5].foffset = j5;
6602vinfos[5].indices[0] = _ij5[0];
6603vinfos[5].indices[1] = _ij5[1];
6604vinfos[5].maxsolutions = _nj5;
6605std::vector<int> vfree(0);
6606solutions.AddSolution(vinfos,vfree);
6607}
6608}
6609}
6610
6611}
6612
6613}
6614
6615}
6616} while(0);
6617if( bgotonextstatement )
6618{
6619bool bgotonextstatement = true;
6620do
6621{
6622if( 1 )
6623{
6624bgotonextstatement=false;
6625continue; // branch miss [j3]
6626
6627}
6628} while(0);
6629if( bgotonextstatement )
6630{
6631}
6632}
6633}
6634}
6635}
6636}
6637
6638} else
6639{
6640{
6641IkReal j3array[1], cj3array[1], sj3array[1];
6642bool j3valid[1]={false};
6643_nj3 = 1;
6644IkReal x501=((1.0)*new_r01);
6645CheckValue<IkReal> x502 = IKatan2WithCheck(IkReal(((new_r01*new_r01)+(((-1.0)*(gconst1*gconst1))))),IkReal(((((-1.0)*new_r11*x501))+((gconst1*gconst2)))),IKFAST_ATAN2_MAGTHRESH);
6646if(!x502.valid){
6647continue;
6648}
6649CheckValue<IkReal> x503=IKPowWithIntegerCheck(IKsign((((gconst1*new_r11))+(((-1.0)*gconst2*x501)))),-1);
6650if(!x503.valid){
6651continue;
6652}
6653j3array[0]=((-1.5707963267949)+(x502.value)+(((1.5707963267949)*(x503.value))));
6654sj3array[0]=IKsin(j3array[0]);
6655cj3array[0]=IKcos(j3array[0]);
6656if( j3array[0] > IKPI )
6657{
6658 j3array[0]-=IK2PI;
6659}
6660else if( j3array[0] < -IKPI )
6661{ j3array[0]+=IK2PI;
6662}
6663j3valid[0] = true;
6664for(int ij3 = 0; ij3 < 1; ++ij3)
6665{
6666if( !j3valid[ij3] )
6667{
6668 continue;
6669}
6670_ij3[0] = ij3; _ij3[1] = -1;
6671for(int iij3 = ij3+1; iij3 < 1; ++iij3)
6672{
6673if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
6674{
6675 j3valid[iij3]=false; _ij3[1] = iij3; break;
6676}
6677}
6678j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
6679{
6680IkReal evalcond[8];
6681IkReal x504=IKcos(j3);
6682IkReal x505=IKsin(j3);
6683IkReal x506=((1.0)*gconst2);
6684IkReal x507=(gconst1*x505);
6685IkReal x508=(gconst2*x505);
6686IkReal x509=(gconst1*x504);
6687IkReal x510=((1.0)*x504);
6688IkReal x511=(x504*x506);
6689evalcond[0]=(gconst1+((new_r11*x505))+((new_r01*x504)));
6690evalcond[1]=(x508+x509+new_r01);
6691evalcond[2]=((((-1.0)*new_r10*x510))+gconst1+((new_r00*x505)));
6692evalcond[3]=((((-1.0)*new_r11*x510))+gconst2+((new_r01*x505)));
6693evalcond[4]=(x507+new_r00+(((-1.0)*x511)));
6694evalcond[5]=(x507+new_r11+(((-1.0)*x511)));
6695evalcond[6]=((((-1.0)*x506))+((new_r10*x505))+((new_r00*x504)));
6696evalcond[7]=((((-1.0)*x505*x506))+new_r10+(((-1.0)*x509)));
6697if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
6698{
6699continue;
6700}
6701}
6702
6703{
6704std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
6705vinfos[0].jointtype = 1;
6706vinfos[0].foffset = j0;
6707vinfos[0].indices[0] = _ij0[0];
6708vinfos[0].indices[1] = _ij0[1];
6709vinfos[0].maxsolutions = _nj0;
6710vinfos[1].jointtype = 1;
6711vinfos[1].foffset = j1;
6712vinfos[1].indices[0] = _ij1[0];
6713vinfos[1].indices[1] = _ij1[1];
6714vinfos[1].maxsolutions = _nj1;
6715vinfos[2].jointtype = 1;
6716vinfos[2].foffset = j2;
6717vinfos[2].indices[0] = _ij2[0];
6718vinfos[2].indices[1] = _ij2[1];
6719vinfos[2].maxsolutions = _nj2;
6720vinfos[3].jointtype = 1;
6721vinfos[3].foffset = j3;
6722vinfos[3].indices[0] = _ij3[0];
6723vinfos[3].indices[1] = _ij3[1];
6724vinfos[3].maxsolutions = _nj3;
6725vinfos[4].jointtype = 1;
6726vinfos[4].foffset = j4;
6727vinfos[4].indices[0] = _ij4[0];
6728vinfos[4].indices[1] = _ij4[1];
6729vinfos[4].maxsolutions = _nj4;
6730vinfos[5].jointtype = 1;
6731vinfos[5].foffset = j5;
6732vinfos[5].indices[0] = _ij5[0];
6733vinfos[5].indices[1] = _ij5[1];
6734vinfos[5].maxsolutions = _nj5;
6735std::vector<int> vfree(0);
6736solutions.AddSolution(vinfos,vfree);
6737}
6738}
6739}
6740
6741}
6742
6743}
6744
6745} else
6746{
6747{
6748IkReal j3array[1], cj3array[1], sj3array[1];
6749bool j3valid[1]={false};
6750_nj3 = 1;
6751IkReal x512=((1.0)*gconst2);
6752CheckValue<IkReal> x513 = IKatan2WithCheck(IkReal(((gconst1*gconst1)+((new_r01*new_r10)))),IkReal((((new_r00*new_r01))+(((-1.0)*gconst1*x512)))),IKFAST_ATAN2_MAGTHRESH);
6753if(!x513.valid){
6754continue;
6755}
6756CheckValue<IkReal> x514=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r10*x512))+(((-1.0)*gconst1*new_r00)))),-1);
6757if(!x514.valid){
6758continue;
6759}
6760j3array[0]=((-1.5707963267949)+(x513.value)+(((1.5707963267949)*(x514.value))));
6761sj3array[0]=IKsin(j3array[0]);
6762cj3array[0]=IKcos(j3array[0]);
6763if( j3array[0] > IKPI )
6764{
6765 j3array[0]-=IK2PI;
6766}
6767else if( j3array[0] < -IKPI )
6768{ j3array[0]+=IK2PI;
6769}
6770j3valid[0] = true;
6771for(int ij3 = 0; ij3 < 1; ++ij3)
6772{
6773if( !j3valid[ij3] )
6774{
6775 continue;
6776}
6777_ij3[0] = ij3; _ij3[1] = -1;
6778for(int iij3 = ij3+1; iij3 < 1; ++iij3)
6779{
6780if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
6781{
6782 j3valid[iij3]=false; _ij3[1] = iij3; break;
6783}
6784}
6785j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
6786{
6787IkReal evalcond[8];
6788IkReal x515=IKcos(j3);
6789IkReal x516=IKsin(j3);
6790IkReal x517=((1.0)*gconst2);
6791IkReal x518=(gconst1*x516);
6792IkReal x519=(gconst2*x516);
6793IkReal x520=(gconst1*x515);
6794IkReal x521=((1.0)*x515);
6795IkReal x522=(x515*x517);
6796evalcond[0]=(((new_r01*x515))+((new_r11*x516))+gconst1);
6797evalcond[1]=(x520+x519+new_r01);
6798evalcond[2]=(((new_r00*x516))+gconst1+(((-1.0)*new_r10*x521)));
6799evalcond[3]=(((new_r01*x516))+gconst2+(((-1.0)*new_r11*x521)));
6800evalcond[4]=((((-1.0)*x522))+x518+new_r00);
6801evalcond[5]=((((-1.0)*x522))+x518+new_r11);
6802evalcond[6]=(((new_r00*x515))+((new_r10*x516))+(((-1.0)*x517)));
6803evalcond[7]=((((-1.0)*x520))+(((-1.0)*x516*x517))+new_r10);
6804if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
6805{
6806continue;
6807}
6808}
6809
6810{
6811std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
6812vinfos[0].jointtype = 1;
6813vinfos[0].foffset = j0;
6814vinfos[0].indices[0] = _ij0[0];
6815vinfos[0].indices[1] = _ij0[1];
6816vinfos[0].maxsolutions = _nj0;
6817vinfos[1].jointtype = 1;
6818vinfos[1].foffset = j1;
6819vinfos[1].indices[0] = _ij1[0];
6820vinfos[1].indices[1] = _ij1[1];
6821vinfos[1].maxsolutions = _nj1;
6822vinfos[2].jointtype = 1;
6823vinfos[2].foffset = j2;
6824vinfos[2].indices[0] = _ij2[0];
6825vinfos[2].indices[1] = _ij2[1];
6826vinfos[2].maxsolutions = _nj2;
6827vinfos[3].jointtype = 1;
6828vinfos[3].foffset = j3;
6829vinfos[3].indices[0] = _ij3[0];
6830vinfos[3].indices[1] = _ij3[1];
6831vinfos[3].maxsolutions = _nj3;
6832vinfos[4].jointtype = 1;
6833vinfos[4].foffset = j4;
6834vinfos[4].indices[0] = _ij4[0];
6835vinfos[4].indices[1] = _ij4[1];
6836vinfos[4].maxsolutions = _nj4;
6837vinfos[5].jointtype = 1;
6838vinfos[5].foffset = j5;
6839vinfos[5].indices[0] = _ij5[0];
6840vinfos[5].indices[1] = _ij5[1];
6841vinfos[5].maxsolutions = _nj5;
6842std::vector<int> vfree(0);
6843solutions.AddSolution(vinfos,vfree);
6844}
6845}
6846}
6847
6848}
6849
6850}
6851
6852} else
6853{
6854{
6855IkReal j3array[1], cj3array[1], sj3array[1];
6856bool j3valid[1]={false};
6857_nj3 = 1;
6858IkReal x523=((1.0)*new_r11);
6859CheckValue<IkReal> x524 = IKatan2WithCheck(IkReal((((gconst1*new_r10))+((gconst1*new_r01)))),IkReal((((gconst1*new_r00))+(((-1.0)*gconst1*x523)))),IKFAST_ATAN2_MAGTHRESH);
6860if(!x524.valid){
6861continue;
6862}
6863CheckValue<IkReal> x525=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r10*x523))+(((-1.0)*new_r00*new_r01)))),-1);
6864if(!x525.valid){
6865continue;
6866}
6867j3array[0]=((-1.5707963267949)+(x524.value)+(((1.5707963267949)*(x525.value))));
6868sj3array[0]=IKsin(j3array[0]);
6869cj3array[0]=IKcos(j3array[0]);
6870if( j3array[0] > IKPI )
6871{
6872 j3array[0]-=IK2PI;
6873}
6874else if( j3array[0] < -IKPI )
6875{ j3array[0]+=IK2PI;
6876}
6877j3valid[0] = true;
6878for(int ij3 = 0; ij3 < 1; ++ij3)
6879{
6880if( !j3valid[ij3] )
6881{
6882 continue;
6883}
6884_ij3[0] = ij3; _ij3[1] = -1;
6885for(int iij3 = ij3+1; iij3 < 1; ++iij3)
6886{
6887if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
6888{
6889 j3valid[iij3]=false; _ij3[1] = iij3; break;
6890}
6891}
6892j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
6893{
6894IkReal evalcond[8];
6895IkReal x526=IKcos(j3);
6896IkReal x527=IKsin(j3);
6897IkReal x528=((1.0)*gconst2);
6898IkReal x529=(gconst1*x527);
6899IkReal x530=(gconst2*x527);
6900IkReal x531=(gconst1*x526);
6901IkReal x532=((1.0)*x526);
6902IkReal x533=(x526*x528);
6903evalcond[0]=(((new_r01*x526))+gconst1+((new_r11*x527)));
6904evalcond[1]=(x531+x530+new_r01);
6905evalcond[2]=(gconst1+(((-1.0)*new_r10*x532))+((new_r00*x527)));
6906evalcond[3]=(((new_r01*x527))+gconst2+(((-1.0)*new_r11*x532)));
6907evalcond[4]=((((-1.0)*x533))+x529+new_r00);
6908evalcond[5]=((((-1.0)*x533))+x529+new_r11);
6909evalcond[6]=((((-1.0)*x528))+((new_r10*x527))+((new_r00*x526)));
6910evalcond[7]=((((-1.0)*x527*x528))+(((-1.0)*x531))+new_r10);
6911if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
6912{
6913continue;
6914}
6915}
6916
6917{
6918std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
6919vinfos[0].jointtype = 1;
6920vinfos[0].foffset = j0;
6921vinfos[0].indices[0] = _ij0[0];
6922vinfos[0].indices[1] = _ij0[1];
6923vinfos[0].maxsolutions = _nj0;
6924vinfos[1].jointtype = 1;
6925vinfos[1].foffset = j1;
6926vinfos[1].indices[0] = _ij1[0];
6927vinfos[1].indices[1] = _ij1[1];
6928vinfos[1].maxsolutions = _nj1;
6929vinfos[2].jointtype = 1;
6930vinfos[2].foffset = j2;
6931vinfos[2].indices[0] = _ij2[0];
6932vinfos[2].indices[1] = _ij2[1];
6933vinfos[2].maxsolutions = _nj2;
6934vinfos[3].jointtype = 1;
6935vinfos[3].foffset = j3;
6936vinfos[3].indices[0] = _ij3[0];
6937vinfos[3].indices[1] = _ij3[1];
6938vinfos[3].maxsolutions = _nj3;
6939vinfos[4].jointtype = 1;
6940vinfos[4].foffset = j4;
6941vinfos[4].indices[0] = _ij4[0];
6942vinfos[4].indices[1] = _ij4[1];
6943vinfos[4].maxsolutions = _nj4;
6944vinfos[5].jointtype = 1;
6945vinfos[5].foffset = j5;
6946vinfos[5].indices[0] = _ij5[0];
6947vinfos[5].indices[1] = _ij5[1];
6948vinfos[5].maxsolutions = _nj5;
6949std::vector<int> vfree(0);
6950solutions.AddSolution(vinfos,vfree);
6951}
6952}
6953}
6954
6955}
6956
6957}
6958
6959}
6960} while(0);
6961if( bgotonextstatement )
6962{
6963bool bgotonextstatement = true;
6964do
6965{
6966IkReal x534=((-1.0)*new_r11);
6967IkReal x536 = ((new_r01*new_r01)+(new_r11*new_r11));
6968if(IKabs(x536)==0){
6969continue;
6970}
6971IkReal x535=pow(x536,-0.5);
6972CheckValue<IkReal> x537 = IKatan2WithCheck(IkReal(x534),IkReal(((-1.0)*new_r01)),IKFAST_ATAN2_MAGTHRESH);
6973if(!x537.valid){
6974continue;
6975}
6976IkReal gconst3=((3.14159265358979)+(((-1.0)*(x537.value))));
6977IkReal gconst4=(x534*x535);
6978IkReal gconst5=((1.0)*new_r01*x535);
6979CheckValue<IkReal> x538 = IKatan2WithCheck(IkReal(((-1.0)*new_r11)),IkReal(((-1.0)*new_r01)),IKFAST_ATAN2_MAGTHRESH);
6980if(!x538.valid){
6981continue;
6982}
6983evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+(x538.value)+j5)))), 6.28318530717959)));
6984if( IKabs(evalcond[0]) < 0.0000050000000000 )
6985{
6986bgotonextstatement=false;
6987{
6988IkReal j3eval[3];
6989IkReal x539=((-1.0)*new_r11);
6990CheckValue<IkReal> x542 = IKatan2WithCheck(IkReal(x539),IkReal(((-1.0)*new_r01)),IKFAST_ATAN2_MAGTHRESH);
6991if(!x542.valid){
6992continue;
6993}
6994IkReal x540=((1.0)*(x542.value));
6995IkReal x541=x535;
6996sj4=0;
6997cj4=1.0;
6998j4=0;
6999sj5=gconst4;
7000cj5=gconst5;
7001j5=((3.14159265)+(((-1.0)*x540)));
7002IkReal gconst3=((3.14159265358979)+(((-1.0)*x540)));
7003IkReal gconst4=(x539*x541);
7004IkReal gconst5=((1.0)*new_r01*x541);
7005IkReal x543=new_r11*new_r11;
7006IkReal x544=((1.0)*new_r01);
7007IkReal x545=((1.0)*new_r10);
7008IkReal x546=((((-1.0)*new_r00*x544))+(((-1.0)*new_r11*x545)));
7009IkReal x547=x535;
7010IkReal x548=(new_r11*x547);
7011j3eval[0]=x546;
7012j3eval[1]=((IKabs((((x543*x547))+(((-1.0)*new_r00*x548)))))+(IKabs(((((-1.0)*x544*x548))+(((-1.0)*x545*x548))))));
7013j3eval[2]=IKsign(x546);
7014if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
7015{
7016{
7017IkReal j3eval[1];
7018IkReal x549=((-1.0)*new_r11);
7019CheckValue<IkReal> x552 = IKatan2WithCheck(IkReal(x549),IkReal(((-1.0)*new_r01)),IKFAST_ATAN2_MAGTHRESH);
7020if(!x552.valid){
7021continue;
7022}
7023IkReal x550=((1.0)*(x552.value));
7024IkReal x551=x535;
7025sj4=0;
7026cj4=1.0;
7027j4=0;
7028sj5=gconst4;
7029cj5=gconst5;
7030j5=((3.14159265)+(((-1.0)*x550)));
7031IkReal gconst3=((3.14159265358979)+(((-1.0)*x550)));
7032IkReal gconst4=(x549*x551);
7033IkReal gconst5=((1.0)*new_r01*x551);
7034IkReal x553=new_r11*new_r11;
7035IkReal x554=new_r01*new_r01*new_r01;
7037if(!x558.valid){
7038continue;
7039}
7040IkReal x555=x558.value;
7041IkReal x556=(x553*x555);
7042IkReal x557=(x554*x555);
7043j3eval[0]=((IKabs((((new_r10*x557))+x556+((new_r01*new_r10*x556)))))+(IKabs((((new_r00*new_r01*x556))+((new_r01*new_r11*x555))+((new_r00*x557))))));
7044if( IKabs(j3eval[0]) < 0.0000010000000000 )
7045{
7046{
7047IkReal j3eval[1];
7048IkReal x559=((-1.0)*new_r11);
7049CheckValue<IkReal> x562 = IKatan2WithCheck(IkReal(x559),IkReal(((-1.0)*new_r01)),IKFAST_ATAN2_MAGTHRESH);
7050if(!x562.valid){
7051continue;
7052}
7053IkReal x560=((1.0)*(x562.value));
7054IkReal x561=x535;
7055sj4=0;
7056cj4=1.0;
7057j4=0;
7058sj5=gconst4;
7059cj5=gconst5;
7060j5=((3.14159265)+(((-1.0)*x560)));
7061IkReal gconst3=((3.14159265358979)+(((-1.0)*x560)));
7062IkReal gconst4=(x559*x561);
7063IkReal gconst5=((1.0)*new_r01*x561);
7064IkReal x563=new_r01*new_r01;
7065IkReal x564=new_r11*new_r11;
7066CheckValue<IkReal> x571=IKPowWithIntegerCheck((x564+x563),-1);
7067if(!x571.valid){
7068continue;
7069}
7070IkReal x565=x571.value;
7071IkReal x566=(x564*x565);
7072CheckValue<IkReal> x572=IKPowWithIntegerCheck(((((-1.0)*x563))+(((-1.0)*x564))),-1);
7073if(!x572.valid){
7074continue;
7075}
7076IkReal x567=x572.value;
7077IkReal x568=((1.0)*x567);
7078IkReal x569=(new_r11*x568);
7079IkReal x570=(new_r01*x568);
7080j3eval[0]=((IKabs((((x563*x566))+((x565*(x563*x563)))+(((-1.0)*x566)))))+(IKabs(((((-1.0)*new_r01*x569*(new_r11*new_r11)))+(((-1.0)*x569*(new_r01*new_r01*new_r01)))+(((-1.0)*new_r01*x569))))));
7081if( IKabs(j3eval[0]) < 0.0000010000000000 )
7082{
7083{
7084IkReal evalcond[3];
7085bool bgotonextstatement = true;
7086do
7087{
7088evalcond[0]=((IKabs(new_r11))+(IKabs(new_r00)));
7089if( IKabs(evalcond[0]) < 0.0000050000000000 )
7090{
7091bgotonextstatement=false;
7092{
7093IkReal j3array[2], cj3array[2], sj3array[2];
7094bool j3valid[2]={false};
7095_nj3 = 2;
7097if(!x573.valid){
7098continue;
7099}
7100sj3array[0]=(new_r10*(x573.value));
7101if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
7102{
7103 j3valid[0] = j3valid[1] = true;
7104 j3array[0] = IKasin(sj3array[0]);
7105 cj3array[0] = IKcos(j3array[0]);
7106 sj3array[1] = sj3array[0];
7107 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
7108 cj3array[1] = -cj3array[0];
7109}
7110else if( isnan(sj3array[0]) )
7111{
7112 // probably any value will work
7113 j3valid[0] = true;
7114 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
7115}
7116for(int ij3 = 0; ij3 < 2; ++ij3)
7117{
7118if( !j3valid[ij3] )
7119{
7120 continue;
7121}
7122_ij3[0] = ij3; _ij3[1] = -1;
7123for(int iij3 = ij3+1; iij3 < 2; ++iij3)
7124{
7125if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
7126{
7127 j3valid[iij3]=false; _ij3[1] = iij3; break;
7128}
7129}
7130j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
7131{
7132IkReal evalcond[6];
7133IkReal x574=IKcos(j3);
7134IkReal x575=IKsin(j3);
7135IkReal x576=((-1.0)*x574);
7136evalcond[0]=(new_r01*x574);
7137evalcond[1]=(new_r10*x576);
7138evalcond[2]=(gconst5*x576);
7139evalcond[3]=(((new_r01*x575))+gconst5);
7140evalcond[4]=(((gconst5*x575))+new_r01);
7141evalcond[5]=(((new_r10*x575))+(((-1.0)*gconst5)));
7142if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
7143{
7144continue;
7145}
7146}
7147
7148{
7149std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
7150vinfos[0].jointtype = 1;
7151vinfos[0].foffset = j0;
7152vinfos[0].indices[0] = _ij0[0];
7153vinfos[0].indices[1] = _ij0[1];
7154vinfos[0].maxsolutions = _nj0;
7155vinfos[1].jointtype = 1;
7156vinfos[1].foffset = j1;
7157vinfos[1].indices[0] = _ij1[0];
7158vinfos[1].indices[1] = _ij1[1];
7159vinfos[1].maxsolutions = _nj1;
7160vinfos[2].jointtype = 1;
7161vinfos[2].foffset = j2;
7162vinfos[2].indices[0] = _ij2[0];
7163vinfos[2].indices[1] = _ij2[1];
7164vinfos[2].maxsolutions = _nj2;
7165vinfos[3].jointtype = 1;
7166vinfos[3].foffset = j3;
7167vinfos[3].indices[0] = _ij3[0];
7168vinfos[3].indices[1] = _ij3[1];
7169vinfos[3].maxsolutions = _nj3;
7170vinfos[4].jointtype = 1;
7171vinfos[4].foffset = j4;
7172vinfos[4].indices[0] = _ij4[0];
7173vinfos[4].indices[1] = _ij4[1];
7174vinfos[4].maxsolutions = _nj4;
7175vinfos[5].jointtype = 1;
7176vinfos[5].foffset = j5;
7177vinfos[5].indices[0] = _ij5[0];
7178vinfos[5].indices[1] = _ij5[1];
7179vinfos[5].maxsolutions = _nj5;
7180std::vector<int> vfree(0);
7181solutions.AddSolution(vinfos,vfree);
7182}
7183}
7184}
7185
7186}
7187} while(0);
7188if( bgotonextstatement )
7189{
7190bool bgotonextstatement = true;
7191do
7192{
7193evalcond[0]=((IKabs(new_r10))+(IKabs(new_r00)));
7194evalcond[1]=gconst4;
7195evalcond[2]=gconst5;
7196if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 )
7197{
7198bgotonextstatement=false;
7199{
7200IkReal j3eval[3];
7201IkReal x577=((-1.0)*new_r11);
7202CheckValue<IkReal> x579 = IKatan2WithCheck(IkReal(x577),IkReal(((-1.0)*new_r01)),IKFAST_ATAN2_MAGTHRESH);
7203if(!x579.valid){
7204continue;
7205}
7206IkReal x578=((1.0)*(x579.value));
7207sj4=0;
7208cj4=1.0;
7209j4=0;
7210sj5=gconst4;
7211cj5=gconst5;
7212j5=((3.14159265)+(((-1.0)*x578)));
7213new_r00=0;
7214new_r10=0;
7215new_r21=0;
7216new_r22=0;
7217IkReal gconst3=((3.14159265358979)+(((-1.0)*x578)));
7218IkReal gconst4=x577;
7219IkReal gconst5=((1.0)*new_r01);
7220j3eval[0]=1.0;
7221j3eval[1]=1.0;
7222j3eval[2]=((IKabs(((1.0)+(((-1.0)*(new_r01*new_r01))))))+(IKabs(((1.0)*new_r01*new_r11))));
7223if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
7224{
7225{
7226IkReal j3eval[4];
7227IkReal x580=((-1.0)*new_r11);
7228CheckValue<IkReal> x582 = IKatan2WithCheck(IkReal(x580),IkReal(((-1.0)*new_r01)),IKFAST_ATAN2_MAGTHRESH);
7229if(!x582.valid){
7230continue;
7231}
7232IkReal x581=((1.0)*(x582.value));
7233sj4=0;
7234cj4=1.0;
7235j4=0;
7236sj5=gconst4;
7237cj5=gconst5;
7238j5=((3.14159265)+(((-1.0)*x581)));
7239new_r00=0;
7240new_r10=0;
7241new_r21=0;
7242new_r22=0;
7243IkReal gconst3=((3.14159265358979)+(((-1.0)*x581)));
7244IkReal gconst4=x580;
7245IkReal gconst5=((1.0)*new_r01);
7246j3eval[0]=-1.0;
7247j3eval[1]=new_r01;
7248j3eval[2]=1.0;
7249j3eval[3]=-1.0;
7250if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 || IKabs(j3eval[3]) < 0.0000010000000000 )
7251{
7252{
7253IkReal j3eval[3];
7254IkReal x583=((-1.0)*new_r11);
7255CheckValue<IkReal> x585 = IKatan2WithCheck(IkReal(x583),IkReal(((-1.0)*new_r01)),IKFAST_ATAN2_MAGTHRESH);
7256if(!x585.valid){
7257continue;
7258}
7259IkReal x584=((1.0)*(x585.value));
7260sj4=0;
7261cj4=1.0;
7262j4=0;
7263sj5=gconst4;
7264cj5=gconst5;
7265j5=((3.14159265)+(((-1.0)*x584)));
7266new_r00=0;
7267new_r10=0;
7268new_r21=0;
7269new_r22=0;
7270IkReal gconst3=((3.14159265358979)+(((-1.0)*x584)));
7271IkReal gconst4=x583;
7272IkReal gconst5=((1.0)*new_r01);
7273j3eval[0]=-1.0;
7274j3eval[1]=-1.0;
7275j3eval[2]=((IKabs(((2.0)*new_r01*new_r11)))+(IKabs(((-1.0)+(((2.0)*(new_r01*new_r01)))))));
7276if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
7277{
7278continue; // 3 cases reached
7279
7280} else
7281{
7282{
7283IkReal j3array[1], cj3array[1], sj3array[1];
7284bool j3valid[1]={false};
7285_nj3 = 1;
7286IkReal x586=((1.0)*new_r01);
7287CheckValue<IkReal> x587 = IKatan2WithCheck(IkReal(((new_r01*new_r01)+(((-1.0)*(gconst4*gconst4))))),IkReal(((((-1.0)*new_r11*x586))+((gconst4*gconst5)))),IKFAST_ATAN2_MAGTHRESH);
7288if(!x587.valid){
7289continue;
7290}
7291CheckValue<IkReal> x588=IKPowWithIntegerCheck(IKsign((((gconst4*new_r11))+(((-1.0)*gconst5*x586)))),-1);
7292if(!x588.valid){
7293continue;
7294}
7295j3array[0]=((-1.5707963267949)+(x587.value)+(((1.5707963267949)*(x588.value))));
7296sj3array[0]=IKsin(j3array[0]);
7297cj3array[0]=IKcos(j3array[0]);
7298if( j3array[0] > IKPI )
7299{
7300 j3array[0]-=IK2PI;
7301}
7302else if( j3array[0] < -IKPI )
7303{ j3array[0]+=IK2PI;
7304}
7305j3valid[0] = true;
7306for(int ij3 = 0; ij3 < 1; ++ij3)
7307{
7308if( !j3valid[ij3] )
7309{
7310 continue;
7311}
7312_ij3[0] = ij3; _ij3[1] = -1;
7313for(int iij3 = ij3+1; iij3 < 1; ++iij3)
7314{
7315if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
7316{
7317 j3valid[iij3]=false; _ij3[1] = iij3; break;
7318}
7319}
7320j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
7321{
7322IkReal evalcond[6];
7323IkReal x589=IKsin(j3);
7324IkReal x590=IKcos(j3);
7325IkReal x591=(gconst4*x589);
7326IkReal x592=(gconst4*x590);
7327IkReal x593=((1.0)*x590);
7328IkReal x594=(gconst5*x589);
7329IkReal x595=(gconst5*x593);
7330evalcond[0]=(gconst4+((new_r01*x590))+((new_r11*x589)));
7331evalcond[1]=(x594+x592+new_r01);
7332evalcond[2]=((((-1.0)*x595))+x591);
7333evalcond[3]=((((-1.0)*new_r11*x593))+gconst5+((new_r01*x589)));
7334evalcond[4]=((((-1.0)*x595))+x591+new_r11);
7335evalcond[5]=((((-1.0)*x594))+(((-1.0)*x592)));
7336if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
7337{
7338continue;
7339}
7340}
7341
7342{
7343std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
7344vinfos[0].jointtype = 1;
7345vinfos[0].foffset = j0;
7346vinfos[0].indices[0] = _ij0[0];
7347vinfos[0].indices[1] = _ij0[1];
7348vinfos[0].maxsolutions = _nj0;
7349vinfos[1].jointtype = 1;
7350vinfos[1].foffset = j1;
7351vinfos[1].indices[0] = _ij1[0];
7352vinfos[1].indices[1] = _ij1[1];
7353vinfos[1].maxsolutions = _nj1;
7354vinfos[2].jointtype = 1;
7355vinfos[2].foffset = j2;
7356vinfos[2].indices[0] = _ij2[0];
7357vinfos[2].indices[1] = _ij2[1];
7358vinfos[2].maxsolutions = _nj2;
7359vinfos[3].jointtype = 1;
7360vinfos[3].foffset = j3;
7361vinfos[3].indices[0] = _ij3[0];
7362vinfos[3].indices[1] = _ij3[1];
7363vinfos[3].maxsolutions = _nj3;
7364vinfos[4].jointtype = 1;
7365vinfos[4].foffset = j4;
7366vinfos[4].indices[0] = _ij4[0];
7367vinfos[4].indices[1] = _ij4[1];
7368vinfos[4].maxsolutions = _nj4;
7369vinfos[5].jointtype = 1;
7370vinfos[5].foffset = j5;
7371vinfos[5].indices[0] = _ij5[0];
7372vinfos[5].indices[1] = _ij5[1];
7373vinfos[5].maxsolutions = _nj5;
7374std::vector<int> vfree(0);
7375solutions.AddSolution(vinfos,vfree);
7376}
7377}
7378}
7379
7380}
7381
7382}
7383
7384} else
7385{
7386{
7387IkReal j3array[1], cj3array[1], sj3array[1];
7388bool j3valid[1]={false};
7389_nj3 = 1;
7390CheckValue<IkReal> x596=IKPowWithIntegerCheck(IKsign(((((-1.0)*(gconst4*gconst4)))+(((-1.0)*(gconst5*gconst5))))),-1);
7391if(!x596.valid){
7392continue;
7393}
7394CheckValue<IkReal> x597 = IKatan2WithCheck(IkReal((gconst5*new_r01)),IkReal((gconst4*new_r01)),IKFAST_ATAN2_MAGTHRESH);
7395if(!x597.valid){
7396continue;
7397}
7398j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x596.value)))+(x597.value));
7399sj3array[0]=IKsin(j3array[0]);
7400cj3array[0]=IKcos(j3array[0]);
7401if( j3array[0] > IKPI )
7402{
7403 j3array[0]-=IK2PI;
7404}
7405else if( j3array[0] < -IKPI )
7406{ j3array[0]+=IK2PI;
7407}
7408j3valid[0] = true;
7409for(int ij3 = 0; ij3 < 1; ++ij3)
7410{
7411if( !j3valid[ij3] )
7412{
7413 continue;
7414}
7415_ij3[0] = ij3; _ij3[1] = -1;
7416for(int iij3 = ij3+1; iij3 < 1; ++iij3)
7417{
7418if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
7419{
7420 j3valid[iij3]=false; _ij3[1] = iij3; break;
7421}
7422}
7423j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
7424{
7425IkReal evalcond[6];
7426IkReal x598=IKsin(j3);
7427IkReal x599=IKcos(j3);
7428IkReal x600=(gconst4*x598);
7429IkReal x601=(gconst4*x599);
7430IkReal x602=((1.0)*x599);
7431IkReal x603=(gconst5*x598);
7432IkReal x604=(gconst5*x602);
7433evalcond[0]=(((new_r11*x598))+gconst4+((new_r01*x599)));
7434evalcond[1]=(x603+x601+new_r01);
7435evalcond[2]=(x600+(((-1.0)*x604)));
7436evalcond[3]=((((-1.0)*new_r11*x602))+gconst5+((new_r01*x598)));
7437evalcond[4]=(x600+(((-1.0)*x604))+new_r11);
7438evalcond[5]=((((-1.0)*x601))+(((-1.0)*x603)));
7439if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
7440{
7441continue;
7442}
7443}
7444
7445{
7446std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
7447vinfos[0].jointtype = 1;
7448vinfos[0].foffset = j0;
7449vinfos[0].indices[0] = _ij0[0];
7450vinfos[0].indices[1] = _ij0[1];
7451vinfos[0].maxsolutions = _nj0;
7452vinfos[1].jointtype = 1;
7453vinfos[1].foffset = j1;
7454vinfos[1].indices[0] = _ij1[0];
7455vinfos[1].indices[1] = _ij1[1];
7456vinfos[1].maxsolutions = _nj1;
7457vinfos[2].jointtype = 1;
7458vinfos[2].foffset = j2;
7459vinfos[2].indices[0] = _ij2[0];
7460vinfos[2].indices[1] = _ij2[1];
7461vinfos[2].maxsolutions = _nj2;
7462vinfos[3].jointtype = 1;
7463vinfos[3].foffset = j3;
7464vinfos[3].indices[0] = _ij3[0];
7465vinfos[3].indices[1] = _ij3[1];
7466vinfos[3].maxsolutions = _nj3;
7467vinfos[4].jointtype = 1;
7468vinfos[4].foffset = j4;
7469vinfos[4].indices[0] = _ij4[0];
7470vinfos[4].indices[1] = _ij4[1];
7471vinfos[4].maxsolutions = _nj4;
7472vinfos[5].jointtype = 1;
7473vinfos[5].foffset = j5;
7474vinfos[5].indices[0] = _ij5[0];
7475vinfos[5].indices[1] = _ij5[1];
7476vinfos[5].maxsolutions = _nj5;
7477std::vector<int> vfree(0);
7478solutions.AddSolution(vinfos,vfree);
7479}
7480}
7481}
7482
7483}
7484
7485}
7486
7487} else
7488{
7489{
7490IkReal j3array[1], cj3array[1], sj3array[1];
7491bool j3valid[1]={false};
7492_nj3 = 1;
7493CheckValue<IkReal> x605=IKPowWithIntegerCheck(IKsign((((gconst5*new_r01))+(((-1.0)*gconst4*new_r11)))),-1);
7494if(!x605.valid){
7495continue;
7496}
7497CheckValue<IkReal> x606 = IKatan2WithCheck(IkReal(gconst4*gconst4),IkReal(((-1.0)*gconst4*gconst5)),IKFAST_ATAN2_MAGTHRESH);
7498if(!x606.valid){
7499continue;
7500}
7501j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x605.value)))+(x606.value));
7502sj3array[0]=IKsin(j3array[0]);
7503cj3array[0]=IKcos(j3array[0]);
7504if( j3array[0] > IKPI )
7505{
7506 j3array[0]-=IK2PI;
7507}
7508else if( j3array[0] < -IKPI )
7509{ j3array[0]+=IK2PI;
7510}
7511j3valid[0] = true;
7512for(int ij3 = 0; ij3 < 1; ++ij3)
7513{
7514if( !j3valid[ij3] )
7515{
7516 continue;
7517}
7518_ij3[0] = ij3; _ij3[1] = -1;
7519for(int iij3 = ij3+1; iij3 < 1; ++iij3)
7520{
7521if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
7522{
7523 j3valid[iij3]=false; _ij3[1] = iij3; break;
7524}
7525}
7526j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
7527{
7528IkReal evalcond[6];
7529IkReal x607=IKsin(j3);
7530IkReal x608=IKcos(j3);
7531IkReal x609=(gconst4*x607);
7532IkReal x610=(gconst4*x608);
7533IkReal x611=((1.0)*x608);
7534IkReal x612=(gconst5*x607);
7535IkReal x613=(gconst5*x611);
7536evalcond[0]=(gconst4+((new_r11*x607))+((new_r01*x608)));
7537evalcond[1]=(x610+x612+new_r01);
7538evalcond[2]=((((-1.0)*x613))+x609);
7539evalcond[3]=(gconst5+(((-1.0)*new_r11*x611))+((new_r01*x607)));
7540evalcond[4]=((((-1.0)*x613))+x609+new_r11);
7541evalcond[5]=((((-1.0)*x610))+(((-1.0)*x612)));
7542if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
7543{
7544continue;
7545}
7546}
7547
7548{
7549std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
7550vinfos[0].jointtype = 1;
7551vinfos[0].foffset = j0;
7552vinfos[0].indices[0] = _ij0[0];
7553vinfos[0].indices[1] = _ij0[1];
7554vinfos[0].maxsolutions = _nj0;
7555vinfos[1].jointtype = 1;
7556vinfos[1].foffset = j1;
7557vinfos[1].indices[0] = _ij1[0];
7558vinfos[1].indices[1] = _ij1[1];
7559vinfos[1].maxsolutions = _nj1;
7560vinfos[2].jointtype = 1;
7561vinfos[2].foffset = j2;
7562vinfos[2].indices[0] = _ij2[0];
7563vinfos[2].indices[1] = _ij2[1];
7564vinfos[2].maxsolutions = _nj2;
7565vinfos[3].jointtype = 1;
7566vinfos[3].foffset = j3;
7567vinfos[3].indices[0] = _ij3[0];
7568vinfos[3].indices[1] = _ij3[1];
7569vinfos[3].maxsolutions = _nj3;
7570vinfos[4].jointtype = 1;
7571vinfos[4].foffset = j4;
7572vinfos[4].indices[0] = _ij4[0];
7573vinfos[4].indices[1] = _ij4[1];
7574vinfos[4].maxsolutions = _nj4;
7575vinfos[5].jointtype = 1;
7576vinfos[5].foffset = j5;
7577vinfos[5].indices[0] = _ij5[0];
7578vinfos[5].indices[1] = _ij5[1];
7579vinfos[5].maxsolutions = _nj5;
7580std::vector<int> vfree(0);
7581solutions.AddSolution(vinfos,vfree);
7582}
7583}
7584}
7585
7586}
7587
7588}
7589
7590}
7591} while(0);
7592if( bgotonextstatement )
7593{
7594bool bgotonextstatement = true;
7595do
7596{
7597evalcond[0]=((IKabs(new_r10))+(IKabs(new_r01)));
7598if( IKabs(evalcond[0]) < 0.0000050000000000 )
7599{
7600bgotonextstatement=false;
7601{
7602IkReal j3eval[1];
7603IkReal x614=((-1.0)*new_r11);
7604CheckValue<IkReal> x616 = IKatan2WithCheck(IkReal(x614),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
7605if(!x616.valid){
7606continue;
7607}
7608IkReal x615=((1.0)*(x616.value));
7609sj4=0;
7610cj4=1.0;
7611j4=0;
7612sj5=gconst4;
7613cj5=gconst5;
7614j5=((3.14159265)+(((-1.0)*x615)));
7615new_r01=0;
7616new_r10=0;
7617IkReal gconst3=((3.14159265358979)+(((-1.0)*x615)));
7618IkReal x617 = new_r11*new_r11;
7619if(IKabs(x617)==0){
7620continue;
7621}
7622IkReal gconst4=(x614*(pow(x617,-0.5)));
7623IkReal gconst5=0;
7624j3eval[0]=new_r00;
7625if( IKabs(j3eval[0]) < 0.0000010000000000 )
7626{
7627{
7628IkReal j3eval[1];
7629IkReal x618=((-1.0)*new_r11);
7630CheckValue<IkReal> x620 = IKatan2WithCheck(IkReal(x618),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
7631if(!x620.valid){
7632continue;
7633}
7634IkReal x619=((1.0)*(x620.value));
7635sj4=0;
7636cj4=1.0;
7637j4=0;
7638sj5=gconst4;
7639cj5=gconst5;
7640j5=((3.14159265)+(((-1.0)*x619)));
7641new_r01=0;
7642new_r10=0;
7643IkReal gconst3=((3.14159265358979)+(((-1.0)*x619)));
7644IkReal x621 = new_r11*new_r11;
7645if(IKabs(x621)==0){
7646continue;
7647}
7648IkReal gconst4=(x618*(pow(x621,-0.5)));
7649IkReal gconst5=0;
7650j3eval[0]=new_r11;
7651if( IKabs(j3eval[0]) < 0.0000010000000000 )
7652{
7653{
7654IkReal j3array[2], cj3array[2], sj3array[2];
7655bool j3valid[2]={false};
7656_nj3 = 2;
7658if(!x622.valid){
7659continue;
7660}
7661sj3array[0]=((-1.0)*new_r00*(x622.value));
7662if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
7663{
7664 j3valid[0] = j3valid[1] = true;
7665 j3array[0] = IKasin(sj3array[0]);
7666 cj3array[0] = IKcos(j3array[0]);
7667 sj3array[1] = sj3array[0];
7668 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
7669 cj3array[1] = -cj3array[0];
7670}
7671else if( isnan(sj3array[0]) )
7672{
7673 // probably any value will work
7674 j3valid[0] = true;
7675 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
7676}
7677for(int ij3 = 0; ij3 < 2; ++ij3)
7678{
7679if( !j3valid[ij3] )
7680{
7681 continue;
7682}
7683_ij3[0] = ij3; _ij3[1] = -1;
7684for(int iij3 = ij3+1; iij3 < 2; ++iij3)
7685{
7686if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
7687{
7688 j3valid[iij3]=false; _ij3[1] = iij3; break;
7689}
7690}
7691j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
7692{
7693IkReal evalcond[6];
7694IkReal x623=IKcos(j3);
7695IkReal x624=IKsin(j3);
7696evalcond[0]=(gconst4*x623);
7697evalcond[1]=(new_r00*x623);
7698evalcond[2]=((-1.0)*new_r11*x623);
7699evalcond[3]=(gconst4+((new_r00*x624)));
7700evalcond[4]=(gconst4+((new_r11*x624)));
7701evalcond[5]=(((gconst4*x624))+new_r11);
7702if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
7703{
7704continue;
7705}
7706}
7707
7708{
7709std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
7710vinfos[0].jointtype = 1;
7711vinfos[0].foffset = j0;
7712vinfos[0].indices[0] = _ij0[0];
7713vinfos[0].indices[1] = _ij0[1];
7714vinfos[0].maxsolutions = _nj0;
7715vinfos[1].jointtype = 1;
7716vinfos[1].foffset = j1;
7717vinfos[1].indices[0] = _ij1[0];
7718vinfos[1].indices[1] = _ij1[1];
7719vinfos[1].maxsolutions = _nj1;
7720vinfos[2].jointtype = 1;
7721vinfos[2].foffset = j2;
7722vinfos[2].indices[0] = _ij2[0];
7723vinfos[2].indices[1] = _ij2[1];
7724vinfos[2].maxsolutions = _nj2;
7725vinfos[3].jointtype = 1;
7726vinfos[3].foffset = j3;
7727vinfos[3].indices[0] = _ij3[0];
7728vinfos[3].indices[1] = _ij3[1];
7729vinfos[3].maxsolutions = _nj3;
7730vinfos[4].jointtype = 1;
7731vinfos[4].foffset = j4;
7732vinfos[4].indices[0] = _ij4[0];
7733vinfos[4].indices[1] = _ij4[1];
7734vinfos[4].maxsolutions = _nj4;
7735vinfos[5].jointtype = 1;
7736vinfos[5].foffset = j5;
7737vinfos[5].indices[0] = _ij5[0];
7738vinfos[5].indices[1] = _ij5[1];
7739vinfos[5].maxsolutions = _nj5;
7740std::vector<int> vfree(0);
7741solutions.AddSolution(vinfos,vfree);
7742}
7743}
7744}
7745
7746} else
7747{
7748{
7749IkReal j3array[2], cj3array[2], sj3array[2];
7750bool j3valid[2]={false};
7751_nj3 = 2;
7753if(!x625.valid){
7754continue;
7755}
7756sj3array[0]=((-1.0)*gconst4*(x625.value));
7757if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
7758{
7759 j3valid[0] = j3valid[1] = true;
7760 j3array[0] = IKasin(sj3array[0]);
7761 cj3array[0] = IKcos(j3array[0]);
7762 sj3array[1] = sj3array[0];
7763 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
7764 cj3array[1] = -cj3array[0];
7765}
7766else if( isnan(sj3array[0]) )
7767{
7768 // probably any value will work
7769 j3valid[0] = true;
7770 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
7771}
7772for(int ij3 = 0; ij3 < 2; ++ij3)
7773{
7774if( !j3valid[ij3] )
7775{
7776 continue;
7777}
7778_ij3[0] = ij3; _ij3[1] = -1;
7779for(int iij3 = ij3+1; iij3 < 2; ++iij3)
7780{
7781if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
7782{
7783 j3valid[iij3]=false; _ij3[1] = iij3; break;
7784}
7785}
7786j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
7787{
7788IkReal evalcond[6];
7789IkReal x626=IKcos(j3);
7790IkReal x627=IKsin(j3);
7791IkReal x628=(gconst4*x627);
7792evalcond[0]=(gconst4*x626);
7793evalcond[1]=(new_r00*x626);
7794evalcond[2]=((-1.0)*new_r11*x626);
7795evalcond[3]=(gconst4+((new_r00*x627)));
7796evalcond[4]=(x628+new_r00);
7797evalcond[5]=(x628+new_r11);
7798if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
7799{
7800continue;
7801}
7802}
7803
7804{
7805std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
7806vinfos[0].jointtype = 1;
7807vinfos[0].foffset = j0;
7808vinfos[0].indices[0] = _ij0[0];
7809vinfos[0].indices[1] = _ij0[1];
7810vinfos[0].maxsolutions = _nj0;
7811vinfos[1].jointtype = 1;
7812vinfos[1].foffset = j1;
7813vinfos[1].indices[0] = _ij1[0];
7814vinfos[1].indices[1] = _ij1[1];
7815vinfos[1].maxsolutions = _nj1;
7816vinfos[2].jointtype = 1;
7817vinfos[2].foffset = j2;
7818vinfos[2].indices[0] = _ij2[0];
7819vinfos[2].indices[1] = _ij2[1];
7820vinfos[2].maxsolutions = _nj2;
7821vinfos[3].jointtype = 1;
7822vinfos[3].foffset = j3;
7823vinfos[3].indices[0] = _ij3[0];
7824vinfos[3].indices[1] = _ij3[1];
7825vinfos[3].maxsolutions = _nj3;
7826vinfos[4].jointtype = 1;
7827vinfos[4].foffset = j4;
7828vinfos[4].indices[0] = _ij4[0];
7829vinfos[4].indices[1] = _ij4[1];
7830vinfos[4].maxsolutions = _nj4;
7831vinfos[5].jointtype = 1;
7832vinfos[5].foffset = j5;
7833vinfos[5].indices[0] = _ij5[0];
7834vinfos[5].indices[1] = _ij5[1];
7835vinfos[5].maxsolutions = _nj5;
7836std::vector<int> vfree(0);
7837solutions.AddSolution(vinfos,vfree);
7838}
7839}
7840}
7841
7842}
7843
7844}
7845
7846} else
7847{
7848{
7849IkReal j3array[2], cj3array[2], sj3array[2];
7850bool j3valid[2]={false};
7851_nj3 = 2;
7853if(!x629.valid){
7854continue;
7855}
7856sj3array[0]=((-1.0)*gconst4*(x629.value));
7857if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
7858{
7859 j3valid[0] = j3valid[1] = true;
7860 j3array[0] = IKasin(sj3array[0]);
7861 cj3array[0] = IKcos(j3array[0]);
7862 sj3array[1] = sj3array[0];
7863 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
7864 cj3array[1] = -cj3array[0];
7865}
7866else if( isnan(sj3array[0]) )
7867{
7868 // probably any value will work
7869 j3valid[0] = true;
7870 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
7871}
7872for(int ij3 = 0; ij3 < 2; ++ij3)
7873{
7874if( !j3valid[ij3] )
7875{
7876 continue;
7877}
7878_ij3[0] = ij3; _ij3[1] = -1;
7879for(int iij3 = ij3+1; iij3 < 2; ++iij3)
7880{
7881if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
7882{
7883 j3valid[iij3]=false; _ij3[1] = iij3; break;
7884}
7885}
7886j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
7887{
7888IkReal evalcond[6];
7889IkReal x630=IKcos(j3);
7890IkReal x631=IKsin(j3);
7891IkReal x632=(gconst4*x631);
7892evalcond[0]=(gconst4*x630);
7893evalcond[1]=(new_r00*x630);
7894evalcond[2]=((-1.0)*new_r11*x630);
7895evalcond[3]=(gconst4+((new_r11*x631)));
7896evalcond[4]=(x632+new_r00);
7897evalcond[5]=(x632+new_r11);
7898if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
7899{
7900continue;
7901}
7902}
7903
7904{
7905std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
7906vinfos[0].jointtype = 1;
7907vinfos[0].foffset = j0;
7908vinfos[0].indices[0] = _ij0[0];
7909vinfos[0].indices[1] = _ij0[1];
7910vinfos[0].maxsolutions = _nj0;
7911vinfos[1].jointtype = 1;
7912vinfos[1].foffset = j1;
7913vinfos[1].indices[0] = _ij1[0];
7914vinfos[1].indices[1] = _ij1[1];
7915vinfos[1].maxsolutions = _nj1;
7916vinfos[2].jointtype = 1;
7917vinfos[2].foffset = j2;
7918vinfos[2].indices[0] = _ij2[0];
7919vinfos[2].indices[1] = _ij2[1];
7920vinfos[2].maxsolutions = _nj2;
7921vinfos[3].jointtype = 1;
7922vinfos[3].foffset = j3;
7923vinfos[3].indices[0] = _ij3[0];
7924vinfos[3].indices[1] = _ij3[1];
7925vinfos[3].maxsolutions = _nj3;
7926vinfos[4].jointtype = 1;
7927vinfos[4].foffset = j4;
7928vinfos[4].indices[0] = _ij4[0];
7929vinfos[4].indices[1] = _ij4[1];
7930vinfos[4].maxsolutions = _nj4;
7931vinfos[5].jointtype = 1;
7932vinfos[5].foffset = j5;
7933vinfos[5].indices[0] = _ij5[0];
7934vinfos[5].indices[1] = _ij5[1];
7935vinfos[5].maxsolutions = _nj5;
7936std::vector<int> vfree(0);
7937solutions.AddSolution(vinfos,vfree);
7938}
7939}
7940}
7941
7942}
7943
7944}
7945
7946}
7947} while(0);
7948if( bgotonextstatement )
7949{
7950bool bgotonextstatement = true;
7951do
7952{
7953evalcond[0]=IKabs(new_r11);
7954if( IKabs(evalcond[0]) < 0.0000050000000000 )
7955{
7956bgotonextstatement=false;
7957{
7958IkReal j3eval[1];
7959CheckValue<IkReal> x634 = IKatan2WithCheck(IkReal(0),IkReal(((-1.0)*new_r01)),IKFAST_ATAN2_MAGTHRESH);
7960if(!x634.valid){
7961continue;
7962}
7963IkReal x633=((1.0)*(x634.value));
7964sj4=0;
7965cj4=1.0;
7966j4=0;
7967sj5=gconst4;
7968cj5=gconst5;
7969j5=((3.14159265)+(((-1.0)*x633)));
7970new_r11=0;
7971IkReal gconst3=((3.14159265358979)+(((-1.0)*x633)));
7972IkReal gconst4=0;
7973IkReal x635 = new_r01*new_r01;
7974if(IKabs(x635)==0){
7975continue;
7976}
7977IkReal gconst5=((1.0)*new_r01*(pow(x635,-0.5)));
7978j3eval[0]=((IKabs(new_r10))+(IKabs(new_r00)));
7979if( IKabs(j3eval[0]) < 0.0000010000000000 )
7980{
7981{
7982IkReal j3eval[1];
7983CheckValue<IkReal> x637 = IKatan2WithCheck(IkReal(0),IkReal(((-1.0)*new_r01)),IKFAST_ATAN2_MAGTHRESH);
7984if(!x637.valid){
7985continue;
7986}
7987IkReal x636=((1.0)*(x637.value));
7988sj4=0;
7989cj4=1.0;
7990j4=0;
7991sj5=gconst4;
7992cj5=gconst5;
7993j5=((3.14159265)+(((-1.0)*x636)));
7994new_r11=0;
7995IkReal gconst3=((3.14159265358979)+(((-1.0)*x636)));
7996IkReal gconst4=0;
7997IkReal x638 = new_r01*new_r01;
7998if(IKabs(x638)==0){
7999continue;
8000}
8001IkReal gconst5=((1.0)*new_r01*(pow(x638,-0.5)));
8002j3eval[0]=((IKabs(new_r00))+(IKabs(new_r01)));
8003if( IKabs(j3eval[0]) < 0.0000010000000000 )
8004{
8005{
8006IkReal j3eval[1];
8007CheckValue<IkReal> x640 = IKatan2WithCheck(IkReal(0),IkReal(((-1.0)*new_r01)),IKFAST_ATAN2_MAGTHRESH);
8008if(!x640.valid){
8009continue;
8010}
8011IkReal x639=((1.0)*(x640.value));
8012sj4=0;
8013cj4=1.0;
8014j4=0;
8015sj5=gconst4;
8016cj5=gconst5;
8017j5=((3.14159265)+(((-1.0)*x639)));
8018new_r11=0;
8019IkReal gconst3=((3.14159265358979)+(((-1.0)*x639)));
8020IkReal gconst4=0;
8021IkReal x641 = new_r01*new_r01;
8022if(IKabs(x641)==0){
8023continue;
8024}
8025IkReal gconst5=((1.0)*new_r01*(pow(x641,-0.5)));
8026j3eval[0]=new_r01;
8027if( IKabs(j3eval[0]) < 0.0000010000000000 )
8028{
8029continue; // 3 cases reached
8030
8031} else
8032{
8033{
8034IkReal j3array[1], cj3array[1], sj3array[1];
8035bool j3valid[1]={false};
8036_nj3 = 1;
8038if(!x642.valid){
8039continue;
8040}
8042if(!x643.valid){
8043continue;
8044}
8045if( IKabs(((-1.0)*gconst5*(x642.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r00*(x643.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*gconst5*(x642.value)))+IKsqr((new_r00*(x643.value)))-1) <= IKFAST_SINCOS_THRESH )
8046 continue;
8047j3array[0]=IKatan2(((-1.0)*gconst5*(x642.value)), (new_r00*(x643.value)));
8048sj3array[0]=IKsin(j3array[0]);
8049cj3array[0]=IKcos(j3array[0]);
8050if( j3array[0] > IKPI )
8051{
8052 j3array[0]-=IK2PI;
8053}
8054else if( j3array[0] < -IKPI )
8055{ j3array[0]+=IK2PI;
8056}
8057j3valid[0] = true;
8058for(int ij3 = 0; ij3 < 1; ++ij3)
8059{
8060if( !j3valid[ij3] )
8061{
8062 continue;
8063}
8064_ij3[0] = ij3; _ij3[1] = -1;
8065for(int iij3 = ij3+1; iij3 < 1; ++iij3)
8066{
8067if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
8068{
8069 j3valid[iij3]=false; _ij3[1] = iij3; break;
8070}
8071}
8072j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
8073{
8074IkReal evalcond[8];
8075IkReal x644=IKcos(j3);
8076IkReal x645=IKsin(j3);
8077IkReal x646=((1.0)*gconst5);
8078evalcond[0]=(new_r01*x644);
8079evalcond[1]=((-1.0)*gconst5*x644);
8080evalcond[2]=(gconst5+((new_r01*x645)));
8081evalcond[3]=(new_r01+((gconst5*x645)));
8082evalcond[4]=((((-1.0)*x644*x646))+new_r00);
8083evalcond[5]=((((-1.0)*x645*x646))+new_r10);
8084evalcond[6]=((((-1.0)*new_r10*x644))+((new_r00*x645)));
8085evalcond[7]=((((-1.0)*x646))+((new_r10*x645))+((new_r00*x644)));
8086if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
8087{
8088continue;
8089}
8090}
8091
8092{
8093std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
8094vinfos[0].jointtype = 1;
8095vinfos[0].foffset = j0;
8096vinfos[0].indices[0] = _ij0[0];
8097vinfos[0].indices[1] = _ij0[1];
8098vinfos[0].maxsolutions = _nj0;
8099vinfos[1].jointtype = 1;
8100vinfos[1].foffset = j1;
8101vinfos[1].indices[0] = _ij1[0];
8102vinfos[1].indices[1] = _ij1[1];
8103vinfos[1].maxsolutions = _nj1;
8104vinfos[2].jointtype = 1;
8105vinfos[2].foffset = j2;
8106vinfos[2].indices[0] = _ij2[0];
8107vinfos[2].indices[1] = _ij2[1];
8108vinfos[2].maxsolutions = _nj2;
8109vinfos[3].jointtype = 1;
8110vinfos[3].foffset = j3;
8111vinfos[3].indices[0] = _ij3[0];
8112vinfos[3].indices[1] = _ij3[1];
8113vinfos[3].maxsolutions = _nj3;
8114vinfos[4].jointtype = 1;
8115vinfos[4].foffset = j4;
8116vinfos[4].indices[0] = _ij4[0];
8117vinfos[4].indices[1] = _ij4[1];
8118vinfos[4].maxsolutions = _nj4;
8119vinfos[5].jointtype = 1;
8120vinfos[5].foffset = j5;
8121vinfos[5].indices[0] = _ij5[0];
8122vinfos[5].indices[1] = _ij5[1];
8123vinfos[5].maxsolutions = _nj5;
8124std::vector<int> vfree(0);
8125solutions.AddSolution(vinfos,vfree);
8126}
8127}
8128}
8129
8130}
8131
8132}
8133
8134} else
8135{
8136{
8137IkReal j3array[1], cj3array[1], sj3array[1];
8138bool j3valid[1]={false};
8139_nj3 = 1;
8141if(!x647.valid){
8142continue;
8143}
8145if(!x648.valid){
8146continue;
8147}
8148j3array[0]=((-1.5707963267949)+(x647.value)+(((1.5707963267949)*(x648.value))));
8149sj3array[0]=IKsin(j3array[0]);
8150cj3array[0]=IKcos(j3array[0]);
8151if( j3array[0] > IKPI )
8152{
8153 j3array[0]-=IK2PI;
8154}
8155else if( j3array[0] < -IKPI )
8156{ j3array[0]+=IK2PI;
8157}
8158j3valid[0] = true;
8159for(int ij3 = 0; ij3 < 1; ++ij3)
8160{
8161if( !j3valid[ij3] )
8162{
8163 continue;
8164}
8165_ij3[0] = ij3; _ij3[1] = -1;
8166for(int iij3 = ij3+1; iij3 < 1; ++iij3)
8167{
8168if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
8169{
8170 j3valid[iij3]=false; _ij3[1] = iij3; break;
8171}
8172}
8173j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
8174{
8175IkReal evalcond[8];
8176IkReal x649=IKcos(j3);
8177IkReal x650=IKsin(j3);
8178IkReal x651=((1.0)*gconst5);
8179evalcond[0]=(new_r01*x649);
8180evalcond[1]=((-1.0)*gconst5*x649);
8181evalcond[2]=(gconst5+((new_r01*x650)));
8182evalcond[3]=(new_r01+((gconst5*x650)));
8183evalcond[4]=((((-1.0)*x649*x651))+new_r00);
8184evalcond[5]=((((-1.0)*x650*x651))+new_r10);
8185evalcond[6]=((((-1.0)*new_r10*x649))+((new_r00*x650)));
8186evalcond[7]=((((-1.0)*x651))+((new_r00*x649))+((new_r10*x650)));
8187if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
8188{
8189continue;
8190}
8191}
8192
8193{
8194std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
8195vinfos[0].jointtype = 1;
8196vinfos[0].foffset = j0;
8197vinfos[0].indices[0] = _ij0[0];
8198vinfos[0].indices[1] = _ij0[1];
8199vinfos[0].maxsolutions = _nj0;
8200vinfos[1].jointtype = 1;
8201vinfos[1].foffset = j1;
8202vinfos[1].indices[0] = _ij1[0];
8203vinfos[1].indices[1] = _ij1[1];
8204vinfos[1].maxsolutions = _nj1;
8205vinfos[2].jointtype = 1;
8206vinfos[2].foffset = j2;
8207vinfos[2].indices[0] = _ij2[0];
8208vinfos[2].indices[1] = _ij2[1];
8209vinfos[2].maxsolutions = _nj2;
8210vinfos[3].jointtype = 1;
8211vinfos[3].foffset = j3;
8212vinfos[3].indices[0] = _ij3[0];
8213vinfos[3].indices[1] = _ij3[1];
8214vinfos[3].maxsolutions = _nj3;
8215vinfos[4].jointtype = 1;
8216vinfos[4].foffset = j4;
8217vinfos[4].indices[0] = _ij4[0];
8218vinfos[4].indices[1] = _ij4[1];
8219vinfos[4].maxsolutions = _nj4;
8220vinfos[5].jointtype = 1;
8221vinfos[5].foffset = j5;
8222vinfos[5].indices[0] = _ij5[0];
8223vinfos[5].indices[1] = _ij5[1];
8224vinfos[5].maxsolutions = _nj5;
8225std::vector<int> vfree(0);
8226solutions.AddSolution(vinfos,vfree);
8227}
8228}
8229}
8230
8231}
8232
8233}
8234
8235} else
8236{
8237{
8238IkReal j3array[1], cj3array[1], sj3array[1];
8239bool j3valid[1]={false};
8240_nj3 = 1;
8242if(!x652.valid){
8243continue;
8244}
8246if(!x653.valid){
8247continue;
8248}
8249j3array[0]=((-1.5707963267949)+(x652.value)+(((1.5707963267949)*(x653.value))));
8250sj3array[0]=IKsin(j3array[0]);
8251cj3array[0]=IKcos(j3array[0]);
8252if( j3array[0] > IKPI )
8253{
8254 j3array[0]-=IK2PI;
8255}
8256else if( j3array[0] < -IKPI )
8257{ j3array[0]+=IK2PI;
8258}
8259j3valid[0] = true;
8260for(int ij3 = 0; ij3 < 1; ++ij3)
8261{
8262if( !j3valid[ij3] )
8263{
8264 continue;
8265}
8266_ij3[0] = ij3; _ij3[1] = -1;
8267for(int iij3 = ij3+1; iij3 < 1; ++iij3)
8268{
8269if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
8270{
8271 j3valid[iij3]=false; _ij3[1] = iij3; break;
8272}
8273}
8274j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
8275{
8276IkReal evalcond[8];
8277IkReal x654=IKcos(j3);
8278IkReal x655=IKsin(j3);
8279IkReal x656=((1.0)*gconst5);
8280evalcond[0]=(new_r01*x654);
8281evalcond[1]=((-1.0)*gconst5*x654);
8282evalcond[2]=(gconst5+((new_r01*x655)));
8283evalcond[3]=(new_r01+((gconst5*x655)));
8284evalcond[4]=(new_r00+(((-1.0)*x654*x656)));
8285evalcond[5]=((((-1.0)*x655*x656))+new_r10);
8286evalcond[6]=((((-1.0)*new_r10*x654))+((new_r00*x655)));
8287evalcond[7]=((((-1.0)*x656))+((new_r10*x655))+((new_r00*x654)));
8288if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
8289{
8290continue;
8291}
8292}
8293
8294{
8295std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
8296vinfos[0].jointtype = 1;
8297vinfos[0].foffset = j0;
8298vinfos[0].indices[0] = _ij0[0];
8299vinfos[0].indices[1] = _ij0[1];
8300vinfos[0].maxsolutions = _nj0;
8301vinfos[1].jointtype = 1;
8302vinfos[1].foffset = j1;
8303vinfos[1].indices[0] = _ij1[0];
8304vinfos[1].indices[1] = _ij1[1];
8305vinfos[1].maxsolutions = _nj1;
8306vinfos[2].jointtype = 1;
8307vinfos[2].foffset = j2;
8308vinfos[2].indices[0] = _ij2[0];
8309vinfos[2].indices[1] = _ij2[1];
8310vinfos[2].maxsolutions = _nj2;
8311vinfos[3].jointtype = 1;
8312vinfos[3].foffset = j3;
8313vinfos[3].indices[0] = _ij3[0];
8314vinfos[3].indices[1] = _ij3[1];
8315vinfos[3].maxsolutions = _nj3;
8316vinfos[4].jointtype = 1;
8317vinfos[4].foffset = j4;
8318vinfos[4].indices[0] = _ij4[0];
8319vinfos[4].indices[1] = _ij4[1];
8320vinfos[4].maxsolutions = _nj4;
8321vinfos[5].jointtype = 1;
8322vinfos[5].foffset = j5;
8323vinfos[5].indices[0] = _ij5[0];
8324vinfos[5].indices[1] = _ij5[1];
8325vinfos[5].maxsolutions = _nj5;
8326std::vector<int> vfree(0);
8327solutions.AddSolution(vinfos,vfree);
8328}
8329}
8330}
8331
8332}
8333
8334}
8335
8336}
8337} while(0);
8338if( bgotonextstatement )
8339{
8340bool bgotonextstatement = true;
8341do
8342{
8343if( 1 )
8344{
8345bgotonextstatement=false;
8346continue; // branch miss [j3]
8347
8348}
8349} while(0);
8350if( bgotonextstatement )
8351{
8352}
8353}
8354}
8355}
8356}
8357}
8358
8359} else
8360{
8361{
8362IkReal j3array[1], cj3array[1], sj3array[1];
8363bool j3valid[1]={false};
8364_nj3 = 1;
8365IkReal x657=((1.0)*new_r01);
8366CheckValue<IkReal> x658 = IKatan2WithCheck(IkReal(((new_r01*new_r01)+(((-1.0)*(gconst4*gconst4))))),IkReal(((((-1.0)*new_r11*x657))+((gconst4*gconst5)))),IKFAST_ATAN2_MAGTHRESH);
8367if(!x658.valid){
8368continue;
8369}
8370CheckValue<IkReal> x659=IKPowWithIntegerCheck(IKsign((((gconst4*new_r11))+(((-1.0)*gconst5*x657)))),-1);
8371if(!x659.valid){
8372continue;
8373}
8374j3array[0]=((-1.5707963267949)+(x658.value)+(((1.5707963267949)*(x659.value))));
8375sj3array[0]=IKsin(j3array[0]);
8376cj3array[0]=IKcos(j3array[0]);
8377if( j3array[0] > IKPI )
8378{
8379 j3array[0]-=IK2PI;
8380}
8381else if( j3array[0] < -IKPI )
8382{ j3array[0]+=IK2PI;
8383}
8384j3valid[0] = true;
8385for(int ij3 = 0; ij3 < 1; ++ij3)
8386{
8387if( !j3valid[ij3] )
8388{
8389 continue;
8390}
8391_ij3[0] = ij3; _ij3[1] = -1;
8392for(int iij3 = ij3+1; iij3 < 1; ++iij3)
8393{
8394if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
8395{
8396 j3valid[iij3]=false; _ij3[1] = iij3; break;
8397}
8398}
8399j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
8400{
8401IkReal evalcond[8];
8402IkReal x660=IKsin(j3);
8403IkReal x661=IKcos(j3);
8404IkReal x662=((1.0)*gconst5);
8405IkReal x663=(gconst4*x660);
8406IkReal x664=(gconst4*x661);
8407IkReal x665=((1.0)*x661);
8408IkReal x666=(x661*x662);
8409evalcond[0]=(gconst4+((new_r11*x660))+((new_r01*x661)));
8410evalcond[1]=(((gconst5*x660))+x664+new_r01);
8411evalcond[2]=(gconst4+(((-1.0)*new_r10*x665))+((new_r00*x660)));
8412evalcond[3]=(gconst5+(((-1.0)*new_r11*x665))+((new_r01*x660)));
8413evalcond[4]=((((-1.0)*x666))+x663+new_r00);
8414evalcond[5]=((((-1.0)*x666))+x663+new_r11);
8415evalcond[6]=(((new_r10*x660))+(((-1.0)*x662))+((new_r00*x661)));
8416evalcond[7]=((((-1.0)*x660*x662))+(((-1.0)*x664))+new_r10);
8417if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
8418{
8419continue;
8420}
8421}
8422
8423{
8424std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
8425vinfos[0].jointtype = 1;
8426vinfos[0].foffset = j0;
8427vinfos[0].indices[0] = _ij0[0];
8428vinfos[0].indices[1] = _ij0[1];
8429vinfos[0].maxsolutions = _nj0;
8430vinfos[1].jointtype = 1;
8431vinfos[1].foffset = j1;
8432vinfos[1].indices[0] = _ij1[0];
8433vinfos[1].indices[1] = _ij1[1];
8434vinfos[1].maxsolutions = _nj1;
8435vinfos[2].jointtype = 1;
8436vinfos[2].foffset = j2;
8437vinfos[2].indices[0] = _ij2[0];
8438vinfos[2].indices[1] = _ij2[1];
8439vinfos[2].maxsolutions = _nj2;
8440vinfos[3].jointtype = 1;
8441vinfos[3].foffset = j3;
8442vinfos[3].indices[0] = _ij3[0];
8443vinfos[3].indices[1] = _ij3[1];
8444vinfos[3].maxsolutions = _nj3;
8445vinfos[4].jointtype = 1;
8446vinfos[4].foffset = j4;
8447vinfos[4].indices[0] = _ij4[0];
8448vinfos[4].indices[1] = _ij4[1];
8449vinfos[4].maxsolutions = _nj4;
8450vinfos[5].jointtype = 1;
8451vinfos[5].foffset = j5;
8452vinfos[5].indices[0] = _ij5[0];
8453vinfos[5].indices[1] = _ij5[1];
8454vinfos[5].maxsolutions = _nj5;
8455std::vector<int> vfree(0);
8456solutions.AddSolution(vinfos,vfree);
8457}
8458}
8459}
8460
8461}
8462
8463}
8464
8465} else
8466{
8467{
8468IkReal j3array[1], cj3array[1], sj3array[1];
8469bool j3valid[1]={false};
8470_nj3 = 1;
8471IkReal x667=((1.0)*gconst4);
8472CheckValue<IkReal> x668 = IKatan2WithCheck(IkReal(((gconst4*gconst4)+((new_r01*new_r10)))),IkReal((((new_r00*new_r01))+(((-1.0)*gconst5*x667)))),IKFAST_ATAN2_MAGTHRESH);
8473if(!x668.valid){
8474continue;
8475}
8476CheckValue<IkReal> x669=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst5*new_r10))+(((-1.0)*new_r00*x667)))),-1);
8477if(!x669.valid){
8478continue;
8479}
8480j3array[0]=((-1.5707963267949)+(x668.value)+(((1.5707963267949)*(x669.value))));
8481sj3array[0]=IKsin(j3array[0]);
8482cj3array[0]=IKcos(j3array[0]);
8483if( j3array[0] > IKPI )
8484{
8485 j3array[0]-=IK2PI;
8486}
8487else if( j3array[0] < -IKPI )
8488{ j3array[0]+=IK2PI;
8489}
8490j3valid[0] = true;
8491for(int ij3 = 0; ij3 < 1; ++ij3)
8492{
8493if( !j3valid[ij3] )
8494{
8495 continue;
8496}
8497_ij3[0] = ij3; _ij3[1] = -1;
8498for(int iij3 = ij3+1; iij3 < 1; ++iij3)
8499{
8500if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
8501{
8502 j3valid[iij3]=false; _ij3[1] = iij3; break;
8503}
8504}
8505j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
8506{
8507IkReal evalcond[8];
8508IkReal x670=IKsin(j3);
8509IkReal x671=IKcos(j3);
8510IkReal x672=((1.0)*gconst5);
8511IkReal x673=(gconst4*x670);
8512IkReal x674=(gconst4*x671);
8513IkReal x675=((1.0)*x671);
8514IkReal x676=(x671*x672);
8515evalcond[0]=(((new_r11*x670))+((new_r01*x671))+gconst4);
8516evalcond[1]=(((gconst5*x670))+x674+new_r01);
8517evalcond[2]=(((new_r00*x670))+gconst4+(((-1.0)*new_r10*x675)));
8518evalcond[3]=(((new_r01*x670))+gconst5+(((-1.0)*new_r11*x675)));
8519evalcond[4]=(x673+new_r00+(((-1.0)*x676)));
8520evalcond[5]=(x673+new_r11+(((-1.0)*x676)));
8521evalcond[6]=(((new_r00*x671))+((new_r10*x670))+(((-1.0)*x672)));
8522evalcond[7]=((((-1.0)*x670*x672))+(((-1.0)*x674))+new_r10);
8523if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
8524{
8525continue;
8526}
8527}
8528
8529{
8530std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
8531vinfos[0].jointtype = 1;
8532vinfos[0].foffset = j0;
8533vinfos[0].indices[0] = _ij0[0];
8534vinfos[0].indices[1] = _ij0[1];
8535vinfos[0].maxsolutions = _nj0;
8536vinfos[1].jointtype = 1;
8537vinfos[1].foffset = j1;
8538vinfos[1].indices[0] = _ij1[0];
8539vinfos[1].indices[1] = _ij1[1];
8540vinfos[1].maxsolutions = _nj1;
8541vinfos[2].jointtype = 1;
8542vinfos[2].foffset = j2;
8543vinfos[2].indices[0] = _ij2[0];
8544vinfos[2].indices[1] = _ij2[1];
8545vinfos[2].maxsolutions = _nj2;
8546vinfos[3].jointtype = 1;
8547vinfos[3].foffset = j3;
8548vinfos[3].indices[0] = _ij3[0];
8549vinfos[3].indices[1] = _ij3[1];
8550vinfos[3].maxsolutions = _nj3;
8551vinfos[4].jointtype = 1;
8552vinfos[4].foffset = j4;
8553vinfos[4].indices[0] = _ij4[0];
8554vinfos[4].indices[1] = _ij4[1];
8555vinfos[4].maxsolutions = _nj4;
8556vinfos[5].jointtype = 1;
8557vinfos[5].foffset = j5;
8558vinfos[5].indices[0] = _ij5[0];
8559vinfos[5].indices[1] = _ij5[1];
8560vinfos[5].maxsolutions = _nj5;
8561std::vector<int> vfree(0);
8562solutions.AddSolution(vinfos,vfree);
8563}
8564}
8565}
8566
8567}
8568
8569}
8570
8571} else
8572{
8573{
8574IkReal j3array[1], cj3array[1], sj3array[1];
8575bool j3valid[1]={false};
8576_nj3 = 1;
8577IkReal x677=((1.0)*new_r11);
8578CheckValue<IkReal> x678=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r00*new_r01))+(((-1.0)*new_r10*x677)))),-1);
8579if(!x678.valid){
8580continue;
8581}
8582CheckValue<IkReal> x679 = IKatan2WithCheck(IkReal((((gconst4*new_r10))+((gconst4*new_r01)))),IkReal((((gconst4*new_r00))+(((-1.0)*gconst4*x677)))),IKFAST_ATAN2_MAGTHRESH);
8583if(!x679.valid){
8584continue;
8585}
8586j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x678.value)))+(x679.value));
8587sj3array[0]=IKsin(j3array[0]);
8588cj3array[0]=IKcos(j3array[0]);
8589if( j3array[0] > IKPI )
8590{
8591 j3array[0]-=IK2PI;
8592}
8593else if( j3array[0] < -IKPI )
8594{ j3array[0]+=IK2PI;
8595}
8596j3valid[0] = true;
8597for(int ij3 = 0; ij3 < 1; ++ij3)
8598{
8599if( !j3valid[ij3] )
8600{
8601 continue;
8602}
8603_ij3[0] = ij3; _ij3[1] = -1;
8604for(int iij3 = ij3+1; iij3 < 1; ++iij3)
8605{
8606if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
8607{
8608 j3valid[iij3]=false; _ij3[1] = iij3; break;
8609}
8610}
8611j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
8612{
8613IkReal evalcond[8];
8614IkReal x680=IKsin(j3);
8615IkReal x681=IKcos(j3);
8616IkReal x682=((1.0)*gconst5);
8617IkReal x683=(gconst4*x680);
8618IkReal x684=(gconst4*x681);
8619IkReal x685=((1.0)*x681);
8620IkReal x686=(x681*x682);
8621evalcond[0]=(gconst4+((new_r01*x681))+((new_r11*x680)));
8622evalcond[1]=(((gconst5*x680))+x684+new_r01);
8623evalcond[2]=((((-1.0)*new_r10*x685))+gconst4+((new_r00*x680)));
8624evalcond[3]=(gconst5+((new_r01*x680))+(((-1.0)*new_r11*x685)));
8625evalcond[4]=((((-1.0)*x686))+x683+new_r00);
8626evalcond[5]=((((-1.0)*x686))+x683+new_r11);
8627evalcond[6]=((((-1.0)*x682))+((new_r00*x681))+((new_r10*x680)));
8628evalcond[7]=((((-1.0)*x680*x682))+new_r10+(((-1.0)*x684)));
8629if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
8630{
8631continue;
8632}
8633}
8634
8635{
8636std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
8637vinfos[0].jointtype = 1;
8638vinfos[0].foffset = j0;
8639vinfos[0].indices[0] = _ij0[0];
8640vinfos[0].indices[1] = _ij0[1];
8641vinfos[0].maxsolutions = _nj0;
8642vinfos[1].jointtype = 1;
8643vinfos[1].foffset = j1;
8644vinfos[1].indices[0] = _ij1[0];
8645vinfos[1].indices[1] = _ij1[1];
8646vinfos[1].maxsolutions = _nj1;
8647vinfos[2].jointtype = 1;
8648vinfos[2].foffset = j2;
8649vinfos[2].indices[0] = _ij2[0];
8650vinfos[2].indices[1] = _ij2[1];
8651vinfos[2].maxsolutions = _nj2;
8652vinfos[3].jointtype = 1;
8653vinfos[3].foffset = j3;
8654vinfos[3].indices[0] = _ij3[0];
8655vinfos[3].indices[1] = _ij3[1];
8656vinfos[3].maxsolutions = _nj3;
8657vinfos[4].jointtype = 1;
8658vinfos[4].foffset = j4;
8659vinfos[4].indices[0] = _ij4[0];
8660vinfos[4].indices[1] = _ij4[1];
8661vinfos[4].maxsolutions = _nj4;
8662vinfos[5].jointtype = 1;
8663vinfos[5].foffset = j5;
8664vinfos[5].indices[0] = _ij5[0];
8665vinfos[5].indices[1] = _ij5[1];
8666vinfos[5].maxsolutions = _nj5;
8667std::vector<int> vfree(0);
8668solutions.AddSolution(vinfos,vfree);
8669}
8670}
8671}
8672
8673}
8674
8675}
8676
8677}
8678} while(0);
8679if( bgotonextstatement )
8680{
8681bool bgotonextstatement = true;
8682do
8683{
8684evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j5))), 6.28318530717959)));
8685if( IKabs(evalcond[0]) < 0.0000050000000000 )
8686{
8687bgotonextstatement=false;
8688{
8689IkReal j3array[1], cj3array[1], sj3array[1];
8690bool j3valid[1]={false};
8691_nj3 = 1;
8693 continue;
8694j3array[0]=IKatan2(((-1.0)*new_r01), new_r00);
8695sj3array[0]=IKsin(j3array[0]);
8696cj3array[0]=IKcos(j3array[0]);
8697if( j3array[0] > IKPI )
8698{
8699 j3array[0]-=IK2PI;
8700}
8701else if( j3array[0] < -IKPI )
8702{ j3array[0]+=IK2PI;
8703}
8704j3valid[0] = true;
8705for(int ij3 = 0; ij3 < 1; ++ij3)
8706{
8707if( !j3valid[ij3] )
8708{
8709 continue;
8710}
8711_ij3[0] = ij3; _ij3[1] = -1;
8712for(int iij3 = ij3+1; iij3 < 1; ++iij3)
8713{
8714if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
8715{
8716 j3valid[iij3]=false; _ij3[1] = iij3; break;
8717}
8718}
8719j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
8720{
8721IkReal evalcond[8];
8722IkReal x687=IKsin(j3);
8723IkReal x688=IKcos(j3);
8724IkReal x689=((1.0)*x688);
8725evalcond[0]=(x687+new_r01);
8726evalcond[1]=((((-1.0)*x689))+new_r00);
8727evalcond[2]=((((-1.0)*x689))+new_r11);
8728evalcond[3]=(new_r10+(((-1.0)*x687)));
8729evalcond[4]=(((new_r01*x688))+((new_r11*x687)));
8730evalcond[5]=((((-1.0)*new_r10*x689))+((new_r00*x687)));
8731evalcond[6]=((-1.0)+((new_r00*x688))+((new_r10*x687)));
8732evalcond[7]=((1.0)+((new_r01*x687))+(((-1.0)*new_r11*x689)));
8733if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
8734{
8735continue;
8736}
8737}
8738
8739{
8740std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
8741vinfos[0].jointtype = 1;
8742vinfos[0].foffset = j0;
8743vinfos[0].indices[0] = _ij0[0];
8744vinfos[0].indices[1] = _ij0[1];
8745vinfos[0].maxsolutions = _nj0;
8746vinfos[1].jointtype = 1;
8747vinfos[1].foffset = j1;
8748vinfos[1].indices[0] = _ij1[0];
8749vinfos[1].indices[1] = _ij1[1];
8750vinfos[1].maxsolutions = _nj1;
8751vinfos[2].jointtype = 1;
8752vinfos[2].foffset = j2;
8753vinfos[2].indices[0] = _ij2[0];
8754vinfos[2].indices[1] = _ij2[1];
8755vinfos[2].maxsolutions = _nj2;
8756vinfos[3].jointtype = 1;
8757vinfos[3].foffset = j3;
8758vinfos[3].indices[0] = _ij3[0];
8759vinfos[3].indices[1] = _ij3[1];
8760vinfos[3].maxsolutions = _nj3;
8761vinfos[4].jointtype = 1;
8762vinfos[4].foffset = j4;
8763vinfos[4].indices[0] = _ij4[0];
8764vinfos[4].indices[1] = _ij4[1];
8765vinfos[4].maxsolutions = _nj4;
8766vinfos[5].jointtype = 1;
8767vinfos[5].foffset = j5;
8768vinfos[5].indices[0] = _ij5[0];
8769vinfos[5].indices[1] = _ij5[1];
8770vinfos[5].maxsolutions = _nj5;
8771std::vector<int> vfree(0);
8772solutions.AddSolution(vinfos,vfree);
8773}
8774}
8775}
8776
8777}
8778} while(0);
8779if( bgotonextstatement )
8780{
8781bool bgotonextstatement = true;
8782do
8783{
8784evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j5)))), 6.28318530717959)));
8785if( IKabs(evalcond[0]) < 0.0000050000000000 )
8786{
8787bgotonextstatement=false;
8788{
8789IkReal j3array[1], cj3array[1], sj3array[1];
8790bool j3valid[1]={false};
8791_nj3 = 1;
8792if( IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r00)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r10))+IKsqr(((-1.0)*new_r00))-1) <= IKFAST_SINCOS_THRESH )
8793 continue;
8794j3array[0]=IKatan2(((-1.0)*new_r10), ((-1.0)*new_r00));
8795sj3array[0]=IKsin(j3array[0]);
8796cj3array[0]=IKcos(j3array[0]);
8797if( j3array[0] > IKPI )
8798{
8799 j3array[0]-=IK2PI;
8800}
8801else if( j3array[0] < -IKPI )
8802{ j3array[0]+=IK2PI;
8803}
8804j3valid[0] = true;
8805for(int ij3 = 0; ij3 < 1; ++ij3)
8806{
8807if( !j3valid[ij3] )
8808{
8809 continue;
8810}
8811_ij3[0] = ij3; _ij3[1] = -1;
8812for(int iij3 = ij3+1; iij3 < 1; ++iij3)
8813{
8814if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
8815{
8816 j3valid[iij3]=false; _ij3[1] = iij3; break;
8817}
8818}
8819j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
8820{
8821IkReal evalcond[8];
8822IkReal x690=IKcos(j3);
8823IkReal x691=IKsin(j3);
8824IkReal x692=((1.0)*x690);
8825evalcond[0]=(x690+new_r00);
8826evalcond[1]=(x690+new_r11);
8827evalcond[2]=(x691+new_r10);
8828evalcond[3]=(new_r01+(((-1.0)*x691)));
8829evalcond[4]=(((new_r11*x691))+((new_r01*x690)));
8830evalcond[5]=((((-1.0)*new_r10*x692))+((new_r00*x691)));
8831evalcond[6]=((1.0)+((new_r10*x691))+((new_r00*x690)));
8832evalcond[7]=((-1.0)+(((-1.0)*new_r11*x692))+((new_r01*x691)));
8833if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
8834{
8835continue;
8836}
8837}
8838
8839{
8840std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
8841vinfos[0].jointtype = 1;
8842vinfos[0].foffset = j0;
8843vinfos[0].indices[0] = _ij0[0];
8844vinfos[0].indices[1] = _ij0[1];
8845vinfos[0].maxsolutions = _nj0;
8846vinfos[1].jointtype = 1;
8847vinfos[1].foffset = j1;
8848vinfos[1].indices[0] = _ij1[0];
8849vinfos[1].indices[1] = _ij1[1];
8850vinfos[1].maxsolutions = _nj1;
8851vinfos[2].jointtype = 1;
8852vinfos[2].foffset = j2;
8853vinfos[2].indices[0] = _ij2[0];
8854vinfos[2].indices[1] = _ij2[1];
8855vinfos[2].maxsolutions = _nj2;
8856vinfos[3].jointtype = 1;
8857vinfos[3].foffset = j3;
8858vinfos[3].indices[0] = _ij3[0];
8859vinfos[3].indices[1] = _ij3[1];
8860vinfos[3].maxsolutions = _nj3;
8861vinfos[4].jointtype = 1;
8862vinfos[4].foffset = j4;
8863vinfos[4].indices[0] = _ij4[0];
8864vinfos[4].indices[1] = _ij4[1];
8865vinfos[4].maxsolutions = _nj4;
8866vinfos[5].jointtype = 1;
8867vinfos[5].foffset = j5;
8868vinfos[5].indices[0] = _ij5[0];
8869vinfos[5].indices[1] = _ij5[1];
8870vinfos[5].maxsolutions = _nj5;
8871std::vector<int> vfree(0);
8872solutions.AddSolution(vinfos,vfree);
8873}
8874}
8875}
8876
8877}
8878} while(0);
8879if( bgotonextstatement )
8880{
8881bool bgotonextstatement = true;
8882do
8883{
8884evalcond[0]=((IKabs(new_r11))+(IKabs(new_r00)));
8885if( IKabs(evalcond[0]) < 0.0000050000000000 )
8886{
8887bgotonextstatement=false;
8888{
8889IkReal j3eval[3];
8890sj4=0;
8891cj4=1.0;
8892j4=0;
8893new_r11=0;
8894new_r00=0;
8895j3eval[0]=new_r01;
8896j3eval[1]=IKsign(new_r01);
8897j3eval[2]=((IKabs(cj5))+(IKabs(sj5)));
8898if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
8899{
8900{
8901IkReal j3eval[2];
8902sj4=0;
8903cj4=1.0;
8904j4=0;
8905new_r11=0;
8906new_r00=0;
8907j3eval[0]=new_r01;
8908j3eval[1]=new_r10;
8909if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 )
8910{
8911{
8912IkReal j3eval[2];
8913sj4=0;
8914cj4=1.0;
8915j4=0;
8916new_r11=0;
8917new_r00=0;
8918j3eval[0]=new_r01;
8919j3eval[1]=sj5;
8920if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 )
8921{
8922{
8923IkReal evalcond[1];
8924bool bgotonextstatement = true;
8925do
8926{
8927evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j5))), 6.28318530717959)));
8928if( IKabs(evalcond[0]) < 0.0000050000000000 )
8929{
8930bgotonextstatement=false;
8931{
8932IkReal j3array[2], cj3array[2], sj3array[2];
8933bool j3valid[2]={false};
8934_nj3 = 2;
8935sj3array[0]=new_r10;
8936if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
8937{
8938 j3valid[0] = j3valid[1] = true;
8939 j3array[0] = IKasin(sj3array[0]);
8940 cj3array[0] = IKcos(j3array[0]);
8941 sj3array[1] = sj3array[0];
8942 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
8943 cj3array[1] = -cj3array[0];
8944}
8945else if( isnan(sj3array[0]) )
8946{
8947 // probably any value will work
8948 j3valid[0] = true;
8949 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
8950}
8951for(int ij3 = 0; ij3 < 2; ++ij3)
8952{
8953if( !j3valid[ij3] )
8954{
8955 continue;
8956}
8957_ij3[0] = ij3; _ij3[1] = -1;
8958for(int iij3 = ij3+1; iij3 < 2; ++iij3)
8959{
8960if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
8961{
8962 j3valid[iij3]=false; _ij3[1] = iij3; break;
8963}
8964}
8965j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
8966{
8967IkReal evalcond[6];
8968IkReal x693=IKcos(j3);
8969IkReal x694=IKsin(j3);
8970IkReal x695=((-1.0)*x693);
8971evalcond[0]=(new_r01*x693);
8972evalcond[1]=(x694+new_r01);
8973evalcond[2]=x695;
8974evalcond[3]=(new_r10*x695);
8975evalcond[4]=((1.0)+((new_r01*x694)));
8976evalcond[5]=((-1.0)+((new_r10*x694)));
8977if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
8978{
8979continue;
8980}
8981}
8982
8983{
8984std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
8985vinfos[0].jointtype = 1;
8986vinfos[0].foffset = j0;
8987vinfos[0].indices[0] = _ij0[0];
8988vinfos[0].indices[1] = _ij0[1];
8989vinfos[0].maxsolutions = _nj0;
8990vinfos[1].jointtype = 1;
8991vinfos[1].foffset = j1;
8992vinfos[1].indices[0] = _ij1[0];
8993vinfos[1].indices[1] = _ij1[1];
8994vinfos[1].maxsolutions = _nj1;
8995vinfos[2].jointtype = 1;
8996vinfos[2].foffset = j2;
8997vinfos[2].indices[0] = _ij2[0];
8998vinfos[2].indices[1] = _ij2[1];
8999vinfos[2].maxsolutions = _nj2;
9000vinfos[3].jointtype = 1;
9001vinfos[3].foffset = j3;
9002vinfos[3].indices[0] = _ij3[0];
9003vinfos[3].indices[1] = _ij3[1];
9004vinfos[3].maxsolutions = _nj3;
9005vinfos[4].jointtype = 1;
9006vinfos[4].foffset = j4;
9007vinfos[4].indices[0] = _ij4[0];
9008vinfos[4].indices[1] = _ij4[1];
9009vinfos[4].maxsolutions = _nj4;
9010vinfos[5].jointtype = 1;
9011vinfos[5].foffset = j5;
9012vinfos[5].indices[0] = _ij5[0];
9013vinfos[5].indices[1] = _ij5[1];
9014vinfos[5].maxsolutions = _nj5;
9015std::vector<int> vfree(0);
9016solutions.AddSolution(vinfos,vfree);
9017}
9018}
9019}
9020
9021}
9022} while(0);
9023if( bgotonextstatement )
9024{
9025bool bgotonextstatement = true;
9026do
9027{
9028evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j5)))), 6.28318530717959)));
9029if( IKabs(evalcond[0]) < 0.0000050000000000 )
9030{
9031bgotonextstatement=false;
9032{
9033IkReal j3array[2], cj3array[2], sj3array[2];
9034bool j3valid[2]={false};
9035_nj3 = 2;
9036sj3array[0]=new_r01;
9037if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
9038{
9039 j3valid[0] = j3valid[1] = true;
9040 j3array[0] = IKasin(sj3array[0]);
9041 cj3array[0] = IKcos(j3array[0]);
9042 sj3array[1] = sj3array[0];
9043 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
9044 cj3array[1] = -cj3array[0];
9045}
9046else if( isnan(sj3array[0]) )
9047{
9048 // probably any value will work
9049 j3valid[0] = true;
9050 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
9051}
9052for(int ij3 = 0; ij3 < 2; ++ij3)
9053{
9054if( !j3valid[ij3] )
9055{
9056 continue;
9057}
9058_ij3[0] = ij3; _ij3[1] = -1;
9059for(int iij3 = ij3+1; iij3 < 2; ++iij3)
9060{
9061if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
9062{
9063 j3valid[iij3]=false; _ij3[1] = iij3; break;
9064}
9065}
9066j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
9067{
9068IkReal evalcond[6];
9069IkReal x696=IKcos(j3);
9070IkReal x697=IKsin(j3);
9071evalcond[0]=x696;
9072evalcond[1]=(new_r01*x696);
9073evalcond[2]=(x697+new_r10);
9074evalcond[3]=((-1.0)*new_r10*x696);
9075evalcond[4]=((-1.0)+((new_r01*x697)));
9076evalcond[5]=((1.0)+((new_r10*x697)));
9077if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
9078{
9079continue;
9080}
9081}
9082
9083{
9084std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
9085vinfos[0].jointtype = 1;
9086vinfos[0].foffset = j0;
9087vinfos[0].indices[0] = _ij0[0];
9088vinfos[0].indices[1] = _ij0[1];
9089vinfos[0].maxsolutions = _nj0;
9090vinfos[1].jointtype = 1;
9091vinfos[1].foffset = j1;
9092vinfos[1].indices[0] = _ij1[0];
9093vinfos[1].indices[1] = _ij1[1];
9094vinfos[1].maxsolutions = _nj1;
9095vinfos[2].jointtype = 1;
9096vinfos[2].foffset = j2;
9097vinfos[2].indices[0] = _ij2[0];
9098vinfos[2].indices[1] = _ij2[1];
9099vinfos[2].maxsolutions = _nj2;
9100vinfos[3].jointtype = 1;
9101vinfos[3].foffset = j3;
9102vinfos[3].indices[0] = _ij3[0];
9103vinfos[3].indices[1] = _ij3[1];
9104vinfos[3].maxsolutions = _nj3;
9105vinfos[4].jointtype = 1;
9106vinfos[4].foffset = j4;
9107vinfos[4].indices[0] = _ij4[0];
9108vinfos[4].indices[1] = _ij4[1];
9109vinfos[4].maxsolutions = _nj4;
9110vinfos[5].jointtype = 1;
9111vinfos[5].foffset = j5;
9112vinfos[5].indices[0] = _ij5[0];
9113vinfos[5].indices[1] = _ij5[1];
9114vinfos[5].maxsolutions = _nj5;
9115std::vector<int> vfree(0);
9116solutions.AddSolution(vinfos,vfree);
9117}
9118}
9119}
9120
9121}
9122} while(0);
9123if( bgotonextstatement )
9124{
9125bool bgotonextstatement = true;
9126do
9127{
9128if( 1 )
9129{
9130bgotonextstatement=false;
9131continue; // branch miss [j3]
9132
9133}
9134} while(0);
9135if( bgotonextstatement )
9136{
9137}
9138}
9139}
9140}
9141
9142} else
9143{
9144{
9145IkReal j3array[1], cj3array[1], sj3array[1];
9146bool j3valid[1]={false};
9147_nj3 = 1;
9149if(!x699.valid){
9150continue;
9151}
9152IkReal x698=x699.value;
9154if(!x700.valid){
9155continue;
9156}
9158if(!x701.valid){
9159continue;
9160}
9161if( IKabs(((-1.0)*cj5*x698)) < IKFAST_ATAN2_MAGTHRESH && IKabs((x698*(x700.value)*(((((-1.0)*(x701.value)))+(cj5*cj5))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*cj5*x698))+IKsqr((x698*(x700.value)*(((((-1.0)*(x701.value)))+(cj5*cj5)))))-1) <= IKFAST_SINCOS_THRESH )
9162 continue;
9163j3array[0]=IKatan2(((-1.0)*cj5*x698), (x698*(x700.value)*(((((-1.0)*(x701.value)))+(cj5*cj5)))));
9164sj3array[0]=IKsin(j3array[0]);
9165cj3array[0]=IKcos(j3array[0]);
9166if( j3array[0] > IKPI )
9167{
9168 j3array[0]-=IK2PI;
9169}
9170else if( j3array[0] < -IKPI )
9171{ j3array[0]+=IK2PI;
9172}
9173j3valid[0] = true;
9174for(int ij3 = 0; ij3 < 1; ++ij3)
9175{
9176if( !j3valid[ij3] )
9177{
9178 continue;
9179}
9180_ij3[0] = ij3; _ij3[1] = -1;
9181for(int iij3 = ij3+1; iij3 < 1; ++iij3)
9182{
9183if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
9184{
9185 j3valid[iij3]=false; _ij3[1] = iij3; break;
9186}
9187}
9188j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
9189{
9190IkReal evalcond[7];
9191IkReal x702=IKcos(j3);
9192IkReal x703=IKsin(j3);
9193IkReal x704=((1.0)*cj5);
9194IkReal x705=(sj5*x702);
9195evalcond[0]=(cj5+((new_r01*x703)));
9196evalcond[1]=(sj5+((new_r01*x702)));
9197evalcond[2]=(sj5+(((-1.0)*new_r10*x702)));
9198evalcond[3]=((((-1.0)*x704))+((new_r10*x703)));
9199evalcond[4]=(((cj5*x703))+x705+new_r01);
9200evalcond[5]=((((-1.0)*x702*x704))+((sj5*x703)));
9201evalcond[6]=((((-1.0)*x705))+(((-1.0)*x703*x704))+new_r10);
9202if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH )
9203{
9204continue;
9205}
9206}
9207
9208{
9209std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
9210vinfos[0].jointtype = 1;
9211vinfos[0].foffset = j0;
9212vinfos[0].indices[0] = _ij0[0];
9213vinfos[0].indices[1] = _ij0[1];
9214vinfos[0].maxsolutions = _nj0;
9215vinfos[1].jointtype = 1;
9216vinfos[1].foffset = j1;
9217vinfos[1].indices[0] = _ij1[0];
9218vinfos[1].indices[1] = _ij1[1];
9219vinfos[1].maxsolutions = _nj1;
9220vinfos[2].jointtype = 1;
9221vinfos[2].foffset = j2;
9222vinfos[2].indices[0] = _ij2[0];
9223vinfos[2].indices[1] = _ij2[1];
9224vinfos[2].maxsolutions = _nj2;
9225vinfos[3].jointtype = 1;
9226vinfos[3].foffset = j3;
9227vinfos[3].indices[0] = _ij3[0];
9228vinfos[3].indices[1] = _ij3[1];
9229vinfos[3].maxsolutions = _nj3;
9230vinfos[4].jointtype = 1;
9231vinfos[4].foffset = j4;
9232vinfos[4].indices[0] = _ij4[0];
9233vinfos[4].indices[1] = _ij4[1];
9234vinfos[4].maxsolutions = _nj4;
9235vinfos[5].jointtype = 1;
9236vinfos[5].foffset = j5;
9237vinfos[5].indices[0] = _ij5[0];
9238vinfos[5].indices[1] = _ij5[1];
9239vinfos[5].maxsolutions = _nj5;
9240std::vector<int> vfree(0);
9241solutions.AddSolution(vinfos,vfree);
9242}
9243}
9244}
9245
9246}
9247
9248}
9249
9250} else
9251{
9252{
9253IkReal j3array[1], cj3array[1], sj3array[1];
9254bool j3valid[1]={false};
9255_nj3 = 1;
9257if(!x706.valid){
9258continue;
9259}
9261if(!x707.valid){
9262continue;
9263}
9264if( IKabs(((-1.0)*cj5*(x706.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((sj5*(x707.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*cj5*(x706.value)))+IKsqr((sj5*(x707.value)))-1) <= IKFAST_SINCOS_THRESH )
9265 continue;
9266j3array[0]=IKatan2(((-1.0)*cj5*(x706.value)), (sj5*(x707.value)));
9267sj3array[0]=IKsin(j3array[0]);
9268cj3array[0]=IKcos(j3array[0]);
9269if( j3array[0] > IKPI )
9270{
9271 j3array[0]-=IK2PI;
9272}
9273else if( j3array[0] < -IKPI )
9274{ j3array[0]+=IK2PI;
9275}
9276j3valid[0] = true;
9277for(int ij3 = 0; ij3 < 1; ++ij3)
9278{
9279if( !j3valid[ij3] )
9280{
9281 continue;
9282}
9283_ij3[0] = ij3; _ij3[1] = -1;
9284for(int iij3 = ij3+1; iij3 < 1; ++iij3)
9285{
9286if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
9287{
9288 j3valid[iij3]=false; _ij3[1] = iij3; break;
9289}
9290}
9291j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
9292{
9293IkReal evalcond[7];
9294IkReal x708=IKcos(j3);
9295IkReal x709=IKsin(j3);
9296IkReal x710=((1.0)*cj5);
9297IkReal x711=(sj5*x708);
9298evalcond[0]=(cj5+((new_r01*x709)));
9299evalcond[1]=(sj5+((new_r01*x708)));
9300evalcond[2]=(sj5+(((-1.0)*new_r10*x708)));
9301evalcond[3]=((((-1.0)*x710))+((new_r10*x709)));
9302evalcond[4]=(((cj5*x709))+x711+new_r01);
9303evalcond[5]=(((sj5*x709))+(((-1.0)*x708*x710)));
9304evalcond[6]=((((-1.0)*x709*x710))+(((-1.0)*x711))+new_r10);
9305if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH )
9306{
9307continue;
9308}
9309}
9310
9311{
9312std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
9313vinfos[0].jointtype = 1;
9314vinfos[0].foffset = j0;
9315vinfos[0].indices[0] = _ij0[0];
9316vinfos[0].indices[1] = _ij0[1];
9317vinfos[0].maxsolutions = _nj0;
9318vinfos[1].jointtype = 1;
9319vinfos[1].foffset = j1;
9320vinfos[1].indices[0] = _ij1[0];
9321vinfos[1].indices[1] = _ij1[1];
9322vinfos[1].maxsolutions = _nj1;
9323vinfos[2].jointtype = 1;
9324vinfos[2].foffset = j2;
9325vinfos[2].indices[0] = _ij2[0];
9326vinfos[2].indices[1] = _ij2[1];
9327vinfos[2].maxsolutions = _nj2;
9328vinfos[3].jointtype = 1;
9329vinfos[3].foffset = j3;
9330vinfos[3].indices[0] = _ij3[0];
9331vinfos[3].indices[1] = _ij3[1];
9332vinfos[3].maxsolutions = _nj3;
9333vinfos[4].jointtype = 1;
9334vinfos[4].foffset = j4;
9335vinfos[4].indices[0] = _ij4[0];
9336vinfos[4].indices[1] = _ij4[1];
9337vinfos[4].maxsolutions = _nj4;
9338vinfos[5].jointtype = 1;
9339vinfos[5].foffset = j5;
9340vinfos[5].indices[0] = _ij5[0];
9341vinfos[5].indices[1] = _ij5[1];
9342vinfos[5].maxsolutions = _nj5;
9343std::vector<int> vfree(0);
9344solutions.AddSolution(vinfos,vfree);
9345}
9346}
9347}
9348
9349}
9350
9351}
9352
9353} else
9354{
9355{
9356IkReal j3array[1], cj3array[1], sj3array[1];
9357bool j3valid[1]={false};
9358_nj3 = 1;
9360if(!x712.valid){
9361continue;
9362}
9363CheckValue<IkReal> x713 = IKatan2WithCheck(IkReal(((-1.0)*cj5)),IkReal(((-1.0)*sj5)),IKFAST_ATAN2_MAGTHRESH);
9364if(!x713.valid){
9365continue;
9366}
9367j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x712.value)))+(x713.value));
9368sj3array[0]=IKsin(j3array[0]);
9369cj3array[0]=IKcos(j3array[0]);
9370if( j3array[0] > IKPI )
9371{
9372 j3array[0]-=IK2PI;
9373}
9374else if( j3array[0] < -IKPI )
9375{ j3array[0]+=IK2PI;
9376}
9377j3valid[0] = true;
9378for(int ij3 = 0; ij3 < 1; ++ij3)
9379{
9380if( !j3valid[ij3] )
9381{
9382 continue;
9383}
9384_ij3[0] = ij3; _ij3[1] = -1;
9385for(int iij3 = ij3+1; iij3 < 1; ++iij3)
9386{
9387if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
9388{
9389 j3valid[iij3]=false; _ij3[1] = iij3; break;
9390}
9391}
9392j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
9393{
9394IkReal evalcond[7];
9395IkReal x714=IKcos(j3);
9396IkReal x715=IKsin(j3);
9397IkReal x716=((1.0)*cj5);
9398IkReal x717=(sj5*x714);
9399evalcond[0]=(cj5+((new_r01*x715)));
9400evalcond[1]=(sj5+((new_r01*x714)));
9401evalcond[2]=(sj5+(((-1.0)*new_r10*x714)));
9402evalcond[3]=((((-1.0)*x716))+((new_r10*x715)));
9403evalcond[4]=(((cj5*x715))+x717+new_r01);
9404evalcond[5]=((((-1.0)*x714*x716))+((sj5*x715)));
9405evalcond[6]=((((-1.0)*x717))+new_r10+(((-1.0)*x715*x716)));
9406if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH )
9407{
9408continue;
9409}
9410}
9411
9412{
9413std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
9414vinfos[0].jointtype = 1;
9415vinfos[0].foffset = j0;
9416vinfos[0].indices[0] = _ij0[0];
9417vinfos[0].indices[1] = _ij0[1];
9418vinfos[0].maxsolutions = _nj0;
9419vinfos[1].jointtype = 1;
9420vinfos[1].foffset = j1;
9421vinfos[1].indices[0] = _ij1[0];
9422vinfos[1].indices[1] = _ij1[1];
9423vinfos[1].maxsolutions = _nj1;
9424vinfos[2].jointtype = 1;
9425vinfos[2].foffset = j2;
9426vinfos[2].indices[0] = _ij2[0];
9427vinfos[2].indices[1] = _ij2[1];
9428vinfos[2].maxsolutions = _nj2;
9429vinfos[3].jointtype = 1;
9430vinfos[3].foffset = j3;
9431vinfos[3].indices[0] = _ij3[0];
9432vinfos[3].indices[1] = _ij3[1];
9433vinfos[3].maxsolutions = _nj3;
9434vinfos[4].jointtype = 1;
9435vinfos[4].foffset = j4;
9436vinfos[4].indices[0] = _ij4[0];
9437vinfos[4].indices[1] = _ij4[1];
9438vinfos[4].maxsolutions = _nj4;
9439vinfos[5].jointtype = 1;
9440vinfos[5].foffset = j5;
9441vinfos[5].indices[0] = _ij5[0];
9442vinfos[5].indices[1] = _ij5[1];
9443vinfos[5].maxsolutions = _nj5;
9444std::vector<int> vfree(0);
9445solutions.AddSolution(vinfos,vfree);
9446}
9447}
9448}
9449
9450}
9451
9452}
9453
9454}
9455} while(0);
9456if( bgotonextstatement )
9457{
9458bool bgotonextstatement = true;
9459do
9460{
9461evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01)));
9462if( IKabs(evalcond[0]) < 0.0000050000000000 )
9463{
9464bgotonextstatement=false;
9465{
9466IkReal j3eval[1];
9467sj4=0;
9468cj4=1.0;
9469j4=0;
9470new_r11=0;
9471new_r01=0;
9472new_r22=0;
9473new_r20=0;
9474j3eval[0]=((IKabs(new_r10))+(IKabs(new_r00)));
9475if( IKabs(j3eval[0]) < 0.0000010000000000 )
9476{
9477continue; // no branches [j3]
9478
9479} else
9480{
9481{
9482IkReal j3array[2], cj3array[2], sj3array[2];
9483bool j3valid[2]={false};
9484_nj3 = 2;
9486if(!x719.valid){
9487continue;
9488}
9489IkReal x718=x719.value;
9490j3array[0]=((-1.0)*x718);
9491sj3array[0]=IKsin(j3array[0]);
9492cj3array[0]=IKcos(j3array[0]);
9493j3array[1]=((3.14159265358979)+(((-1.0)*x718)));
9494sj3array[1]=IKsin(j3array[1]);
9495cj3array[1]=IKcos(j3array[1]);
9496if( j3array[0] > IKPI )
9497{
9498 j3array[0]-=IK2PI;
9499}
9500else if( j3array[0] < -IKPI )
9501{ j3array[0]+=IK2PI;
9502}
9503j3valid[0] = true;
9504if( j3array[1] > IKPI )
9505{
9506 j3array[1]-=IK2PI;
9507}
9508else if( j3array[1] < -IKPI )
9509{ j3array[1]+=IK2PI;
9510}
9511j3valid[1] = true;
9512for(int ij3 = 0; ij3 < 2; ++ij3)
9513{
9514if( !j3valid[ij3] )
9515{
9516 continue;
9517}
9518_ij3[0] = ij3; _ij3[1] = -1;
9519for(int iij3 = ij3+1; iij3 < 2; ++iij3)
9520{
9521if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
9522{
9523 j3valid[iij3]=false; _ij3[1] = iij3; break;
9524}
9525}
9526j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
9527{
9528IkReal evalcond[1];
9529evalcond[0]=(((new_r00*(IKsin(j3))))+(((-1.0)*new_r10*(IKcos(j3)))));
9530if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH )
9531{
9532continue;
9533}
9534}
9535
9536{
9537std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
9538vinfos[0].jointtype = 1;
9539vinfos[0].foffset = j0;
9540vinfos[0].indices[0] = _ij0[0];
9541vinfos[0].indices[1] = _ij0[1];
9542vinfos[0].maxsolutions = _nj0;
9543vinfos[1].jointtype = 1;
9544vinfos[1].foffset = j1;
9545vinfos[1].indices[0] = _ij1[0];
9546vinfos[1].indices[1] = _ij1[1];
9547vinfos[1].maxsolutions = _nj1;
9548vinfos[2].jointtype = 1;
9549vinfos[2].foffset = j2;
9550vinfos[2].indices[0] = _ij2[0];
9551vinfos[2].indices[1] = _ij2[1];
9552vinfos[2].maxsolutions = _nj2;
9553vinfos[3].jointtype = 1;
9554vinfos[3].foffset = j3;
9555vinfos[3].indices[0] = _ij3[0];
9556vinfos[3].indices[1] = _ij3[1];
9557vinfos[3].maxsolutions = _nj3;
9558vinfos[4].jointtype = 1;
9559vinfos[4].foffset = j4;
9560vinfos[4].indices[0] = _ij4[0];
9561vinfos[4].indices[1] = _ij4[1];
9562vinfos[4].maxsolutions = _nj4;
9563vinfos[5].jointtype = 1;
9564vinfos[5].foffset = j5;
9565vinfos[5].indices[0] = _ij5[0];
9566vinfos[5].indices[1] = _ij5[1];
9567vinfos[5].maxsolutions = _nj5;
9568std::vector<int> vfree(0);
9569solutions.AddSolution(vinfos,vfree);
9570}
9571}
9572}
9573
9574}
9575
9576}
9577
9578}
9579} while(0);
9580if( bgotonextstatement )
9581{
9582bool bgotonextstatement = true;
9583do
9584{
9585evalcond[0]=((IKabs(new_r10))+(IKabs(new_r00)));
9586if( IKabs(evalcond[0]) < 0.0000050000000000 )
9587{
9588bgotonextstatement=false;
9589{
9590IkReal j3eval[1];
9591sj4=0;
9592cj4=1.0;
9593j4=0;
9594new_r00=0;
9595new_r10=0;
9596new_r21=0;
9597new_r22=0;
9598j3eval[0]=((IKabs(new_r11))+(IKabs(new_r01)));
9599if( IKabs(j3eval[0]) < 0.0000010000000000 )
9600{
9601continue; // no branches [j3]
9602
9603} else
9604{
9605{
9606IkReal j3array[2], cj3array[2], sj3array[2];
9607bool j3valid[2]={false};
9608_nj3 = 2;
9610if(!x721.valid){
9611continue;
9612}
9613IkReal x720=x721.value;
9614j3array[0]=((-1.0)*x720);
9615sj3array[0]=IKsin(j3array[0]);
9616cj3array[0]=IKcos(j3array[0]);
9617j3array[1]=((3.14159265358979)+(((-1.0)*x720)));
9618sj3array[1]=IKsin(j3array[1]);
9619cj3array[1]=IKcos(j3array[1]);
9620if( j3array[0] > IKPI )
9621{
9622 j3array[0]-=IK2PI;
9623}
9624else if( j3array[0] < -IKPI )
9625{ j3array[0]+=IK2PI;
9626}
9627j3valid[0] = true;
9628if( j3array[1] > IKPI )
9629{
9630 j3array[1]-=IK2PI;
9631}
9632else if( j3array[1] < -IKPI )
9633{ j3array[1]+=IK2PI;
9634}
9635j3valid[1] = true;
9636for(int ij3 = 0; ij3 < 2; ++ij3)
9637{
9638if( !j3valid[ij3] )
9639{
9640 continue;
9641}
9642_ij3[0] = ij3; _ij3[1] = -1;
9643for(int iij3 = ij3+1; iij3 < 2; ++iij3)
9644{
9645if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
9646{
9647 j3valid[iij3]=false; _ij3[1] = iij3; break;
9648}
9649}
9650j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
9651{
9652IkReal evalcond[1];
9653evalcond[0]=(((new_r01*(IKsin(j3))))+(((-1.0)*new_r11*(IKcos(j3)))));
9654if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH )
9655{
9656continue;
9657}
9658}
9659
9660{
9661std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
9662vinfos[0].jointtype = 1;
9663vinfos[0].foffset = j0;
9664vinfos[0].indices[0] = _ij0[0];
9665vinfos[0].indices[1] = _ij0[1];
9666vinfos[0].maxsolutions = _nj0;
9667vinfos[1].jointtype = 1;
9668vinfos[1].foffset = j1;
9669vinfos[1].indices[0] = _ij1[0];
9670vinfos[1].indices[1] = _ij1[1];
9671vinfos[1].maxsolutions = _nj1;
9672vinfos[2].jointtype = 1;
9673vinfos[2].foffset = j2;
9674vinfos[2].indices[0] = _ij2[0];
9675vinfos[2].indices[1] = _ij2[1];
9676vinfos[2].maxsolutions = _nj2;
9677vinfos[3].jointtype = 1;
9678vinfos[3].foffset = j3;
9679vinfos[3].indices[0] = _ij3[0];
9680vinfos[3].indices[1] = _ij3[1];
9681vinfos[3].maxsolutions = _nj3;
9682vinfos[4].jointtype = 1;
9683vinfos[4].foffset = j4;
9684vinfos[4].indices[0] = _ij4[0];
9685vinfos[4].indices[1] = _ij4[1];
9686vinfos[4].maxsolutions = _nj4;
9687vinfos[5].jointtype = 1;
9688vinfos[5].foffset = j5;
9689vinfos[5].indices[0] = _ij5[0];
9690vinfos[5].indices[1] = _ij5[1];
9691vinfos[5].maxsolutions = _nj5;
9692std::vector<int> vfree(0);
9693solutions.AddSolution(vinfos,vfree);
9694}
9695}
9696}
9697
9698}
9699
9700}
9701
9702}
9703} while(0);
9704if( bgotonextstatement )
9705{
9706bool bgotonextstatement = true;
9707do
9708{
9709evalcond[0]=((IKabs(new_r10))+(IKabs(new_r01)));
9710if( IKabs(evalcond[0]) < 0.0000050000000000 )
9711{
9712bgotonextstatement=false;
9713{
9714IkReal j3eval[3];
9715sj4=0;
9716cj4=1.0;
9717j4=0;
9718new_r01=0;
9719new_r10=0;
9720j3eval[0]=new_r11;
9721j3eval[1]=IKsign(new_r11);
9722j3eval[2]=((IKabs(cj5))+(IKabs(sj5)));
9723if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
9724{
9725{
9726IkReal j3eval[3];
9727sj4=0;
9728cj4=1.0;
9729j4=0;
9730new_r01=0;
9731new_r10=0;
9732j3eval[0]=new_r00;
9733j3eval[1]=((IKabs(cj5))+(IKabs(sj5)));
9734j3eval[2]=IKsign(new_r00);
9735if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
9736{
9737{
9738IkReal j3eval[2];
9739sj4=0;
9740cj4=1.0;
9741j4=0;
9742new_r01=0;
9743new_r10=0;
9744j3eval[0]=new_r00;
9745j3eval[1]=new_r11;
9746if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 )
9747{
9748continue; // no branches [j3]
9749
9750} else
9751{
9752{
9753IkReal j3array[1], cj3array[1], sj3array[1];
9754bool j3valid[1]={false};
9755_nj3 = 1;
9757if(!x722.valid){
9758continue;
9759}
9761if(!x723.valid){
9762continue;
9763}
9764if( IKabs(((-1.0)*sj5*(x722.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((cj5*(x723.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*sj5*(x722.value)))+IKsqr((cj5*(x723.value)))-1) <= IKFAST_SINCOS_THRESH )
9765 continue;
9766j3array[0]=IKatan2(((-1.0)*sj5*(x722.value)), (cj5*(x723.value)));
9767sj3array[0]=IKsin(j3array[0]);
9768cj3array[0]=IKcos(j3array[0]);
9769if( j3array[0] > IKPI )
9770{
9771 j3array[0]-=IK2PI;
9772}
9773else if( j3array[0] < -IKPI )
9774{ j3array[0]+=IK2PI;
9775}
9776j3valid[0] = true;
9777for(int ij3 = 0; ij3 < 1; ++ij3)
9778{
9779if( !j3valid[ij3] )
9780{
9781 continue;
9782}
9783_ij3[0] = ij3; _ij3[1] = -1;
9784for(int iij3 = ij3+1; iij3 < 1; ++iij3)
9785{
9786if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
9787{
9788 j3valid[iij3]=false; _ij3[1] = iij3; break;
9789}
9790}
9791j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
9792{
9793IkReal evalcond[7];
9794IkReal x724=IKsin(j3);
9795IkReal x725=IKcos(j3);
9796IkReal x726=(sj5*x724);
9797IkReal x727=((1.0)*x725);
9798IkReal x728=(cj5*x727);
9799evalcond[0]=(sj5+((new_r00*x724)));
9800evalcond[1]=(sj5+((new_r11*x724)));
9801evalcond[2]=(cj5+(((-1.0)*new_r11*x727)));
9802evalcond[3]=(((new_r00*x725))+(((-1.0)*cj5)));
9803evalcond[4]=(((cj5*x724))+((sj5*x725)));
9804evalcond[5]=((((-1.0)*x728))+x726+new_r00);
9805evalcond[6]=((((-1.0)*x728))+x726+new_r11);
9806if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH )
9807{
9808continue;
9809}
9810}
9811
9812{
9813std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
9814vinfos[0].jointtype = 1;
9815vinfos[0].foffset = j0;
9816vinfos[0].indices[0] = _ij0[0];
9817vinfos[0].indices[1] = _ij0[1];
9818vinfos[0].maxsolutions = _nj0;
9819vinfos[1].jointtype = 1;
9820vinfos[1].foffset = j1;
9821vinfos[1].indices[0] = _ij1[0];
9822vinfos[1].indices[1] = _ij1[1];
9823vinfos[1].maxsolutions = _nj1;
9824vinfos[2].jointtype = 1;
9825vinfos[2].foffset = j2;
9826vinfos[2].indices[0] = _ij2[0];
9827vinfos[2].indices[1] = _ij2[1];
9828vinfos[2].maxsolutions = _nj2;
9829vinfos[3].jointtype = 1;
9830vinfos[3].foffset = j3;
9831vinfos[3].indices[0] = _ij3[0];
9832vinfos[3].indices[1] = _ij3[1];
9833vinfos[3].maxsolutions = _nj3;
9834vinfos[4].jointtype = 1;
9835vinfos[4].foffset = j4;
9836vinfos[4].indices[0] = _ij4[0];
9837vinfos[4].indices[1] = _ij4[1];
9838vinfos[4].maxsolutions = _nj4;
9839vinfos[5].jointtype = 1;
9840vinfos[5].foffset = j5;
9841vinfos[5].indices[0] = _ij5[0];
9842vinfos[5].indices[1] = _ij5[1];
9843vinfos[5].maxsolutions = _nj5;
9844std::vector<int> vfree(0);
9845solutions.AddSolution(vinfos,vfree);
9846}
9847}
9848}
9849
9850}
9851
9852}
9853
9854} else
9855{
9856{
9857IkReal j3array[1], cj3array[1], sj3array[1];
9858bool j3valid[1]={false};
9859_nj3 = 1;
9861if(!x729.valid){
9862continue;
9863}
9864CheckValue<IkReal> x730 = IKatan2WithCheck(IkReal(((-1.0)*sj5)),IkReal(cj5),IKFAST_ATAN2_MAGTHRESH);
9865if(!x730.valid){
9866continue;
9867}
9868j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x729.value)))+(x730.value));
9869sj3array[0]=IKsin(j3array[0]);
9870cj3array[0]=IKcos(j3array[0]);
9871if( j3array[0] > IKPI )
9872{
9873 j3array[0]-=IK2PI;
9874}
9875else if( j3array[0] < -IKPI )
9876{ j3array[0]+=IK2PI;
9877}
9878j3valid[0] = true;
9879for(int ij3 = 0; ij3 < 1; ++ij3)
9880{
9881if( !j3valid[ij3] )
9882{
9883 continue;
9884}
9885_ij3[0] = ij3; _ij3[1] = -1;
9886for(int iij3 = ij3+1; iij3 < 1; ++iij3)
9887{
9888if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
9889{
9890 j3valid[iij3]=false; _ij3[1] = iij3; break;
9891}
9892}
9893j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
9894{
9895IkReal evalcond[7];
9896IkReal x731=IKsin(j3);
9897IkReal x732=IKcos(j3);
9898IkReal x733=(sj5*x731);
9899IkReal x734=((1.0)*x732);
9900IkReal x735=(cj5*x734);
9901evalcond[0]=(sj5+((new_r00*x731)));
9902evalcond[1]=(sj5+((new_r11*x731)));
9903evalcond[2]=(cj5+(((-1.0)*new_r11*x734)));
9904evalcond[3]=(((new_r00*x732))+(((-1.0)*cj5)));
9905evalcond[4]=(((cj5*x731))+((sj5*x732)));
9906evalcond[5]=((((-1.0)*x735))+x733+new_r00);
9907evalcond[6]=((((-1.0)*x735))+x733+new_r11);
9908if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH )
9909{
9910continue;
9911}
9912}
9913
9914{
9915std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
9916vinfos[0].jointtype = 1;
9917vinfos[0].foffset = j0;
9918vinfos[0].indices[0] = _ij0[0];
9919vinfos[0].indices[1] = _ij0[1];
9920vinfos[0].maxsolutions = _nj0;
9921vinfos[1].jointtype = 1;
9922vinfos[1].foffset = j1;
9923vinfos[1].indices[0] = _ij1[0];
9924vinfos[1].indices[1] = _ij1[1];
9925vinfos[1].maxsolutions = _nj1;
9926vinfos[2].jointtype = 1;
9927vinfos[2].foffset = j2;
9928vinfos[2].indices[0] = _ij2[0];
9929vinfos[2].indices[1] = _ij2[1];
9930vinfos[2].maxsolutions = _nj2;
9931vinfos[3].jointtype = 1;
9932vinfos[3].foffset = j3;
9933vinfos[3].indices[0] = _ij3[0];
9934vinfos[3].indices[1] = _ij3[1];
9935vinfos[3].maxsolutions = _nj3;
9936vinfos[4].jointtype = 1;
9937vinfos[4].foffset = j4;
9938vinfos[4].indices[0] = _ij4[0];
9939vinfos[4].indices[1] = _ij4[1];
9940vinfos[4].maxsolutions = _nj4;
9941vinfos[5].jointtype = 1;
9942vinfos[5].foffset = j5;
9943vinfos[5].indices[0] = _ij5[0];
9944vinfos[5].indices[1] = _ij5[1];
9945vinfos[5].maxsolutions = _nj5;
9946std::vector<int> vfree(0);
9947solutions.AddSolution(vinfos,vfree);
9948}
9949}
9950}
9951
9952}
9953
9954}
9955
9956} else
9957{
9958{
9959IkReal j3array[1], cj3array[1], sj3array[1];
9960bool j3valid[1]={false};
9961_nj3 = 1;
9963if(!x736.valid){
9964continue;
9965}
9966CheckValue<IkReal> x737 = IKatan2WithCheck(IkReal(((-1.0)*sj5)),IkReal(cj5),IKFAST_ATAN2_MAGTHRESH);
9967if(!x737.valid){
9968continue;
9969}
9970j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x736.value)))+(x737.value));
9971sj3array[0]=IKsin(j3array[0]);
9972cj3array[0]=IKcos(j3array[0]);
9973if( j3array[0] > IKPI )
9974{
9975 j3array[0]-=IK2PI;
9976}
9977else if( j3array[0] < -IKPI )
9978{ j3array[0]+=IK2PI;
9979}
9980j3valid[0] = true;
9981for(int ij3 = 0; ij3 < 1; ++ij3)
9982{
9983if( !j3valid[ij3] )
9984{
9985 continue;
9986}
9987_ij3[0] = ij3; _ij3[1] = -1;
9988for(int iij3 = ij3+1; iij3 < 1; ++iij3)
9989{
9990if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
9991{
9992 j3valid[iij3]=false; _ij3[1] = iij3; break;
9993}
9994}
9995j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
9996{
9997IkReal evalcond[7];
9998IkReal x738=IKsin(j3);
9999IkReal x739=IKcos(j3);
10000IkReal x740=(sj5*x738);
10001IkReal x741=((1.0)*x739);
10002IkReal x742=(cj5*x741);
10003evalcond[0]=(sj5+((new_r00*x738)));
10004evalcond[1]=(sj5+((new_r11*x738)));
10005evalcond[2]=(cj5+(((-1.0)*new_r11*x741)));
10006evalcond[3]=(((new_r00*x739))+(((-1.0)*cj5)));
10007evalcond[4]=(((cj5*x738))+((sj5*x739)));
10008evalcond[5]=(x740+new_r00+(((-1.0)*x742)));
10009evalcond[6]=(x740+new_r11+(((-1.0)*x742)));
10010if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH )
10011{
10012continue;
10013}
10014}
10015
10016{
10017std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
10018vinfos[0].jointtype = 1;
10019vinfos[0].foffset = j0;
10020vinfos[0].indices[0] = _ij0[0];
10021vinfos[0].indices[1] = _ij0[1];
10022vinfos[0].maxsolutions = _nj0;
10023vinfos[1].jointtype = 1;
10024vinfos[1].foffset = j1;
10025vinfos[1].indices[0] = _ij1[0];
10026vinfos[1].indices[1] = _ij1[1];
10027vinfos[1].maxsolutions = _nj1;
10028vinfos[2].jointtype = 1;
10029vinfos[2].foffset = j2;
10030vinfos[2].indices[0] = _ij2[0];
10031vinfos[2].indices[1] = _ij2[1];
10032vinfos[2].maxsolutions = _nj2;
10033vinfos[3].jointtype = 1;
10034vinfos[3].foffset = j3;
10035vinfos[3].indices[0] = _ij3[0];
10036vinfos[3].indices[1] = _ij3[1];
10037vinfos[3].maxsolutions = _nj3;
10038vinfos[4].jointtype = 1;
10039vinfos[4].foffset = j4;
10040vinfos[4].indices[0] = _ij4[0];
10041vinfos[4].indices[1] = _ij4[1];
10042vinfos[4].maxsolutions = _nj4;
10043vinfos[5].jointtype = 1;
10044vinfos[5].foffset = j5;
10045vinfos[5].indices[0] = _ij5[0];
10046vinfos[5].indices[1] = _ij5[1];
10047vinfos[5].maxsolutions = _nj5;
10048std::vector<int> vfree(0);
10049solutions.AddSolution(vinfos,vfree);
10050}
10051}
10052}
10053
10054}
10055
10056}
10057
10058}
10059} while(0);
10060if( bgotonextstatement )
10061{
10062bool bgotonextstatement = true;
10063do
10064{
10065if( 1 )
10066{
10067bgotonextstatement=false;
10068continue; // branch miss [j3]
10069
10070}
10071} while(0);
10072if( bgotonextstatement )
10073{
10074}
10075}
10076}
10077}
10078}
10079}
10080}
10081}
10082}
10083}
10084
10085} else
10086{
10087{
10088IkReal j3array[1], cj3array[1], sj3array[1];
10089bool j3valid[1]={false};
10090_nj3 = 1;
10091IkReal x743=((1.0)*new_r11);
10092CheckValue<IkReal> x744 = IKatan2WithCheck(IkReal((((new_r00*new_r01))+((cj5*sj5)))),IkReal(((1.0)+(((-1.0)*new_r00*x743))+(((-1.0)*(cj5*cj5))))),IKFAST_ATAN2_MAGTHRESH);
10093if(!x744.valid){
10094continue;
10095}
10096CheckValue<IkReal> x745=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r01*sj5))+(((-1.0)*cj5*x743)))),-1);
10097if(!x745.valid){
10098continue;
10099}
10100j3array[0]=((-1.5707963267949)+(x744.value)+(((1.5707963267949)*(x745.value))));
10101sj3array[0]=IKsin(j3array[0]);
10102cj3array[0]=IKcos(j3array[0]);
10103if( j3array[0] > IKPI )
10104{
10105 j3array[0]-=IK2PI;
10106}
10107else if( j3array[0] < -IKPI )
10108{ j3array[0]+=IK2PI;
10109}
10110j3valid[0] = true;
10111for(int ij3 = 0; ij3 < 1; ++ij3)
10112{
10113if( !j3valid[ij3] )
10114{
10115 continue;
10116}
10117_ij3[0] = ij3; _ij3[1] = -1;
10118for(int iij3 = ij3+1; iij3 < 1; ++iij3)
10119{
10120if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
10121{
10122 j3valid[iij3]=false; _ij3[1] = iij3; break;
10123}
10124}
10125j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
10126{
10127IkReal evalcond[8];
10128IkReal x746=IKcos(j3);
10129IkReal x747=IKsin(j3);
10130IkReal x748=(sj5*x747);
10131IkReal x749=(cj5*x747);
10132IkReal x750=(sj5*x746);
10133IkReal x751=((1.0)*x746);
10134IkReal x752=(cj5*x751);
10135evalcond[0]=(sj5+((new_r01*x746))+((new_r11*x747)));
10136evalcond[1]=(x750+x749+new_r01);
10137evalcond[2]=(sj5+(((-1.0)*new_r10*x751))+((new_r00*x747)));
10138evalcond[3]=(cj5+(((-1.0)*new_r11*x751))+((new_r01*x747)));
10139evalcond[4]=(x748+new_r00+(((-1.0)*x752)));
10140evalcond[5]=(x748+new_r11+(((-1.0)*x752)));
10141evalcond[6]=(((new_r10*x747))+((new_r00*x746))+(((-1.0)*cj5)));
10142evalcond[7]=((((-1.0)*x750))+(((-1.0)*x749))+new_r10);
10143if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
10144{
10145continue;
10146}
10147}
10148
10149{
10150std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
10151vinfos[0].jointtype = 1;
10152vinfos[0].foffset = j0;
10153vinfos[0].indices[0] = _ij0[0];
10154vinfos[0].indices[1] = _ij0[1];
10155vinfos[0].maxsolutions = _nj0;
10156vinfos[1].jointtype = 1;
10157vinfos[1].foffset = j1;
10158vinfos[1].indices[0] = _ij1[0];
10159vinfos[1].indices[1] = _ij1[1];
10160vinfos[1].maxsolutions = _nj1;
10161vinfos[2].jointtype = 1;
10162vinfos[2].foffset = j2;
10163vinfos[2].indices[0] = _ij2[0];
10164vinfos[2].indices[1] = _ij2[1];
10165vinfos[2].maxsolutions = _nj2;
10166vinfos[3].jointtype = 1;
10167vinfos[3].foffset = j3;
10168vinfos[3].indices[0] = _ij3[0];
10169vinfos[3].indices[1] = _ij3[1];
10170vinfos[3].maxsolutions = _nj3;
10171vinfos[4].jointtype = 1;
10172vinfos[4].foffset = j4;
10173vinfos[4].indices[0] = _ij4[0];
10174vinfos[4].indices[1] = _ij4[1];
10175vinfos[4].maxsolutions = _nj4;
10176vinfos[5].jointtype = 1;
10177vinfos[5].foffset = j5;
10178vinfos[5].indices[0] = _ij5[0];
10179vinfos[5].indices[1] = _ij5[1];
10180vinfos[5].maxsolutions = _nj5;
10181std::vector<int> vfree(0);
10182solutions.AddSolution(vinfos,vfree);
10183}
10184}
10185}
10186
10187}
10188
10189}
10190
10191} else
10192{
10193{
10194IkReal j3array[1], cj3array[1], sj3array[1];
10195bool j3valid[1]={false};
10196_nj3 = 1;
10197CheckValue<IkReal> x753 = IKatan2WithCheck(IkReal((((new_r11*sj5))+((cj5*new_r01)))),IkReal((((new_r01*sj5))+(((-1.0)*cj5*new_r11)))),IKFAST_ATAN2_MAGTHRESH);
10198if(!x753.valid){
10199continue;
10200}
10201CheckValue<IkReal> x754=IKPowWithIntegerCheck(IKsign(((((-1.0)*(new_r01*new_r01)))+(((-1.0)*(new_r11*new_r11))))),-1);
10202if(!x754.valid){
10203continue;
10204}
10205j3array[0]=((-1.5707963267949)+(x753.value)+(((1.5707963267949)*(x754.value))));
10206sj3array[0]=IKsin(j3array[0]);
10207cj3array[0]=IKcos(j3array[0]);
10208if( j3array[0] > IKPI )
10209{
10210 j3array[0]-=IK2PI;
10211}
10212else if( j3array[0] < -IKPI )
10213{ j3array[0]+=IK2PI;
10214}
10215j3valid[0] = true;
10216for(int ij3 = 0; ij3 < 1; ++ij3)
10217{
10218if( !j3valid[ij3] )
10219{
10220 continue;
10221}
10222_ij3[0] = ij3; _ij3[1] = -1;
10223for(int iij3 = ij3+1; iij3 < 1; ++iij3)
10224{
10225if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
10226{
10227 j3valid[iij3]=false; _ij3[1] = iij3; break;
10228}
10229}
10230j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
10231{
10232IkReal evalcond[8];
10233IkReal x755=IKcos(j3);
10234IkReal x756=IKsin(j3);
10235IkReal x757=(sj5*x756);
10236IkReal x758=(cj5*x756);
10237IkReal x759=(sj5*x755);
10238IkReal x760=((1.0)*x755);
10239IkReal x761=(cj5*x760);
10240evalcond[0]=(sj5+((new_r11*x756))+((new_r01*x755)));
10241evalcond[1]=(x759+x758+new_r01);
10242evalcond[2]=(sj5+(((-1.0)*new_r10*x760))+((new_r00*x756)));
10243evalcond[3]=(cj5+(((-1.0)*new_r11*x760))+((new_r01*x756)));
10244evalcond[4]=((((-1.0)*x761))+x757+new_r00);
10245evalcond[5]=((((-1.0)*x761))+x757+new_r11);
10246evalcond[6]=(((new_r00*x755))+((new_r10*x756))+(((-1.0)*cj5)));
10247evalcond[7]=((((-1.0)*x759))+(((-1.0)*x758))+new_r10);
10248if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
10249{
10250continue;
10251}
10252}
10253
10254{
10255std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
10256vinfos[0].jointtype = 1;
10257vinfos[0].foffset = j0;
10258vinfos[0].indices[0] = _ij0[0];
10259vinfos[0].indices[1] = _ij0[1];
10260vinfos[0].maxsolutions = _nj0;
10261vinfos[1].jointtype = 1;
10262vinfos[1].foffset = j1;
10263vinfos[1].indices[0] = _ij1[0];
10264vinfos[1].indices[1] = _ij1[1];
10265vinfos[1].maxsolutions = _nj1;
10266vinfos[2].jointtype = 1;
10267vinfos[2].foffset = j2;
10268vinfos[2].indices[0] = _ij2[0];
10269vinfos[2].indices[1] = _ij2[1];
10270vinfos[2].maxsolutions = _nj2;
10271vinfos[3].jointtype = 1;
10272vinfos[3].foffset = j3;
10273vinfos[3].indices[0] = _ij3[0];
10274vinfos[3].indices[1] = _ij3[1];
10275vinfos[3].maxsolutions = _nj3;
10276vinfos[4].jointtype = 1;
10277vinfos[4].foffset = j4;
10278vinfos[4].indices[0] = _ij4[0];
10279vinfos[4].indices[1] = _ij4[1];
10280vinfos[4].maxsolutions = _nj4;
10281vinfos[5].jointtype = 1;
10282vinfos[5].foffset = j5;
10283vinfos[5].indices[0] = _ij5[0];
10284vinfos[5].indices[1] = _ij5[1];
10285vinfos[5].maxsolutions = _nj5;
10286std::vector<int> vfree(0);
10287solutions.AddSolution(vinfos,vfree);
10288}
10289}
10290}
10291
10292}
10293
10294}
10295
10296} else
10297{
10298{
10299IkReal j3array[1], cj3array[1], sj3array[1];
10300bool j3valid[1]={false};
10301_nj3 = 1;
10302IkReal x762=((1.0)*new_r11);
10303CheckValue<IkReal> x763 = IKatan2WithCheck(IkReal((((new_r10*sj5))+((new_r01*sj5)))),IkReal((((new_r00*sj5))+(((-1.0)*sj5*x762)))),IKFAST_ATAN2_MAGTHRESH);
10304if(!x763.valid){
10305continue;
10306}
10307CheckValue<IkReal> x764=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r10*x762))+(((-1.0)*new_r00*new_r01)))),-1);
10308if(!x764.valid){
10309continue;
10310}
10311j3array[0]=((-1.5707963267949)+(x763.value)+(((1.5707963267949)*(x764.value))));
10312sj3array[0]=IKsin(j3array[0]);
10313cj3array[0]=IKcos(j3array[0]);
10314if( j3array[0] > IKPI )
10315{
10316 j3array[0]-=IK2PI;
10317}
10318else if( j3array[0] < -IKPI )
10319{ j3array[0]+=IK2PI;
10320}
10321j3valid[0] = true;
10322for(int ij3 = 0; ij3 < 1; ++ij3)
10323{
10324if( !j3valid[ij3] )
10325{
10326 continue;
10327}
10328_ij3[0] = ij3; _ij3[1] = -1;
10329for(int iij3 = ij3+1; iij3 < 1; ++iij3)
10330{
10331if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
10332{
10333 j3valid[iij3]=false; _ij3[1] = iij3; break;
10334}
10335}
10336j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
10337{
10338IkReal evalcond[8];
10339IkReal x765=IKcos(j3);
10340IkReal x766=IKsin(j3);
10341IkReal x767=(sj5*x766);
10342IkReal x768=(cj5*x766);
10343IkReal x769=(sj5*x765);
10344IkReal x770=((1.0)*x765);
10345IkReal x771=(cj5*x770);
10346evalcond[0]=(sj5+((new_r11*x766))+((new_r01*x765)));
10347evalcond[1]=(x768+x769+new_r01);
10348evalcond[2]=(sj5+((new_r00*x766))+(((-1.0)*new_r10*x770)));
10349evalcond[3]=(cj5+((new_r01*x766))+(((-1.0)*new_r11*x770)));
10350evalcond[4]=(x767+(((-1.0)*x771))+new_r00);
10351evalcond[5]=(x767+(((-1.0)*x771))+new_r11);
10352evalcond[6]=(((new_r10*x766))+((new_r00*x765))+(((-1.0)*cj5)));
10353evalcond[7]=((((-1.0)*x769))+(((-1.0)*x768))+new_r10);
10354if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
10355{
10356continue;
10357}
10358}
10359
10360{
10361std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
10362vinfos[0].jointtype = 1;
10363vinfos[0].foffset = j0;
10364vinfos[0].indices[0] = _ij0[0];
10365vinfos[0].indices[1] = _ij0[1];
10366vinfos[0].maxsolutions = _nj0;
10367vinfos[1].jointtype = 1;
10368vinfos[1].foffset = j1;
10369vinfos[1].indices[0] = _ij1[0];
10370vinfos[1].indices[1] = _ij1[1];
10371vinfos[1].maxsolutions = _nj1;
10372vinfos[2].jointtype = 1;
10373vinfos[2].foffset = j2;
10374vinfos[2].indices[0] = _ij2[0];
10375vinfos[2].indices[1] = _ij2[1];
10376vinfos[2].maxsolutions = _nj2;
10377vinfos[3].jointtype = 1;
10378vinfos[3].foffset = j3;
10379vinfos[3].indices[0] = _ij3[0];
10380vinfos[3].indices[1] = _ij3[1];
10381vinfos[3].maxsolutions = _nj3;
10382vinfos[4].jointtype = 1;
10383vinfos[4].foffset = j4;
10384vinfos[4].indices[0] = _ij4[0];
10385vinfos[4].indices[1] = _ij4[1];
10386vinfos[4].maxsolutions = _nj4;
10387vinfos[5].jointtype = 1;
10388vinfos[5].foffset = j5;
10389vinfos[5].indices[0] = _ij5[0];
10390vinfos[5].indices[1] = _ij5[1];
10391vinfos[5].maxsolutions = _nj5;
10392std::vector<int> vfree(0);
10393solutions.AddSolution(vinfos,vfree);
10394}
10395}
10396}
10397
10398}
10399
10400}
10401
10402}
10403} while(0);
10404if( bgotonextstatement )
10405{
10406bool bgotonextstatement = true;
10407do
10408{
10409evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j4)))), 6.28318530717959)));
10410evalcond[1]=new_r02;
10411evalcond[2]=new_r12;
10412evalcond[3]=new_r21;
10413evalcond[4]=new_r20;
10414if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 && IKabs(evalcond[3]) < 0.0000050000000000 && IKabs(evalcond[4]) < 0.0000050000000000 )
10415{
10416bgotonextstatement=false;
10417{
10418IkReal j3eval[3];
10419sj4=0;
10420cj4=-1.0;
10421j4=3.14159265358979;
10422IkReal x772=((1.0)*new_r10);
10423IkReal x773=((((-1.0)*new_r11*x772))+(((-1.0)*new_r00*new_r01)));
10424j3eval[0]=x773;
10425j3eval[1]=((IKabs((((cj5*new_r11))+((cj5*new_r00)))))+(IKabs((((cj5*new_r01))+(((-1.0)*cj5*x772))))));
10426j3eval[2]=IKsign(x773);
10427if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
10428{
10429{
10430IkReal j3eval[3];
10431sj4=0;
10432cj4=-1.0;
10433j4=3.14159265358979;
10434IkReal x774=((1.0)*new_r10);
10435IkReal x775=((((-1.0)*cj5*new_r00))+(((-1.0)*sj5*x774)));
10436j3eval[0]=x775;
10437j3eval[1]=IKsign(x775);
10438j3eval[2]=((IKabs((((new_r00*new_r01))+((cj5*sj5)))))+(IKabs(((((-1.0)*new_r01*x774))+(cj5*cj5)))));
10439if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
10440{
10441{
10442IkReal j3eval[3];
10443sj4=0;
10444cj4=-1.0;
10445j4=3.14159265358979;
10446IkReal x776=((1.0)*new_r00);
10447IkReal x777=((((-1.0)*sj5*x776))+((cj5*new_r10)));
10448j3eval[0]=x777;
10449j3eval[1]=((IKabs((((cj5*sj5))+(((-1.0)*new_r10*x776)))))+(IKabs(((((-1.0)*(cj5*cj5)))+(new_r00*new_r00)))));
10450j3eval[2]=IKsign(x777);
10451if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
10452{
10453{
10454IkReal evalcond[1];
10455bool bgotonextstatement = true;
10456do
10457{
10458IkReal x778=((-1.0)*new_r00);
10459IkReal x780 = ((new_r10*new_r10)+(new_r00*new_r00));
10460if(IKabs(x780)==0){
10461continue;
10462}
10463IkReal x779=pow(x780,-0.5);
10465if(!x781.valid){
10466continue;
10467}
10468IkReal gconst6=((-1.0)*(x781.value));
10469IkReal gconst7=((-1.0)*new_r10*x779);
10470IkReal gconst8=(x778*x779);
10472if(!x782.valid){
10473continue;
10474}
10475evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs((j5+(x782.value))))), 6.28318530717959)));
10476if( IKabs(evalcond[0]) < 0.0000050000000000 )
10477{
10478bgotonextstatement=false;
10479{
10480IkReal j3eval[3];
10481IkReal x783=((-1.0)*new_r00);
10483if(!x786.valid){
10484continue;
10485}
10486IkReal x784=((-1.0)*(x786.value));
10487IkReal x785=x779;
10488sj4=0;
10489cj4=-1.0;
10490j4=3.14159265358979;
10491sj5=gconst7;
10492cj5=gconst8;
10493j5=x784;
10494IkReal gconst6=x784;
10495IkReal gconst7=((-1.0)*new_r10*x785);
10496IkReal gconst8=(x783*x785);
10497IkReal x787=new_r00*new_r00;
10498IkReal x788=((1.0)*new_r11);
10499IkReal x789=((1.0)*new_r00*new_r01);
10500IkReal x790=((((-1.0)*x789))+(((-1.0)*new_r10*x788)));
10501IkReal x791=x779;
10502IkReal x792=(new_r00*x791);
10503j3eval[0]=x790;
10504j3eval[1]=((IKabs(((((-1.0)*x788*x792))+(((-1.0)*x787*x791)))))+(IKabs((((new_r10*x792))+(((-1.0)*x789*x791))))));
10505j3eval[2]=IKsign(x790);
10506if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
10507{
10508{
10509IkReal j3eval[1];
10510IkReal x793=((-1.0)*new_r00);
10512if(!x796.valid){
10513continue;
10514}
10515IkReal x794=((-1.0)*(x796.value));
10516IkReal x795=x779;
10517sj4=0;
10518cj4=-1.0;
10519j4=3.14159265358979;
10520sj5=gconst7;
10521cj5=gconst8;
10522j5=x794;
10523IkReal gconst6=x794;
10524IkReal gconst7=((-1.0)*new_r10*x795);
10525IkReal gconst8=(x793*x795);
10526IkReal x797=new_r10*new_r10;
10527IkReal x798=new_r00*new_r00;
10528CheckValue<IkReal> x801=IKPowWithIntegerCheck((x797+x798),-1);
10529if(!x801.valid){
10530continue;
10531}
10532IkReal x799=x801.value;
10533IkReal x800=(new_r00*x799);
10534j3eval[0]=((IKabs((((new_r01*x797*x800))+((new_r10*x800))+((new_r01*x800*(new_r00*new_r00))))))+(IKabs((((x798*x799))+(((-1.0)*new_r01*new_r10))))));
10535if( IKabs(j3eval[0]) < 0.0000010000000000 )
10536{
10537{
10538IkReal j3eval[1];
10539IkReal x802=((-1.0)*new_r00);
10541if(!x805.valid){
10542continue;
10543}
10544IkReal x803=((-1.0)*(x805.value));
10545IkReal x804=x779;
10546sj4=0;
10547cj4=-1.0;
10548j4=3.14159265358979;
10549sj5=gconst7;
10550cj5=gconst8;
10551j5=x803;
10552IkReal gconst6=x803;
10553IkReal gconst7=((-1.0)*new_r10*x804);
10554IkReal gconst8=(x802*x804);
10555IkReal x806=new_r00*new_r00;
10556IkReal x807=new_r10*new_r10;
10557CheckValue<IkReal> x811=IKPowWithIntegerCheck((x807+x806),-1);
10558if(!x811.valid){
10559continue;
10560}
10561IkReal x808=x811.value;
10562IkReal x809=(new_r10*x808);
10563IkReal x810=((1.0)*x808);
10564j3eval[0]=((IKabs((((new_r00*x809*(new_r10*new_r10)))+((new_r00*x809))+((x809*(new_r00*new_r00*new_r00))))))+(IKabs((((x806*x808))+(((-1.0)*x810*(x807*x807)))+(((-1.0)*x806*x807*x810))))));
10565if( IKabs(j3eval[0]) < 0.0000010000000000 )
10566{
10567{
10568IkReal evalcond[2];
10569bool bgotonextstatement = true;
10570do
10571{
10572evalcond[0]=((IKabs(new_r11))+(IKabs(new_r00)));
10573if( IKabs(evalcond[0]) < 0.0000050000000000 )
10574{
10575bgotonextstatement=false;
10576{
10577IkReal j3eval[1];
10579if(!x813.valid){
10580continue;
10581}
10582IkReal x812=((-1.0)*(x813.value));
10583sj4=0;
10584cj4=-1.0;
10585j4=3.14159265358979;
10586sj5=gconst7;
10587cj5=gconst8;
10588j5=x812;
10589new_r11=0;
10590new_r00=0;
10591IkReal gconst6=x812;
10592IkReal x814 = new_r10*new_r10;
10593if(IKabs(x814)==0){
10594continue;
10595}
10596IkReal gconst7=((-1.0)*new_r10*(pow(x814,-0.5)));
10597IkReal gconst8=0;
10598j3eval[0]=new_r10;
10599if( IKabs(j3eval[0]) < 0.0000010000000000 )
10600{
10601{
10602IkReal j3array[2], cj3array[2], sj3array[2];
10603bool j3valid[2]={false};
10604_nj3 = 2;
10606if(!x815.valid){
10607continue;
10608}
10609cj3array[0]=(new_r01*(x815.value));
10610if( cj3array[0] >= -1-IKFAST_SINCOS_THRESH && cj3array[0] <= 1+IKFAST_SINCOS_THRESH )
10611{
10612 j3valid[0] = j3valid[1] = true;
10613 j3array[0] = IKacos(cj3array[0]);
10614 sj3array[0] = IKsin(j3array[0]);
10615 cj3array[1] = cj3array[0];
10616 j3array[1] = -j3array[0];
10617 sj3array[1] = -sj3array[0];
10618}
10619else if( isnan(cj3array[0]) )
10620{
10621 // probably any value will work
10622 j3valid[0] = true;
10623 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
10624}
10625for(int ij3 = 0; ij3 < 2; ++ij3)
10626{
10627if( !j3valid[ij3] )
10628{
10629 continue;
10630}
10631_ij3[0] = ij3; _ij3[1] = -1;
10632for(int iij3 = ij3+1; iij3 < 2; ++iij3)
10633{
10634if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
10635{
10636 j3valid[iij3]=false; _ij3[1] = iij3; break;
10637}
10638}
10639j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
10640{
10641IkReal evalcond[6];
10642IkReal x816=IKsin(j3);
10643IkReal x817=IKcos(j3);
10644IkReal x818=((1.0)*gconst7);
10645evalcond[0]=(new_r01*x816);
10646evalcond[1]=(new_r10*x816);
10647evalcond[2]=(gconst7*x816);
10648evalcond[3]=((((-1.0)*new_r10*x817))+gconst7);
10649evalcond[4]=((((-1.0)*x817*x818))+new_r10);
10650evalcond[5]=(((new_r01*x817))+(((-1.0)*x818)));
10651if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
10652{
10653continue;
10654}
10655}
10656
10657{
10658std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
10659vinfos[0].jointtype = 1;
10660vinfos[0].foffset = j0;
10661vinfos[0].indices[0] = _ij0[0];
10662vinfos[0].indices[1] = _ij0[1];
10663vinfos[0].maxsolutions = _nj0;
10664vinfos[1].jointtype = 1;
10665vinfos[1].foffset = j1;
10666vinfos[1].indices[0] = _ij1[0];
10667vinfos[1].indices[1] = _ij1[1];
10668vinfos[1].maxsolutions = _nj1;
10669vinfos[2].jointtype = 1;
10670vinfos[2].foffset = j2;
10671vinfos[2].indices[0] = _ij2[0];
10672vinfos[2].indices[1] = _ij2[1];
10673vinfos[2].maxsolutions = _nj2;
10674vinfos[3].jointtype = 1;
10675vinfos[3].foffset = j3;
10676vinfos[3].indices[0] = _ij3[0];
10677vinfos[3].indices[1] = _ij3[1];
10678vinfos[3].maxsolutions = _nj3;
10679vinfos[4].jointtype = 1;
10680vinfos[4].foffset = j4;
10681vinfos[4].indices[0] = _ij4[0];
10682vinfos[4].indices[1] = _ij4[1];
10683vinfos[4].maxsolutions = _nj4;
10684vinfos[5].jointtype = 1;
10685vinfos[5].foffset = j5;
10686vinfos[5].indices[0] = _ij5[0];
10687vinfos[5].indices[1] = _ij5[1];
10688vinfos[5].maxsolutions = _nj5;
10689std::vector<int> vfree(0);
10690solutions.AddSolution(vinfos,vfree);
10691}
10692}
10693}
10694
10695} else
10696{
10697{
10698IkReal j3array[2], cj3array[2], sj3array[2];
10699bool j3valid[2]={false};
10700_nj3 = 2;
10702if(!x819.valid){
10703continue;
10704}
10705cj3array[0]=(gconst7*(x819.value));
10706if( cj3array[0] >= -1-IKFAST_SINCOS_THRESH && cj3array[0] <= 1+IKFAST_SINCOS_THRESH )
10707{
10708 j3valid[0] = j3valid[1] = true;
10709 j3array[0] = IKacos(cj3array[0]);
10710 sj3array[0] = IKsin(j3array[0]);
10711 cj3array[1] = cj3array[0];
10712 j3array[1] = -j3array[0];
10713 sj3array[1] = -sj3array[0];
10714}
10715else if( isnan(cj3array[0]) )
10716{
10717 // probably any value will work
10718 j3valid[0] = true;
10719 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
10720}
10721for(int ij3 = 0; ij3 < 2; ++ij3)
10722{
10723if( !j3valid[ij3] )
10724{
10725 continue;
10726}
10727_ij3[0] = ij3; _ij3[1] = -1;
10728for(int iij3 = ij3+1; iij3 < 2; ++iij3)
10729{
10730if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
10731{
10732 j3valid[iij3]=false; _ij3[1] = iij3; break;
10733}
10734}
10735j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
10736{
10737IkReal evalcond[6];
10738IkReal x820=IKsin(j3);
10739IkReal x821=IKcos(j3);
10740IkReal x822=((1.0)*gconst7);
10741IkReal x823=(x821*x822);
10742evalcond[0]=(new_r01*x820);
10743evalcond[1]=(new_r10*x820);
10744evalcond[2]=(gconst7*x820);
10745evalcond[3]=((((-1.0)*x823))+new_r01);
10746evalcond[4]=((((-1.0)*x823))+new_r10);
10747evalcond[5]=(((new_r01*x821))+(((-1.0)*x822)));
10748if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
10749{
10750continue;
10751}
10752}
10753
10754{
10755std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
10756vinfos[0].jointtype = 1;
10757vinfos[0].foffset = j0;
10758vinfos[0].indices[0] = _ij0[0];
10759vinfos[0].indices[1] = _ij0[1];
10760vinfos[0].maxsolutions = _nj0;
10761vinfos[1].jointtype = 1;
10762vinfos[1].foffset = j1;
10763vinfos[1].indices[0] = _ij1[0];
10764vinfos[1].indices[1] = _ij1[1];
10765vinfos[1].maxsolutions = _nj1;
10766vinfos[2].jointtype = 1;
10767vinfos[2].foffset = j2;
10768vinfos[2].indices[0] = _ij2[0];
10769vinfos[2].indices[1] = _ij2[1];
10770vinfos[2].maxsolutions = _nj2;
10771vinfos[3].jointtype = 1;
10772vinfos[3].foffset = j3;
10773vinfos[3].indices[0] = _ij3[0];
10774vinfos[3].indices[1] = _ij3[1];
10775vinfos[3].maxsolutions = _nj3;
10776vinfos[4].jointtype = 1;
10777vinfos[4].foffset = j4;
10778vinfos[4].indices[0] = _ij4[0];
10779vinfos[4].indices[1] = _ij4[1];
10780vinfos[4].maxsolutions = _nj4;
10781vinfos[5].jointtype = 1;
10782vinfos[5].foffset = j5;
10783vinfos[5].indices[0] = _ij5[0];
10784vinfos[5].indices[1] = _ij5[1];
10785vinfos[5].maxsolutions = _nj5;
10786std::vector<int> vfree(0);
10787solutions.AddSolution(vinfos,vfree);
10788}
10789}
10790}
10791
10792}
10793
10794}
10795
10796}
10797} while(0);
10798if( bgotonextstatement )
10799{
10800bool bgotonextstatement = true;
10801do
10802{
10803evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01)));
10804evalcond[1]=gconst8;
10805if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
10806{
10807bgotonextstatement=false;
10808{
10809IkReal j3eval[3];
10810IkReal x824=((-1.0)*new_r00);
10812if(!x826.valid){
10813continue;
10814}
10815IkReal x825=((-1.0)*(x826.value));
10816sj4=0;
10817cj4=-1.0;
10818j4=3.14159265358979;
10819sj5=gconst7;
10820cj5=gconst8;
10821j5=x825;
10822new_r11=0;
10823new_r01=0;
10824new_r22=0;
10825new_r20=0;
10826IkReal gconst6=x825;
10827IkReal gconst7=((-1.0)*new_r10);
10828IkReal gconst8=x824;
10829j3eval[0]=1.0;
10830j3eval[1]=1.0;
10831j3eval[2]=((IKabs(((1.0)+(((-1.0)*(new_r10*new_r10))))))+(IKabs((new_r00*new_r10))));
10832if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
10833{
10834{
10835IkReal j3eval[3];
10836IkReal x827=((-1.0)*new_r00);
10838if(!x829.valid){
10839continue;
10840}
10841IkReal x828=((-1.0)*(x829.value));
10842sj4=0;
10843cj4=-1.0;
10844j4=3.14159265358979;
10845sj5=gconst7;
10846cj5=gconst8;
10847j5=x828;
10848new_r11=0;
10849new_r01=0;
10850new_r22=0;
10851new_r20=0;
10852IkReal gconst6=x828;
10853IkReal gconst7=((-1.0)*new_r10);
10854IkReal gconst8=x827;
10855j3eval[0]=-1.0;
10856j3eval[1]=((IKabs(((-1.0)+(new_r10*new_r10))))+(IKabs((new_r00*new_r10))));
10857j3eval[2]=-1.0;
10858if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
10859{
10860{
10861IkReal j3eval[3];
10862IkReal x830=((-1.0)*new_r00);
10864if(!x832.valid){
10865continue;
10866}
10867IkReal x831=((-1.0)*(x832.value));
10868sj4=0;
10869cj4=-1.0;
10870j4=3.14159265358979;
10871sj5=gconst7;
10872cj5=gconst8;
10873j5=x831;
10874new_r11=0;
10875new_r01=0;
10876new_r22=0;
10877new_r20=0;
10878IkReal gconst6=x831;
10879IkReal gconst7=((-1.0)*new_r10);
10880IkReal gconst8=x830;
10881j3eval[0]=1.0;
10882j3eval[1]=((((0.5)*(IKabs(((1.0)+(((-2.0)*(new_r10*new_r10))))))))+(IKabs((new_r00*new_r10))));
10883j3eval[2]=1.0;
10884if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
10885{
10886continue; // 3 cases reached
10887
10888} else
10889{
10890{
10891IkReal j3array[1], cj3array[1], sj3array[1];
10892bool j3valid[1]={false};
10893_nj3 = 1;
10894CheckValue<IkReal> x833=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst7*new_r10))+(((-1.0)*gconst8*new_r00)))),-1);
10895if(!x833.valid){
10896continue;
10897}
10898CheckValue<IkReal> x834 = IKatan2WithCheck(IkReal((((new_r00*new_r10))+((gconst7*gconst8)))),IkReal(((gconst8*gconst8)+(((-1.0)*(new_r10*new_r10))))),IKFAST_ATAN2_MAGTHRESH);
10899if(!x834.valid){
10900continue;
10901}
10902j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x833.value)))+(x834.value));
10903sj3array[0]=IKsin(j3array[0]);
10904cj3array[0]=IKcos(j3array[0]);
10905if( j3array[0] > IKPI )
10906{
10907 j3array[0]-=IK2PI;
10908}
10909else if( j3array[0] < -IKPI )
10910{ j3array[0]+=IK2PI;
10911}
10912j3valid[0] = true;
10913for(int ij3 = 0; ij3 < 1; ++ij3)
10914{
10915if( !j3valid[ij3] )
10916{
10917 continue;
10918}
10919_ij3[0] = ij3; _ij3[1] = -1;
10920for(int iij3 = ij3+1; iij3 < 1; ++iij3)
10921{
10922if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
10923{
10924 j3valid[iij3]=false; _ij3[1] = iij3; break;
10925}
10926}
10927j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
10928{
10929IkReal evalcond[6];
10930IkReal x835=IKsin(j3);
10931IkReal x836=IKcos(j3);
10932IkReal x837=(gconst8*x835);
10933IkReal x838=(gconst7*x835);
10934IkReal x839=(gconst8*x836);
10935IkReal x840=((1.0)*x836);
10936IkReal x841=(gconst7*x840);
10937evalcond[0]=((((-1.0)*x841))+x837);
10938evalcond[1]=(gconst8+((new_r00*x836))+((new_r10*x835)));
10939evalcond[2]=(new_r00+x838+x839);
10940evalcond[3]=((((-1.0)*new_r10*x840))+gconst7+((new_r00*x835)));
10941evalcond[4]=((((-1.0)*x838))+(((-1.0)*x839)));
10942evalcond[5]=((((-1.0)*x841))+new_r10+x837);
10943if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
10944{
10945continue;
10946}
10947}
10948
10949{
10950std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
10951vinfos[0].jointtype = 1;
10952vinfos[0].foffset = j0;
10953vinfos[0].indices[0] = _ij0[0];
10954vinfos[0].indices[1] = _ij0[1];
10955vinfos[0].maxsolutions = _nj0;
10956vinfos[1].jointtype = 1;
10957vinfos[1].foffset = j1;
10958vinfos[1].indices[0] = _ij1[0];
10959vinfos[1].indices[1] = _ij1[1];
10960vinfos[1].maxsolutions = _nj1;
10961vinfos[2].jointtype = 1;
10962vinfos[2].foffset = j2;
10963vinfos[2].indices[0] = _ij2[0];
10964vinfos[2].indices[1] = _ij2[1];
10965vinfos[2].maxsolutions = _nj2;
10966vinfos[3].jointtype = 1;
10967vinfos[3].foffset = j3;
10968vinfos[3].indices[0] = _ij3[0];
10969vinfos[3].indices[1] = _ij3[1];
10970vinfos[3].maxsolutions = _nj3;
10971vinfos[4].jointtype = 1;
10972vinfos[4].foffset = j4;
10973vinfos[4].indices[0] = _ij4[0];
10974vinfos[4].indices[1] = _ij4[1];
10975vinfos[4].maxsolutions = _nj4;
10976vinfos[5].jointtype = 1;
10977vinfos[5].foffset = j5;
10978vinfos[5].indices[0] = _ij5[0];
10979vinfos[5].indices[1] = _ij5[1];
10980vinfos[5].maxsolutions = _nj5;
10981std::vector<int> vfree(0);
10982solutions.AddSolution(vinfos,vfree);
10983}
10984}
10985}
10986
10987}
10988
10989}
10990
10991} else
10992{
10993{
10994IkReal j3array[1], cj3array[1], sj3array[1];
10995bool j3valid[1]={false};
10996_nj3 = 1;
10997CheckValue<IkReal> x842 = IKatan2WithCheck(IkReal((gconst7*new_r00)),IkReal((gconst8*new_r00)),IKFAST_ATAN2_MAGTHRESH);
10998if(!x842.valid){
10999continue;
11000}
11001CheckValue<IkReal> x843=IKPowWithIntegerCheck(IKsign(((((-1.0)*(gconst8*gconst8)))+(((-1.0)*(gconst7*gconst7))))),-1);
11002if(!x843.valid){
11003continue;
11004}
11005j3array[0]=((-1.5707963267949)+(x842.value)+(((1.5707963267949)*(x843.value))));
11006sj3array[0]=IKsin(j3array[0]);
11007cj3array[0]=IKcos(j3array[0]);
11008if( j3array[0] > IKPI )
11009{
11010 j3array[0]-=IK2PI;
11011}
11012else if( j3array[0] < -IKPI )
11013{ j3array[0]+=IK2PI;
11014}
11015j3valid[0] = true;
11016for(int ij3 = 0; ij3 < 1; ++ij3)
11017{
11018if( !j3valid[ij3] )
11019{
11020 continue;
11021}
11022_ij3[0] = ij3; _ij3[1] = -1;
11023for(int iij3 = ij3+1; iij3 < 1; ++iij3)
11024{
11025if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
11026{
11027 j3valid[iij3]=false; _ij3[1] = iij3; break;
11028}
11029}
11030j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
11031{
11032IkReal evalcond[6];
11033IkReal x844=IKsin(j3);
11034IkReal x845=IKcos(j3);
11035IkReal x846=(gconst8*x844);
11036IkReal x847=(gconst7*x844);
11037IkReal x848=(gconst8*x845);
11038IkReal x849=((1.0)*x845);
11039IkReal x850=(gconst7*x849);
11040evalcond[0]=((((-1.0)*x850))+x846);
11041evalcond[1]=(((new_r10*x844))+gconst8+((new_r00*x845)));
11042evalcond[2]=(new_r00+x847+x848);
11043evalcond[3]=((((-1.0)*new_r10*x849))+gconst7+((new_r00*x844)));
11044evalcond[4]=((((-1.0)*x848))+(((-1.0)*x847)));
11045evalcond[5]=((((-1.0)*x850))+new_r10+x846);
11046if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
11047{
11048continue;
11049}
11050}
11051
11052{
11053std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
11054vinfos[0].jointtype = 1;
11055vinfos[0].foffset = j0;
11056vinfos[0].indices[0] = _ij0[0];
11057vinfos[0].indices[1] = _ij0[1];
11058vinfos[0].maxsolutions = _nj0;
11059vinfos[1].jointtype = 1;
11060vinfos[1].foffset = j1;
11061vinfos[1].indices[0] = _ij1[0];
11062vinfos[1].indices[1] = _ij1[1];
11063vinfos[1].maxsolutions = _nj1;
11064vinfos[2].jointtype = 1;
11065vinfos[2].foffset = j2;
11066vinfos[2].indices[0] = _ij2[0];
11067vinfos[2].indices[1] = _ij2[1];
11068vinfos[2].maxsolutions = _nj2;
11069vinfos[3].jointtype = 1;
11070vinfos[3].foffset = j3;
11071vinfos[3].indices[0] = _ij3[0];
11072vinfos[3].indices[1] = _ij3[1];
11073vinfos[3].maxsolutions = _nj3;
11074vinfos[4].jointtype = 1;
11075vinfos[4].foffset = j4;
11076vinfos[4].indices[0] = _ij4[0];
11077vinfos[4].indices[1] = _ij4[1];
11078vinfos[4].maxsolutions = _nj4;
11079vinfos[5].jointtype = 1;
11080vinfos[5].foffset = j5;
11081vinfos[5].indices[0] = _ij5[0];
11082vinfos[5].indices[1] = _ij5[1];
11083vinfos[5].maxsolutions = _nj5;
11084std::vector<int> vfree(0);
11085solutions.AddSolution(vinfos,vfree);
11086}
11087}
11088}
11089
11090}
11091
11092}
11093
11094} else
11095{
11096{
11097IkReal j3array[1], cj3array[1], sj3array[1];
11098bool j3valid[1]={false};
11099_nj3 = 1;
11100CheckValue<IkReal> x851 = IKatan2WithCheck(IkReal((gconst7*gconst8)),IkReal(gconst8*gconst8),IKFAST_ATAN2_MAGTHRESH);
11101if(!x851.valid){
11102continue;
11103}
11104CheckValue<IkReal> x852=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst7*new_r10))+(((-1.0)*gconst8*new_r00)))),-1);
11105if(!x852.valid){
11106continue;
11107}
11108j3array[0]=((-1.5707963267949)+(x851.value)+(((1.5707963267949)*(x852.value))));
11109sj3array[0]=IKsin(j3array[0]);
11110cj3array[0]=IKcos(j3array[0]);
11111if( j3array[0] > IKPI )
11112{
11113 j3array[0]-=IK2PI;
11114}
11115else if( j3array[0] < -IKPI )
11116{ j3array[0]+=IK2PI;
11117}
11118j3valid[0] = true;
11119for(int ij3 = 0; ij3 < 1; ++ij3)
11120{
11121if( !j3valid[ij3] )
11122{
11123 continue;
11124}
11125_ij3[0] = ij3; _ij3[1] = -1;
11126for(int iij3 = ij3+1; iij3 < 1; ++iij3)
11127{
11128if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
11129{
11130 j3valid[iij3]=false; _ij3[1] = iij3; break;
11131}
11132}
11133j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
11134{
11135IkReal evalcond[6];
11136IkReal x853=IKsin(j3);
11137IkReal x854=IKcos(j3);
11138IkReal x855=(gconst8*x853);
11139IkReal x856=(gconst7*x853);
11140IkReal x857=(gconst8*x854);
11141IkReal x858=((1.0)*x854);
11142IkReal x859=(gconst7*x858);
11143evalcond[0]=((((-1.0)*x859))+x855);
11144evalcond[1]=(gconst8+((new_r10*x853))+((new_r00*x854)));
11145evalcond[2]=(new_r00+x856+x857);
11146evalcond[3]=(gconst7+(((-1.0)*new_r10*x858))+((new_r00*x853)));
11147evalcond[4]=((((-1.0)*x856))+(((-1.0)*x857)));
11148evalcond[5]=((((-1.0)*x859))+new_r10+x855);
11149if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
11150{
11151continue;
11152}
11153}
11154
11155{
11156std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
11157vinfos[0].jointtype = 1;
11158vinfos[0].foffset = j0;
11159vinfos[0].indices[0] = _ij0[0];
11160vinfos[0].indices[1] = _ij0[1];
11161vinfos[0].maxsolutions = _nj0;
11162vinfos[1].jointtype = 1;
11163vinfos[1].foffset = j1;
11164vinfos[1].indices[0] = _ij1[0];
11165vinfos[1].indices[1] = _ij1[1];
11166vinfos[1].maxsolutions = _nj1;
11167vinfos[2].jointtype = 1;
11168vinfos[2].foffset = j2;
11169vinfos[2].indices[0] = _ij2[0];
11170vinfos[2].indices[1] = _ij2[1];
11171vinfos[2].maxsolutions = _nj2;
11172vinfos[3].jointtype = 1;
11173vinfos[3].foffset = j3;
11174vinfos[3].indices[0] = _ij3[0];
11175vinfos[3].indices[1] = _ij3[1];
11176vinfos[3].maxsolutions = _nj3;
11177vinfos[4].jointtype = 1;
11178vinfos[4].foffset = j4;
11179vinfos[4].indices[0] = _ij4[0];
11180vinfos[4].indices[1] = _ij4[1];
11181vinfos[4].maxsolutions = _nj4;
11182vinfos[5].jointtype = 1;
11183vinfos[5].foffset = j5;
11184vinfos[5].indices[0] = _ij5[0];
11185vinfos[5].indices[1] = _ij5[1];
11186vinfos[5].maxsolutions = _nj5;
11187std::vector<int> vfree(0);
11188solutions.AddSolution(vinfos,vfree);
11189}
11190}
11191}
11192
11193}
11194
11195}
11196
11197}
11198} while(0);
11199if( bgotonextstatement )
11200{
11201bool bgotonextstatement = true;
11202do
11203{
11204evalcond[0]=((IKabs(new_r10))+(IKabs(new_r01)));
11205if( IKabs(evalcond[0]) < 0.0000050000000000 )
11206{
11207bgotonextstatement=false;
11208{
11209IkReal j3eval[1];
11210IkReal x860=((-1.0)*new_r00);
11211CheckValue<IkReal> x862 = IKatan2WithCheck(IkReal(0),IkReal(x860),IKFAST_ATAN2_MAGTHRESH);
11212if(!x862.valid){
11213continue;
11214}
11215IkReal x861=((-1.0)*(x862.value));
11216sj4=0;
11217cj4=-1.0;
11218j4=3.14159265358979;
11219sj5=gconst7;
11220cj5=gconst8;
11221j5=x861;
11222new_r01=0;
11223new_r10=0;
11224IkReal gconst6=x861;
11225IkReal gconst7=0;
11226IkReal x863 = new_r00*new_r00;
11227if(IKabs(x863)==0){
11228continue;
11229}
11230IkReal gconst8=(x860*(pow(x863,-0.5)));
11231j3eval[0]=new_r11;
11232if( IKabs(j3eval[0]) < 0.0000010000000000 )
11233{
11234{
11235IkReal j3array[2], cj3array[2], sj3array[2];
11236bool j3valid[2]={false};
11237_nj3 = 2;
11239if(!x864.valid){
11240continue;
11241}
11242cj3array[0]=(new_r11*(x864.value));
11243if( cj3array[0] >= -1-IKFAST_SINCOS_THRESH && cj3array[0] <= 1+IKFAST_SINCOS_THRESH )
11244{
11245 j3valid[0] = j3valid[1] = true;
11246 j3array[0] = IKacos(cj3array[0]);
11247 sj3array[0] = IKsin(j3array[0]);
11248 cj3array[1] = cj3array[0];
11249 j3array[1] = -j3array[0];
11250 sj3array[1] = -sj3array[0];
11251}
11252else if( isnan(cj3array[0]) )
11253{
11254 // probably any value will work
11255 j3valid[0] = true;
11256 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
11257}
11258for(int ij3 = 0; ij3 < 2; ++ij3)
11259{
11260if( !j3valid[ij3] )
11261{
11262 continue;
11263}
11264_ij3[0] = ij3; _ij3[1] = -1;
11265for(int iij3 = ij3+1; iij3 < 2; ++iij3)
11266{
11267if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
11268{
11269 j3valid[iij3]=false; _ij3[1] = iij3; break;
11270}
11271}
11272j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
11273{
11274IkReal evalcond[6];
11275IkReal x865=IKsin(j3);
11276IkReal x866=IKcos(j3);
11277evalcond[0]=(new_r00*x865);
11278evalcond[1]=(new_r11*x865);
11279evalcond[2]=(gconst8*x865);
11280evalcond[3]=(((new_r00*x866))+gconst8);
11281evalcond[4]=(((gconst8*x866))+new_r00);
11282evalcond[5]=(gconst8+(((-1.0)*new_r11*x866)));
11283if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
11284{
11285continue;
11286}
11287}
11288
11289{
11290std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
11291vinfos[0].jointtype = 1;
11292vinfos[0].foffset = j0;
11293vinfos[0].indices[0] = _ij0[0];
11294vinfos[0].indices[1] = _ij0[1];
11295vinfos[0].maxsolutions = _nj0;
11296vinfos[1].jointtype = 1;
11297vinfos[1].foffset = j1;
11298vinfos[1].indices[0] = _ij1[0];
11299vinfos[1].indices[1] = _ij1[1];
11300vinfos[1].maxsolutions = _nj1;
11301vinfos[2].jointtype = 1;
11302vinfos[2].foffset = j2;
11303vinfos[2].indices[0] = _ij2[0];
11304vinfos[2].indices[1] = _ij2[1];
11305vinfos[2].maxsolutions = _nj2;
11306vinfos[3].jointtype = 1;
11307vinfos[3].foffset = j3;
11308vinfos[3].indices[0] = _ij3[0];
11309vinfos[3].indices[1] = _ij3[1];
11310vinfos[3].maxsolutions = _nj3;
11311vinfos[4].jointtype = 1;
11312vinfos[4].foffset = j4;
11313vinfos[4].indices[0] = _ij4[0];
11314vinfos[4].indices[1] = _ij4[1];
11315vinfos[4].maxsolutions = _nj4;
11316vinfos[5].jointtype = 1;
11317vinfos[5].foffset = j5;
11318vinfos[5].indices[0] = _ij5[0];
11319vinfos[5].indices[1] = _ij5[1];
11320vinfos[5].maxsolutions = _nj5;
11321std::vector<int> vfree(0);
11322solutions.AddSolution(vinfos,vfree);
11323}
11324}
11325}
11326
11327} else
11328{
11329{
11330IkReal j3array[2], cj3array[2], sj3array[2];
11331bool j3valid[2]={false};
11332_nj3 = 2;
11334if(!x867.valid){
11335continue;
11336}
11337cj3array[0]=(gconst8*(x867.value));
11338if( cj3array[0] >= -1-IKFAST_SINCOS_THRESH && cj3array[0] <= 1+IKFAST_SINCOS_THRESH )
11339{
11340 j3valid[0] = j3valid[1] = true;
11341 j3array[0] = IKacos(cj3array[0]);
11342 sj3array[0] = IKsin(j3array[0]);
11343 cj3array[1] = cj3array[0];
11344 j3array[1] = -j3array[0];
11345 sj3array[1] = -sj3array[0];
11346}
11347else if( isnan(cj3array[0]) )
11348{
11349 // probably any value will work
11350 j3valid[0] = true;
11351 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
11352}
11353for(int ij3 = 0; ij3 < 2; ++ij3)
11354{
11355if( !j3valid[ij3] )
11356{
11357 continue;
11358}
11359_ij3[0] = ij3; _ij3[1] = -1;
11360for(int iij3 = ij3+1; iij3 < 2; ++iij3)
11361{
11362if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
11363{
11364 j3valid[iij3]=false; _ij3[1] = iij3; break;
11365}
11366}
11367j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
11368{
11369IkReal evalcond[6];
11370IkReal x868=IKsin(j3);
11371IkReal x869=IKcos(j3);
11372IkReal x870=(gconst8*x869);
11373evalcond[0]=(new_r00*x868);
11374evalcond[1]=(new_r11*x868);
11375evalcond[2]=(gconst8*x868);
11376evalcond[3]=(((new_r00*x869))+gconst8);
11377evalcond[4]=(new_r00+x870);
11378evalcond[5]=((((-1.0)*x870))+new_r11);
11379if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
11380{
11381continue;
11382}
11383}
11384
11385{
11386std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
11387vinfos[0].jointtype = 1;
11388vinfos[0].foffset = j0;
11389vinfos[0].indices[0] = _ij0[0];
11390vinfos[0].indices[1] = _ij0[1];
11391vinfos[0].maxsolutions = _nj0;
11392vinfos[1].jointtype = 1;
11393vinfos[1].foffset = j1;
11394vinfos[1].indices[0] = _ij1[0];
11395vinfos[1].indices[1] = _ij1[1];
11396vinfos[1].maxsolutions = _nj1;
11397vinfos[2].jointtype = 1;
11398vinfos[2].foffset = j2;
11399vinfos[2].indices[0] = _ij2[0];
11400vinfos[2].indices[1] = _ij2[1];
11401vinfos[2].maxsolutions = _nj2;
11402vinfos[3].jointtype = 1;
11403vinfos[3].foffset = j3;
11404vinfos[3].indices[0] = _ij3[0];
11405vinfos[3].indices[1] = _ij3[1];
11406vinfos[3].maxsolutions = _nj3;
11407vinfos[4].jointtype = 1;
11408vinfos[4].foffset = j4;
11409vinfos[4].indices[0] = _ij4[0];
11410vinfos[4].indices[1] = _ij4[1];
11411vinfos[4].maxsolutions = _nj4;
11412vinfos[5].jointtype = 1;
11413vinfos[5].foffset = j5;
11414vinfos[5].indices[0] = _ij5[0];
11415vinfos[5].indices[1] = _ij5[1];
11416vinfos[5].maxsolutions = _nj5;
11417std::vector<int> vfree(0);
11418solutions.AddSolution(vinfos,vfree);
11419}
11420}
11421}
11422
11423}
11424
11425}
11426
11427}
11428} while(0);
11429if( bgotonextstatement )
11430{
11431bool bgotonextstatement = true;
11432do
11433{
11434evalcond[0]=IKabs(new_r00);
11435if( IKabs(evalcond[0]) < 0.0000050000000000 )
11436{
11437bgotonextstatement=false;
11438{
11439IkReal j3eval[1];
11441if(!x872.valid){
11442continue;
11443}
11444IkReal x871=((-1.0)*(x872.value));
11445sj4=0;
11446cj4=-1.0;
11447j4=3.14159265358979;
11448sj5=gconst7;
11449cj5=gconst8;
11450j5=x871;
11451new_r00=0;
11452IkReal gconst6=x871;
11453IkReal x873 = new_r10*new_r10;
11454if(IKabs(x873)==0){
11455continue;
11456}
11457IkReal gconst7=((-1.0)*new_r10*(pow(x873,-0.5)));
11458IkReal gconst8=0;
11459j3eval[0]=((IKabs(new_r11))+(IKabs(new_r01)));
11460if( IKabs(j3eval[0]) < 0.0000010000000000 )
11461{
11462{
11463IkReal j3eval[1];
11465if(!x875.valid){
11466continue;
11467}
11468IkReal x874=((-1.0)*(x875.value));
11469sj4=0;
11470cj4=-1.0;
11471j4=3.14159265358979;
11472sj5=gconst7;
11473cj5=gconst8;
11474j5=x874;
11475new_r00=0;
11476IkReal gconst6=x874;
11477IkReal x876 = new_r10*new_r10;
11478if(IKabs(x876)==0){
11479continue;
11480}
11481IkReal gconst7=((-1.0)*new_r10*(pow(x876,-0.5)));
11482IkReal gconst8=0;
11483j3eval[0]=((IKabs(new_r11))+(IKabs(new_r10)));
11484if( IKabs(j3eval[0]) < 0.0000010000000000 )
11485{
11486{
11487IkReal j3eval[1];
11489if(!x878.valid){
11490continue;
11491}
11492IkReal x877=((-1.0)*(x878.value));
11493sj4=0;
11494cj4=-1.0;
11495j4=3.14159265358979;
11496sj5=gconst7;
11497cj5=gconst8;
11498j5=x877;
11499new_r00=0;
11500IkReal gconst6=x877;
11501IkReal x879 = new_r10*new_r10;
11502if(IKabs(x879)==0){
11503continue;
11504}
11505IkReal gconst7=((-1.0)*new_r10*(pow(x879,-0.5)));
11506IkReal gconst8=0;
11507j3eval[0]=new_r10;
11508if( IKabs(j3eval[0]) < 0.0000010000000000 )
11509{
11510continue; // 3 cases reached
11511
11512} else
11513{
11514{
11515IkReal j3array[1], cj3array[1], sj3array[1];
11516bool j3valid[1]={false};
11517_nj3 = 1;
11519if(!x880.valid){
11520continue;
11521}
11523if(!x881.valid){
11524continue;
11525}
11526if( IKabs((new_r11*(x880.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst7*(x881.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((new_r11*(x880.value)))+IKsqr((gconst7*(x881.value)))-1) <= IKFAST_SINCOS_THRESH )
11527 continue;
11528j3array[0]=IKatan2((new_r11*(x880.value)), (gconst7*(x881.value)));
11529sj3array[0]=IKsin(j3array[0]);
11530cj3array[0]=IKcos(j3array[0]);
11531if( j3array[0] > IKPI )
11532{
11533 j3array[0]-=IK2PI;
11534}
11535else if( j3array[0] < -IKPI )
11536{ j3array[0]+=IK2PI;
11537}
11538j3valid[0] = true;
11539for(int ij3 = 0; ij3 < 1; ++ij3)
11540{
11541if( !j3valid[ij3] )
11542{
11543 continue;
11544}
11545_ij3[0] = ij3; _ij3[1] = -1;
11546for(int iij3 = ij3+1; iij3 < 1; ++iij3)
11547{
11548if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
11549{
11550 j3valid[iij3]=false; _ij3[1] = iij3; break;
11551}
11552}
11553j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
11554{
11555IkReal evalcond[8];
11556IkReal x882=IKsin(j3);
11557IkReal x883=IKcos(j3);
11558IkReal x884=((1.0)*gconst7);
11559IkReal x885=((1.0)*x883);
11560IkReal x886=(x883*x884);
11561evalcond[0]=(new_r10*x882);
11562evalcond[1]=(gconst7*x882);
11563evalcond[2]=((((-1.0)*new_r10*x885))+gconst7);
11564evalcond[3]=((((-1.0)*x886))+new_r01);
11565evalcond[4]=((((-1.0)*x882*x884))+new_r11);
11566evalcond[5]=((((-1.0)*x886))+new_r10);
11567evalcond[6]=(((new_r01*x882))+(((-1.0)*new_r11*x885)));
11568evalcond[7]=(((new_r01*x883))+((new_r11*x882))+(((-1.0)*x884)));
11569if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
11570{
11571continue;
11572}
11573}
11574
11575{
11576std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
11577vinfos[0].jointtype = 1;
11578vinfos[0].foffset = j0;
11579vinfos[0].indices[0] = _ij0[0];
11580vinfos[0].indices[1] = _ij0[1];
11581vinfos[0].maxsolutions = _nj0;
11582vinfos[1].jointtype = 1;
11583vinfos[1].foffset = j1;
11584vinfos[1].indices[0] = _ij1[0];
11585vinfos[1].indices[1] = _ij1[1];
11586vinfos[1].maxsolutions = _nj1;
11587vinfos[2].jointtype = 1;
11588vinfos[2].foffset = j2;
11589vinfos[2].indices[0] = _ij2[0];
11590vinfos[2].indices[1] = _ij2[1];
11591vinfos[2].maxsolutions = _nj2;
11592vinfos[3].jointtype = 1;
11593vinfos[3].foffset = j3;
11594vinfos[3].indices[0] = _ij3[0];
11595vinfos[3].indices[1] = _ij3[1];
11596vinfos[3].maxsolutions = _nj3;
11597vinfos[4].jointtype = 1;
11598vinfos[4].foffset = j4;
11599vinfos[4].indices[0] = _ij4[0];
11600vinfos[4].indices[1] = _ij4[1];
11601vinfos[4].maxsolutions = _nj4;
11602vinfos[5].jointtype = 1;
11603vinfos[5].foffset = j5;
11604vinfos[5].indices[0] = _ij5[0];
11605vinfos[5].indices[1] = _ij5[1];
11606vinfos[5].maxsolutions = _nj5;
11607std::vector<int> vfree(0);
11608solutions.AddSolution(vinfos,vfree);
11609}
11610}
11611}
11612
11613}
11614
11615}
11616
11617} else
11618{
11619{
11620IkReal j3array[1], cj3array[1], sj3array[1];
11621bool j3valid[1]={false};
11622_nj3 = 1;
11624if(!x887.valid){
11625continue;
11626}
11628if(!x888.valid){
11629continue;
11630}
11631j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x887.value)))+(x888.value));
11632sj3array[0]=IKsin(j3array[0]);
11633cj3array[0]=IKcos(j3array[0]);
11634if( j3array[0] > IKPI )
11635{
11636 j3array[0]-=IK2PI;
11637}
11638else if( j3array[0] < -IKPI )
11639{ j3array[0]+=IK2PI;
11640}
11641j3valid[0] = true;
11642for(int ij3 = 0; ij3 < 1; ++ij3)
11643{
11644if( !j3valid[ij3] )
11645{
11646 continue;
11647}
11648_ij3[0] = ij3; _ij3[1] = -1;
11649for(int iij3 = ij3+1; iij3 < 1; ++iij3)
11650{
11651if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
11652{
11653 j3valid[iij3]=false; _ij3[1] = iij3; break;
11654}
11655}
11656j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
11657{
11658IkReal evalcond[8];
11659IkReal x889=IKsin(j3);
11660IkReal x890=IKcos(j3);
11661IkReal x891=((1.0)*gconst7);
11662IkReal x892=((1.0)*x890);
11663IkReal x893=(x890*x891);
11664evalcond[0]=(new_r10*x889);
11665evalcond[1]=(gconst7*x889);
11666evalcond[2]=(gconst7+(((-1.0)*new_r10*x892)));
11667evalcond[3]=((((-1.0)*x893))+new_r01);
11668evalcond[4]=((((-1.0)*x889*x891))+new_r11);
11669evalcond[5]=((((-1.0)*x893))+new_r10);
11670evalcond[6]=(((new_r01*x889))+(((-1.0)*new_r11*x892)));
11671evalcond[7]=(((new_r11*x889))+((new_r01*x890))+(((-1.0)*x891)));
11672if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
11673{
11674continue;
11675}
11676}
11677
11678{
11679std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
11680vinfos[0].jointtype = 1;
11681vinfos[0].foffset = j0;
11682vinfos[0].indices[0] = _ij0[0];
11683vinfos[0].indices[1] = _ij0[1];
11684vinfos[0].maxsolutions = _nj0;
11685vinfos[1].jointtype = 1;
11686vinfos[1].foffset = j1;
11687vinfos[1].indices[0] = _ij1[0];
11688vinfos[1].indices[1] = _ij1[1];
11689vinfos[1].maxsolutions = _nj1;
11690vinfos[2].jointtype = 1;
11691vinfos[2].foffset = j2;
11692vinfos[2].indices[0] = _ij2[0];
11693vinfos[2].indices[1] = _ij2[1];
11694vinfos[2].maxsolutions = _nj2;
11695vinfos[3].jointtype = 1;
11696vinfos[3].foffset = j3;
11697vinfos[3].indices[0] = _ij3[0];
11698vinfos[3].indices[1] = _ij3[1];
11699vinfos[3].maxsolutions = _nj3;
11700vinfos[4].jointtype = 1;
11701vinfos[4].foffset = j4;
11702vinfos[4].indices[0] = _ij4[0];
11703vinfos[4].indices[1] = _ij4[1];
11704vinfos[4].maxsolutions = _nj4;
11705vinfos[5].jointtype = 1;
11706vinfos[5].foffset = j5;
11707vinfos[5].indices[0] = _ij5[0];
11708vinfos[5].indices[1] = _ij5[1];
11709vinfos[5].maxsolutions = _nj5;
11710std::vector<int> vfree(0);
11711solutions.AddSolution(vinfos,vfree);
11712}
11713}
11714}
11715
11716}
11717
11718}
11719
11720} else
11721{
11722{
11723IkReal j3array[1], cj3array[1], sj3array[1];
11724bool j3valid[1]={false};
11725_nj3 = 1;
11727if(!x894.valid){
11728continue;
11729}
11731if(!x895.valid){
11732continue;
11733}
11734j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x894.value)))+(x895.value));
11735sj3array[0]=IKsin(j3array[0]);
11736cj3array[0]=IKcos(j3array[0]);
11737if( j3array[0] > IKPI )
11738{
11739 j3array[0]-=IK2PI;
11740}
11741else if( j3array[0] < -IKPI )
11742{ j3array[0]+=IK2PI;
11743}
11744j3valid[0] = true;
11745for(int ij3 = 0; ij3 < 1; ++ij3)
11746{
11747if( !j3valid[ij3] )
11748{
11749 continue;
11750}
11751_ij3[0] = ij3; _ij3[1] = -1;
11752for(int iij3 = ij3+1; iij3 < 1; ++iij3)
11753{
11754if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
11755{
11756 j3valid[iij3]=false; _ij3[1] = iij3; break;
11757}
11758}
11759j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
11760{
11761IkReal evalcond[8];
11762IkReal x896=IKsin(j3);
11763IkReal x897=IKcos(j3);
11764IkReal x898=((1.0)*gconst7);
11765IkReal x899=((1.0)*x897);
11766IkReal x900=(x897*x898);
11767evalcond[0]=(new_r10*x896);
11768evalcond[1]=(gconst7*x896);
11769evalcond[2]=(gconst7+(((-1.0)*new_r10*x899)));
11770evalcond[3]=((((-1.0)*x900))+new_r01);
11771evalcond[4]=((((-1.0)*x896*x898))+new_r11);
11772evalcond[5]=((((-1.0)*x900))+new_r10);
11773evalcond[6]=(((new_r01*x896))+(((-1.0)*new_r11*x899)));
11774evalcond[7]=(((new_r11*x896))+((new_r01*x897))+(((-1.0)*x898)));
11775if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
11776{
11777continue;
11778}
11779}
11780
11781{
11782std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
11783vinfos[0].jointtype = 1;
11784vinfos[0].foffset = j0;
11785vinfos[0].indices[0] = _ij0[0];
11786vinfos[0].indices[1] = _ij0[1];
11787vinfos[0].maxsolutions = _nj0;
11788vinfos[1].jointtype = 1;
11789vinfos[1].foffset = j1;
11790vinfos[1].indices[0] = _ij1[0];
11791vinfos[1].indices[1] = _ij1[1];
11792vinfos[1].maxsolutions = _nj1;
11793vinfos[2].jointtype = 1;
11794vinfos[2].foffset = j2;
11795vinfos[2].indices[0] = _ij2[0];
11796vinfos[2].indices[1] = _ij2[1];
11797vinfos[2].maxsolutions = _nj2;
11798vinfos[3].jointtype = 1;
11799vinfos[3].foffset = j3;
11800vinfos[3].indices[0] = _ij3[0];
11801vinfos[3].indices[1] = _ij3[1];
11802vinfos[3].maxsolutions = _nj3;
11803vinfos[4].jointtype = 1;
11804vinfos[4].foffset = j4;
11805vinfos[4].indices[0] = _ij4[0];
11806vinfos[4].indices[1] = _ij4[1];
11807vinfos[4].maxsolutions = _nj4;
11808vinfos[5].jointtype = 1;
11809vinfos[5].foffset = j5;
11810vinfos[5].indices[0] = _ij5[0];
11811vinfos[5].indices[1] = _ij5[1];
11812vinfos[5].maxsolutions = _nj5;
11813std::vector<int> vfree(0);
11814solutions.AddSolution(vinfos,vfree);
11815}
11816}
11817}
11818
11819}
11820
11821}
11822
11823}
11824} while(0);
11825if( bgotonextstatement )
11826{
11827bool bgotonextstatement = true;
11828do
11829{
11830if( 1 )
11831{
11832bgotonextstatement=false;
11833continue; // branch miss [j3]
11834
11835}
11836} while(0);
11837if( bgotonextstatement )
11838{
11839}
11840}
11841}
11842}
11843}
11844}
11845
11846} else
11847{
11848{
11849IkReal j3array[1], cj3array[1], sj3array[1];
11850bool j3valid[1]={false};
11851_nj3 = 1;
11852CheckValue<IkReal> x901=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst7*new_r10))+(((-1.0)*gconst8*new_r00)))),-1);
11853if(!x901.valid){
11854continue;
11855}
11856CheckValue<IkReal> x902 = IKatan2WithCheck(IkReal((((new_r00*new_r10))+((gconst7*gconst8)))),IkReal(((gconst8*gconst8)+(((-1.0)*(new_r10*new_r10))))),IKFAST_ATAN2_MAGTHRESH);
11857if(!x902.valid){
11858continue;
11859}
11860j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x901.value)))+(x902.value));
11861sj3array[0]=IKsin(j3array[0]);
11862cj3array[0]=IKcos(j3array[0]);
11863if( j3array[0] > IKPI )
11864{
11865 j3array[0]-=IK2PI;
11866}
11867else if( j3array[0] < -IKPI )
11868{ j3array[0]+=IK2PI;
11869}
11870j3valid[0] = true;
11871for(int ij3 = 0; ij3 < 1; ++ij3)
11872{
11873if( !j3valid[ij3] )
11874{
11875 continue;
11876}
11877_ij3[0] = ij3; _ij3[1] = -1;
11878for(int iij3 = ij3+1; iij3 < 1; ++iij3)
11879{
11880if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
11881{
11882 j3valid[iij3]=false; _ij3[1] = iij3; break;
11883}
11884}
11885j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
11886{
11887IkReal evalcond[8];
11888IkReal x903=IKcos(j3);
11889IkReal x904=IKsin(j3);
11890IkReal x905=(gconst8*x904);
11891IkReal x906=(gconst7*x904);
11892IkReal x907=((1.0)*x903);
11893IkReal x908=(gconst7*x907);
11894evalcond[0]=(gconst8+((new_r10*x904))+((new_r00*x903)));
11895evalcond[1]=(new_r00+((gconst8*x903))+x906);
11896evalcond[2]=(gconst7+((new_r00*x904))+(((-1.0)*new_r10*x907)));
11897evalcond[3]=((((-1.0)*new_r11*x907))+gconst8+((new_r01*x904)));
11898evalcond[4]=((((-1.0)*x908))+new_r01+x905);
11899evalcond[5]=((((-1.0)*x908))+new_r10+x905);
11900evalcond[6]=((((-1.0)*gconst7))+((new_r11*x904))+((new_r01*x903)));
11901evalcond[7]=((((-1.0)*gconst8*x907))+(((-1.0)*x906))+new_r11);
11902if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
11903{
11904continue;
11905}
11906}
11907
11908{
11909std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
11910vinfos[0].jointtype = 1;
11911vinfos[0].foffset = j0;
11912vinfos[0].indices[0] = _ij0[0];
11913vinfos[0].indices[1] = _ij0[1];
11914vinfos[0].maxsolutions = _nj0;
11915vinfos[1].jointtype = 1;
11916vinfos[1].foffset = j1;
11917vinfos[1].indices[0] = _ij1[0];
11918vinfos[1].indices[1] = _ij1[1];
11919vinfos[1].maxsolutions = _nj1;
11920vinfos[2].jointtype = 1;
11921vinfos[2].foffset = j2;
11922vinfos[2].indices[0] = _ij2[0];
11923vinfos[2].indices[1] = _ij2[1];
11924vinfos[2].maxsolutions = _nj2;
11925vinfos[3].jointtype = 1;
11926vinfos[3].foffset = j3;
11927vinfos[3].indices[0] = _ij3[0];
11928vinfos[3].indices[1] = _ij3[1];
11929vinfos[3].maxsolutions = _nj3;
11930vinfos[4].jointtype = 1;
11931vinfos[4].foffset = j4;
11932vinfos[4].indices[0] = _ij4[0];
11933vinfos[4].indices[1] = _ij4[1];
11934vinfos[4].maxsolutions = _nj4;
11935vinfos[5].jointtype = 1;
11936vinfos[5].foffset = j5;
11937vinfos[5].indices[0] = _ij5[0];
11938vinfos[5].indices[1] = _ij5[1];
11939vinfos[5].maxsolutions = _nj5;
11940std::vector<int> vfree(0);
11941solutions.AddSolution(vinfos,vfree);
11942}
11943}
11944}
11945
11946}
11947
11948}
11949
11950} else
11951{
11952{
11953IkReal j3array[1], cj3array[1], sj3array[1];
11954bool j3valid[1]={false};
11955_nj3 = 1;
11956IkReal x909=((1.0)*new_r10);
11957CheckValue<IkReal> x910=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst7*x909))+(((-1.0)*gconst8*new_r00)))),-1);
11958if(!x910.valid){
11959continue;
11960}
11961CheckValue<IkReal> x911 = IKatan2WithCheck(IkReal((((new_r00*new_r01))+((gconst7*gconst8)))),IkReal(((gconst8*gconst8)+(((-1.0)*new_r01*x909)))),IKFAST_ATAN2_MAGTHRESH);
11962if(!x911.valid){
11963continue;
11964}
11965j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x910.value)))+(x911.value));
11966sj3array[0]=IKsin(j3array[0]);
11967cj3array[0]=IKcos(j3array[0]);
11968if( j3array[0] > IKPI )
11969{
11970 j3array[0]-=IK2PI;
11971}
11972else if( j3array[0] < -IKPI )
11973{ j3array[0]+=IK2PI;
11974}
11975j3valid[0] = true;
11976for(int ij3 = 0; ij3 < 1; ++ij3)
11977{
11978if( !j3valid[ij3] )
11979{
11980 continue;
11981}
11982_ij3[0] = ij3; _ij3[1] = -1;
11983for(int iij3 = ij3+1; iij3 < 1; ++iij3)
11984{
11985if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
11986{
11987 j3valid[iij3]=false; _ij3[1] = iij3; break;
11988}
11989}
11990j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
11991{
11992IkReal evalcond[8];
11993IkReal x912=IKcos(j3);
11994IkReal x913=IKsin(j3);
11995IkReal x914=(gconst8*x913);
11996IkReal x915=(gconst7*x913);
11997IkReal x916=((1.0)*x912);
11998IkReal x917=(gconst7*x916);
11999evalcond[0]=(gconst8+((new_r10*x913))+((new_r00*x912)));
12000evalcond[1]=(((gconst8*x912))+new_r00+x915);
12001evalcond[2]=(gconst7+((new_r00*x913))+(((-1.0)*new_r10*x916)));
12002evalcond[3]=(gconst8+((new_r01*x913))+(((-1.0)*new_r11*x916)));
12003evalcond[4]=((((-1.0)*x917))+new_r01+x914);
12004evalcond[5]=((((-1.0)*x917))+new_r10+x914);
12005evalcond[6]=(((new_r11*x913))+(((-1.0)*gconst7))+((new_r01*x912)));
12006evalcond[7]=((((-1.0)*gconst8*x916))+(((-1.0)*x915))+new_r11);
12007if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
12008{
12009continue;
12010}
12011}
12012
12013{
12014std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
12015vinfos[0].jointtype = 1;
12016vinfos[0].foffset = j0;
12017vinfos[0].indices[0] = _ij0[0];
12018vinfos[0].indices[1] = _ij0[1];
12019vinfos[0].maxsolutions = _nj0;
12020vinfos[1].jointtype = 1;
12021vinfos[1].foffset = j1;
12022vinfos[1].indices[0] = _ij1[0];
12023vinfos[1].indices[1] = _ij1[1];
12024vinfos[1].maxsolutions = _nj1;
12025vinfos[2].jointtype = 1;
12026vinfos[2].foffset = j2;
12027vinfos[2].indices[0] = _ij2[0];
12028vinfos[2].indices[1] = _ij2[1];
12029vinfos[2].maxsolutions = _nj2;
12030vinfos[3].jointtype = 1;
12031vinfos[3].foffset = j3;
12032vinfos[3].indices[0] = _ij3[0];
12033vinfos[3].indices[1] = _ij3[1];
12034vinfos[3].maxsolutions = _nj3;
12035vinfos[4].jointtype = 1;
12036vinfos[4].foffset = j4;
12037vinfos[4].indices[0] = _ij4[0];
12038vinfos[4].indices[1] = _ij4[1];
12039vinfos[4].maxsolutions = _nj4;
12040vinfos[5].jointtype = 1;
12041vinfos[5].foffset = j5;
12042vinfos[5].indices[0] = _ij5[0];
12043vinfos[5].indices[1] = _ij5[1];
12044vinfos[5].maxsolutions = _nj5;
12045std::vector<int> vfree(0);
12046solutions.AddSolution(vinfos,vfree);
12047}
12048}
12049}
12050
12051}
12052
12053}
12054
12055} else
12056{
12057{
12058IkReal j3array[1], cj3array[1], sj3array[1];
12059bool j3valid[1]={false};
12060_nj3 = 1;
12061IkReal x918=((1.0)*new_r10);
12062CheckValue<IkReal> x919 = IKatan2WithCheck(IkReal((((gconst8*new_r11))+((gconst8*new_r00)))),IkReal((((gconst8*new_r01))+(((-1.0)*gconst8*x918)))),IKFAST_ATAN2_MAGTHRESH);
12063if(!x919.valid){
12064continue;
12065}
12066CheckValue<IkReal> x920=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r00*new_r01))+(((-1.0)*new_r11*x918)))),-1);
12067if(!x920.valid){
12068continue;
12069}
12070j3array[0]=((-1.5707963267949)+(x919.value)+(((1.5707963267949)*(x920.value))));
12071sj3array[0]=IKsin(j3array[0]);
12072cj3array[0]=IKcos(j3array[0]);
12073if( j3array[0] > IKPI )
12074{
12075 j3array[0]-=IK2PI;
12076}
12077else if( j3array[0] < -IKPI )
12078{ j3array[0]+=IK2PI;
12079}
12080j3valid[0] = true;
12081for(int ij3 = 0; ij3 < 1; ++ij3)
12082{
12083if( !j3valid[ij3] )
12084{
12085 continue;
12086}
12087_ij3[0] = ij3; _ij3[1] = -1;
12088for(int iij3 = ij3+1; iij3 < 1; ++iij3)
12089{
12090if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
12091{
12092 j3valid[iij3]=false; _ij3[1] = iij3; break;
12093}
12094}
12095j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
12096{
12097IkReal evalcond[8];
12098IkReal x921=IKcos(j3);
12099IkReal x922=IKsin(j3);
12100IkReal x923=(gconst8*x922);
12101IkReal x924=(gconst7*x922);
12102IkReal x925=((1.0)*x921);
12103IkReal x926=(gconst7*x925);
12104evalcond[0]=(gconst8+((new_r00*x921))+((new_r10*x922)));
12105evalcond[1]=(((gconst8*x921))+new_r00+x924);
12106evalcond[2]=(gconst7+(((-1.0)*new_r10*x925))+((new_r00*x922)));
12107evalcond[3]=((((-1.0)*new_r11*x925))+gconst8+((new_r01*x922)));
12108evalcond[4]=((((-1.0)*x926))+new_r01+x923);
12109evalcond[5]=((((-1.0)*x926))+new_r10+x923);
12110evalcond[6]=((((-1.0)*gconst7))+((new_r01*x921))+((new_r11*x922)));
12111evalcond[7]=((((-1.0)*gconst8*x925))+(((-1.0)*x924))+new_r11);
12112if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
12113{
12114continue;
12115}
12116}
12117
12118{
12119std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
12120vinfos[0].jointtype = 1;
12121vinfos[0].foffset = j0;
12122vinfos[0].indices[0] = _ij0[0];
12123vinfos[0].indices[1] = _ij0[1];
12124vinfos[0].maxsolutions = _nj0;
12125vinfos[1].jointtype = 1;
12126vinfos[1].foffset = j1;
12127vinfos[1].indices[0] = _ij1[0];
12128vinfos[1].indices[1] = _ij1[1];
12129vinfos[1].maxsolutions = _nj1;
12130vinfos[2].jointtype = 1;
12131vinfos[2].foffset = j2;
12132vinfos[2].indices[0] = _ij2[0];
12133vinfos[2].indices[1] = _ij2[1];
12134vinfos[2].maxsolutions = _nj2;
12135vinfos[3].jointtype = 1;
12136vinfos[3].foffset = j3;
12137vinfos[3].indices[0] = _ij3[0];
12138vinfos[3].indices[1] = _ij3[1];
12139vinfos[3].maxsolutions = _nj3;
12140vinfos[4].jointtype = 1;
12141vinfos[4].foffset = j4;
12142vinfos[4].indices[0] = _ij4[0];
12143vinfos[4].indices[1] = _ij4[1];
12144vinfos[4].maxsolutions = _nj4;
12145vinfos[5].jointtype = 1;
12146vinfos[5].foffset = j5;
12147vinfos[5].indices[0] = _ij5[0];
12148vinfos[5].indices[1] = _ij5[1];
12149vinfos[5].maxsolutions = _nj5;
12150std::vector<int> vfree(0);
12151solutions.AddSolution(vinfos,vfree);
12152}
12153}
12154}
12155
12156}
12157
12158}
12159
12160}
12161} while(0);
12162if( bgotonextstatement )
12163{
12164bool bgotonextstatement = true;
12165do
12166{
12167IkReal x929 = ((new_r10*new_r10)+(new_r00*new_r00));
12168if(IKabs(x929)==0){
12169continue;
12170}
12171IkReal x927=pow(x929,-0.5);
12172IkReal x928=((1.0)*x927);
12174if(!x930.valid){
12175continue;
12176}
12177IkReal gconst9=((3.14159265358979)+(((-1.0)*(x930.value))));
12178IkReal gconst10=(new_r10*x928);
12179IkReal gconst11=(new_r00*x928);
12181if(!x931.valid){
12182continue;
12183}
12184evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j5+(x931.value))))), 6.28318530717959)));
12185if( IKabs(evalcond[0]) < 0.0000050000000000 )
12186{
12187bgotonextstatement=false;
12188{
12189IkReal j3eval[3];
12191if(!x935.valid){
12192continue;
12193}
12194IkReal x932=((1.0)*(x935.value));
12195IkReal x933=x927;
12196IkReal x934=((1.0)*x933);
12197sj4=0;
12198cj4=-1.0;
12199j4=3.14159265358979;
12200sj5=gconst10;
12201cj5=gconst11;
12202j5=((3.14159265)+(((-1.0)*x932)));
12203IkReal gconst9=((3.14159265358979)+(((-1.0)*x932)));
12204IkReal gconst10=(new_r10*x934);
12205IkReal gconst11=(new_r00*x934);
12206IkReal x936=new_r00*new_r00;
12207IkReal x937=((1.0)*new_r00);
12208IkReal x938=((((-1.0)*new_r01*x937))+(((-1.0)*new_r10*new_r11)));
12209IkReal x939=x927;
12210IkReal x940=(new_r00*x939);
12211j3eval[0]=x938;
12212j3eval[1]=((IKabs((((new_r01*x940))+(((-1.0)*new_r10*x937*x939)))))+(IKabs((((x936*x939))+((new_r11*x940))))));
12213j3eval[2]=IKsign(x938);
12214if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
12215{
12216{
12217IkReal j3eval[1];
12219if(!x944.valid){
12220continue;
12221}
12222IkReal x941=((1.0)*(x944.value));
12223IkReal x942=x927;
12224IkReal x943=((1.0)*x942);
12225sj4=0;
12226cj4=-1.0;
12227j4=3.14159265358979;
12228sj5=gconst10;
12229cj5=gconst11;
12230j5=((3.14159265)+(((-1.0)*x941)));
12231IkReal gconst9=((3.14159265358979)+(((-1.0)*x941)));
12232IkReal gconst10=(new_r10*x943);
12233IkReal gconst11=(new_r00*x943);
12234IkReal x945=new_r10*new_r10;
12235IkReal x946=new_r00*new_r00;
12236IkReal x947=((1.0)*new_r01);
12237CheckValue<IkReal> x951=IKPowWithIntegerCheck((x945+x946),-1);
12238if(!x951.valid){
12239continue;
12240}
12241IkReal x948=x951.value;
12242IkReal x949=(new_r10*x948);
12243IkReal x950=(new_r01*x948);
12244j3eval[0]=((IKabs((((new_r00*x949))+((new_r00*x945*x950))+((x950*(new_r00*new_r00*new_r00))))))+(IKabs((((x946*x948))+(((-1.0)*x947*x949*(new_r10*new_r10)))+(((-1.0)*x946*x947*x949))))));
12245if( IKabs(j3eval[0]) < 0.0000010000000000 )
12246{
12247{
12248IkReal j3eval[1];
12250if(!x955.valid){
12251continue;
12252}
12253IkReal x952=((1.0)*(x955.value));
12254IkReal x953=x927;
12255IkReal x954=((1.0)*x953);
12256sj4=0;
12257cj4=-1.0;
12258j4=3.14159265358979;
12259sj5=gconst10;
12260cj5=gconst11;
12261j5=((3.14159265)+(((-1.0)*x952)));
12262IkReal gconst9=((3.14159265358979)+(((-1.0)*x952)));
12263IkReal gconst10=(new_r10*x954);
12264IkReal gconst11=(new_r00*x954);
12265IkReal x956=new_r00*new_r00;
12266IkReal x957=new_r10*new_r10;
12267CheckValue<IkReal> x961=IKPowWithIntegerCheck((x957+x956),-1);
12268if(!x961.valid){
12269continue;
12270}
12271IkReal x958=x961.value;
12272IkReal x959=(new_r10*x958);
12273IkReal x960=((1.0)*x958);
12274j3eval[0]=((IKabs(((((-1.0)*x956*x957*x960))+((x956*x958))+(((-1.0)*x960*(x957*x957))))))+(IKabs((((new_r00*x959))+((x959*(new_r00*new_r00*new_r00)))+((new_r00*x959*(new_r10*new_r10)))))));
12275if( IKabs(j3eval[0]) < 0.0000010000000000 )
12276{
12277{
12278IkReal evalcond[2];
12279bool bgotonextstatement = true;
12280do
12281{
12282evalcond[0]=((IKabs(new_r11))+(IKabs(new_r00)));
12283if( IKabs(evalcond[0]) < 0.0000050000000000 )
12284{
12285bgotonextstatement=false;
12286{
12287IkReal j3eval[1];
12289if(!x963.valid){
12290continue;
12291}
12292IkReal x962=((1.0)*(x963.value));
12293sj4=0;
12294cj4=-1.0;
12295j4=3.14159265358979;
12296sj5=gconst10;
12297cj5=gconst11;
12298j5=((3.14159265)+(((-1.0)*x962)));
12299new_r11=0;
12300new_r00=0;
12301IkReal gconst9=((3.14159265358979)+(((-1.0)*x962)));
12302IkReal x964 = new_r10*new_r10;
12303if(IKabs(x964)==0){
12304continue;
12305}
12306IkReal gconst10=((1.0)*new_r10*(pow(x964,-0.5)));
12307IkReal gconst11=0;
12308j3eval[0]=new_r10;
12309if( IKabs(j3eval[0]) < 0.0000010000000000 )
12310{
12311{
12312IkReal j3array[2], cj3array[2], sj3array[2];
12313bool j3valid[2]={false};
12314_nj3 = 2;
12316if(!x965.valid){
12317continue;
12318}
12319cj3array[0]=(new_r01*(x965.value));
12320if( cj3array[0] >= -1-IKFAST_SINCOS_THRESH && cj3array[0] <= 1+IKFAST_SINCOS_THRESH )
12321{
12322 j3valid[0] = j3valid[1] = true;
12323 j3array[0] = IKacos(cj3array[0]);
12324 sj3array[0] = IKsin(j3array[0]);
12325 cj3array[1] = cj3array[0];
12326 j3array[1] = -j3array[0];
12327 sj3array[1] = -sj3array[0];
12328}
12329else if( isnan(cj3array[0]) )
12330{
12331 // probably any value will work
12332 j3valid[0] = true;
12333 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
12334}
12335for(int ij3 = 0; ij3 < 2; ++ij3)
12336{
12337if( !j3valid[ij3] )
12338{
12339 continue;
12340}
12341_ij3[0] = ij3; _ij3[1] = -1;
12342for(int iij3 = ij3+1; iij3 < 2; ++iij3)
12343{
12344if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
12345{
12346 j3valid[iij3]=false; _ij3[1] = iij3; break;
12347}
12348}
12349j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
12350{
12351IkReal evalcond[6];
12352IkReal x966=IKsin(j3);
12353IkReal x967=IKcos(j3);
12354IkReal x968=((1.0)*gconst10);
12355evalcond[0]=(new_r01*x966);
12356evalcond[1]=(new_r10*x966);
12357evalcond[2]=(gconst10*x966);
12358evalcond[3]=(gconst10+(((-1.0)*new_r10*x967)));
12359evalcond[4]=((((-1.0)*x967*x968))+new_r10);
12360evalcond[5]=(((new_r01*x967))+(((-1.0)*x968)));
12361if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
12362{
12363continue;
12364}
12365}
12366
12367{
12368std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
12369vinfos[0].jointtype = 1;
12370vinfos[0].foffset = j0;
12371vinfos[0].indices[0] = _ij0[0];
12372vinfos[0].indices[1] = _ij0[1];
12373vinfos[0].maxsolutions = _nj0;
12374vinfos[1].jointtype = 1;
12375vinfos[1].foffset = j1;
12376vinfos[1].indices[0] = _ij1[0];
12377vinfos[1].indices[1] = _ij1[1];
12378vinfos[1].maxsolutions = _nj1;
12379vinfos[2].jointtype = 1;
12380vinfos[2].foffset = j2;
12381vinfos[2].indices[0] = _ij2[0];
12382vinfos[2].indices[1] = _ij2[1];
12383vinfos[2].maxsolutions = _nj2;
12384vinfos[3].jointtype = 1;
12385vinfos[3].foffset = j3;
12386vinfos[3].indices[0] = _ij3[0];
12387vinfos[3].indices[1] = _ij3[1];
12388vinfos[3].maxsolutions = _nj3;
12389vinfos[4].jointtype = 1;
12390vinfos[4].foffset = j4;
12391vinfos[4].indices[0] = _ij4[0];
12392vinfos[4].indices[1] = _ij4[1];
12393vinfos[4].maxsolutions = _nj4;
12394vinfos[5].jointtype = 1;
12395vinfos[5].foffset = j5;
12396vinfos[5].indices[0] = _ij5[0];
12397vinfos[5].indices[1] = _ij5[1];
12398vinfos[5].maxsolutions = _nj5;
12399std::vector<int> vfree(0);
12400solutions.AddSolution(vinfos,vfree);
12401}
12402}
12403}
12404
12405} else
12406{
12407{
12408IkReal j3array[2], cj3array[2], sj3array[2];
12409bool j3valid[2]={false};
12410_nj3 = 2;
12412if(!x969.valid){
12413continue;
12414}
12415cj3array[0]=(gconst10*(x969.value));
12416if( cj3array[0] >= -1-IKFAST_SINCOS_THRESH && cj3array[0] <= 1+IKFAST_SINCOS_THRESH )
12417{
12418 j3valid[0] = j3valid[1] = true;
12419 j3array[0] = IKacos(cj3array[0]);
12420 sj3array[0] = IKsin(j3array[0]);
12421 cj3array[1] = cj3array[0];
12422 j3array[1] = -j3array[0];
12423 sj3array[1] = -sj3array[0];
12424}
12425else if( isnan(cj3array[0]) )
12426{
12427 // probably any value will work
12428 j3valid[0] = true;
12429 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
12430}
12431for(int ij3 = 0; ij3 < 2; ++ij3)
12432{
12433if( !j3valid[ij3] )
12434{
12435 continue;
12436}
12437_ij3[0] = ij3; _ij3[1] = -1;
12438for(int iij3 = ij3+1; iij3 < 2; ++iij3)
12439{
12440if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
12441{
12442 j3valid[iij3]=false; _ij3[1] = iij3; break;
12443}
12444}
12445j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
12446{
12447IkReal evalcond[6];
12448IkReal x970=IKsin(j3);
12449IkReal x971=IKcos(j3);
12450IkReal x972=((1.0)*gconst10);
12451IkReal x973=(x971*x972);
12452evalcond[0]=(new_r01*x970);
12453evalcond[1]=(new_r10*x970);
12454evalcond[2]=(gconst10*x970);
12455evalcond[3]=(new_r01+(((-1.0)*x973)));
12456evalcond[4]=(new_r10+(((-1.0)*x973)));
12457evalcond[5]=(((new_r01*x971))+(((-1.0)*x972)));
12458if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
12459{
12460continue;
12461}
12462}
12463
12464{
12465std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
12466vinfos[0].jointtype = 1;
12467vinfos[0].foffset = j0;
12468vinfos[0].indices[0] = _ij0[0];
12469vinfos[0].indices[1] = _ij0[1];
12470vinfos[0].maxsolutions = _nj0;
12471vinfos[1].jointtype = 1;
12472vinfos[1].foffset = j1;
12473vinfos[1].indices[0] = _ij1[0];
12474vinfos[1].indices[1] = _ij1[1];
12475vinfos[1].maxsolutions = _nj1;
12476vinfos[2].jointtype = 1;
12477vinfos[2].foffset = j2;
12478vinfos[2].indices[0] = _ij2[0];
12479vinfos[2].indices[1] = _ij2[1];
12480vinfos[2].maxsolutions = _nj2;
12481vinfos[3].jointtype = 1;
12482vinfos[3].foffset = j3;
12483vinfos[3].indices[0] = _ij3[0];
12484vinfos[3].indices[1] = _ij3[1];
12485vinfos[3].maxsolutions = _nj3;
12486vinfos[4].jointtype = 1;
12487vinfos[4].foffset = j4;
12488vinfos[4].indices[0] = _ij4[0];
12489vinfos[4].indices[1] = _ij4[1];
12490vinfos[4].maxsolutions = _nj4;
12491vinfos[5].jointtype = 1;
12492vinfos[5].foffset = j5;
12493vinfos[5].indices[0] = _ij5[0];
12494vinfos[5].indices[1] = _ij5[1];
12495vinfos[5].maxsolutions = _nj5;
12496std::vector<int> vfree(0);
12497solutions.AddSolution(vinfos,vfree);
12498}
12499}
12500}
12501
12502}
12503
12504}
12505
12506}
12507} while(0);
12508if( bgotonextstatement )
12509{
12510bool bgotonextstatement = true;
12511do
12512{
12513evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01)));
12514evalcond[1]=gconst11;
12515if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
12516{
12517bgotonextstatement=false;
12518{
12519IkReal j3eval[3];
12521if(!x975.valid){
12522continue;
12523}
12524IkReal x974=((1.0)*(x975.value));
12525sj4=0;
12526cj4=-1.0;
12527j4=3.14159265358979;
12528sj5=gconst10;
12529cj5=gconst11;
12530j5=((3.14159265)+(((-1.0)*x974)));
12531new_r11=0;
12532new_r01=0;
12533new_r22=0;
12534new_r20=0;
12535IkReal gconst9=((3.14159265358979)+(((-1.0)*x974)));
12536IkReal gconst10=((1.0)*new_r10);
12537IkReal gconst11=((1.0)*new_r00);
12538j3eval[0]=-1.0;
12539j3eval[1]=-1.0;
12540j3eval[2]=((IKabs(((1.0)+(((-1.0)*(new_r10*new_r10))))))+(IKabs(((1.0)*new_r00*new_r10))));
12541if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
12542{
12543{
12544IkReal j3eval[3];
12546if(!x977.valid){
12547continue;
12548}
12549IkReal x976=((1.0)*(x977.value));
12550sj4=0;
12551cj4=-1.0;
12552j4=3.14159265358979;
12553sj5=gconst10;
12554cj5=gconst11;
12555j5=((3.14159265)+(((-1.0)*x976)));
12556new_r11=0;
12557new_r01=0;
12558new_r22=0;
12559new_r20=0;
12560IkReal gconst9=((3.14159265358979)+(((-1.0)*x976)));
12561IkReal gconst10=((1.0)*new_r10);
12562IkReal gconst11=((1.0)*new_r00);
12563j3eval[0]=-1.0;
12564j3eval[1]=-1.0;
12565j3eval[2]=((IKabs(((1.0)+(((-1.0)*(new_r10*new_r10))))))+(IKabs(((1.0)*new_r00*new_r10))));
12566if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
12567{
12568{
12569IkReal j3eval[3];
12571if(!x979.valid){
12572continue;
12573}
12574IkReal x978=((1.0)*(x979.value));
12575sj4=0;
12576cj4=-1.0;
12577j4=3.14159265358979;
12578sj5=gconst10;
12579cj5=gconst11;
12580j5=((3.14159265)+(((-1.0)*x978)));
12581new_r11=0;
12582new_r01=0;
12583new_r22=0;
12584new_r20=0;
12585IkReal gconst9=((3.14159265358979)+(((-1.0)*x978)));
12586IkReal gconst10=((1.0)*new_r10);
12587IkReal gconst11=((1.0)*new_r00);
12588j3eval[0]=-1.0;
12589j3eval[1]=-1.0;
12590j3eval[2]=((IKabs(((1.0)+(((-2.0)*(new_r10*new_r10))))))+(IKabs(((2.0)*new_r00*new_r10))));
12591if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
12592{
12593continue; // 3 cases reached
12594
12595} else
12596{
12597{
12598IkReal j3array[1], cj3array[1], sj3array[1];
12599bool j3valid[1]={false};
12600_nj3 = 1;
12601CheckValue<IkReal> x980 = IKatan2WithCheck(IkReal((((gconst10*gconst11))+((new_r00*new_r10)))),IkReal(((((-1.0)*(new_r10*new_r10)))+(gconst11*gconst11))),IKFAST_ATAN2_MAGTHRESH);
12602if(!x980.valid){
12603continue;
12604}
12605CheckValue<IkReal> x981=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst10*new_r10))+(((-1.0)*gconst11*new_r00)))),-1);
12606if(!x981.valid){
12607continue;
12608}
12609j3array[0]=((-1.5707963267949)+(x980.value)+(((1.5707963267949)*(x981.value))));
12610sj3array[0]=IKsin(j3array[0]);
12611cj3array[0]=IKcos(j3array[0]);
12612if( j3array[0] > IKPI )
12613{
12614 j3array[0]-=IK2PI;
12615}
12616else if( j3array[0] < -IKPI )
12617{ j3array[0]+=IK2PI;
12618}
12619j3valid[0] = true;
12620for(int ij3 = 0; ij3 < 1; ++ij3)
12621{
12622if( !j3valid[ij3] )
12623{
12624 continue;
12625}
12626_ij3[0] = ij3; _ij3[1] = -1;
12627for(int iij3 = ij3+1; iij3 < 1; ++iij3)
12628{
12629if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
12630{
12631 j3valid[iij3]=false; _ij3[1] = iij3; break;
12632}
12633}
12634j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
12635{
12636IkReal evalcond[6];
12637IkReal x982=IKsin(j3);
12638IkReal x983=IKcos(j3);
12639IkReal x984=(gconst11*x982);
12640IkReal x985=(gconst10*x982);
12641IkReal x986=(gconst11*x983);
12642IkReal x987=((1.0)*x983);
12643IkReal x988=(gconst10*x987);
12644evalcond[0]=((((-1.0)*x988))+x984);
12645evalcond[1]=(((new_r00*x983))+gconst11+((new_r10*x982)));
12646evalcond[2]=(new_r00+x985+x986);
12647evalcond[3]=(((new_r00*x982))+gconst10+(((-1.0)*new_r10*x987)));
12648evalcond[4]=((((-1.0)*x985))+(((-1.0)*x986)));
12649evalcond[5]=((((-1.0)*x988))+new_r10+x984);
12650if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
12651{
12652continue;
12653}
12654}
12655
12656{
12657std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
12658vinfos[0].jointtype = 1;
12659vinfos[0].foffset = j0;
12660vinfos[0].indices[0] = _ij0[0];
12661vinfos[0].indices[1] = _ij0[1];
12662vinfos[0].maxsolutions = _nj0;
12663vinfos[1].jointtype = 1;
12664vinfos[1].foffset = j1;
12665vinfos[1].indices[0] = _ij1[0];
12666vinfos[1].indices[1] = _ij1[1];
12667vinfos[1].maxsolutions = _nj1;
12668vinfos[2].jointtype = 1;
12669vinfos[2].foffset = j2;
12670vinfos[2].indices[0] = _ij2[0];
12671vinfos[2].indices[1] = _ij2[1];
12672vinfos[2].maxsolutions = _nj2;
12673vinfos[3].jointtype = 1;
12674vinfos[3].foffset = j3;
12675vinfos[3].indices[0] = _ij3[0];
12676vinfos[3].indices[1] = _ij3[1];
12677vinfos[3].maxsolutions = _nj3;
12678vinfos[4].jointtype = 1;
12679vinfos[4].foffset = j4;
12680vinfos[4].indices[0] = _ij4[0];
12681vinfos[4].indices[1] = _ij4[1];
12682vinfos[4].maxsolutions = _nj4;
12683vinfos[5].jointtype = 1;
12684vinfos[5].foffset = j5;
12685vinfos[5].indices[0] = _ij5[0];
12686vinfos[5].indices[1] = _ij5[1];
12687vinfos[5].maxsolutions = _nj5;
12688std::vector<int> vfree(0);
12689solutions.AddSolution(vinfos,vfree);
12690}
12691}
12692}
12693
12694}
12695
12696}
12697
12698} else
12699{
12700{
12701IkReal j3array[1], cj3array[1], sj3array[1];
12702bool j3valid[1]={false};
12703_nj3 = 1;
12704CheckValue<IkReal> x989=IKPowWithIntegerCheck(IKsign(((((-1.0)*(gconst11*gconst11)))+(((-1.0)*(gconst10*gconst10))))),-1);
12705if(!x989.valid){
12706continue;
12707}
12708CheckValue<IkReal> x990 = IKatan2WithCheck(IkReal((gconst10*new_r00)),IkReal((gconst11*new_r00)),IKFAST_ATAN2_MAGTHRESH);
12709if(!x990.valid){
12710continue;
12711}
12712j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x989.value)))+(x990.value));
12713sj3array[0]=IKsin(j3array[0]);
12714cj3array[0]=IKcos(j3array[0]);
12715if( j3array[0] > IKPI )
12716{
12717 j3array[0]-=IK2PI;
12718}
12719else if( j3array[0] < -IKPI )
12720{ j3array[0]+=IK2PI;
12721}
12722j3valid[0] = true;
12723for(int ij3 = 0; ij3 < 1; ++ij3)
12724{
12725if( !j3valid[ij3] )
12726{
12727 continue;
12728}
12729_ij3[0] = ij3; _ij3[1] = -1;
12730for(int iij3 = ij3+1; iij3 < 1; ++iij3)
12731{
12732if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
12733{
12734 j3valid[iij3]=false; _ij3[1] = iij3; break;
12735}
12736}
12737j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
12738{
12739IkReal evalcond[6];
12740IkReal x991=IKsin(j3);
12741IkReal x992=IKcos(j3);
12742IkReal x993=(gconst11*x991);
12743IkReal x994=(gconst10*x991);
12744IkReal x995=(gconst11*x992);
12745IkReal x996=((1.0)*x992);
12746IkReal x997=(gconst10*x996);
12747evalcond[0]=((((-1.0)*x997))+x993);
12748evalcond[1]=(((new_r10*x991))+gconst11+((new_r00*x992)));
12749evalcond[2]=(new_r00+x995+x994);
12750evalcond[3]=((((-1.0)*new_r10*x996))+gconst10+((new_r00*x991)));
12751evalcond[4]=((((-1.0)*x994))+(((-1.0)*x995)));
12752evalcond[5]=((((-1.0)*x997))+new_r10+x993);
12753if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
12754{
12755continue;
12756}
12757}
12758
12759{
12760std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
12761vinfos[0].jointtype = 1;
12762vinfos[0].foffset = j0;
12763vinfos[0].indices[0] = _ij0[0];
12764vinfos[0].indices[1] = _ij0[1];
12765vinfos[0].maxsolutions = _nj0;
12766vinfos[1].jointtype = 1;
12767vinfos[1].foffset = j1;
12768vinfos[1].indices[0] = _ij1[0];
12769vinfos[1].indices[1] = _ij1[1];
12770vinfos[1].maxsolutions = _nj1;
12771vinfos[2].jointtype = 1;
12772vinfos[2].foffset = j2;
12773vinfos[2].indices[0] = _ij2[0];
12774vinfos[2].indices[1] = _ij2[1];
12775vinfos[2].maxsolutions = _nj2;
12776vinfos[3].jointtype = 1;
12777vinfos[3].foffset = j3;
12778vinfos[3].indices[0] = _ij3[0];
12779vinfos[3].indices[1] = _ij3[1];
12780vinfos[3].maxsolutions = _nj3;
12781vinfos[4].jointtype = 1;
12782vinfos[4].foffset = j4;
12783vinfos[4].indices[0] = _ij4[0];
12784vinfos[4].indices[1] = _ij4[1];
12785vinfos[4].maxsolutions = _nj4;
12786vinfos[5].jointtype = 1;
12787vinfos[5].foffset = j5;
12788vinfos[5].indices[0] = _ij5[0];
12789vinfos[5].indices[1] = _ij5[1];
12790vinfos[5].maxsolutions = _nj5;
12791std::vector<int> vfree(0);
12792solutions.AddSolution(vinfos,vfree);
12793}
12794}
12795}
12796
12797}
12798
12799}
12800
12801} else
12802{
12803{
12804IkReal j3array[1], cj3array[1], sj3array[1];
12805bool j3valid[1]={false};
12806_nj3 = 1;
12807CheckValue<IkReal> x998 = IKatan2WithCheck(IkReal((gconst10*gconst11)),IkReal(gconst11*gconst11),IKFAST_ATAN2_MAGTHRESH);
12808if(!x998.valid){
12809continue;
12810}
12811CheckValue<IkReal> x999=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst10*new_r10))+(((-1.0)*gconst11*new_r00)))),-1);
12812if(!x999.valid){
12813continue;
12814}
12815j3array[0]=((-1.5707963267949)+(x998.value)+(((1.5707963267949)*(x999.value))));
12816sj3array[0]=IKsin(j3array[0]);
12817cj3array[0]=IKcos(j3array[0]);
12818if( j3array[0] > IKPI )
12819{
12820 j3array[0]-=IK2PI;
12821}
12822else if( j3array[0] < -IKPI )
12823{ j3array[0]+=IK2PI;
12824}
12825j3valid[0] = true;
12826for(int ij3 = 0; ij3 < 1; ++ij3)
12827{
12828if( !j3valid[ij3] )
12829{
12830 continue;
12831}
12832_ij3[0] = ij3; _ij3[1] = -1;
12833for(int iij3 = ij3+1; iij3 < 1; ++iij3)
12834{
12835if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
12836{
12837 j3valid[iij3]=false; _ij3[1] = iij3; break;
12838}
12839}
12840j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
12841{
12842IkReal evalcond[6];
12843IkReal x1000=IKsin(j3);
12844IkReal x1001=IKcos(j3);
12845IkReal x1002=(gconst11*x1000);
12846IkReal x1003=(gconst10*x1000);
12847IkReal x1004=(gconst11*x1001);
12848IkReal x1005=((1.0)*x1001);
12849IkReal x1006=(gconst10*x1005);
12850evalcond[0]=(x1002+(((-1.0)*x1006)));
12851evalcond[1]=(gconst11+((new_r10*x1000))+((new_r00*x1001)));
12852evalcond[2]=(x1004+x1003+new_r00);
12853evalcond[3]=(gconst10+(((-1.0)*new_r10*x1005))+((new_r00*x1000)));
12854evalcond[4]=((((-1.0)*x1003))+(((-1.0)*x1004)));
12855evalcond[5]=(x1002+(((-1.0)*x1006))+new_r10);
12856if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
12857{
12858continue;
12859}
12860}
12861
12862{
12863std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
12864vinfos[0].jointtype = 1;
12865vinfos[0].foffset = j0;
12866vinfos[0].indices[0] = _ij0[0];
12867vinfos[0].indices[1] = _ij0[1];
12868vinfos[0].maxsolutions = _nj0;
12869vinfos[1].jointtype = 1;
12870vinfos[1].foffset = j1;
12871vinfos[1].indices[0] = _ij1[0];
12872vinfos[1].indices[1] = _ij1[1];
12873vinfos[1].maxsolutions = _nj1;
12874vinfos[2].jointtype = 1;
12875vinfos[2].foffset = j2;
12876vinfos[2].indices[0] = _ij2[0];
12877vinfos[2].indices[1] = _ij2[1];
12878vinfos[2].maxsolutions = _nj2;
12879vinfos[3].jointtype = 1;
12880vinfos[3].foffset = j3;
12881vinfos[3].indices[0] = _ij3[0];
12882vinfos[3].indices[1] = _ij3[1];
12883vinfos[3].maxsolutions = _nj3;
12884vinfos[4].jointtype = 1;
12885vinfos[4].foffset = j4;
12886vinfos[4].indices[0] = _ij4[0];
12887vinfos[4].indices[1] = _ij4[1];
12888vinfos[4].maxsolutions = _nj4;
12889vinfos[5].jointtype = 1;
12890vinfos[5].foffset = j5;
12891vinfos[5].indices[0] = _ij5[0];
12892vinfos[5].indices[1] = _ij5[1];
12893vinfos[5].maxsolutions = _nj5;
12894std::vector<int> vfree(0);
12895solutions.AddSolution(vinfos,vfree);
12896}
12897}
12898}
12899
12900}
12901
12902}
12903
12904}
12905} while(0);
12906if( bgotonextstatement )
12907{
12908bool bgotonextstatement = true;
12909do
12910{
12911evalcond[0]=((IKabs(new_r10))+(IKabs(new_r01)));
12912if( IKabs(evalcond[0]) < 0.0000050000000000 )
12913{
12914bgotonextstatement=false;
12915{
12916IkReal j3eval[1];
12917CheckValue<IkReal> x1008 = IKatan2WithCheck(IkReal(0),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH);
12918if(!x1008.valid){
12919continue;
12920}
12921IkReal x1007=((1.0)*(x1008.value));
12922sj4=0;
12923cj4=-1.0;
12924j4=3.14159265358979;
12925sj5=gconst10;
12926cj5=gconst11;
12927j5=((3.14159265)+(((-1.0)*x1007)));
12928new_r01=0;
12929new_r10=0;
12930IkReal gconst9=((3.14159265358979)+(((-1.0)*x1007)));
12931IkReal gconst10=0;
12932IkReal x1009 = new_r00*new_r00;
12933if(IKabs(x1009)==0){
12934continue;
12935}
12936IkReal gconst11=((1.0)*new_r00*(pow(x1009,-0.5)));
12937j3eval[0]=new_r11;
12938if( IKabs(j3eval[0]) < 0.0000010000000000 )
12939{
12940{
12941IkReal j3array[2], cj3array[2], sj3array[2];
12942bool j3valid[2]={false};
12943_nj3 = 2;
12944CheckValue<IkReal> x1010=IKPowWithIntegerCheck(gconst11,-1);
12945if(!x1010.valid){
12946continue;
12947}
12948cj3array[0]=(new_r11*(x1010.value));
12949if( cj3array[0] >= -1-IKFAST_SINCOS_THRESH && cj3array[0] <= 1+IKFAST_SINCOS_THRESH )
12950{
12951 j3valid[0] = j3valid[1] = true;
12952 j3array[0] = IKacos(cj3array[0]);
12953 sj3array[0] = IKsin(j3array[0]);
12954 cj3array[1] = cj3array[0];
12955 j3array[1] = -j3array[0];
12956 sj3array[1] = -sj3array[0];
12957}
12958else if( isnan(cj3array[0]) )
12959{
12960 // probably any value will work
12961 j3valid[0] = true;
12962 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
12963}
12964for(int ij3 = 0; ij3 < 2; ++ij3)
12965{
12966if( !j3valid[ij3] )
12967{
12968 continue;
12969}
12970_ij3[0] = ij3; _ij3[1] = -1;
12971for(int iij3 = ij3+1; iij3 < 2; ++iij3)
12972{
12973if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
12974{
12975 j3valid[iij3]=false; _ij3[1] = iij3; break;
12976}
12977}
12978j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
12979{
12980IkReal evalcond[6];
12981IkReal x1011=IKsin(j3);
12982IkReal x1012=IKcos(j3);
12983evalcond[0]=(new_r00*x1011);
12984evalcond[1]=(new_r11*x1011);
12985evalcond[2]=(gconst11*x1011);
12986evalcond[3]=(gconst11+((new_r00*x1012)));
12987evalcond[4]=(((gconst11*x1012))+new_r00);
12988evalcond[5]=((((-1.0)*new_r11*x1012))+gconst11);
12989if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
12990{
12991continue;
12992}
12993}
12994
12995{
12996std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
12997vinfos[0].jointtype = 1;
12998vinfos[0].foffset = j0;
12999vinfos[0].indices[0] = _ij0[0];
13000vinfos[0].indices[1] = _ij0[1];
13001vinfos[0].maxsolutions = _nj0;
13002vinfos[1].jointtype = 1;
13003vinfos[1].foffset = j1;
13004vinfos[1].indices[0] = _ij1[0];
13005vinfos[1].indices[1] = _ij1[1];
13006vinfos[1].maxsolutions = _nj1;
13007vinfos[2].jointtype = 1;
13008vinfos[2].foffset = j2;
13009vinfos[2].indices[0] = _ij2[0];
13010vinfos[2].indices[1] = _ij2[1];
13011vinfos[2].maxsolutions = _nj2;
13012vinfos[3].jointtype = 1;
13013vinfos[3].foffset = j3;
13014vinfos[3].indices[0] = _ij3[0];
13015vinfos[3].indices[1] = _ij3[1];
13016vinfos[3].maxsolutions = _nj3;
13017vinfos[4].jointtype = 1;
13018vinfos[4].foffset = j4;
13019vinfos[4].indices[0] = _ij4[0];
13020vinfos[4].indices[1] = _ij4[1];
13021vinfos[4].maxsolutions = _nj4;
13022vinfos[5].jointtype = 1;
13023vinfos[5].foffset = j5;
13024vinfos[5].indices[0] = _ij5[0];
13025vinfos[5].indices[1] = _ij5[1];
13026vinfos[5].maxsolutions = _nj5;
13027std::vector<int> vfree(0);
13028solutions.AddSolution(vinfos,vfree);
13029}
13030}
13031}
13032
13033} else
13034{
13035{
13036IkReal j3array[2], cj3array[2], sj3array[2];
13037bool j3valid[2]={false};
13038_nj3 = 2;
13040if(!x1013.valid){
13041continue;
13042}
13043cj3array[0]=(gconst11*(x1013.value));
13044if( cj3array[0] >= -1-IKFAST_SINCOS_THRESH && cj3array[0] <= 1+IKFAST_SINCOS_THRESH )
13045{
13046 j3valid[0] = j3valid[1] = true;
13047 j3array[0] = IKacos(cj3array[0]);
13048 sj3array[0] = IKsin(j3array[0]);
13049 cj3array[1] = cj3array[0];
13050 j3array[1] = -j3array[0];
13051 sj3array[1] = -sj3array[0];
13052}
13053else if( isnan(cj3array[0]) )
13054{
13055 // probably any value will work
13056 j3valid[0] = true;
13057 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
13058}
13059for(int ij3 = 0; ij3 < 2; ++ij3)
13060{
13061if( !j3valid[ij3] )
13062{
13063 continue;
13064}
13065_ij3[0] = ij3; _ij3[1] = -1;
13066for(int iij3 = ij3+1; iij3 < 2; ++iij3)
13067{
13068if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
13069{
13070 j3valid[iij3]=false; _ij3[1] = iij3; break;
13071}
13072}
13073j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
13074{
13075IkReal evalcond[6];
13076IkReal x1014=IKsin(j3);
13077IkReal x1015=IKcos(j3);
13078IkReal x1016=(gconst11*x1015);
13079evalcond[0]=(new_r00*x1014);
13080evalcond[1]=(new_r11*x1014);
13081evalcond[2]=(gconst11*x1014);
13082evalcond[3]=(gconst11+((new_r00*x1015)));
13083evalcond[4]=(x1016+new_r00);
13084evalcond[5]=(new_r11+(((-1.0)*x1016)));
13085if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
13086{
13087continue;
13088}
13089}
13090
13091{
13092std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
13093vinfos[0].jointtype = 1;
13094vinfos[0].foffset = j0;
13095vinfos[0].indices[0] = _ij0[0];
13096vinfos[0].indices[1] = _ij0[1];
13097vinfos[0].maxsolutions = _nj0;
13098vinfos[1].jointtype = 1;
13099vinfos[1].foffset = j1;
13100vinfos[1].indices[0] = _ij1[0];
13101vinfos[1].indices[1] = _ij1[1];
13102vinfos[1].maxsolutions = _nj1;
13103vinfos[2].jointtype = 1;
13104vinfos[2].foffset = j2;
13105vinfos[2].indices[0] = _ij2[0];
13106vinfos[2].indices[1] = _ij2[1];
13107vinfos[2].maxsolutions = _nj2;
13108vinfos[3].jointtype = 1;
13109vinfos[3].foffset = j3;
13110vinfos[3].indices[0] = _ij3[0];
13111vinfos[3].indices[1] = _ij3[1];
13112vinfos[3].maxsolutions = _nj3;
13113vinfos[4].jointtype = 1;
13114vinfos[4].foffset = j4;
13115vinfos[4].indices[0] = _ij4[0];
13116vinfos[4].indices[1] = _ij4[1];
13117vinfos[4].maxsolutions = _nj4;
13118vinfos[5].jointtype = 1;
13119vinfos[5].foffset = j5;
13120vinfos[5].indices[0] = _ij5[0];
13121vinfos[5].indices[1] = _ij5[1];
13122vinfos[5].maxsolutions = _nj5;
13123std::vector<int> vfree(0);
13124solutions.AddSolution(vinfos,vfree);
13125}
13126}
13127}
13128
13129}
13130
13131}
13132
13133}
13134} while(0);
13135if( bgotonextstatement )
13136{
13137bool bgotonextstatement = true;
13138do
13139{
13140evalcond[0]=IKabs(new_r00);
13141if( IKabs(evalcond[0]) < 0.0000050000000000 )
13142{
13143bgotonextstatement=false;
13144{
13145IkReal j3eval[1];
13147if(!x1018.valid){
13148continue;
13149}
13150IkReal x1017=((1.0)*(x1018.value));
13151sj4=0;
13152cj4=-1.0;
13153j4=3.14159265358979;
13154sj5=gconst10;
13155cj5=gconst11;
13156j5=((3.14159265)+(((-1.0)*x1017)));
13157new_r00=0;
13158IkReal gconst9=((3.14159265358979)+(((-1.0)*x1017)));
13159IkReal x1019 = new_r10*new_r10;
13160if(IKabs(x1019)==0){
13161continue;
13162}
13163IkReal gconst10=((1.0)*new_r10*(pow(x1019,-0.5)));
13164IkReal gconst11=0;
13165j3eval[0]=((IKabs(new_r11))+(IKabs(new_r01)));
13166if( IKabs(j3eval[0]) < 0.0000010000000000 )
13167{
13168{
13169IkReal j3eval[1];
13171if(!x1021.valid){
13172continue;
13173}
13174IkReal x1020=((1.0)*(x1021.value));
13175sj4=0;
13176cj4=-1.0;
13177j4=3.14159265358979;
13178sj5=gconst10;
13179cj5=gconst11;
13180j5=((3.14159265)+(((-1.0)*x1020)));
13181new_r00=0;
13182IkReal gconst9=((3.14159265358979)+(((-1.0)*x1020)));
13183IkReal x1022 = new_r10*new_r10;
13184if(IKabs(x1022)==0){
13185continue;
13186}
13187IkReal gconst10=((1.0)*new_r10*(pow(x1022,-0.5)));
13188IkReal gconst11=0;
13189j3eval[0]=((IKabs(new_r11))+(IKabs(new_r10)));
13190if( IKabs(j3eval[0]) < 0.0000010000000000 )
13191{
13192{
13193IkReal j3eval[1];
13195if(!x1024.valid){
13196continue;
13197}
13198IkReal x1023=((1.0)*(x1024.value));
13199sj4=0;
13200cj4=-1.0;
13201j4=3.14159265358979;
13202sj5=gconst10;
13203cj5=gconst11;
13204j5=((3.14159265)+(((-1.0)*x1023)));
13205new_r00=0;
13206IkReal gconst9=((3.14159265358979)+(((-1.0)*x1023)));
13207IkReal x1025 = new_r10*new_r10;
13208if(IKabs(x1025)==0){
13209continue;
13210}
13211IkReal gconst10=((1.0)*new_r10*(pow(x1025,-0.5)));
13212IkReal gconst11=0;
13213j3eval[0]=new_r10;
13214if( IKabs(j3eval[0]) < 0.0000010000000000 )
13215{
13216continue; // 3 cases reached
13217
13218} else
13219{
13220{
13221IkReal j3array[1], cj3array[1], sj3array[1];
13222bool j3valid[1]={false};
13223_nj3 = 1;
13224CheckValue<IkReal> x1026=IKPowWithIntegerCheck(gconst10,-1);
13225if(!x1026.valid){
13226continue;
13227}
13229if(!x1027.valid){
13230continue;
13231}
13232if( IKabs((new_r11*(x1026.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst10*(x1027.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((new_r11*(x1026.value)))+IKsqr((gconst10*(x1027.value)))-1) <= IKFAST_SINCOS_THRESH )
13233 continue;
13234j3array[0]=IKatan2((new_r11*(x1026.value)), (gconst10*(x1027.value)));
13235sj3array[0]=IKsin(j3array[0]);
13236cj3array[0]=IKcos(j3array[0]);
13237if( j3array[0] > IKPI )
13238{
13239 j3array[0]-=IK2PI;
13240}
13241else if( j3array[0] < -IKPI )
13242{ j3array[0]+=IK2PI;
13243}
13244j3valid[0] = true;
13245for(int ij3 = 0; ij3 < 1; ++ij3)
13246{
13247if( !j3valid[ij3] )
13248{
13249 continue;
13250}
13251_ij3[0] = ij3; _ij3[1] = -1;
13252for(int iij3 = ij3+1; iij3 < 1; ++iij3)
13253{
13254if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
13255{
13256 j3valid[iij3]=false; _ij3[1] = iij3; break;
13257}
13258}
13259j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
13260{
13261IkReal evalcond[8];
13262IkReal x1028=IKsin(j3);
13263IkReal x1029=IKcos(j3);
13264IkReal x1030=(gconst10*x1028);
13265IkReal x1031=((1.0)*x1029);
13266IkReal x1032=(gconst10*x1031);
13267evalcond[0]=(new_r10*x1028);
13268evalcond[1]=x1030;
13269evalcond[2]=(gconst10+(((-1.0)*new_r10*x1031)));
13270evalcond[3]=((((-1.0)*x1032))+new_r01);
13271evalcond[4]=((((-1.0)*x1030))+new_r11);
13272evalcond[5]=((((-1.0)*x1032))+new_r10);
13273evalcond[6]=((((-1.0)*new_r11*x1031))+((new_r01*x1028)));
13274evalcond[7]=(((new_r11*x1028))+(((-1.0)*gconst10))+((new_r01*x1029)));
13275if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
13276{
13277continue;
13278}
13279}
13280
13281{
13282std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
13283vinfos[0].jointtype = 1;
13284vinfos[0].foffset = j0;
13285vinfos[0].indices[0] = _ij0[0];
13286vinfos[0].indices[1] = _ij0[1];
13287vinfos[0].maxsolutions = _nj0;
13288vinfos[1].jointtype = 1;
13289vinfos[1].foffset = j1;
13290vinfos[1].indices[0] = _ij1[0];
13291vinfos[1].indices[1] = _ij1[1];
13292vinfos[1].maxsolutions = _nj1;
13293vinfos[2].jointtype = 1;
13294vinfos[2].foffset = j2;
13295vinfos[2].indices[0] = _ij2[0];
13296vinfos[2].indices[1] = _ij2[1];
13297vinfos[2].maxsolutions = _nj2;
13298vinfos[3].jointtype = 1;
13299vinfos[3].foffset = j3;
13300vinfos[3].indices[0] = _ij3[0];
13301vinfos[3].indices[1] = _ij3[1];
13302vinfos[3].maxsolutions = _nj3;
13303vinfos[4].jointtype = 1;
13304vinfos[4].foffset = j4;
13305vinfos[4].indices[0] = _ij4[0];
13306vinfos[4].indices[1] = _ij4[1];
13307vinfos[4].maxsolutions = _nj4;
13308vinfos[5].jointtype = 1;
13309vinfos[5].foffset = j5;
13310vinfos[5].indices[0] = _ij5[0];
13311vinfos[5].indices[1] = _ij5[1];
13312vinfos[5].maxsolutions = _nj5;
13313std::vector<int> vfree(0);
13314solutions.AddSolution(vinfos,vfree);
13315}
13316}
13317}
13318
13319}
13320
13321}
13322
13323} else
13324{
13325{
13326IkReal j3array[1], cj3array[1], sj3array[1];
13327bool j3valid[1]={false};
13328_nj3 = 1;
13330if(!x1033.valid){
13331continue;
13332}
13334if(!x1034.valid){
13335continue;
13336}
13337j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1033.value)))+(x1034.value));
13338sj3array[0]=IKsin(j3array[0]);
13339cj3array[0]=IKcos(j3array[0]);
13340if( j3array[0] > IKPI )
13341{
13342 j3array[0]-=IK2PI;
13343}
13344else if( j3array[0] < -IKPI )
13345{ j3array[0]+=IK2PI;
13346}
13347j3valid[0] = true;
13348for(int ij3 = 0; ij3 < 1; ++ij3)
13349{
13350if( !j3valid[ij3] )
13351{
13352 continue;
13353}
13354_ij3[0] = ij3; _ij3[1] = -1;
13355for(int iij3 = ij3+1; iij3 < 1; ++iij3)
13356{
13357if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
13358{
13359 j3valid[iij3]=false; _ij3[1] = iij3; break;
13360}
13361}
13362j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
13363{
13364IkReal evalcond[8];
13365IkReal x1035=IKsin(j3);
13366IkReal x1036=IKcos(j3);
13367IkReal x1037=(gconst10*x1035);
13368IkReal x1038=((1.0)*x1036);
13369IkReal x1039=(gconst10*x1038);
13370evalcond[0]=(new_r10*x1035);
13371evalcond[1]=x1037;
13372evalcond[2]=(gconst10+(((-1.0)*new_r10*x1038)));
13373evalcond[3]=((((-1.0)*x1039))+new_r01);
13374evalcond[4]=((((-1.0)*x1037))+new_r11);
13375evalcond[5]=((((-1.0)*x1039))+new_r10);
13376evalcond[6]=((((-1.0)*new_r11*x1038))+((new_r01*x1035)));
13377evalcond[7]=(((new_r11*x1035))+(((-1.0)*gconst10))+((new_r01*x1036)));
13378if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
13379{
13380continue;
13381}
13382}
13383
13384{
13385std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
13386vinfos[0].jointtype = 1;
13387vinfos[0].foffset = j0;
13388vinfos[0].indices[0] = _ij0[0];
13389vinfos[0].indices[1] = _ij0[1];
13390vinfos[0].maxsolutions = _nj0;
13391vinfos[1].jointtype = 1;
13392vinfos[1].foffset = j1;
13393vinfos[1].indices[0] = _ij1[0];
13394vinfos[1].indices[1] = _ij1[1];
13395vinfos[1].maxsolutions = _nj1;
13396vinfos[2].jointtype = 1;
13397vinfos[2].foffset = j2;
13398vinfos[2].indices[0] = _ij2[0];
13399vinfos[2].indices[1] = _ij2[1];
13400vinfos[2].maxsolutions = _nj2;
13401vinfos[3].jointtype = 1;
13402vinfos[3].foffset = j3;
13403vinfos[3].indices[0] = _ij3[0];
13404vinfos[3].indices[1] = _ij3[1];
13405vinfos[3].maxsolutions = _nj3;
13406vinfos[4].jointtype = 1;
13407vinfos[4].foffset = j4;
13408vinfos[4].indices[0] = _ij4[0];
13409vinfos[4].indices[1] = _ij4[1];
13410vinfos[4].maxsolutions = _nj4;
13411vinfos[5].jointtype = 1;
13412vinfos[5].foffset = j5;
13413vinfos[5].indices[0] = _ij5[0];
13414vinfos[5].indices[1] = _ij5[1];
13415vinfos[5].maxsolutions = _nj5;
13416std::vector<int> vfree(0);
13417solutions.AddSolution(vinfos,vfree);
13418}
13419}
13420}
13421
13422}
13423
13424}
13425
13426} else
13427{
13428{
13429IkReal j3array[1], cj3array[1], sj3array[1];
13430bool j3valid[1]={false};
13431_nj3 = 1;
13433if(!x1040.valid){
13434continue;
13435}
13437if(!x1041.valid){
13438continue;
13439}
13440j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1040.value)))+(x1041.value));
13441sj3array[0]=IKsin(j3array[0]);
13442cj3array[0]=IKcos(j3array[0]);
13443if( j3array[0] > IKPI )
13444{
13445 j3array[0]-=IK2PI;
13446}
13447else if( j3array[0] < -IKPI )
13448{ j3array[0]+=IK2PI;
13449}
13450j3valid[0] = true;
13451for(int ij3 = 0; ij3 < 1; ++ij3)
13452{
13453if( !j3valid[ij3] )
13454{
13455 continue;
13456}
13457_ij3[0] = ij3; _ij3[1] = -1;
13458for(int iij3 = ij3+1; iij3 < 1; ++iij3)
13459{
13460if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
13461{
13462 j3valid[iij3]=false; _ij3[1] = iij3; break;
13463}
13464}
13465j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
13466{
13467IkReal evalcond[8];
13468IkReal x1042=IKsin(j3);
13469IkReal x1043=IKcos(j3);
13470IkReal x1044=(gconst10*x1042);
13471IkReal x1045=((1.0)*x1043);
13472IkReal x1046=(gconst10*x1045);
13473evalcond[0]=(new_r10*x1042);
13474evalcond[1]=x1044;
13475evalcond[2]=(gconst10+(((-1.0)*new_r10*x1045)));
13476evalcond[3]=(new_r01+(((-1.0)*x1046)));
13477evalcond[4]=((((-1.0)*x1044))+new_r11);
13478evalcond[5]=(new_r10+(((-1.0)*x1046)));
13479evalcond[6]=(((new_r01*x1042))+(((-1.0)*new_r11*x1045)));
13480evalcond[7]=(((new_r11*x1042))+((new_r01*x1043))+(((-1.0)*gconst10)));
13481if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
13482{
13483continue;
13484}
13485}
13486
13487{
13488std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
13489vinfos[0].jointtype = 1;
13490vinfos[0].foffset = j0;
13491vinfos[0].indices[0] = _ij0[0];
13492vinfos[0].indices[1] = _ij0[1];
13493vinfos[0].maxsolutions = _nj0;
13494vinfos[1].jointtype = 1;
13495vinfos[1].foffset = j1;
13496vinfos[1].indices[0] = _ij1[0];
13497vinfos[1].indices[1] = _ij1[1];
13498vinfos[1].maxsolutions = _nj1;
13499vinfos[2].jointtype = 1;
13500vinfos[2].foffset = j2;
13501vinfos[2].indices[0] = _ij2[0];
13502vinfos[2].indices[1] = _ij2[1];
13503vinfos[2].maxsolutions = _nj2;
13504vinfos[3].jointtype = 1;
13505vinfos[3].foffset = j3;
13506vinfos[3].indices[0] = _ij3[0];
13507vinfos[3].indices[1] = _ij3[1];
13508vinfos[3].maxsolutions = _nj3;
13509vinfos[4].jointtype = 1;
13510vinfos[4].foffset = j4;
13511vinfos[4].indices[0] = _ij4[0];
13512vinfos[4].indices[1] = _ij4[1];
13513vinfos[4].maxsolutions = _nj4;
13514vinfos[5].jointtype = 1;
13515vinfos[5].foffset = j5;
13516vinfos[5].indices[0] = _ij5[0];
13517vinfos[5].indices[1] = _ij5[1];
13518vinfos[5].maxsolutions = _nj5;
13519std::vector<int> vfree(0);
13520solutions.AddSolution(vinfos,vfree);
13521}
13522}
13523}
13524
13525}
13526
13527}
13528
13529}
13530} while(0);
13531if( bgotonextstatement )
13532{
13533bool bgotonextstatement = true;
13534do
13535{
13536if( 1 )
13537{
13538bgotonextstatement=false;
13539continue; // branch miss [j3]
13540
13541}
13542} while(0);
13543if( bgotonextstatement )
13544{
13545}
13546}
13547}
13548}
13549}
13550}
13551
13552} else
13553{
13554{
13555IkReal j3array[1], cj3array[1], sj3array[1];
13556bool j3valid[1]={false};
13557_nj3 = 1;
13558CheckValue<IkReal> x1047 = IKatan2WithCheck(IkReal((((gconst10*gconst11))+((new_r00*new_r10)))),IkReal(((((-1.0)*(new_r10*new_r10)))+(gconst11*gconst11))),IKFAST_ATAN2_MAGTHRESH);
13559if(!x1047.valid){
13560continue;
13561}
13562CheckValue<IkReal> x1048=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst10*new_r10))+(((-1.0)*gconst11*new_r00)))),-1);
13563if(!x1048.valid){
13564continue;
13565}
13566j3array[0]=((-1.5707963267949)+(x1047.value)+(((1.5707963267949)*(x1048.value))));
13567sj3array[0]=IKsin(j3array[0]);
13568cj3array[0]=IKcos(j3array[0]);
13569if( j3array[0] > IKPI )
13570{
13571 j3array[0]-=IK2PI;
13572}
13573else if( j3array[0] < -IKPI )
13574{ j3array[0]+=IK2PI;
13575}
13576j3valid[0] = true;
13577for(int ij3 = 0; ij3 < 1; ++ij3)
13578{
13579if( !j3valid[ij3] )
13580{
13581 continue;
13582}
13583_ij3[0] = ij3; _ij3[1] = -1;
13584for(int iij3 = ij3+1; iij3 < 1; ++iij3)
13585{
13586if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
13587{
13588 j3valid[iij3]=false; _ij3[1] = iij3; break;
13589}
13590}
13591j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
13592{
13593IkReal evalcond[8];
13594IkReal x1049=IKcos(j3);
13595IkReal x1050=IKsin(j3);
13596IkReal x1051=((1.0)*gconst10);
13597IkReal x1052=(gconst11*x1050);
13598IkReal x1053=(gconst10*x1050);
13599IkReal x1054=(gconst11*x1049);
13600IkReal x1055=((1.0)*x1049);
13601IkReal x1056=(x1049*x1051);
13602evalcond[0]=(gconst11+((new_r00*x1049))+((new_r10*x1050)));
13603evalcond[1]=(x1053+x1054+new_r00);
13604evalcond[2]=(gconst10+((new_r00*x1050))+(((-1.0)*new_r10*x1055)));
13605evalcond[3]=(gconst11+((new_r01*x1050))+(((-1.0)*new_r11*x1055)));
13606evalcond[4]=((((-1.0)*x1056))+x1052+new_r01);
13607evalcond[5]=((((-1.0)*x1056))+x1052+new_r10);
13608evalcond[6]=((((-1.0)*x1051))+((new_r01*x1049))+((new_r11*x1050)));
13609evalcond[7]=((((-1.0)*x1054))+new_r11+(((-1.0)*x1050*x1051)));
13610if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
13611{
13612continue;
13613}
13614}
13615
13616{
13617std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
13618vinfos[0].jointtype = 1;
13619vinfos[0].foffset = j0;
13620vinfos[0].indices[0] = _ij0[0];
13621vinfos[0].indices[1] = _ij0[1];
13622vinfos[0].maxsolutions = _nj0;
13623vinfos[1].jointtype = 1;
13624vinfos[1].foffset = j1;
13625vinfos[1].indices[0] = _ij1[0];
13626vinfos[1].indices[1] = _ij1[1];
13627vinfos[1].maxsolutions = _nj1;
13628vinfos[2].jointtype = 1;
13629vinfos[2].foffset = j2;
13630vinfos[2].indices[0] = _ij2[0];
13631vinfos[2].indices[1] = _ij2[1];
13632vinfos[2].maxsolutions = _nj2;
13633vinfos[3].jointtype = 1;
13634vinfos[3].foffset = j3;
13635vinfos[3].indices[0] = _ij3[0];
13636vinfos[3].indices[1] = _ij3[1];
13637vinfos[3].maxsolutions = _nj3;
13638vinfos[4].jointtype = 1;
13639vinfos[4].foffset = j4;
13640vinfos[4].indices[0] = _ij4[0];
13641vinfos[4].indices[1] = _ij4[1];
13642vinfos[4].maxsolutions = _nj4;
13643vinfos[5].jointtype = 1;
13644vinfos[5].foffset = j5;
13645vinfos[5].indices[0] = _ij5[0];
13646vinfos[5].indices[1] = _ij5[1];
13647vinfos[5].maxsolutions = _nj5;
13648std::vector<int> vfree(0);
13649solutions.AddSolution(vinfos,vfree);
13650}
13651}
13652}
13653
13654}
13655
13656}
13657
13658} else
13659{
13660{
13661IkReal j3array[1], cj3array[1], sj3array[1];
13662bool j3valid[1]={false};
13663_nj3 = 1;
13664IkReal x1057=((1.0)*new_r10);
13665CheckValue<IkReal> x1058 = IKatan2WithCheck(IkReal((((gconst10*gconst11))+((new_r00*new_r01)))),IkReal(((((-1.0)*new_r01*x1057))+(gconst11*gconst11))),IKFAST_ATAN2_MAGTHRESH);
13666if(!x1058.valid){
13667continue;
13668}
13669CheckValue<IkReal> x1059=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst10*x1057))+(((-1.0)*gconst11*new_r00)))),-1);
13670if(!x1059.valid){
13671continue;
13672}
13673j3array[0]=((-1.5707963267949)+(x1058.value)+(((1.5707963267949)*(x1059.value))));
13674sj3array[0]=IKsin(j3array[0]);
13675cj3array[0]=IKcos(j3array[0]);
13676if( j3array[0] > IKPI )
13677{
13678 j3array[0]-=IK2PI;
13679}
13680else if( j3array[0] < -IKPI )
13681{ j3array[0]+=IK2PI;
13682}
13683j3valid[0] = true;
13684for(int ij3 = 0; ij3 < 1; ++ij3)
13685{
13686if( !j3valid[ij3] )
13687{
13688 continue;
13689}
13690_ij3[0] = ij3; _ij3[1] = -1;
13691for(int iij3 = ij3+1; iij3 < 1; ++iij3)
13692{
13693if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
13694{
13695 j3valid[iij3]=false; _ij3[1] = iij3; break;
13696}
13697}
13698j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
13699{
13700IkReal evalcond[8];
13701IkReal x1060=IKcos(j3);
13702IkReal x1061=IKsin(j3);
13703IkReal x1062=((1.0)*gconst10);
13704IkReal x1063=(gconst11*x1061);
13705IkReal x1064=(gconst10*x1061);
13706IkReal x1065=(gconst11*x1060);
13707IkReal x1066=((1.0)*x1060);
13708IkReal x1067=(x1060*x1062);
13709evalcond[0]=(gconst11+((new_r00*x1060))+((new_r10*x1061)));
13710evalcond[1]=(x1065+x1064+new_r00);
13711evalcond[2]=((((-1.0)*new_r10*x1066))+gconst10+((new_r00*x1061)));
13712evalcond[3]=(gconst11+((new_r01*x1061))+(((-1.0)*new_r11*x1066)));
13713evalcond[4]=(x1063+new_r01+(((-1.0)*x1067)));
13714evalcond[5]=(x1063+new_r10+(((-1.0)*x1067)));
13715evalcond[6]=(((new_r01*x1060))+((new_r11*x1061))+(((-1.0)*x1062)));
13716evalcond[7]=((((-1.0)*x1061*x1062))+new_r11+(((-1.0)*x1065)));
13717if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
13718{
13719continue;
13720}
13721}
13722
13723{
13724std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
13725vinfos[0].jointtype = 1;
13726vinfos[0].foffset = j0;
13727vinfos[0].indices[0] = _ij0[0];
13728vinfos[0].indices[1] = _ij0[1];
13729vinfos[0].maxsolutions = _nj0;
13730vinfos[1].jointtype = 1;
13731vinfos[1].foffset = j1;
13732vinfos[1].indices[0] = _ij1[0];
13733vinfos[1].indices[1] = _ij1[1];
13734vinfos[1].maxsolutions = _nj1;
13735vinfos[2].jointtype = 1;
13736vinfos[2].foffset = j2;
13737vinfos[2].indices[0] = _ij2[0];
13738vinfos[2].indices[1] = _ij2[1];
13739vinfos[2].maxsolutions = _nj2;
13740vinfos[3].jointtype = 1;
13741vinfos[3].foffset = j3;
13742vinfos[3].indices[0] = _ij3[0];
13743vinfos[3].indices[1] = _ij3[1];
13744vinfos[3].maxsolutions = _nj3;
13745vinfos[4].jointtype = 1;
13746vinfos[4].foffset = j4;
13747vinfos[4].indices[0] = _ij4[0];
13748vinfos[4].indices[1] = _ij4[1];
13749vinfos[4].maxsolutions = _nj4;
13750vinfos[5].jointtype = 1;
13751vinfos[5].foffset = j5;
13752vinfos[5].indices[0] = _ij5[0];
13753vinfos[5].indices[1] = _ij5[1];
13754vinfos[5].maxsolutions = _nj5;
13755std::vector<int> vfree(0);
13756solutions.AddSolution(vinfos,vfree);
13757}
13758}
13759}
13760
13761}
13762
13763}
13764
13765} else
13766{
13767{
13768IkReal j3array[1], cj3array[1], sj3array[1];
13769bool j3valid[1]={false};
13770_nj3 = 1;
13771IkReal x1068=((1.0)*new_r10);
13772CheckValue<IkReal> x1069=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r00*new_r01))+(((-1.0)*new_r11*x1068)))),-1);
13773if(!x1069.valid){
13774continue;
13775}
13776CheckValue<IkReal> x1070 = IKatan2WithCheck(IkReal((((gconst11*new_r00))+((gconst11*new_r11)))),IkReal((((gconst11*new_r01))+(((-1.0)*gconst11*x1068)))),IKFAST_ATAN2_MAGTHRESH);
13777if(!x1070.valid){
13778continue;
13779}
13780j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1069.value)))+(x1070.value));
13781sj3array[0]=IKsin(j3array[0]);
13782cj3array[0]=IKcos(j3array[0]);
13783if( j3array[0] > IKPI )
13784{
13785 j3array[0]-=IK2PI;
13786}
13787else if( j3array[0] < -IKPI )
13788{ j3array[0]+=IK2PI;
13789}
13790j3valid[0] = true;
13791for(int ij3 = 0; ij3 < 1; ++ij3)
13792{
13793if( !j3valid[ij3] )
13794{
13795 continue;
13796}
13797_ij3[0] = ij3; _ij3[1] = -1;
13798for(int iij3 = ij3+1; iij3 < 1; ++iij3)
13799{
13800if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
13801{
13802 j3valid[iij3]=false; _ij3[1] = iij3; break;
13803}
13804}
13805j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
13806{
13807IkReal evalcond[8];
13808IkReal x1071=IKcos(j3);
13809IkReal x1072=IKsin(j3);
13810IkReal x1073=((1.0)*gconst10);
13811IkReal x1074=(gconst11*x1072);
13812IkReal x1075=(gconst10*x1072);
13813IkReal x1076=(gconst11*x1071);
13814IkReal x1077=((1.0)*x1071);
13815IkReal x1078=(x1071*x1073);
13816evalcond[0]=(gconst11+((new_r00*x1071))+((new_r10*x1072)));
13817evalcond[1]=(x1076+x1075+new_r00);
13818evalcond[2]=(gconst10+((new_r00*x1072))+(((-1.0)*new_r10*x1077)));
13819evalcond[3]=((((-1.0)*new_r11*x1077))+gconst11+((new_r01*x1072)));
13820evalcond[4]=(x1074+new_r01+(((-1.0)*x1078)));
13821evalcond[5]=(x1074+new_r10+(((-1.0)*x1078)));
13822evalcond[6]=(((new_r01*x1071))+((new_r11*x1072))+(((-1.0)*x1073)));
13823evalcond[7]=((((-1.0)*x1076))+(((-1.0)*x1072*x1073))+new_r11);
13824if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
13825{
13826continue;
13827}
13828}
13829
13830{
13831std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
13832vinfos[0].jointtype = 1;
13833vinfos[0].foffset = j0;
13834vinfos[0].indices[0] = _ij0[0];
13835vinfos[0].indices[1] = _ij0[1];
13836vinfos[0].maxsolutions = _nj0;
13837vinfos[1].jointtype = 1;
13838vinfos[1].foffset = j1;
13839vinfos[1].indices[0] = _ij1[0];
13840vinfos[1].indices[1] = _ij1[1];
13841vinfos[1].maxsolutions = _nj1;
13842vinfos[2].jointtype = 1;
13843vinfos[2].foffset = j2;
13844vinfos[2].indices[0] = _ij2[0];
13845vinfos[2].indices[1] = _ij2[1];
13846vinfos[2].maxsolutions = _nj2;
13847vinfos[3].jointtype = 1;
13848vinfos[3].foffset = j3;
13849vinfos[3].indices[0] = _ij3[0];
13850vinfos[3].indices[1] = _ij3[1];
13851vinfos[3].maxsolutions = _nj3;
13852vinfos[4].jointtype = 1;
13853vinfos[4].foffset = j4;
13854vinfos[4].indices[0] = _ij4[0];
13855vinfos[4].indices[1] = _ij4[1];
13856vinfos[4].maxsolutions = _nj4;
13857vinfos[5].jointtype = 1;
13858vinfos[5].foffset = j5;
13859vinfos[5].indices[0] = _ij5[0];
13860vinfos[5].indices[1] = _ij5[1];
13861vinfos[5].maxsolutions = _nj5;
13862std::vector<int> vfree(0);
13863solutions.AddSolution(vinfos,vfree);
13864}
13865}
13866}
13867
13868}
13869
13870}
13871
13872}
13873} while(0);
13874if( bgotonextstatement )
13875{
13876bool bgotonextstatement = true;
13877do
13878{
13879IkReal x1079=((-1.0)*new_r10);
13880IkReal x1081 = ((new_r10*new_r10)+(new_r00*new_r00));
13881if(IKabs(x1081)==0){
13882continue;
13883}
13884IkReal x1080=pow(x1081,-0.5);
13885CheckValue<IkReal> x1082 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(x1079),IKFAST_ATAN2_MAGTHRESH);
13886if(!x1082.valid){
13887continue;
13888}
13889IkReal gconst12=((-1.0)*(x1082.value));
13890IkReal gconst13=(new_r00*x1080);
13891IkReal gconst14=(x1079*x1080);
13892CheckValue<IkReal> x1083 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(((-1.0)*new_r10)),IKFAST_ATAN2_MAGTHRESH);
13893if(!x1083.valid){
13894continue;
13895}
13896evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((x1083.value)+j5)))), 6.28318530717959)));
13897if( IKabs(evalcond[0]) < 0.0000050000000000 )
13898{
13899bgotonextstatement=false;
13900{
13901IkReal j3eval[3];
13902IkReal x1084=((-1.0)*new_r10);
13903CheckValue<IkReal> x1087 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(x1084),IKFAST_ATAN2_MAGTHRESH);
13904if(!x1087.valid){
13905continue;
13906}
13907IkReal x1085=((-1.0)*(x1087.value));
13908IkReal x1086=x1080;
13909sj4=0;
13910cj4=-1.0;
13911j4=3.14159265358979;
13912sj5=gconst13;
13913cj5=gconst14;
13914j5=x1085;
13915IkReal gconst12=x1085;
13916IkReal gconst13=(new_r00*x1086);
13917IkReal gconst14=(x1084*x1086);
13918IkReal x1088=new_r10*new_r10;
13919IkReal x1089=((1.0)*new_r00);
13920IkReal x1090=((1.0)*new_r10*new_r11);
13921IkReal x1091=((((-1.0)*x1090))+(((-1.0)*new_r01*x1089)));
13922IkReal x1092=x1080;
13923IkReal x1093=(new_r10*x1092);
13924j3eval[0]=x1091;
13925j3eval[1]=((IKabs((((x1088*x1092))+(((-1.0)*new_r01*x1093)))))+(IKabs(((((-1.0)*x1090*x1092))+(((-1.0)*x1089*x1093))))));
13926j3eval[2]=IKsign(x1091);
13927if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
13928{
13929{
13930IkReal j3eval[1];
13931IkReal x1094=((-1.0)*new_r10);
13932CheckValue<IkReal> x1097 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(x1094),IKFAST_ATAN2_MAGTHRESH);
13933if(!x1097.valid){
13934continue;
13935}
13936IkReal x1095=((-1.0)*(x1097.value));
13937IkReal x1096=x1080;
13938sj4=0;
13939cj4=-1.0;
13940j4=3.14159265358979;
13941sj5=gconst13;
13942cj5=gconst14;
13943j5=x1095;
13944IkReal gconst12=x1095;
13945IkReal gconst13=(new_r00*x1096);
13946IkReal gconst14=(x1094*x1096);
13947IkReal x1098=new_r10*new_r10;
13949if(!x1101.valid){
13950continue;
13951}
13952IkReal x1099=x1101.value;
13953IkReal x1100=(new_r00*x1099);
13954j3eval[0]=((IKabs((((new_r00*new_r11))+((x1098*x1099)))))+(IKabs((((new_r01*x1098*x1100))+((new_r10*x1100))+((new_r01*x1100*(new_r00*new_r00)))))));
13955if( IKabs(j3eval[0]) < 0.0000010000000000 )
13956{
13957{
13958IkReal j3eval[1];
13959IkReal x1102=((-1.0)*new_r10);
13960CheckValue<IkReal> x1105 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(x1102),IKFAST_ATAN2_MAGTHRESH);
13961if(!x1105.valid){
13962continue;
13963}
13964IkReal x1103=((-1.0)*(x1105.value));
13965IkReal x1104=x1080;
13966sj4=0;
13967cj4=-1.0;
13968j4=3.14159265358979;
13969sj5=gconst13;
13970cj5=gconst14;
13971j5=x1103;
13972IkReal gconst12=x1103;
13973IkReal gconst13=(new_r00*x1104);
13974IkReal gconst14=(x1102*x1104);
13975IkReal x1106=new_r10*new_r10;
13976IkReal x1107=new_r00*new_r00;
13977CheckValue<IkReal> x1111=IKPowWithIntegerCheck((x1106+x1107),-1);
13978if(!x1111.valid){
13979continue;
13980}
13981IkReal x1108=x1111.value;
13982IkReal x1109=(new_r10*x1108);
13983IkReal x1110=(x1106*x1108);
13984j3eval[0]=((IKabs((x1110+(((-1.0)*x1108*(x1107*x1107)))+(((-1.0)*x1107*x1110)))))+(IKabs((((x1109*(new_r00*new_r00*new_r00)))+((new_r00*x1109))+((new_r00*x1109*(new_r10*new_r10)))))));
13985if( IKabs(j3eval[0]) < 0.0000010000000000 )
13986{
13987{
13988IkReal evalcond[2];
13989bool bgotonextstatement = true;
13990do
13991{
13992evalcond[0]=((IKabs(new_r11))+(IKabs(new_r00)));
13993if( IKabs(evalcond[0]) < 0.0000050000000000 )
13994{
13995bgotonextstatement=false;
13996{
13997IkReal j3eval[1];
13998IkReal x1112=((-1.0)*new_r10);
13999CheckValue<IkReal> x1114 = IKatan2WithCheck(IkReal(0),IkReal(x1112),IKFAST_ATAN2_MAGTHRESH);
14000if(!x1114.valid){
14001continue;
14002}
14003IkReal x1113=((-1.0)*(x1114.value));
14004sj4=0;
14005cj4=-1.0;
14006j4=3.14159265358979;
14007sj5=gconst13;
14008cj5=gconst14;
14009j5=x1113;
14010new_r11=0;
14011new_r00=0;
14012IkReal gconst12=x1113;
14013IkReal gconst13=0;
14014IkReal x1115 = new_r10*new_r10;
14015if(IKabs(x1115)==0){
14016continue;
14017}
14018IkReal gconst14=(x1112*(pow(x1115,-0.5)));
14019j3eval[0]=new_r01;
14020if( IKabs(j3eval[0]) < 0.0000010000000000 )
14021{
14022{
14023IkReal j3array[2], cj3array[2], sj3array[2];
14024bool j3valid[2]={false};
14025_nj3 = 2;
14026CheckValue<IkReal> x1116=IKPowWithIntegerCheck(gconst14,-1);
14027if(!x1116.valid){
14028continue;
14029}
14030sj3array[0]=((-1.0)*new_r01*(x1116.value));
14031if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
14032{
14033 j3valid[0] = j3valid[1] = true;
14034 j3array[0] = IKasin(sj3array[0]);
14035 cj3array[0] = IKcos(j3array[0]);
14036 sj3array[1] = sj3array[0];
14037 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
14038 cj3array[1] = -cj3array[0];
14039}
14040else if( isnan(sj3array[0]) )
14041{
14042 // probably any value will work
14043 j3valid[0] = true;
14044 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
14045}
14046for(int ij3 = 0; ij3 < 2; ++ij3)
14047{
14048if( !j3valid[ij3] )
14049{
14050 continue;
14051}
14052_ij3[0] = ij3; _ij3[1] = -1;
14053for(int iij3 = ij3+1; iij3 < 2; ++iij3)
14054{
14055if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
14056{
14057 j3valid[iij3]=false; _ij3[1] = iij3; break;
14058}
14059}
14060j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
14061{
14062IkReal evalcond[6];
14063IkReal x1117=IKcos(j3);
14064IkReal x1118=IKsin(j3);
14065evalcond[0]=(new_r01*x1117);
14066evalcond[1]=(gconst14*x1117);
14067evalcond[2]=((-1.0)*new_r10*x1117);
14068evalcond[3]=(gconst14+((new_r01*x1118)));
14069evalcond[4]=(gconst14+((new_r10*x1118)));
14070evalcond[5]=(((gconst14*x1118))+new_r10);
14071if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
14072{
14073continue;
14074}
14075}
14076
14077{
14078std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
14079vinfos[0].jointtype = 1;
14080vinfos[0].foffset = j0;
14081vinfos[0].indices[0] = _ij0[0];
14082vinfos[0].indices[1] = _ij0[1];
14083vinfos[0].maxsolutions = _nj0;
14084vinfos[1].jointtype = 1;
14085vinfos[1].foffset = j1;
14086vinfos[1].indices[0] = _ij1[0];
14087vinfos[1].indices[1] = _ij1[1];
14088vinfos[1].maxsolutions = _nj1;
14089vinfos[2].jointtype = 1;
14090vinfos[2].foffset = j2;
14091vinfos[2].indices[0] = _ij2[0];
14092vinfos[2].indices[1] = _ij2[1];
14093vinfos[2].maxsolutions = _nj2;
14094vinfos[3].jointtype = 1;
14095vinfos[3].foffset = j3;
14096vinfos[3].indices[0] = _ij3[0];
14097vinfos[3].indices[1] = _ij3[1];
14098vinfos[3].maxsolutions = _nj3;
14099vinfos[4].jointtype = 1;
14100vinfos[4].foffset = j4;
14101vinfos[4].indices[0] = _ij4[0];
14102vinfos[4].indices[1] = _ij4[1];
14103vinfos[4].maxsolutions = _nj4;
14104vinfos[5].jointtype = 1;
14105vinfos[5].foffset = j5;
14106vinfos[5].indices[0] = _ij5[0];
14107vinfos[5].indices[1] = _ij5[1];
14108vinfos[5].maxsolutions = _nj5;
14109std::vector<int> vfree(0);
14110solutions.AddSolution(vinfos,vfree);
14111}
14112}
14113}
14114
14115} else
14116{
14117{
14118IkReal j3array[2], cj3array[2], sj3array[2];
14119bool j3valid[2]={false};
14120_nj3 = 2;
14122if(!x1119.valid){
14123continue;
14124}
14125sj3array[0]=((-1.0)*gconst14*(x1119.value));
14126if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
14127{
14128 j3valid[0] = j3valid[1] = true;
14129 j3array[0] = IKasin(sj3array[0]);
14130 cj3array[0] = IKcos(j3array[0]);
14131 sj3array[1] = sj3array[0];
14132 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
14133 cj3array[1] = -cj3array[0];
14134}
14135else if( isnan(sj3array[0]) )
14136{
14137 // probably any value will work
14138 j3valid[0] = true;
14139 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
14140}
14141for(int ij3 = 0; ij3 < 2; ++ij3)
14142{
14143if( !j3valid[ij3] )
14144{
14145 continue;
14146}
14147_ij3[0] = ij3; _ij3[1] = -1;
14148for(int iij3 = ij3+1; iij3 < 2; ++iij3)
14149{
14150if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
14151{
14152 j3valid[iij3]=false; _ij3[1] = iij3; break;
14153}
14154}
14155j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
14156{
14157IkReal evalcond[6];
14158IkReal x1120=IKcos(j3);
14159IkReal x1121=IKsin(j3);
14160IkReal x1122=(gconst14*x1121);
14161evalcond[0]=(new_r01*x1120);
14162evalcond[1]=(gconst14*x1120);
14163evalcond[2]=((-1.0)*new_r10*x1120);
14164evalcond[3]=(x1122+new_r01);
14165evalcond[4]=(gconst14+((new_r10*x1121)));
14166evalcond[5]=(x1122+new_r10);
14167if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
14168{
14169continue;
14170}
14171}
14172
14173{
14174std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
14175vinfos[0].jointtype = 1;
14176vinfos[0].foffset = j0;
14177vinfos[0].indices[0] = _ij0[0];
14178vinfos[0].indices[1] = _ij0[1];
14179vinfos[0].maxsolutions = _nj0;
14180vinfos[1].jointtype = 1;
14181vinfos[1].foffset = j1;
14182vinfos[1].indices[0] = _ij1[0];
14183vinfos[1].indices[1] = _ij1[1];
14184vinfos[1].maxsolutions = _nj1;
14185vinfos[2].jointtype = 1;
14186vinfos[2].foffset = j2;
14187vinfos[2].indices[0] = _ij2[0];
14188vinfos[2].indices[1] = _ij2[1];
14189vinfos[2].maxsolutions = _nj2;
14190vinfos[3].jointtype = 1;
14191vinfos[3].foffset = j3;
14192vinfos[3].indices[0] = _ij3[0];
14193vinfos[3].indices[1] = _ij3[1];
14194vinfos[3].maxsolutions = _nj3;
14195vinfos[4].jointtype = 1;
14196vinfos[4].foffset = j4;
14197vinfos[4].indices[0] = _ij4[0];
14198vinfos[4].indices[1] = _ij4[1];
14199vinfos[4].maxsolutions = _nj4;
14200vinfos[5].jointtype = 1;
14201vinfos[5].foffset = j5;
14202vinfos[5].indices[0] = _ij5[0];
14203vinfos[5].indices[1] = _ij5[1];
14204vinfos[5].maxsolutions = _nj5;
14205std::vector<int> vfree(0);
14206solutions.AddSolution(vinfos,vfree);
14207}
14208}
14209}
14210
14211}
14212
14213}
14214
14215}
14216} while(0);
14217if( bgotonextstatement )
14218{
14219bool bgotonextstatement = true;
14220do
14221{
14222evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01)));
14223evalcond[1]=gconst14;
14224if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
14225{
14226bgotonextstatement=false;
14227{
14228IkReal j3eval[3];
14229IkReal x1123=((-1.0)*new_r10);
14230CheckValue<IkReal> x1125 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(x1123),IKFAST_ATAN2_MAGTHRESH);
14231if(!x1125.valid){
14232continue;
14233}
14234IkReal x1124=((-1.0)*(x1125.value));
14235sj4=0;
14236cj4=-1.0;
14237j4=3.14159265358979;
14238sj5=gconst13;
14239cj5=gconst14;
14240j5=x1124;
14241new_r11=0;
14242new_r01=0;
14243new_r22=0;
14244new_r20=0;
14245IkReal gconst12=x1124;
14246IkReal gconst13=new_r00;
14247IkReal gconst14=x1123;
14248j3eval[0]=-1.0;
14249j3eval[1]=-1.0;
14250j3eval[2]=((IKabs(((1.0)+(((-1.0)*(new_r10*new_r10))))))+(IKabs((new_r00*new_r10))));
14251if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
14252{
14253{
14254IkReal j3eval[3];
14255IkReal x1126=((-1.0)*new_r10);
14256CheckValue<IkReal> x1128 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(x1126),IKFAST_ATAN2_MAGTHRESH);
14257if(!x1128.valid){
14258continue;
14259}
14260IkReal x1127=((-1.0)*(x1128.value));
14261sj4=0;
14262cj4=-1.0;
14263j4=3.14159265358979;
14264sj5=gconst13;
14265cj5=gconst14;
14266j5=x1127;
14267new_r11=0;
14268new_r01=0;
14269new_r22=0;
14270new_r20=0;
14271IkReal gconst12=x1127;
14272IkReal gconst13=new_r00;
14273IkReal gconst14=x1126;
14274j3eval[0]=-1.0;
14275j3eval[1]=-1.0;
14276j3eval[2]=((IKabs(((1.0)+(((-1.0)*(new_r10*new_r10))))))+(IKabs((new_r00*new_r10))));
14277if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
14278{
14279{
14280IkReal j3eval[3];
14281IkReal x1129=((-1.0)*new_r10);
14282CheckValue<IkReal> x1131 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(x1129),IKFAST_ATAN2_MAGTHRESH);
14283if(!x1131.valid){
14284continue;
14285}
14286IkReal x1130=((-1.0)*(x1131.value));
14287sj4=0;
14288cj4=-1.0;
14289j4=3.14159265358979;
14290sj5=gconst13;
14291cj5=gconst14;
14292j5=x1130;
14293new_r11=0;
14294new_r01=0;
14295new_r22=0;
14296new_r20=0;
14297IkReal gconst12=x1130;
14298IkReal gconst13=new_r00;
14299IkReal gconst14=x1129;
14300j3eval[0]=1.0;
14301j3eval[1]=1.0;
14302j3eval[2]=((((0.5)*(IKabs(((-1.0)+(((2.0)*(new_r10*new_r10))))))))+(IKabs((new_r00*new_r10))));
14303if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
14304{
14305continue; // 3 cases reached
14306
14307} else
14308{
14309{
14310IkReal j3array[1], cj3array[1], sj3array[1];
14311bool j3valid[1]={false};
14312_nj3 = 1;
14313IkReal x1132=((1.0)*gconst14);
14314CheckValue<IkReal> x1133=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r10*x1132))+((gconst13*new_r00)))),-1);
14315if(!x1133.valid){
14316continue;
14317}
14318CheckValue<IkReal> x1134 = IKatan2WithCheck(IkReal(((gconst14*gconst14)+(((-1.0)*(new_r00*new_r00))))),IkReal(((((-1.0)*gconst13*x1132))+((new_r00*new_r10)))),IKFAST_ATAN2_MAGTHRESH);
14319if(!x1134.valid){
14320continue;
14321}
14322j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1133.value)))+(x1134.value));
14323sj3array[0]=IKsin(j3array[0]);
14324cj3array[0]=IKcos(j3array[0]);
14325if( j3array[0] > IKPI )
14326{
14327 j3array[0]-=IK2PI;
14328}
14329else if( j3array[0] < -IKPI )
14330{ j3array[0]+=IK2PI;
14331}
14332j3valid[0] = true;
14333for(int ij3 = 0; ij3 < 1; ++ij3)
14334{
14335if( !j3valid[ij3] )
14336{
14337 continue;
14338}
14339_ij3[0] = ij3; _ij3[1] = -1;
14340for(int iij3 = ij3+1; iij3 < 1; ++iij3)
14341{
14342if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
14343{
14344 j3valid[iij3]=false; _ij3[1] = iij3; break;
14345}
14346}
14347j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
14348{
14349IkReal evalcond[6];
14350IkReal x1135=IKsin(j3);
14351IkReal x1136=IKcos(j3);
14352IkReal x1137=((1.0)*gconst13);
14353IkReal x1138=(gconst14*x1135);
14354IkReal x1139=(gconst14*x1136);
14355IkReal x1140=(x1136*x1137);
14356evalcond[0]=(x1138+(((-1.0)*x1140)));
14357evalcond[1]=(gconst14+((new_r00*x1136))+((new_r10*x1135)));
14358evalcond[2]=(x1139+((gconst13*x1135))+new_r00);
14359evalcond[3]=(gconst13+((new_r00*x1135))+(((-1.0)*new_r10*x1136)));
14360evalcond[4]=((((-1.0)*x1139))+(((-1.0)*x1135*x1137)));
14361evalcond[5]=(x1138+(((-1.0)*x1140))+new_r10);
14362if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
14363{
14364continue;
14365}
14366}
14367
14368{
14369std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
14370vinfos[0].jointtype = 1;
14371vinfos[0].foffset = j0;
14372vinfos[0].indices[0] = _ij0[0];
14373vinfos[0].indices[1] = _ij0[1];
14374vinfos[0].maxsolutions = _nj0;
14375vinfos[1].jointtype = 1;
14376vinfos[1].foffset = j1;
14377vinfos[1].indices[0] = _ij1[0];
14378vinfos[1].indices[1] = _ij1[1];
14379vinfos[1].maxsolutions = _nj1;
14380vinfos[2].jointtype = 1;
14381vinfos[2].foffset = j2;
14382vinfos[2].indices[0] = _ij2[0];
14383vinfos[2].indices[1] = _ij2[1];
14384vinfos[2].maxsolutions = _nj2;
14385vinfos[3].jointtype = 1;
14386vinfos[3].foffset = j3;
14387vinfos[3].indices[0] = _ij3[0];
14388vinfos[3].indices[1] = _ij3[1];
14389vinfos[3].maxsolutions = _nj3;
14390vinfos[4].jointtype = 1;
14391vinfos[4].foffset = j4;
14392vinfos[4].indices[0] = _ij4[0];
14393vinfos[4].indices[1] = _ij4[1];
14394vinfos[4].maxsolutions = _nj4;
14395vinfos[5].jointtype = 1;
14396vinfos[5].foffset = j5;
14397vinfos[5].indices[0] = _ij5[0];
14398vinfos[5].indices[1] = _ij5[1];
14399vinfos[5].maxsolutions = _nj5;
14400std::vector<int> vfree(0);
14401solutions.AddSolution(vinfos,vfree);
14402}
14403}
14404}
14405
14406}
14407
14408}
14409
14410} else
14411{
14412{
14413IkReal j3array[1], cj3array[1], sj3array[1];
14414bool j3valid[1]={false};
14415_nj3 = 1;
14416CheckValue<IkReal> x1141=IKPowWithIntegerCheck(IKsign(((((-1.0)*(gconst14*gconst14)))+(((-1.0)*(gconst13*gconst13))))),-1);
14417if(!x1141.valid){
14418continue;
14419}
14420CheckValue<IkReal> x1142 = IKatan2WithCheck(IkReal((gconst13*new_r00)),IkReal((gconst14*new_r00)),IKFAST_ATAN2_MAGTHRESH);
14421if(!x1142.valid){
14422continue;
14423}
14424j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1141.value)))+(x1142.value));
14425sj3array[0]=IKsin(j3array[0]);
14426cj3array[0]=IKcos(j3array[0]);
14427if( j3array[0] > IKPI )
14428{
14429 j3array[0]-=IK2PI;
14430}
14431else if( j3array[0] < -IKPI )
14432{ j3array[0]+=IK2PI;
14433}
14434j3valid[0] = true;
14435for(int ij3 = 0; ij3 < 1; ++ij3)
14436{
14437if( !j3valid[ij3] )
14438{
14439 continue;
14440}
14441_ij3[0] = ij3; _ij3[1] = -1;
14442for(int iij3 = ij3+1; iij3 < 1; ++iij3)
14443{
14444if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
14445{
14446 j3valid[iij3]=false; _ij3[1] = iij3; break;
14447}
14448}
14449j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
14450{
14451IkReal evalcond[6];
14452IkReal x1143=IKsin(j3);
14453IkReal x1144=IKcos(j3);
14454IkReal x1145=((1.0)*gconst13);
14455IkReal x1146=(gconst14*x1143);
14456IkReal x1147=(gconst14*x1144);
14457IkReal x1148=(x1144*x1145);
14458evalcond[0]=(x1146+(((-1.0)*x1148)));
14459evalcond[1]=(((new_r00*x1144))+gconst14+((new_r10*x1143)));
14460evalcond[2]=(x1147+((gconst13*x1143))+new_r00);
14461evalcond[3]=((((-1.0)*new_r10*x1144))+((new_r00*x1143))+gconst13);
14462evalcond[4]=((((-1.0)*x1143*x1145))+(((-1.0)*x1147)));
14463evalcond[5]=(x1146+(((-1.0)*x1148))+new_r10);
14464if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
14465{
14466continue;
14467}
14468}
14469
14470{
14471std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
14472vinfos[0].jointtype = 1;
14473vinfos[0].foffset = j0;
14474vinfos[0].indices[0] = _ij0[0];
14475vinfos[0].indices[1] = _ij0[1];
14476vinfos[0].maxsolutions = _nj0;
14477vinfos[1].jointtype = 1;
14478vinfos[1].foffset = j1;
14479vinfos[1].indices[0] = _ij1[0];
14480vinfos[1].indices[1] = _ij1[1];
14481vinfos[1].maxsolutions = _nj1;
14482vinfos[2].jointtype = 1;
14483vinfos[2].foffset = j2;
14484vinfos[2].indices[0] = _ij2[0];
14485vinfos[2].indices[1] = _ij2[1];
14486vinfos[2].maxsolutions = _nj2;
14487vinfos[3].jointtype = 1;
14488vinfos[3].foffset = j3;
14489vinfos[3].indices[0] = _ij3[0];
14490vinfos[3].indices[1] = _ij3[1];
14491vinfos[3].maxsolutions = _nj3;
14492vinfos[4].jointtype = 1;
14493vinfos[4].foffset = j4;
14494vinfos[4].indices[0] = _ij4[0];
14495vinfos[4].indices[1] = _ij4[1];
14496vinfos[4].maxsolutions = _nj4;
14497vinfos[5].jointtype = 1;
14498vinfos[5].foffset = j5;
14499vinfos[5].indices[0] = _ij5[0];
14500vinfos[5].indices[1] = _ij5[1];
14501vinfos[5].maxsolutions = _nj5;
14502std::vector<int> vfree(0);
14503solutions.AddSolution(vinfos,vfree);
14504}
14505}
14506}
14507
14508}
14509
14510}
14511
14512} else
14513{
14514{
14515IkReal j3array[1], cj3array[1], sj3array[1];
14516bool j3valid[1]={false};
14517_nj3 = 1;
14518CheckValue<IkReal> x1149 = IKatan2WithCheck(IkReal(gconst13*gconst13),IkReal((gconst13*gconst14)),IKFAST_ATAN2_MAGTHRESH);
14519if(!x1149.valid){
14520continue;
14521}
14522CheckValue<IkReal> x1150=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst13*new_r00))+((gconst14*new_r10)))),-1);
14523if(!x1150.valid){
14524continue;
14525}
14526j3array[0]=((-1.5707963267949)+(x1149.value)+(((1.5707963267949)*(x1150.value))));
14527sj3array[0]=IKsin(j3array[0]);
14528cj3array[0]=IKcos(j3array[0]);
14529if( j3array[0] > IKPI )
14530{
14531 j3array[0]-=IK2PI;
14532}
14533else if( j3array[0] < -IKPI )
14534{ j3array[0]+=IK2PI;
14535}
14536j3valid[0] = true;
14537for(int ij3 = 0; ij3 < 1; ++ij3)
14538{
14539if( !j3valid[ij3] )
14540{
14541 continue;
14542}
14543_ij3[0] = ij3; _ij3[1] = -1;
14544for(int iij3 = ij3+1; iij3 < 1; ++iij3)
14545{
14546if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
14547{
14548 j3valid[iij3]=false; _ij3[1] = iij3; break;
14549}
14550}
14551j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
14552{
14553IkReal evalcond[6];
14554IkReal x1151=IKsin(j3);
14555IkReal x1152=IKcos(j3);
14556IkReal x1153=((1.0)*gconst13);
14557IkReal x1154=(gconst14*x1151);
14558IkReal x1155=(gconst14*x1152);
14559IkReal x1156=(x1152*x1153);
14560evalcond[0]=(x1154+(((-1.0)*x1156)));
14561evalcond[1]=(((new_r10*x1151))+gconst14+((new_r00*x1152)));
14562evalcond[2]=(x1155+((gconst13*x1151))+new_r00);
14563evalcond[3]=(gconst13+((new_r00*x1151))+(((-1.0)*new_r10*x1152)));
14564evalcond[4]=((((-1.0)*x1155))+(((-1.0)*x1151*x1153)));
14565evalcond[5]=(x1154+(((-1.0)*x1156))+new_r10);
14566if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
14567{
14568continue;
14569}
14570}
14571
14572{
14573std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
14574vinfos[0].jointtype = 1;
14575vinfos[0].foffset = j0;
14576vinfos[0].indices[0] = _ij0[0];
14577vinfos[0].indices[1] = _ij0[1];
14578vinfos[0].maxsolutions = _nj0;
14579vinfos[1].jointtype = 1;
14580vinfos[1].foffset = j1;
14581vinfos[1].indices[0] = _ij1[0];
14582vinfos[1].indices[1] = _ij1[1];
14583vinfos[1].maxsolutions = _nj1;
14584vinfos[2].jointtype = 1;
14585vinfos[2].foffset = j2;
14586vinfos[2].indices[0] = _ij2[0];
14587vinfos[2].indices[1] = _ij2[1];
14588vinfos[2].maxsolutions = _nj2;
14589vinfos[3].jointtype = 1;
14590vinfos[3].foffset = j3;
14591vinfos[3].indices[0] = _ij3[0];
14592vinfos[3].indices[1] = _ij3[1];
14593vinfos[3].maxsolutions = _nj3;
14594vinfos[4].jointtype = 1;
14595vinfos[4].foffset = j4;
14596vinfos[4].indices[0] = _ij4[0];
14597vinfos[4].indices[1] = _ij4[1];
14598vinfos[4].maxsolutions = _nj4;
14599vinfos[5].jointtype = 1;
14600vinfos[5].foffset = j5;
14601vinfos[5].indices[0] = _ij5[0];
14602vinfos[5].indices[1] = _ij5[1];
14603vinfos[5].maxsolutions = _nj5;
14604std::vector<int> vfree(0);
14605solutions.AddSolution(vinfos,vfree);
14606}
14607}
14608}
14609
14610}
14611
14612}
14613
14614}
14615} while(0);
14616if( bgotonextstatement )
14617{
14618bool bgotonextstatement = true;
14619do
14620{
14621evalcond[0]=((IKabs(new_r10))+(IKabs(new_r01)));
14622if( IKabs(evalcond[0]) < 0.0000050000000000 )
14623{
14624bgotonextstatement=false;
14625{
14626IkReal j3array[2], cj3array[2], sj3array[2];
14627bool j3valid[2]={false};
14628_nj3 = 2;
14629CheckValue<IkReal> x1157=IKPowWithIntegerCheck(gconst13,-1);
14630if(!x1157.valid){
14631continue;
14632}
14633sj3array[0]=(new_r11*(x1157.value));
14634if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
14635{
14636 j3valid[0] = j3valid[1] = true;
14637 j3array[0] = IKasin(sj3array[0]);
14638 cj3array[0] = IKcos(j3array[0]);
14639 sj3array[1] = sj3array[0];
14640 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
14641 cj3array[1] = -cj3array[0];
14642}
14643else if( isnan(sj3array[0]) )
14644{
14645 // probably any value will work
14646 j3valid[0] = true;
14647 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
14648}
14649for(int ij3 = 0; ij3 < 2; ++ij3)
14650{
14651if( !j3valid[ij3] )
14652{
14653 continue;
14654}
14655_ij3[0] = ij3; _ij3[1] = -1;
14656for(int iij3 = ij3+1; iij3 < 2; ++iij3)
14657{
14658if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
14659{
14660 j3valid[iij3]=false; _ij3[1] = iij3; break;
14661}
14662}
14663j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
14664{
14665IkReal evalcond[6];
14666IkReal x1158=IKcos(j3);
14667IkReal x1159=IKsin(j3);
14668IkReal x1160=((-1.0)*x1158);
14669evalcond[0]=(new_r00*x1158);
14670evalcond[1]=(new_r11*x1160);
14671evalcond[2]=(gconst13*x1160);
14672evalcond[3]=(gconst13+((new_r00*x1159)));
14673evalcond[4]=(((gconst13*x1159))+new_r00);
14674evalcond[5]=(((new_r11*x1159))+(((-1.0)*gconst13)));
14675if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
14676{
14677continue;
14678}
14679}
14680
14681{
14682std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
14683vinfos[0].jointtype = 1;
14684vinfos[0].foffset = j0;
14685vinfos[0].indices[0] = _ij0[0];
14686vinfos[0].indices[1] = _ij0[1];
14687vinfos[0].maxsolutions = _nj0;
14688vinfos[1].jointtype = 1;
14689vinfos[1].foffset = j1;
14690vinfos[1].indices[0] = _ij1[0];
14691vinfos[1].indices[1] = _ij1[1];
14692vinfos[1].maxsolutions = _nj1;
14693vinfos[2].jointtype = 1;
14694vinfos[2].foffset = j2;
14695vinfos[2].indices[0] = _ij2[0];
14696vinfos[2].indices[1] = _ij2[1];
14697vinfos[2].maxsolutions = _nj2;
14698vinfos[3].jointtype = 1;
14699vinfos[3].foffset = j3;
14700vinfos[3].indices[0] = _ij3[0];
14701vinfos[3].indices[1] = _ij3[1];
14702vinfos[3].maxsolutions = _nj3;
14703vinfos[4].jointtype = 1;
14704vinfos[4].foffset = j4;
14705vinfos[4].indices[0] = _ij4[0];
14706vinfos[4].indices[1] = _ij4[1];
14707vinfos[4].maxsolutions = _nj4;
14708vinfos[5].jointtype = 1;
14709vinfos[5].foffset = j5;
14710vinfos[5].indices[0] = _ij5[0];
14711vinfos[5].indices[1] = _ij5[1];
14712vinfos[5].maxsolutions = _nj5;
14713std::vector<int> vfree(0);
14714solutions.AddSolution(vinfos,vfree);
14715}
14716}
14717}
14718
14719}
14720} while(0);
14721if( bgotonextstatement )
14722{
14723bool bgotonextstatement = true;
14724do
14725{
14726evalcond[0]=((IKabs(new_r11))+(IKabs(new_r10)));
14727if( IKabs(evalcond[0]) < 0.0000050000000000 )
14728{
14729bgotonextstatement=false;
14730{
14731IkReal j3eval[1];
14732CheckValue<IkReal> x1162 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
14733if(!x1162.valid){
14734continue;
14735}
14736IkReal x1161=((-1.0)*(x1162.value));
14737sj4=0;
14738cj4=-1.0;
14739j4=3.14159265358979;
14740sj5=gconst13;
14741cj5=gconst14;
14742j5=x1161;
14743new_r11=0;
14744new_r10=0;
14745new_r22=0;
14746new_r02=0;
14747IkReal gconst12=x1161;
14748IkReal x1163 = ((1.0)+(((-1.0)*(new_r01*new_r01))));
14749if(IKabs(x1163)==0){
14750continue;
14751}
14752IkReal gconst13=(new_r00*(pow(x1163,-0.5)));
14753IkReal gconst14=0;
14754j3eval[0]=((IKabs(new_r00))+(IKabs(new_r01)));
14755if( IKabs(j3eval[0]) < 0.0000010000000000 )
14756{
14757{
14758IkReal j3eval[1];
14759CheckValue<IkReal> x1165 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
14760if(!x1165.valid){
14761continue;
14762}
14763IkReal x1164=((-1.0)*(x1165.value));
14764sj4=0;
14765cj4=-1.0;
14766j4=3.14159265358979;
14767sj5=gconst13;
14768cj5=gconst14;
14769j5=x1164;
14770new_r11=0;
14771new_r10=0;
14772new_r22=0;
14773new_r02=0;
14774IkReal gconst12=x1164;
14775IkReal x1166 = ((1.0)+(((-1.0)*(new_r01*new_r01))));
14776if(IKabs(x1166)==0){
14777continue;
14778}
14779IkReal gconst13=(new_r00*(pow(x1166,-0.5)));
14780IkReal gconst14=0;
14781j3eval[0]=new_r00;
14782if( IKabs(j3eval[0]) < 0.0000010000000000 )
14783{
14784{
14785IkReal j3eval[2];
14786CheckValue<IkReal> x1168 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
14787if(!x1168.valid){
14788continue;
14789}
14790IkReal x1167=((-1.0)*(x1168.value));
14791sj4=0;
14792cj4=-1.0;
14793j4=3.14159265358979;
14794sj5=gconst13;
14795cj5=gconst14;
14796j5=x1167;
14797new_r11=0;
14798new_r10=0;
14799new_r22=0;
14800new_r02=0;
14801IkReal gconst12=x1167;
14802IkReal x1169 = ((1.0)+(((-1.0)*(new_r01*new_r01))));
14803if(IKabs(x1169)==0){
14804continue;
14805}
14806IkReal gconst13=(new_r00*(pow(x1169,-0.5)));
14807IkReal gconst14=0;
14808j3eval[0]=new_r00;
14809j3eval[1]=new_r01;
14810if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 )
14811{
14812continue; // 3 cases reached
14813
14814} else
14815{
14816{
14817IkReal j3array[1], cj3array[1], sj3array[1];
14818bool j3valid[1]={false};
14819_nj3 = 1;
14821if(!x1170.valid){
14822continue;
14823}
14825if(!x1171.valid){
14826continue;
14827}
14828if( IKabs(((-1.0)*gconst13*(x1170.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst13*(x1171.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*gconst13*(x1170.value)))+IKsqr((gconst13*(x1171.value)))-1) <= IKFAST_SINCOS_THRESH )
14829 continue;
14830j3array[0]=IKatan2(((-1.0)*gconst13*(x1170.value)), (gconst13*(x1171.value)));
14831sj3array[0]=IKsin(j3array[0]);
14832cj3array[0]=IKcos(j3array[0]);
14833if( j3array[0] > IKPI )
14834{
14835 j3array[0]-=IK2PI;
14836}
14837else if( j3array[0] < -IKPI )
14838{ j3array[0]+=IK2PI;
14839}
14840j3valid[0] = true;
14841for(int ij3 = 0; ij3 < 1; ++ij3)
14842{
14843if( !j3valid[ij3] )
14844{
14845 continue;
14846}
14847_ij3[0] = ij3; _ij3[1] = -1;
14848for(int iij3 = ij3+1; iij3 < 1; ++iij3)
14849{
14850if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
14851{
14852 j3valid[iij3]=false; _ij3[1] = iij3; break;
14853}
14854}
14855j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
14856{
14857IkReal evalcond[8];
14858IkReal x1172=IKsin(j3);
14859IkReal x1173=IKcos(j3);
14860IkReal x1174=(gconst13*x1173);
14861IkReal x1175=(gconst13*x1172);
14862evalcond[0]=(new_r01*x1172);
14863evalcond[1]=(new_r00*x1173);
14864evalcond[2]=((-1.0)*x1175);
14865evalcond[3]=((-1.0)*x1174);
14866evalcond[4]=(gconst13+((new_r00*x1172)));
14867evalcond[5]=(x1175+new_r00);
14868evalcond[6]=(new_r01+(((-1.0)*x1174)));
14869evalcond[7]=((((-1.0)*gconst13))+((new_r01*x1173)));
14870if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
14871{
14872continue;
14873}
14874}
14875
14876{
14877std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
14878vinfos[0].jointtype = 1;
14879vinfos[0].foffset = j0;
14880vinfos[0].indices[0] = _ij0[0];
14881vinfos[0].indices[1] = _ij0[1];
14882vinfos[0].maxsolutions = _nj0;
14883vinfos[1].jointtype = 1;
14884vinfos[1].foffset = j1;
14885vinfos[1].indices[0] = _ij1[0];
14886vinfos[1].indices[1] = _ij1[1];
14887vinfos[1].maxsolutions = _nj1;
14888vinfos[2].jointtype = 1;
14889vinfos[2].foffset = j2;
14890vinfos[2].indices[0] = _ij2[0];
14891vinfos[2].indices[1] = _ij2[1];
14892vinfos[2].maxsolutions = _nj2;
14893vinfos[3].jointtype = 1;
14894vinfos[3].foffset = j3;
14895vinfos[3].indices[0] = _ij3[0];
14896vinfos[3].indices[1] = _ij3[1];
14897vinfos[3].maxsolutions = _nj3;
14898vinfos[4].jointtype = 1;
14899vinfos[4].foffset = j4;
14900vinfos[4].indices[0] = _ij4[0];
14901vinfos[4].indices[1] = _ij4[1];
14902vinfos[4].maxsolutions = _nj4;
14903vinfos[5].jointtype = 1;
14904vinfos[5].foffset = j5;
14905vinfos[5].indices[0] = _ij5[0];
14906vinfos[5].indices[1] = _ij5[1];
14907vinfos[5].maxsolutions = _nj5;
14908std::vector<int> vfree(0);
14909solutions.AddSolution(vinfos,vfree);
14910}
14911}
14912}
14913
14914}
14915
14916}
14917
14918} else
14919{
14920{
14921IkReal j3array[1], cj3array[1], sj3array[1];
14922bool j3valid[1]={false};
14923_nj3 = 1;
14925if(!x1176.valid){
14926continue;
14927}
14928CheckValue<IkReal> x1177=IKPowWithIntegerCheck(gconst13,-1);
14929if(!x1177.valid){
14930continue;
14931}
14932if( IKabs(((-1.0)*gconst13*(x1176.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r01*(x1177.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*gconst13*(x1176.value)))+IKsqr((new_r01*(x1177.value)))-1) <= IKFAST_SINCOS_THRESH )
14933 continue;
14934j3array[0]=IKatan2(((-1.0)*gconst13*(x1176.value)), (new_r01*(x1177.value)));
14935sj3array[0]=IKsin(j3array[0]);
14936cj3array[0]=IKcos(j3array[0]);
14937if( j3array[0] > IKPI )
14938{
14939 j3array[0]-=IK2PI;
14940}
14941else if( j3array[0] < -IKPI )
14942{ j3array[0]+=IK2PI;
14943}
14944j3valid[0] = true;
14945for(int ij3 = 0; ij3 < 1; ++ij3)
14946{
14947if( !j3valid[ij3] )
14948{
14949 continue;
14950}
14951_ij3[0] = ij3; _ij3[1] = -1;
14952for(int iij3 = ij3+1; iij3 < 1; ++iij3)
14953{
14954if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
14955{
14956 j3valid[iij3]=false; _ij3[1] = iij3; break;
14957}
14958}
14959j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
14960{
14961IkReal evalcond[8];
14962IkReal x1178=IKsin(j3);
14963IkReal x1179=IKcos(j3);
14964IkReal x1180=(gconst13*x1179);
14965IkReal x1181=(gconst13*x1178);
14966evalcond[0]=(new_r01*x1178);
14967evalcond[1]=(new_r00*x1179);
14968evalcond[2]=((-1.0)*x1181);
14969evalcond[3]=((-1.0)*x1180);
14970evalcond[4]=(gconst13+((new_r00*x1178)));
14971evalcond[5]=(x1181+new_r00);
14972evalcond[6]=(new_r01+(((-1.0)*x1180)));
14973evalcond[7]=((((-1.0)*gconst13))+((new_r01*x1179)));
14974if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
14975{
14976continue;
14977}
14978}
14979
14980{
14981std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
14982vinfos[0].jointtype = 1;
14983vinfos[0].foffset = j0;
14984vinfos[0].indices[0] = _ij0[0];
14985vinfos[0].indices[1] = _ij0[1];
14986vinfos[0].maxsolutions = _nj0;
14987vinfos[1].jointtype = 1;
14988vinfos[1].foffset = j1;
14989vinfos[1].indices[0] = _ij1[0];
14990vinfos[1].indices[1] = _ij1[1];
14991vinfos[1].maxsolutions = _nj1;
14992vinfos[2].jointtype = 1;
14993vinfos[2].foffset = j2;
14994vinfos[2].indices[0] = _ij2[0];
14995vinfos[2].indices[1] = _ij2[1];
14996vinfos[2].maxsolutions = _nj2;
14997vinfos[3].jointtype = 1;
14998vinfos[3].foffset = j3;
14999vinfos[3].indices[0] = _ij3[0];
15000vinfos[3].indices[1] = _ij3[1];
15001vinfos[3].maxsolutions = _nj3;
15002vinfos[4].jointtype = 1;
15003vinfos[4].foffset = j4;
15004vinfos[4].indices[0] = _ij4[0];
15005vinfos[4].indices[1] = _ij4[1];
15006vinfos[4].maxsolutions = _nj4;
15007vinfos[5].jointtype = 1;
15008vinfos[5].foffset = j5;
15009vinfos[5].indices[0] = _ij5[0];
15010vinfos[5].indices[1] = _ij5[1];
15011vinfos[5].maxsolutions = _nj5;
15012std::vector<int> vfree(0);
15013solutions.AddSolution(vinfos,vfree);
15014}
15015}
15016}
15017
15018}
15019
15020}
15021
15022} else
15023{
15024{
15025IkReal j3array[1], cj3array[1], sj3array[1];
15026bool j3valid[1]={false};
15027_nj3 = 1;
15029if(!x1182.valid){
15030continue;
15031}
15033if(!x1183.valid){
15034continue;
15035}
15036j3array[0]=((-1.5707963267949)+(x1182.value)+(((1.5707963267949)*(x1183.value))));
15037sj3array[0]=IKsin(j3array[0]);
15038cj3array[0]=IKcos(j3array[0]);
15039if( j3array[0] > IKPI )
15040{
15041 j3array[0]-=IK2PI;
15042}
15043else if( j3array[0] < -IKPI )
15044{ j3array[0]+=IK2PI;
15045}
15046j3valid[0] = true;
15047for(int ij3 = 0; ij3 < 1; ++ij3)
15048{
15049if( !j3valid[ij3] )
15050{
15051 continue;
15052}
15053_ij3[0] = ij3; _ij3[1] = -1;
15054for(int iij3 = ij3+1; iij3 < 1; ++iij3)
15055{
15056if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
15057{
15058 j3valid[iij3]=false; _ij3[1] = iij3; break;
15059}
15060}
15061j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
15062{
15063IkReal evalcond[8];
15064IkReal x1184=IKsin(j3);
15065IkReal x1185=IKcos(j3);
15066IkReal x1186=(gconst13*x1185);
15067IkReal x1187=(gconst13*x1184);
15068evalcond[0]=(new_r01*x1184);
15069evalcond[1]=(new_r00*x1185);
15070evalcond[2]=((-1.0)*x1187);
15071evalcond[3]=((-1.0)*x1186);
15072evalcond[4]=(gconst13+((new_r00*x1184)));
15073evalcond[5]=(x1187+new_r00);
15074evalcond[6]=(new_r01+(((-1.0)*x1186)));
15075evalcond[7]=(((new_r01*x1185))+(((-1.0)*gconst13)));
15076if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
15077{
15078continue;
15079}
15080}
15081
15082{
15083std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
15084vinfos[0].jointtype = 1;
15085vinfos[0].foffset = j0;
15086vinfos[0].indices[0] = _ij0[0];
15087vinfos[0].indices[1] = _ij0[1];
15088vinfos[0].maxsolutions = _nj0;
15089vinfos[1].jointtype = 1;
15090vinfos[1].foffset = j1;
15091vinfos[1].indices[0] = _ij1[0];
15092vinfos[1].indices[1] = _ij1[1];
15093vinfos[1].maxsolutions = _nj1;
15094vinfos[2].jointtype = 1;
15095vinfos[2].foffset = j2;
15096vinfos[2].indices[0] = _ij2[0];
15097vinfos[2].indices[1] = _ij2[1];
15098vinfos[2].maxsolutions = _nj2;
15099vinfos[3].jointtype = 1;
15100vinfos[3].foffset = j3;
15101vinfos[3].indices[0] = _ij3[0];
15102vinfos[3].indices[1] = _ij3[1];
15103vinfos[3].maxsolutions = _nj3;
15104vinfos[4].jointtype = 1;
15105vinfos[4].foffset = j4;
15106vinfos[4].indices[0] = _ij4[0];
15107vinfos[4].indices[1] = _ij4[1];
15108vinfos[4].maxsolutions = _nj4;
15109vinfos[5].jointtype = 1;
15110vinfos[5].foffset = j5;
15111vinfos[5].indices[0] = _ij5[0];
15112vinfos[5].indices[1] = _ij5[1];
15113vinfos[5].maxsolutions = _nj5;
15114std::vector<int> vfree(0);
15115solutions.AddSolution(vinfos,vfree);
15116}
15117}
15118}
15119
15120}
15121
15122}
15123
15124}
15125} while(0);
15126if( bgotonextstatement )
15127{
15128bool bgotonextstatement = true;
15129do
15130{
15131evalcond[0]=IKabs(new_r10);
15132if( IKabs(evalcond[0]) < 0.0000050000000000 )
15133{
15134bgotonextstatement=false;
15135{
15136IkReal j3eval[1];
15137CheckValue<IkReal> x1189 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
15138if(!x1189.valid){
15139continue;
15140}
15141IkReal x1188=((-1.0)*(x1189.value));
15142sj4=0;
15143cj4=-1.0;
15144j4=3.14159265358979;
15145sj5=gconst13;
15146cj5=gconst14;
15147j5=x1188;
15148new_r10=0;
15149IkReal gconst12=x1188;
15150IkReal x1190 = new_r00*new_r00;
15151if(IKabs(x1190)==0){
15152continue;
15153}
15154IkReal gconst13=(new_r00*(pow(x1190,-0.5)));
15155IkReal gconst14=0;
15156j3eval[0]=((IKabs(new_r11))+(IKabs(new_r01)));
15157if( IKabs(j3eval[0]) < 0.0000010000000000 )
15158{
15159{
15160IkReal j3eval[1];
15161CheckValue<IkReal> x1192 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
15162if(!x1192.valid){
15163continue;
15164}
15165IkReal x1191=((-1.0)*(x1192.value));
15166sj4=0;
15167cj4=-1.0;
15168j4=3.14159265358979;
15169sj5=gconst13;
15170cj5=gconst14;
15171j5=x1191;
15172new_r10=0;
15173IkReal gconst12=x1191;
15174IkReal x1193 = new_r00*new_r00;
15175if(IKabs(x1193)==0){
15176continue;
15177}
15178IkReal gconst13=(new_r00*(pow(x1193,-0.5)));
15179IkReal gconst14=0;
15180j3eval[0]=((IKabs(new_r00))+(IKabs(new_r01)));
15181if( IKabs(j3eval[0]) < 0.0000010000000000 )
15182{
15183{
15184IkReal j3eval[1];
15185CheckValue<IkReal> x1195 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
15186if(!x1195.valid){
15187continue;
15188}
15189IkReal x1194=((-1.0)*(x1195.value));
15190sj4=0;
15191cj4=-1.0;
15192j4=3.14159265358979;
15193sj5=gconst13;
15194cj5=gconst14;
15195j5=x1194;
15196new_r10=0;
15197IkReal gconst12=x1194;
15198IkReal x1196 = new_r00*new_r00;
15199if(IKabs(x1196)==0){
15200continue;
15201}
15202IkReal gconst13=(new_r00*(pow(x1196,-0.5)));
15203IkReal gconst14=0;
15204j3eval[0]=new_r00;
15205if( IKabs(j3eval[0]) < 0.0000010000000000 )
15206{
15207continue; // 3 cases reached
15208
15209} else
15210{
15211{
15212IkReal j3array[1], cj3array[1], sj3array[1];
15213bool j3valid[1]={false};
15214_nj3 = 1;
15216if(!x1197.valid){
15217continue;
15218}
15219CheckValue<IkReal> x1198=IKPowWithIntegerCheck(gconst13,-1);
15220if(!x1198.valid){
15221continue;
15222}
15223if( IKabs(((-1.0)*gconst13*(x1197.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r01*(x1198.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*gconst13*(x1197.value)))+IKsqr((new_r01*(x1198.value)))-1) <= IKFAST_SINCOS_THRESH )
15224 continue;
15225j3array[0]=IKatan2(((-1.0)*gconst13*(x1197.value)), (new_r01*(x1198.value)));
15226sj3array[0]=IKsin(j3array[0]);
15227cj3array[0]=IKcos(j3array[0]);
15228if( j3array[0] > IKPI )
15229{
15230 j3array[0]-=IK2PI;
15231}
15232else if( j3array[0] < -IKPI )
15233{ j3array[0]+=IK2PI;
15234}
15235j3valid[0] = true;
15236for(int ij3 = 0; ij3 < 1; ++ij3)
15237{
15238if( !j3valid[ij3] )
15239{
15240 continue;
15241}
15242_ij3[0] = ij3; _ij3[1] = -1;
15243for(int iij3 = ij3+1; iij3 < 1; ++iij3)
15244{
15245if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
15246{
15247 j3valid[iij3]=false; _ij3[1] = iij3; break;
15248}
15249}
15250j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
15251{
15252IkReal evalcond[8];
15253IkReal x1199=IKcos(j3);
15254IkReal x1200=IKsin(j3);
15255IkReal x1201=(gconst13*x1199);
15256IkReal x1202=(gconst13*x1200);
15257evalcond[0]=(new_r00*x1199);
15258evalcond[1]=((-1.0)*x1201);
15259evalcond[2]=(((new_r00*x1200))+gconst13);
15260evalcond[3]=(x1202+new_r00);
15261evalcond[4]=((((-1.0)*x1201))+new_r01);
15262evalcond[5]=((((-1.0)*x1202))+new_r11);
15263evalcond[6]=(((new_r01*x1200))+(((-1.0)*new_r11*x1199)));
15264evalcond[7]=(((new_r11*x1200))+(((-1.0)*gconst13))+((new_r01*x1199)));
15265if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
15266{
15267continue;
15268}
15269}
15270
15271{
15272std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
15273vinfos[0].jointtype = 1;
15274vinfos[0].foffset = j0;
15275vinfos[0].indices[0] = _ij0[0];
15276vinfos[0].indices[1] = _ij0[1];
15277vinfos[0].maxsolutions = _nj0;
15278vinfos[1].jointtype = 1;
15279vinfos[1].foffset = j1;
15280vinfos[1].indices[0] = _ij1[0];
15281vinfos[1].indices[1] = _ij1[1];
15282vinfos[1].maxsolutions = _nj1;
15283vinfos[2].jointtype = 1;
15284vinfos[2].foffset = j2;
15285vinfos[2].indices[0] = _ij2[0];
15286vinfos[2].indices[1] = _ij2[1];
15287vinfos[2].maxsolutions = _nj2;
15288vinfos[3].jointtype = 1;
15289vinfos[3].foffset = j3;
15290vinfos[3].indices[0] = _ij3[0];
15291vinfos[3].indices[1] = _ij3[1];
15292vinfos[3].maxsolutions = _nj3;
15293vinfos[4].jointtype = 1;
15294vinfos[4].foffset = j4;
15295vinfos[4].indices[0] = _ij4[0];
15296vinfos[4].indices[1] = _ij4[1];
15297vinfos[4].maxsolutions = _nj4;
15298vinfos[5].jointtype = 1;
15299vinfos[5].foffset = j5;
15300vinfos[5].indices[0] = _ij5[0];
15301vinfos[5].indices[1] = _ij5[1];
15302vinfos[5].maxsolutions = _nj5;
15303std::vector<int> vfree(0);
15304solutions.AddSolution(vinfos,vfree);
15305}
15306}
15307}
15308
15309}
15310
15311}
15312
15313} else
15314{
15315{
15316IkReal j3array[1], cj3array[1], sj3array[1];
15317bool j3valid[1]={false};
15318_nj3 = 1;
15320if(!x1203.valid){
15321continue;
15322}
15324if(!x1204.valid){
15325continue;
15326}
15327j3array[0]=((-1.5707963267949)+(x1203.value)+(((1.5707963267949)*(x1204.value))));
15328sj3array[0]=IKsin(j3array[0]);
15329cj3array[0]=IKcos(j3array[0]);
15330if( j3array[0] > IKPI )
15331{
15332 j3array[0]-=IK2PI;
15333}
15334else if( j3array[0] < -IKPI )
15335{ j3array[0]+=IK2PI;
15336}
15337j3valid[0] = true;
15338for(int ij3 = 0; ij3 < 1; ++ij3)
15339{
15340if( !j3valid[ij3] )
15341{
15342 continue;
15343}
15344_ij3[0] = ij3; _ij3[1] = -1;
15345for(int iij3 = ij3+1; iij3 < 1; ++iij3)
15346{
15347if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
15348{
15349 j3valid[iij3]=false; _ij3[1] = iij3; break;
15350}
15351}
15352j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
15353{
15354IkReal evalcond[8];
15355IkReal x1205=IKcos(j3);
15356IkReal x1206=IKsin(j3);
15357IkReal x1207=(gconst13*x1205);
15358IkReal x1208=(gconst13*x1206);
15359evalcond[0]=(new_r00*x1205);
15360evalcond[1]=((-1.0)*x1207);
15361evalcond[2]=(((new_r00*x1206))+gconst13);
15362evalcond[3]=(x1208+new_r00);
15363evalcond[4]=((((-1.0)*x1207))+new_r01);
15364evalcond[5]=((((-1.0)*x1208))+new_r11);
15365evalcond[6]=(((new_r01*x1206))+(((-1.0)*new_r11*x1205)));
15366evalcond[7]=(((new_r11*x1206))+((new_r01*x1205))+(((-1.0)*gconst13)));
15367if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
15368{
15369continue;
15370}
15371}
15372
15373{
15374std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
15375vinfos[0].jointtype = 1;
15376vinfos[0].foffset = j0;
15377vinfos[0].indices[0] = _ij0[0];
15378vinfos[0].indices[1] = _ij0[1];
15379vinfos[0].maxsolutions = _nj0;
15380vinfos[1].jointtype = 1;
15381vinfos[1].foffset = j1;
15382vinfos[1].indices[0] = _ij1[0];
15383vinfos[1].indices[1] = _ij1[1];
15384vinfos[1].maxsolutions = _nj1;
15385vinfos[2].jointtype = 1;
15386vinfos[2].foffset = j2;
15387vinfos[2].indices[0] = _ij2[0];
15388vinfos[2].indices[1] = _ij2[1];
15389vinfos[2].maxsolutions = _nj2;
15390vinfos[3].jointtype = 1;
15391vinfos[3].foffset = j3;
15392vinfos[3].indices[0] = _ij3[0];
15393vinfos[3].indices[1] = _ij3[1];
15394vinfos[3].maxsolutions = _nj3;
15395vinfos[4].jointtype = 1;
15396vinfos[4].foffset = j4;
15397vinfos[4].indices[0] = _ij4[0];
15398vinfos[4].indices[1] = _ij4[1];
15399vinfos[4].maxsolutions = _nj4;
15400vinfos[5].jointtype = 1;
15401vinfos[5].foffset = j5;
15402vinfos[5].indices[0] = _ij5[0];
15403vinfos[5].indices[1] = _ij5[1];
15404vinfos[5].maxsolutions = _nj5;
15405std::vector<int> vfree(0);
15406solutions.AddSolution(vinfos,vfree);
15407}
15408}
15409}
15410
15411}
15412
15413}
15414
15415} else
15416{
15417{
15418IkReal j3array[1], cj3array[1], sj3array[1];
15419bool j3valid[1]={false};
15420_nj3 = 1;
15422if(!x1209.valid){
15423continue;
15424}
15426if(!x1210.valid){
15427continue;
15428}
15429j3array[0]=((-1.5707963267949)+(x1209.value)+(((1.5707963267949)*(x1210.value))));
15430sj3array[0]=IKsin(j3array[0]);
15431cj3array[0]=IKcos(j3array[0]);
15432if( j3array[0] > IKPI )
15433{
15434 j3array[0]-=IK2PI;
15435}
15436else if( j3array[0] < -IKPI )
15437{ j3array[0]+=IK2PI;
15438}
15439j3valid[0] = true;
15440for(int ij3 = 0; ij3 < 1; ++ij3)
15441{
15442if( !j3valid[ij3] )
15443{
15444 continue;
15445}
15446_ij3[0] = ij3; _ij3[1] = -1;
15447for(int iij3 = ij3+1; iij3 < 1; ++iij3)
15448{
15449if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
15450{
15451 j3valid[iij3]=false; _ij3[1] = iij3; break;
15452}
15453}
15454j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
15455{
15456IkReal evalcond[8];
15457IkReal x1211=IKcos(j3);
15458IkReal x1212=IKsin(j3);
15459IkReal x1213=(gconst13*x1211);
15460IkReal x1214=(gconst13*x1212);
15461evalcond[0]=(new_r00*x1211);
15462evalcond[1]=((-1.0)*x1213);
15463evalcond[2]=(gconst13+((new_r00*x1212)));
15464evalcond[3]=(x1214+new_r00);
15465evalcond[4]=(new_r01+(((-1.0)*x1213)));
15466evalcond[5]=(new_r11+(((-1.0)*x1214)));
15467evalcond[6]=(((new_r01*x1212))+(((-1.0)*new_r11*x1211)));
15468evalcond[7]=(((new_r11*x1212))+((new_r01*x1211))+(((-1.0)*gconst13)));
15469if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
15470{
15471continue;
15472}
15473}
15474
15475{
15476std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
15477vinfos[0].jointtype = 1;
15478vinfos[0].foffset = j0;
15479vinfos[0].indices[0] = _ij0[0];
15480vinfos[0].indices[1] = _ij0[1];
15481vinfos[0].maxsolutions = _nj0;
15482vinfos[1].jointtype = 1;
15483vinfos[1].foffset = j1;
15484vinfos[1].indices[0] = _ij1[0];
15485vinfos[1].indices[1] = _ij1[1];
15486vinfos[1].maxsolutions = _nj1;
15487vinfos[2].jointtype = 1;
15488vinfos[2].foffset = j2;
15489vinfos[2].indices[0] = _ij2[0];
15490vinfos[2].indices[1] = _ij2[1];
15491vinfos[2].maxsolutions = _nj2;
15492vinfos[3].jointtype = 1;
15493vinfos[3].foffset = j3;
15494vinfos[3].indices[0] = _ij3[0];
15495vinfos[3].indices[1] = _ij3[1];
15496vinfos[3].maxsolutions = _nj3;
15497vinfos[4].jointtype = 1;
15498vinfos[4].foffset = j4;
15499vinfos[4].indices[0] = _ij4[0];
15500vinfos[4].indices[1] = _ij4[1];
15501vinfos[4].maxsolutions = _nj4;
15502vinfos[5].jointtype = 1;
15503vinfos[5].foffset = j5;
15504vinfos[5].indices[0] = _ij5[0];
15505vinfos[5].indices[1] = _ij5[1];
15506vinfos[5].maxsolutions = _nj5;
15507std::vector<int> vfree(0);
15508solutions.AddSolution(vinfos,vfree);
15509}
15510}
15511}
15512
15513}
15514
15515}
15516
15517}
15518} while(0);
15519if( bgotonextstatement )
15520{
15521bool bgotonextstatement = true;
15522do
15523{
15524if( 1 )
15525{
15526bgotonextstatement=false;
15527continue; // branch miss [j3]
15528
15529}
15530} while(0);
15531if( bgotonextstatement )
15532{
15533}
15534}
15535}
15536}
15537}
15538}
15539}
15540
15541} else
15542{
15543{
15544IkReal j3array[1], cj3array[1], sj3array[1];
15545bool j3valid[1]={false};
15546_nj3 = 1;
15547IkReal x1215=((1.0)*gconst14);
15548CheckValue<IkReal> x1216=IKPowWithIntegerCheck(IKsign((((gconst13*new_r00))+(((-1.0)*new_r10*x1215)))),-1);
15549if(!x1216.valid){
15550continue;
15551}
15552CheckValue<IkReal> x1217 = IKatan2WithCheck(IkReal(((gconst14*gconst14)+(((-1.0)*(new_r00*new_r00))))),IkReal((((new_r00*new_r10))+(((-1.0)*gconst13*x1215)))),IKFAST_ATAN2_MAGTHRESH);
15553if(!x1217.valid){
15554continue;
15555}
15556j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1216.value)))+(x1217.value));
15557sj3array[0]=IKsin(j3array[0]);
15558cj3array[0]=IKcos(j3array[0]);
15559if( j3array[0] > IKPI )
15560{
15561 j3array[0]-=IK2PI;
15562}
15563else if( j3array[0] < -IKPI )
15564{ j3array[0]+=IK2PI;
15565}
15566j3valid[0] = true;
15567for(int ij3 = 0; ij3 < 1; ++ij3)
15568{
15569if( !j3valid[ij3] )
15570{
15571 continue;
15572}
15573_ij3[0] = ij3; _ij3[1] = -1;
15574for(int iij3 = ij3+1; iij3 < 1; ++iij3)
15575{
15576if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
15577{
15578 j3valid[iij3]=false; _ij3[1] = iij3; break;
15579}
15580}
15581j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
15582{
15583IkReal evalcond[8];
15584IkReal x1218=IKsin(j3);
15585IkReal x1219=IKcos(j3);
15586IkReal x1220=(gconst14*x1218);
15587IkReal x1221=((1.0)*x1219);
15588IkReal x1222=(gconst13*x1218);
15589IkReal x1223=(gconst13*x1221);
15590evalcond[0]=(((new_r10*x1218))+gconst14+((new_r00*x1219)));
15591evalcond[1]=(x1222+((gconst14*x1219))+new_r00);
15592evalcond[2]=(gconst13+((new_r00*x1218))+(((-1.0)*new_r10*x1221)));
15593evalcond[3]=(gconst14+((new_r01*x1218))+(((-1.0)*new_r11*x1221)));
15594evalcond[4]=(x1220+(((-1.0)*x1223))+new_r01);
15595evalcond[5]=(x1220+(((-1.0)*x1223))+new_r10);
15596evalcond[6]=(((new_r11*x1218))+((new_r01*x1219))+(((-1.0)*gconst13)));
15597evalcond[7]=((((-1.0)*x1222))+new_r11+(((-1.0)*gconst14*x1221)));
15598if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
15599{
15600continue;
15601}
15602}
15603
15604{
15605std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
15606vinfos[0].jointtype = 1;
15607vinfos[0].foffset = j0;
15608vinfos[0].indices[0] = _ij0[0];
15609vinfos[0].indices[1] = _ij0[1];
15610vinfos[0].maxsolutions = _nj0;
15611vinfos[1].jointtype = 1;
15612vinfos[1].foffset = j1;
15613vinfos[1].indices[0] = _ij1[0];
15614vinfos[1].indices[1] = _ij1[1];
15615vinfos[1].maxsolutions = _nj1;
15616vinfos[2].jointtype = 1;
15617vinfos[2].foffset = j2;
15618vinfos[2].indices[0] = _ij2[0];
15619vinfos[2].indices[1] = _ij2[1];
15620vinfos[2].maxsolutions = _nj2;
15621vinfos[3].jointtype = 1;
15622vinfos[3].foffset = j3;
15623vinfos[3].indices[0] = _ij3[0];
15624vinfos[3].indices[1] = _ij3[1];
15625vinfos[3].maxsolutions = _nj3;
15626vinfos[4].jointtype = 1;
15627vinfos[4].foffset = j4;
15628vinfos[4].indices[0] = _ij4[0];
15629vinfos[4].indices[1] = _ij4[1];
15630vinfos[4].maxsolutions = _nj4;
15631vinfos[5].jointtype = 1;
15632vinfos[5].foffset = j5;
15633vinfos[5].indices[0] = _ij5[0];
15634vinfos[5].indices[1] = _ij5[1];
15635vinfos[5].maxsolutions = _nj5;
15636std::vector<int> vfree(0);
15637solutions.AddSolution(vinfos,vfree);
15638}
15639}
15640}
15641
15642}
15643
15644}
15645
15646} else
15647{
15648{
15649IkReal j3array[1], cj3array[1], sj3array[1];
15650bool j3valid[1]={false};
15651_nj3 = 1;
15652IkReal x1224=((1.0)*gconst14);
15653CheckValue<IkReal> x1225 = IKatan2WithCheck(IkReal(((gconst14*gconst14)+((new_r00*new_r11)))),IkReal((((new_r00*new_r01))+(((-1.0)*gconst13*x1224)))),IKFAST_ATAN2_MAGTHRESH);
15654if(!x1225.valid){
15655continue;
15656}
15657CheckValue<IkReal> x1226=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst13*new_r11))+(((-1.0)*new_r01*x1224)))),-1);
15658if(!x1226.valid){
15659continue;
15660}
15661j3array[0]=((-1.5707963267949)+(x1225.value)+(((1.5707963267949)*(x1226.value))));
15662sj3array[0]=IKsin(j3array[0]);
15663cj3array[0]=IKcos(j3array[0]);
15664if( j3array[0] > IKPI )
15665{
15666 j3array[0]-=IK2PI;
15667}
15668else if( j3array[0] < -IKPI )
15669{ j3array[0]+=IK2PI;
15670}
15671j3valid[0] = true;
15672for(int ij3 = 0; ij3 < 1; ++ij3)
15673{
15674if( !j3valid[ij3] )
15675{
15676 continue;
15677}
15678_ij3[0] = ij3; _ij3[1] = -1;
15679for(int iij3 = ij3+1; iij3 < 1; ++iij3)
15680{
15681if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
15682{
15683 j3valid[iij3]=false; _ij3[1] = iij3; break;
15684}
15685}
15686j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
15687{
15688IkReal evalcond[8];
15689IkReal x1227=IKsin(j3);
15690IkReal x1228=IKcos(j3);
15691IkReal x1229=(gconst14*x1227);
15692IkReal x1230=((1.0)*x1228);
15693IkReal x1231=(gconst13*x1227);
15694IkReal x1232=(gconst13*x1230);
15695evalcond[0]=(gconst14+((new_r00*x1228))+((new_r10*x1227)));
15696evalcond[1]=(x1231+new_r00+((gconst14*x1228)));
15697evalcond[2]=(gconst13+((new_r00*x1227))+(((-1.0)*new_r10*x1230)));
15698evalcond[3]=(gconst14+((new_r01*x1227))+(((-1.0)*new_r11*x1230)));
15699evalcond[4]=(x1229+(((-1.0)*x1232))+new_r01);
15700evalcond[5]=(x1229+(((-1.0)*x1232))+new_r10);
15701evalcond[6]=(((new_r11*x1227))+((new_r01*x1228))+(((-1.0)*gconst13)));
15702evalcond[7]=((((-1.0)*x1231))+new_r11+(((-1.0)*gconst14*x1230)));
15703if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
15704{
15705continue;
15706}
15707}
15708
15709{
15710std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
15711vinfos[0].jointtype = 1;
15712vinfos[0].foffset = j0;
15713vinfos[0].indices[0] = _ij0[0];
15714vinfos[0].indices[1] = _ij0[1];
15715vinfos[0].maxsolutions = _nj0;
15716vinfos[1].jointtype = 1;
15717vinfos[1].foffset = j1;
15718vinfos[1].indices[0] = _ij1[0];
15719vinfos[1].indices[1] = _ij1[1];
15720vinfos[1].maxsolutions = _nj1;
15721vinfos[2].jointtype = 1;
15722vinfos[2].foffset = j2;
15723vinfos[2].indices[0] = _ij2[0];
15724vinfos[2].indices[1] = _ij2[1];
15725vinfos[2].maxsolutions = _nj2;
15726vinfos[3].jointtype = 1;
15727vinfos[3].foffset = j3;
15728vinfos[3].indices[0] = _ij3[0];
15729vinfos[3].indices[1] = _ij3[1];
15730vinfos[3].maxsolutions = _nj3;
15731vinfos[4].jointtype = 1;
15732vinfos[4].foffset = j4;
15733vinfos[4].indices[0] = _ij4[0];
15734vinfos[4].indices[1] = _ij4[1];
15735vinfos[4].maxsolutions = _nj4;
15736vinfos[5].jointtype = 1;
15737vinfos[5].foffset = j5;
15738vinfos[5].indices[0] = _ij5[0];
15739vinfos[5].indices[1] = _ij5[1];
15740vinfos[5].maxsolutions = _nj5;
15741std::vector<int> vfree(0);
15742solutions.AddSolution(vinfos,vfree);
15743}
15744}
15745}
15746
15747}
15748
15749}
15750
15751} else
15752{
15753{
15754IkReal j3array[1], cj3array[1], sj3array[1];
15755bool j3valid[1]={false};
15756_nj3 = 1;
15757IkReal x1233=((1.0)*new_r10);
15758CheckValue<IkReal> x1234=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r00*new_r01))+(((-1.0)*new_r11*x1233)))),-1);
15759if(!x1234.valid){
15760continue;
15761}
15762CheckValue<IkReal> x1235 = IKatan2WithCheck(IkReal((((gconst14*new_r00))+((gconst14*new_r11)))),IkReal((((gconst14*new_r01))+(((-1.0)*gconst14*x1233)))),IKFAST_ATAN2_MAGTHRESH);
15763if(!x1235.valid){
15764continue;
15765}
15766j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1234.value)))+(x1235.value));
15767sj3array[0]=IKsin(j3array[0]);
15768cj3array[0]=IKcos(j3array[0]);
15769if( j3array[0] > IKPI )
15770{
15771 j3array[0]-=IK2PI;
15772}
15773else if( j3array[0] < -IKPI )
15774{ j3array[0]+=IK2PI;
15775}
15776j3valid[0] = true;
15777for(int ij3 = 0; ij3 < 1; ++ij3)
15778{
15779if( !j3valid[ij3] )
15780{
15781 continue;
15782}
15783_ij3[0] = ij3; _ij3[1] = -1;
15784for(int iij3 = ij3+1; iij3 < 1; ++iij3)
15785{
15786if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
15787{
15788 j3valid[iij3]=false; _ij3[1] = iij3; break;
15789}
15790}
15791j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
15792{
15793IkReal evalcond[8];
15794IkReal x1236=IKsin(j3);
15795IkReal x1237=IKcos(j3);
15796IkReal x1238=(gconst14*x1236);
15797IkReal x1239=((1.0)*x1237);
15798IkReal x1240=(gconst13*x1236);
15799IkReal x1241=(gconst13*x1239);
15800evalcond[0]=(gconst14+((new_r10*x1236))+((new_r00*x1237)));
15801evalcond[1]=(((gconst14*x1237))+x1240+new_r00);
15802evalcond[2]=(gconst13+((new_r00*x1236))+(((-1.0)*new_r10*x1239)));
15803evalcond[3]=(gconst14+((new_r01*x1236))+(((-1.0)*new_r11*x1239)));
15804evalcond[4]=(x1238+(((-1.0)*x1241))+new_r01);
15805evalcond[5]=(x1238+(((-1.0)*x1241))+new_r10);
15806evalcond[6]=(((new_r01*x1237))+((new_r11*x1236))+(((-1.0)*gconst13)));
15807evalcond[7]=((((-1.0)*x1240))+new_r11+(((-1.0)*gconst14*x1239)));
15808if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
15809{
15810continue;
15811}
15812}
15813
15814{
15815std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
15816vinfos[0].jointtype = 1;
15817vinfos[0].foffset = j0;
15818vinfos[0].indices[0] = _ij0[0];
15819vinfos[0].indices[1] = _ij0[1];
15820vinfos[0].maxsolutions = _nj0;
15821vinfos[1].jointtype = 1;
15822vinfos[1].foffset = j1;
15823vinfos[1].indices[0] = _ij1[0];
15824vinfos[1].indices[1] = _ij1[1];
15825vinfos[1].maxsolutions = _nj1;
15826vinfos[2].jointtype = 1;
15827vinfos[2].foffset = j2;
15828vinfos[2].indices[0] = _ij2[0];
15829vinfos[2].indices[1] = _ij2[1];
15830vinfos[2].maxsolutions = _nj2;
15831vinfos[3].jointtype = 1;
15832vinfos[3].foffset = j3;
15833vinfos[3].indices[0] = _ij3[0];
15834vinfos[3].indices[1] = _ij3[1];
15835vinfos[3].maxsolutions = _nj3;
15836vinfos[4].jointtype = 1;
15837vinfos[4].foffset = j4;
15838vinfos[4].indices[0] = _ij4[0];
15839vinfos[4].indices[1] = _ij4[1];
15840vinfos[4].maxsolutions = _nj4;
15841vinfos[5].jointtype = 1;
15842vinfos[5].foffset = j5;
15843vinfos[5].indices[0] = _ij5[0];
15844vinfos[5].indices[1] = _ij5[1];
15845vinfos[5].maxsolutions = _nj5;
15846std::vector<int> vfree(0);
15847solutions.AddSolution(vinfos,vfree);
15848}
15849}
15850}
15851
15852}
15853
15854}
15855
15856}
15857} while(0);
15858if( bgotonextstatement )
15859{
15860bool bgotonextstatement = true;
15861do
15862{
15863IkReal x1242=((-1.0)*new_r00);
15864IkReal x1244 = ((new_r10*new_r10)+(new_r00*new_r00));
15865if(IKabs(x1244)==0){
15866continue;
15867}
15868IkReal x1243=pow(x1244,-0.5);
15869CheckValue<IkReal> x1245 = IKatan2WithCheck(IkReal(x1242),IkReal(((-1.0)*new_r10)),IKFAST_ATAN2_MAGTHRESH);
15870if(!x1245.valid){
15871continue;
15872}
15873IkReal gconst15=((3.14159265358979)+(((-1.0)*(x1245.value))));
15874IkReal gconst16=(x1242*x1243);
15875IkReal gconst17=((1.0)*new_r10*x1243);
15876CheckValue<IkReal> x1246 = IKatan2WithCheck(IkReal(((-1.0)*new_r00)),IkReal(((-1.0)*new_r10)),IKFAST_ATAN2_MAGTHRESH);
15877if(!x1246.valid){
15878continue;
15879}
15880evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+(x1246.value)+j5)))), 6.28318530717959)));
15881if( IKabs(evalcond[0]) < 0.0000050000000000 )
15882{
15883bgotonextstatement=false;
15884{
15885IkReal j3eval[3];
15886IkReal x1247=((-1.0)*new_r00);
15887CheckValue<IkReal> x1250 = IKatan2WithCheck(IkReal(x1247),IkReal(((-1.0)*new_r10)),IKFAST_ATAN2_MAGTHRESH);
15888if(!x1250.valid){
15889continue;
15890}
15891IkReal x1248=((1.0)*(x1250.value));
15892IkReal x1249=x1243;
15893sj4=0;
15894cj4=-1.0;
15895j4=3.14159265358979;
15896sj5=gconst16;
15897cj5=gconst17;
15898j5=((3.14159265)+(((-1.0)*x1248)));
15899IkReal gconst15=((3.14159265358979)+(((-1.0)*x1248)));
15900IkReal gconst16=(x1247*x1249);
15901IkReal gconst17=((1.0)*new_r10*x1249);
15902IkReal x1251=new_r10*new_r10;
15903IkReal x1252=(new_r10*new_r11);
15904IkReal x1253=((((-1.0)*new_r00*new_r01))+(((-1.0)*x1252)));
15905IkReal x1254=x1243;
15906IkReal x1255=(new_r10*x1254);
15907j3eval[0]=x1253;
15908j3eval[1]=((IKabs((((new_r01*x1255))+(((-1.0)*x1251*x1254)))))+(IKabs((((new_r00*x1255))+((x1252*x1254))))));
15909j3eval[2]=IKsign(x1253);
15910if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
15911{
15912{
15913IkReal j3eval[1];
15914IkReal x1256=((-1.0)*new_r00);
15915CheckValue<IkReal> x1259 = IKatan2WithCheck(IkReal(x1256),IkReal(((-1.0)*new_r10)),IKFAST_ATAN2_MAGTHRESH);
15916if(!x1259.valid){
15917continue;
15918}
15919IkReal x1257=((1.0)*(x1259.value));
15920IkReal x1258=x1243;
15921sj4=0;
15922cj4=-1.0;
15923j4=3.14159265358979;
15924sj5=gconst16;
15925cj5=gconst17;
15926j5=((3.14159265)+(((-1.0)*x1257)));
15927IkReal gconst15=((3.14159265358979)+(((-1.0)*x1257)));
15928IkReal gconst16=(x1256*x1258);
15929IkReal gconst17=((1.0)*new_r10*x1258);
15930IkReal x1260=new_r10*new_r10;
15931IkReal x1261=new_r00*new_r00*new_r00;
15933if(!x1265.valid){
15934continue;
15935}
15936IkReal x1262=x1265.value;
15937IkReal x1263=(x1260*x1262);
15938IkReal x1264=(x1261*x1262);
15939j3eval[0]=((IKabs((((new_r00*new_r10*x1262))+((new_r01*x1264))+((new_r00*new_r01*x1263)))))+(IKabs((x1263+((new_r11*x1264))+((new_r00*new_r11*x1263))))));
15940if( IKabs(j3eval[0]) < 0.0000010000000000 )
15941{
15942{
15943IkReal j3eval[1];
15944IkReal x1266=((-1.0)*new_r00);
15945CheckValue<IkReal> x1269 = IKatan2WithCheck(IkReal(x1266),IkReal(((-1.0)*new_r10)),IKFAST_ATAN2_MAGTHRESH);
15946if(!x1269.valid){
15947continue;
15948}
15949IkReal x1267=((1.0)*(x1269.value));
15950IkReal x1268=x1243;
15951sj4=0;
15952cj4=-1.0;
15953j4=3.14159265358979;
15954sj5=gconst16;
15955cj5=gconst17;
15956j5=((3.14159265)+(((-1.0)*x1267)));
15957IkReal gconst15=((3.14159265358979)+(((-1.0)*x1267)));
15958IkReal gconst16=(x1266*x1268);
15959IkReal gconst17=((1.0)*new_r10*x1268);
15960IkReal x1270=new_r10*new_r10;
15961IkReal x1271=new_r00*new_r00;
15962CheckValue<IkReal> x1275=IKPowWithIntegerCheck((x1270+x1271),-1);
15963if(!x1275.valid){
15964continue;
15965}
15966IkReal x1272=x1275.value;
15967IkReal x1273=(new_r10*x1272);
15968IkReal x1274=(x1270*x1272);
15969j3eval[0]=((IKabs(((((-1.0)*x1271*x1274))+x1274+(((-1.0)*x1272*(x1271*x1271))))))+(IKabs((((new_r00*x1273))+((x1273*(new_r00*new_r00*new_r00)))+((new_r00*x1273*(new_r10*new_r10)))))));
15970if( IKabs(j3eval[0]) < 0.0000010000000000 )
15971{
15972{
15973IkReal evalcond[2];
15974bool bgotonextstatement = true;
15975do
15976{
15977evalcond[0]=((IKabs(new_r11))+(IKabs(new_r00)));
15978if( IKabs(evalcond[0]) < 0.0000050000000000 )
15979{
15980bgotonextstatement=false;
15981{
15982IkReal j3eval[1];
15983CheckValue<IkReal> x1277 = IKatan2WithCheck(IkReal(0),IkReal(((-1.0)*new_r10)),IKFAST_ATAN2_MAGTHRESH);
15984if(!x1277.valid){
15985continue;
15986}
15987IkReal x1276=((1.0)*(x1277.value));
15988sj4=0;
15989cj4=-1.0;
15990j4=3.14159265358979;
15991sj5=gconst16;
15992cj5=gconst17;
15993j5=((3.14159265)+(((-1.0)*x1276)));
15994new_r11=0;
15995new_r00=0;
15996IkReal gconst15=((3.14159265358979)+(((-1.0)*x1276)));
15997IkReal gconst16=0;
15998IkReal x1278 = new_r10*new_r10;
15999if(IKabs(x1278)==0){
16000continue;
16001}
16002IkReal gconst17=((1.0)*new_r10*(pow(x1278,-0.5)));
16003j3eval[0]=new_r01;
16004if( IKabs(j3eval[0]) < 0.0000010000000000 )
16005{
16006{
16007IkReal j3array[2], cj3array[2], sj3array[2];
16008bool j3valid[2]={false};
16009_nj3 = 2;
16010CheckValue<IkReal> x1279=IKPowWithIntegerCheck(gconst17,-1);
16011if(!x1279.valid){
16012continue;
16013}
16014sj3array[0]=((-1.0)*new_r01*(x1279.value));
16015if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
16016{
16017 j3valid[0] = j3valid[1] = true;
16018 j3array[0] = IKasin(sj3array[0]);
16019 cj3array[0] = IKcos(j3array[0]);
16020 sj3array[1] = sj3array[0];
16021 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
16022 cj3array[1] = -cj3array[0];
16023}
16024else if( isnan(sj3array[0]) )
16025{
16026 // probably any value will work
16027 j3valid[0] = true;
16028 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
16029}
16030for(int ij3 = 0; ij3 < 2; ++ij3)
16031{
16032if( !j3valid[ij3] )
16033{
16034 continue;
16035}
16036_ij3[0] = ij3; _ij3[1] = -1;
16037for(int iij3 = ij3+1; iij3 < 2; ++iij3)
16038{
16039if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
16040{
16041 j3valid[iij3]=false; _ij3[1] = iij3; break;
16042}
16043}
16044j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
16045{
16046IkReal evalcond[6];
16047IkReal x1280=IKcos(j3);
16048IkReal x1281=IKsin(j3);
16049evalcond[0]=(new_r01*x1280);
16050evalcond[1]=(gconst17*x1280);
16051evalcond[2]=((-1.0)*new_r10*x1280);
16052evalcond[3]=(gconst17+((new_r01*x1281)));
16053evalcond[4]=(((new_r10*x1281))+gconst17);
16054evalcond[5]=(new_r10+((gconst17*x1281)));
16055if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
16056{
16057continue;
16058}
16059}
16060
16061{
16062std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
16063vinfos[0].jointtype = 1;
16064vinfos[0].foffset = j0;
16065vinfos[0].indices[0] = _ij0[0];
16066vinfos[0].indices[1] = _ij0[1];
16067vinfos[0].maxsolutions = _nj0;
16068vinfos[1].jointtype = 1;
16069vinfos[1].foffset = j1;
16070vinfos[1].indices[0] = _ij1[0];
16071vinfos[1].indices[1] = _ij1[1];
16072vinfos[1].maxsolutions = _nj1;
16073vinfos[2].jointtype = 1;
16074vinfos[2].foffset = j2;
16075vinfos[2].indices[0] = _ij2[0];
16076vinfos[2].indices[1] = _ij2[1];
16077vinfos[2].maxsolutions = _nj2;
16078vinfos[3].jointtype = 1;
16079vinfos[3].foffset = j3;
16080vinfos[3].indices[0] = _ij3[0];
16081vinfos[3].indices[1] = _ij3[1];
16082vinfos[3].maxsolutions = _nj3;
16083vinfos[4].jointtype = 1;
16084vinfos[4].foffset = j4;
16085vinfos[4].indices[0] = _ij4[0];
16086vinfos[4].indices[1] = _ij4[1];
16087vinfos[4].maxsolutions = _nj4;
16088vinfos[5].jointtype = 1;
16089vinfos[5].foffset = j5;
16090vinfos[5].indices[0] = _ij5[0];
16091vinfos[5].indices[1] = _ij5[1];
16092vinfos[5].maxsolutions = _nj5;
16093std::vector<int> vfree(0);
16094solutions.AddSolution(vinfos,vfree);
16095}
16096}
16097}
16098
16099} else
16100{
16101{
16102IkReal j3array[2], cj3array[2], sj3array[2];
16103bool j3valid[2]={false};
16104_nj3 = 2;
16106if(!x1282.valid){
16107continue;
16108}
16109sj3array[0]=((-1.0)*gconst17*(x1282.value));
16110if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
16111{
16112 j3valid[0] = j3valid[1] = true;
16113 j3array[0] = IKasin(sj3array[0]);
16114 cj3array[0] = IKcos(j3array[0]);
16115 sj3array[1] = sj3array[0];
16116 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
16117 cj3array[1] = -cj3array[0];
16118}
16119else if( isnan(sj3array[0]) )
16120{
16121 // probably any value will work
16122 j3valid[0] = true;
16123 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
16124}
16125for(int ij3 = 0; ij3 < 2; ++ij3)
16126{
16127if( !j3valid[ij3] )
16128{
16129 continue;
16130}
16131_ij3[0] = ij3; _ij3[1] = -1;
16132for(int iij3 = ij3+1; iij3 < 2; ++iij3)
16133{
16134if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
16135{
16136 j3valid[iij3]=false; _ij3[1] = iij3; break;
16137}
16138}
16139j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
16140{
16141IkReal evalcond[6];
16142IkReal x1283=IKcos(j3);
16143IkReal x1284=IKsin(j3);
16144IkReal x1285=(gconst17*x1284);
16145evalcond[0]=(new_r01*x1283);
16146evalcond[1]=(gconst17*x1283);
16147evalcond[2]=((-1.0)*new_r10*x1283);
16148evalcond[3]=(x1285+new_r01);
16149evalcond[4]=(((new_r10*x1284))+gconst17);
16150evalcond[5]=(x1285+new_r10);
16151if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
16152{
16153continue;
16154}
16155}
16156
16157{
16158std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
16159vinfos[0].jointtype = 1;
16160vinfos[0].foffset = j0;
16161vinfos[0].indices[0] = _ij0[0];
16162vinfos[0].indices[1] = _ij0[1];
16163vinfos[0].maxsolutions = _nj0;
16164vinfos[1].jointtype = 1;
16165vinfos[1].foffset = j1;
16166vinfos[1].indices[0] = _ij1[0];
16167vinfos[1].indices[1] = _ij1[1];
16168vinfos[1].maxsolutions = _nj1;
16169vinfos[2].jointtype = 1;
16170vinfos[2].foffset = j2;
16171vinfos[2].indices[0] = _ij2[0];
16172vinfos[2].indices[1] = _ij2[1];
16173vinfos[2].maxsolutions = _nj2;
16174vinfos[3].jointtype = 1;
16175vinfos[3].foffset = j3;
16176vinfos[3].indices[0] = _ij3[0];
16177vinfos[3].indices[1] = _ij3[1];
16178vinfos[3].maxsolutions = _nj3;
16179vinfos[4].jointtype = 1;
16180vinfos[4].foffset = j4;
16181vinfos[4].indices[0] = _ij4[0];
16182vinfos[4].indices[1] = _ij4[1];
16183vinfos[4].maxsolutions = _nj4;
16184vinfos[5].jointtype = 1;
16185vinfos[5].foffset = j5;
16186vinfos[5].indices[0] = _ij5[0];
16187vinfos[5].indices[1] = _ij5[1];
16188vinfos[5].maxsolutions = _nj5;
16189std::vector<int> vfree(0);
16190solutions.AddSolution(vinfos,vfree);
16191}
16192}
16193}
16194
16195}
16196
16197}
16198
16199}
16200} while(0);
16201if( bgotonextstatement )
16202{
16203bool bgotonextstatement = true;
16204do
16205{
16206evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01)));
16207evalcond[1]=gconst17;
16208if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 )
16209{
16210bgotonextstatement=false;
16211{
16212IkReal j3eval[3];
16213IkReal x1286=((-1.0)*new_r00);
16214CheckValue<IkReal> x1288 = IKatan2WithCheck(IkReal(x1286),IkReal(((-1.0)*new_r10)),IKFAST_ATAN2_MAGTHRESH);
16215if(!x1288.valid){
16216continue;
16217}
16218IkReal x1287=((1.0)*(x1288.value));
16219sj4=0;
16220cj4=-1.0;
16221j4=3.14159265358979;
16222sj5=gconst16;
16223cj5=gconst17;
16224j5=((3.14159265)+(((-1.0)*x1287)));
16225new_r11=0;
16226new_r01=0;
16227new_r22=0;
16228new_r20=0;
16229IkReal gconst15=((3.14159265358979)+(((-1.0)*x1287)));
16230IkReal gconst16=x1286;
16231IkReal gconst17=((1.0)*new_r10);
16232j3eval[0]=1.0;
16233j3eval[1]=1.0;
16234j3eval[2]=((IKabs(((1.0)+(((-1.0)*(new_r10*new_r10))))))+(IKabs(((1.0)*new_r00*new_r10))));
16235if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
16236{
16237{
16238IkReal j3eval[3];
16239IkReal x1289=((-1.0)*new_r00);
16240CheckValue<IkReal> x1291 = IKatan2WithCheck(IkReal(x1289),IkReal(((-1.0)*new_r10)),IKFAST_ATAN2_MAGTHRESH);
16241if(!x1291.valid){
16242continue;
16243}
16244IkReal x1290=((1.0)*(x1291.value));
16245sj4=0;
16246cj4=-1.0;
16247j4=3.14159265358979;
16248sj5=gconst16;
16249cj5=gconst17;
16250j5=((3.14159265)+(((-1.0)*x1290)));
16251new_r11=0;
16252new_r01=0;
16253new_r22=0;
16254new_r20=0;
16255IkReal gconst15=((3.14159265358979)+(((-1.0)*x1290)));
16256IkReal gconst16=x1289;
16257IkReal gconst17=((1.0)*new_r10);
16258j3eval[0]=-1.0;
16259j3eval[1]=-1.0;
16260j3eval[2]=((IKabs(((1.0)*new_r00*new_r10)))+(IKabs(((-1.0)+(new_r10*new_r10)))));
16261if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
16262{
16263{
16264IkReal j3eval[3];
16265IkReal x1292=((-1.0)*new_r00);
16266CheckValue<IkReal> x1294 = IKatan2WithCheck(IkReal(x1292),IkReal(((-1.0)*new_r10)),IKFAST_ATAN2_MAGTHRESH);
16267if(!x1294.valid){
16268continue;
16269}
16270IkReal x1293=((1.0)*(x1294.value));
16271sj4=0;
16272cj4=-1.0;
16273j4=3.14159265358979;
16274sj5=gconst16;
16275cj5=gconst17;
16276j5=((3.14159265)+(((-1.0)*x1293)));
16277new_r11=0;
16278new_r01=0;
16279new_r22=0;
16280new_r20=0;
16281IkReal gconst15=((3.14159265358979)+(((-1.0)*x1293)));
16282IkReal gconst16=x1292;
16283IkReal gconst17=((1.0)*new_r10);
16284j3eval[0]=-1.0;
16285j3eval[1]=-1.0;
16286j3eval[2]=((IKabs(((-1.0)+(((2.0)*(new_r10*new_r10))))))+(IKabs(((2.0)*new_r00*new_r10))));
16287if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
16288{
16289continue; // 3 cases reached
16290
16291} else
16292{
16293{
16294IkReal j3array[1], cj3array[1], sj3array[1];
16295bool j3valid[1]={false};
16296_nj3 = 1;
16297IkReal x1295=((1.0)*gconst17);
16298CheckValue<IkReal> x1296 = IKatan2WithCheck(IkReal(((((-1.0)*(new_r00*new_r00)))+(gconst17*gconst17))),IkReal(((((-1.0)*gconst16*x1295))+((new_r00*new_r10)))),IKFAST_ATAN2_MAGTHRESH);
16299if(!x1296.valid){
16300continue;
16301}
16302CheckValue<IkReal> x1297=IKPowWithIntegerCheck(IKsign((((gconst16*new_r00))+(((-1.0)*new_r10*x1295)))),-1);
16303if(!x1297.valid){
16304continue;
16305}
16306j3array[0]=((-1.5707963267949)+(x1296.value)+(((1.5707963267949)*(x1297.value))));
16307sj3array[0]=IKsin(j3array[0]);
16308cj3array[0]=IKcos(j3array[0]);
16309if( j3array[0] > IKPI )
16310{
16311 j3array[0]-=IK2PI;
16312}
16313else if( j3array[0] < -IKPI )
16314{ j3array[0]+=IK2PI;
16315}
16316j3valid[0] = true;
16317for(int ij3 = 0; ij3 < 1; ++ij3)
16318{
16319if( !j3valid[ij3] )
16320{
16321 continue;
16322}
16323_ij3[0] = ij3; _ij3[1] = -1;
16324for(int iij3 = ij3+1; iij3 < 1; ++iij3)
16325{
16326if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
16327{
16328 j3valid[iij3]=false; _ij3[1] = iij3; break;
16329}
16330}
16331j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
16332{
16333IkReal evalcond[6];
16334IkReal x1298=IKsin(j3);
16335IkReal x1299=IKcos(j3);
16336IkReal x1300=(gconst17*x1298);
16337IkReal x1301=(gconst16*x1298);
16338IkReal x1302=(gconst17*x1299);
16339IkReal x1303=((1.0)*x1299);
16340IkReal x1304=(gconst16*x1303);
16341evalcond[0]=(x1300+(((-1.0)*x1304)));
16342evalcond[1]=(gconst17+((new_r10*x1298))+((new_r00*x1299)));
16343evalcond[2]=(x1301+x1302+new_r00);
16344evalcond[3]=((((-1.0)*new_r10*x1303))+gconst16+((new_r00*x1298)));
16345evalcond[4]=((((-1.0)*x1301))+(((-1.0)*x1302)));
16346evalcond[5]=(x1300+(((-1.0)*x1304))+new_r10);
16347if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
16348{
16349continue;
16350}
16351}
16352
16353{
16354std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
16355vinfos[0].jointtype = 1;
16356vinfos[0].foffset = j0;
16357vinfos[0].indices[0] = _ij0[0];
16358vinfos[0].indices[1] = _ij0[1];
16359vinfos[0].maxsolutions = _nj0;
16360vinfos[1].jointtype = 1;
16361vinfos[1].foffset = j1;
16362vinfos[1].indices[0] = _ij1[0];
16363vinfos[1].indices[1] = _ij1[1];
16364vinfos[1].maxsolutions = _nj1;
16365vinfos[2].jointtype = 1;
16366vinfos[2].foffset = j2;
16367vinfos[2].indices[0] = _ij2[0];
16368vinfos[2].indices[1] = _ij2[1];
16369vinfos[2].maxsolutions = _nj2;
16370vinfos[3].jointtype = 1;
16371vinfos[3].foffset = j3;
16372vinfos[3].indices[0] = _ij3[0];
16373vinfos[3].indices[1] = _ij3[1];
16374vinfos[3].maxsolutions = _nj3;
16375vinfos[4].jointtype = 1;
16376vinfos[4].foffset = j4;
16377vinfos[4].indices[0] = _ij4[0];
16378vinfos[4].indices[1] = _ij4[1];
16379vinfos[4].maxsolutions = _nj4;
16380vinfos[5].jointtype = 1;
16381vinfos[5].foffset = j5;
16382vinfos[5].indices[0] = _ij5[0];
16383vinfos[5].indices[1] = _ij5[1];
16384vinfos[5].maxsolutions = _nj5;
16385std::vector<int> vfree(0);
16386solutions.AddSolution(vinfos,vfree);
16387}
16388}
16389}
16390
16391}
16392
16393}
16394
16395} else
16396{
16397{
16398IkReal j3array[1], cj3array[1], sj3array[1];
16399bool j3valid[1]={false};
16400_nj3 = 1;
16401CheckValue<IkReal> x1305=IKPowWithIntegerCheck(IKsign(((((-1.0)*(gconst17*gconst17)))+(((-1.0)*(gconst16*gconst16))))),-1);
16402if(!x1305.valid){
16403continue;
16404}
16405CheckValue<IkReal> x1306 = IKatan2WithCheck(IkReal((gconst16*new_r00)),IkReal((gconst17*new_r00)),IKFAST_ATAN2_MAGTHRESH);
16406if(!x1306.valid){
16407continue;
16408}
16409j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1305.value)))+(x1306.value));
16410sj3array[0]=IKsin(j3array[0]);
16411cj3array[0]=IKcos(j3array[0]);
16412if( j3array[0] > IKPI )
16413{
16414 j3array[0]-=IK2PI;
16415}
16416else if( j3array[0] < -IKPI )
16417{ j3array[0]+=IK2PI;
16418}
16419j3valid[0] = true;
16420for(int ij3 = 0; ij3 < 1; ++ij3)
16421{
16422if( !j3valid[ij3] )
16423{
16424 continue;
16425}
16426_ij3[0] = ij3; _ij3[1] = -1;
16427for(int iij3 = ij3+1; iij3 < 1; ++iij3)
16428{
16429if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
16430{
16431 j3valid[iij3]=false; _ij3[1] = iij3; break;
16432}
16433}
16434j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
16435{
16436IkReal evalcond[6];
16437IkReal x1307=IKsin(j3);
16438IkReal x1308=IKcos(j3);
16439IkReal x1309=(gconst17*x1307);
16440IkReal x1310=(gconst16*x1307);
16441IkReal x1311=(gconst17*x1308);
16442IkReal x1312=((1.0)*x1308);
16443IkReal x1313=(gconst16*x1312);
16444evalcond[0]=(x1309+(((-1.0)*x1313)));
16445evalcond[1]=(gconst17+((new_r10*x1307))+((new_r00*x1308)));
16446evalcond[2]=(x1311+x1310+new_r00);
16447evalcond[3]=((((-1.0)*new_r10*x1312))+gconst16+((new_r00*x1307)));
16448evalcond[4]=((((-1.0)*x1310))+(((-1.0)*x1311)));
16449evalcond[5]=(x1309+(((-1.0)*x1313))+new_r10);
16450if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
16451{
16452continue;
16453}
16454}
16455
16456{
16457std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
16458vinfos[0].jointtype = 1;
16459vinfos[0].foffset = j0;
16460vinfos[0].indices[0] = _ij0[0];
16461vinfos[0].indices[1] = _ij0[1];
16462vinfos[0].maxsolutions = _nj0;
16463vinfos[1].jointtype = 1;
16464vinfos[1].foffset = j1;
16465vinfos[1].indices[0] = _ij1[0];
16466vinfos[1].indices[1] = _ij1[1];
16467vinfos[1].maxsolutions = _nj1;
16468vinfos[2].jointtype = 1;
16469vinfos[2].foffset = j2;
16470vinfos[2].indices[0] = _ij2[0];
16471vinfos[2].indices[1] = _ij2[1];
16472vinfos[2].maxsolutions = _nj2;
16473vinfos[3].jointtype = 1;
16474vinfos[3].foffset = j3;
16475vinfos[3].indices[0] = _ij3[0];
16476vinfos[3].indices[1] = _ij3[1];
16477vinfos[3].maxsolutions = _nj3;
16478vinfos[4].jointtype = 1;
16479vinfos[4].foffset = j4;
16480vinfos[4].indices[0] = _ij4[0];
16481vinfos[4].indices[1] = _ij4[1];
16482vinfos[4].maxsolutions = _nj4;
16483vinfos[5].jointtype = 1;
16484vinfos[5].foffset = j5;
16485vinfos[5].indices[0] = _ij5[0];
16486vinfos[5].indices[1] = _ij5[1];
16487vinfos[5].maxsolutions = _nj5;
16488std::vector<int> vfree(0);
16489solutions.AddSolution(vinfos,vfree);
16490}
16491}
16492}
16493
16494}
16495
16496}
16497
16498} else
16499{
16500{
16501IkReal j3array[1], cj3array[1], sj3array[1];
16502bool j3valid[1]={false};
16503_nj3 = 1;
16504CheckValue<IkReal> x1314=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst16*new_r00))+((gconst17*new_r10)))),-1);
16505if(!x1314.valid){
16506continue;
16507}
16508CheckValue<IkReal> x1315 = IKatan2WithCheck(IkReal(gconst16*gconst16),IkReal((gconst16*gconst17)),IKFAST_ATAN2_MAGTHRESH);
16509if(!x1315.valid){
16510continue;
16511}
16512j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1314.value)))+(x1315.value));
16513sj3array[0]=IKsin(j3array[0]);
16514cj3array[0]=IKcos(j3array[0]);
16515if( j3array[0] > IKPI )
16516{
16517 j3array[0]-=IK2PI;
16518}
16519else if( j3array[0] < -IKPI )
16520{ j3array[0]+=IK2PI;
16521}
16522j3valid[0] = true;
16523for(int ij3 = 0; ij3 < 1; ++ij3)
16524{
16525if( !j3valid[ij3] )
16526{
16527 continue;
16528}
16529_ij3[0] = ij3; _ij3[1] = -1;
16530for(int iij3 = ij3+1; iij3 < 1; ++iij3)
16531{
16532if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
16533{
16534 j3valid[iij3]=false; _ij3[1] = iij3; break;
16535}
16536}
16537j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
16538{
16539IkReal evalcond[6];
16540IkReal x1316=IKsin(j3);
16541IkReal x1317=IKcos(j3);
16542IkReal x1318=(gconst17*x1316);
16543IkReal x1319=(gconst16*x1316);
16544IkReal x1320=(gconst17*x1317);
16545IkReal x1321=((1.0)*x1317);
16546IkReal x1322=(gconst16*x1321);
16547evalcond[0]=(x1318+(((-1.0)*x1322)));
16548evalcond[1]=(((new_r00*x1317))+gconst17+((new_r10*x1316)));
16549evalcond[2]=(x1319+x1320+new_r00);
16550evalcond[3]=(((new_r00*x1316))+(((-1.0)*new_r10*x1321))+gconst16);
16551evalcond[4]=((((-1.0)*x1319))+(((-1.0)*x1320)));
16552evalcond[5]=(x1318+(((-1.0)*x1322))+new_r10);
16553if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
16554{
16555continue;
16556}
16557}
16558
16559{
16560std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
16561vinfos[0].jointtype = 1;
16562vinfos[0].foffset = j0;
16563vinfos[0].indices[0] = _ij0[0];
16564vinfos[0].indices[1] = _ij0[1];
16565vinfos[0].maxsolutions = _nj0;
16566vinfos[1].jointtype = 1;
16567vinfos[1].foffset = j1;
16568vinfos[1].indices[0] = _ij1[0];
16569vinfos[1].indices[1] = _ij1[1];
16570vinfos[1].maxsolutions = _nj1;
16571vinfos[2].jointtype = 1;
16572vinfos[2].foffset = j2;
16573vinfos[2].indices[0] = _ij2[0];
16574vinfos[2].indices[1] = _ij2[1];
16575vinfos[2].maxsolutions = _nj2;
16576vinfos[3].jointtype = 1;
16577vinfos[3].foffset = j3;
16578vinfos[3].indices[0] = _ij3[0];
16579vinfos[3].indices[1] = _ij3[1];
16580vinfos[3].maxsolutions = _nj3;
16581vinfos[4].jointtype = 1;
16582vinfos[4].foffset = j4;
16583vinfos[4].indices[0] = _ij4[0];
16584vinfos[4].indices[1] = _ij4[1];
16585vinfos[4].maxsolutions = _nj4;
16586vinfos[5].jointtype = 1;
16587vinfos[5].foffset = j5;
16588vinfos[5].indices[0] = _ij5[0];
16589vinfos[5].indices[1] = _ij5[1];
16590vinfos[5].maxsolutions = _nj5;
16591std::vector<int> vfree(0);
16592solutions.AddSolution(vinfos,vfree);
16593}
16594}
16595}
16596
16597}
16598
16599}
16600
16601}
16602} while(0);
16603if( bgotonextstatement )
16604{
16605bool bgotonextstatement = true;
16606do
16607{
16608evalcond[0]=((IKabs(new_r10))+(IKabs(new_r01)));
16609if( IKabs(evalcond[0]) < 0.0000050000000000 )
16610{
16611bgotonextstatement=false;
16612{
16613IkReal j3array[2], cj3array[2], sj3array[2];
16614bool j3valid[2]={false};
16615_nj3 = 2;
16616CheckValue<IkReal> x1323=IKPowWithIntegerCheck(gconst16,-1);
16617if(!x1323.valid){
16618continue;
16619}
16620sj3array[0]=(new_r11*(x1323.value));
16621if( sj3array[0] >= -1-IKFAST_SINCOS_THRESH && sj3array[0] <= 1+IKFAST_SINCOS_THRESH )
16622{
16623 j3valid[0] = j3valid[1] = true;
16624 j3array[0] = IKasin(sj3array[0]);
16625 cj3array[0] = IKcos(j3array[0]);
16626 sj3array[1] = sj3array[0];
16627 j3array[1] = j3array[0] > 0 ? (IKPI-j3array[0]) : (-IKPI-j3array[0]);
16628 cj3array[1] = -cj3array[0];
16629}
16630else if( isnan(sj3array[0]) )
16631{
16632 // probably any value will work
16633 j3valid[0] = true;
16634 cj3array[0] = 1; sj3array[0] = 0; j3array[0] = 0;
16635}
16636for(int ij3 = 0; ij3 < 2; ++ij3)
16637{
16638if( !j3valid[ij3] )
16639{
16640 continue;
16641}
16642_ij3[0] = ij3; _ij3[1] = -1;
16643for(int iij3 = ij3+1; iij3 < 2; ++iij3)
16644{
16645if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
16646{
16647 j3valid[iij3]=false; _ij3[1] = iij3; break;
16648}
16649}
16650j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
16651{
16652IkReal evalcond[6];
16653IkReal x1324=IKcos(j3);
16654IkReal x1325=IKsin(j3);
16655IkReal x1326=((-1.0)*x1324);
16656evalcond[0]=(new_r00*x1324);
16657evalcond[1]=(new_r11*x1326);
16658evalcond[2]=(gconst16*x1326);
16659evalcond[3]=(((new_r00*x1325))+gconst16);
16660evalcond[4]=(((gconst16*x1325))+new_r00);
16661evalcond[5]=(((new_r11*x1325))+(((-1.0)*gconst16)));
16662if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH )
16663{
16664continue;
16665}
16666}
16667
16668{
16669std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
16670vinfos[0].jointtype = 1;
16671vinfos[0].foffset = j0;
16672vinfos[0].indices[0] = _ij0[0];
16673vinfos[0].indices[1] = _ij0[1];
16674vinfos[0].maxsolutions = _nj0;
16675vinfos[1].jointtype = 1;
16676vinfos[1].foffset = j1;
16677vinfos[1].indices[0] = _ij1[0];
16678vinfos[1].indices[1] = _ij1[1];
16679vinfos[1].maxsolutions = _nj1;
16680vinfos[2].jointtype = 1;
16681vinfos[2].foffset = j2;
16682vinfos[2].indices[0] = _ij2[0];
16683vinfos[2].indices[1] = _ij2[1];
16684vinfos[2].maxsolutions = _nj2;
16685vinfos[3].jointtype = 1;
16686vinfos[3].foffset = j3;
16687vinfos[3].indices[0] = _ij3[0];
16688vinfos[3].indices[1] = _ij3[1];
16689vinfos[3].maxsolutions = _nj3;
16690vinfos[4].jointtype = 1;
16691vinfos[4].foffset = j4;
16692vinfos[4].indices[0] = _ij4[0];
16693vinfos[4].indices[1] = _ij4[1];
16694vinfos[4].maxsolutions = _nj4;
16695vinfos[5].jointtype = 1;
16696vinfos[5].foffset = j5;
16697vinfos[5].indices[0] = _ij5[0];
16698vinfos[5].indices[1] = _ij5[1];
16699vinfos[5].maxsolutions = _nj5;
16700std::vector<int> vfree(0);
16701solutions.AddSolution(vinfos,vfree);
16702}
16703}
16704}
16705
16706}
16707} while(0);
16708if( bgotonextstatement )
16709{
16710bool bgotonextstatement = true;
16711do
16712{
16713evalcond[0]=((IKabs(new_r11))+(IKabs(new_r10)));
16714if( IKabs(evalcond[0]) < 0.0000050000000000 )
16715{
16716bgotonextstatement=false;
16717{
16718IkReal j3eval[1];
16719IkReal x1327=((-1.0)*new_r00);
16720CheckValue<IkReal> x1329 = IKatan2WithCheck(IkReal(x1327),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
16721if(!x1329.valid){
16722continue;
16723}
16724IkReal x1328=((1.0)*(x1329.value));
16725sj4=0;
16726cj4=-1.0;
16727j4=3.14159265358979;
16728sj5=gconst16;
16729cj5=gconst17;
16730j5=((3.14159265)+(((-1.0)*x1328)));
16731new_r11=0;
16732new_r10=0;
16733new_r22=0;
16734new_r02=0;
16735IkReal gconst15=((3.14159265358979)+(((-1.0)*x1328)));
16736IkReal x1330 = ((1.0)+(((-1.0)*(new_r01*new_r01))));
16737if(IKabs(x1330)==0){
16738continue;
16739}
16740IkReal gconst16=(x1327*(pow(x1330,-0.5)));
16741IkReal gconst17=0;
16742j3eval[0]=((IKabs(new_r00))+(IKabs(new_r01)));
16743if( IKabs(j3eval[0]) < 0.0000010000000000 )
16744{
16745{
16746IkReal j3eval[1];
16747IkReal x1331=((-1.0)*new_r00);
16748CheckValue<IkReal> x1333 = IKatan2WithCheck(IkReal(x1331),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
16749if(!x1333.valid){
16750continue;
16751}
16752IkReal x1332=((1.0)*(x1333.value));
16753sj4=0;
16754cj4=-1.0;
16755j4=3.14159265358979;
16756sj5=gconst16;
16757cj5=gconst17;
16758j5=((3.14159265)+(((-1.0)*x1332)));
16759new_r11=0;
16760new_r10=0;
16761new_r22=0;
16762new_r02=0;
16763IkReal gconst15=((3.14159265358979)+(((-1.0)*x1332)));
16764IkReal x1334 = ((1.0)+(((-1.0)*(new_r01*new_r01))));
16765if(IKabs(x1334)==0){
16766continue;
16767}
16768IkReal gconst16=(x1331*(pow(x1334,-0.5)));
16769IkReal gconst17=0;
16770j3eval[0]=new_r00;
16771if( IKabs(j3eval[0]) < 0.0000010000000000 )
16772{
16773{
16774IkReal j3eval[2];
16775IkReal x1335=((-1.0)*new_r00);
16776CheckValue<IkReal> x1337 = IKatan2WithCheck(IkReal(x1335),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
16777if(!x1337.valid){
16778continue;
16779}
16780IkReal x1336=((1.0)*(x1337.value));
16781sj4=0;
16782cj4=-1.0;
16783j4=3.14159265358979;
16784sj5=gconst16;
16785cj5=gconst17;
16786j5=((3.14159265)+(((-1.0)*x1336)));
16787new_r11=0;
16788new_r10=0;
16789new_r22=0;
16790new_r02=0;
16791IkReal gconst15=((3.14159265358979)+(((-1.0)*x1336)));
16792IkReal x1338 = ((1.0)+(((-1.0)*(new_r01*new_r01))));
16793if(IKabs(x1338)==0){
16794continue;
16795}
16796IkReal gconst16=(x1335*(pow(x1338,-0.5)));
16797IkReal gconst17=0;
16798j3eval[0]=new_r00;
16799j3eval[1]=new_r01;
16800if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 )
16801{
16802continue; // 3 cases reached
16803
16804} else
16805{
16806{
16807IkReal j3array[1], cj3array[1], sj3array[1];
16808bool j3valid[1]={false};
16809_nj3 = 1;
16811if(!x1339.valid){
16812continue;
16813}
16815if(!x1340.valid){
16816continue;
16817}
16818if( IKabs(((-1.0)*gconst16*(x1339.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst16*(x1340.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*gconst16*(x1339.value)))+IKsqr((gconst16*(x1340.value)))-1) <= IKFAST_SINCOS_THRESH )
16819 continue;
16820j3array[0]=IKatan2(((-1.0)*gconst16*(x1339.value)), (gconst16*(x1340.value)));
16821sj3array[0]=IKsin(j3array[0]);
16822cj3array[0]=IKcos(j3array[0]);
16823if( j3array[0] > IKPI )
16824{
16825 j3array[0]-=IK2PI;
16826}
16827else if( j3array[0] < -IKPI )
16828{ j3array[0]+=IK2PI;
16829}
16830j3valid[0] = true;
16831for(int ij3 = 0; ij3 < 1; ++ij3)
16832{
16833if( !j3valid[ij3] )
16834{
16835 continue;
16836}
16837_ij3[0] = ij3; _ij3[1] = -1;
16838for(int iij3 = ij3+1; iij3 < 1; ++iij3)
16839{
16840if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
16841{
16842 j3valid[iij3]=false; _ij3[1] = iij3; break;
16843}
16844}
16845j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
16846{
16847IkReal evalcond[8];
16848IkReal x1341=IKsin(j3);
16849IkReal x1342=IKcos(j3);
16850IkReal x1343=((1.0)*gconst16);
16851IkReal x1344=((-1.0)*gconst16);
16852evalcond[0]=(new_r01*x1341);
16853evalcond[1]=(new_r00*x1342);
16854evalcond[2]=(x1341*x1344);
16855evalcond[3]=(x1342*x1344);
16856evalcond[4]=(gconst16+((new_r00*x1341)));
16857evalcond[5]=(((gconst16*x1341))+new_r00);
16858evalcond[6]=((((-1.0)*x1342*x1343))+new_r01);
16859evalcond[7]=((((-1.0)*x1343))+((new_r01*x1342)));
16860if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
16861{
16862continue;
16863}
16864}
16865
16866{
16867std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
16868vinfos[0].jointtype = 1;
16869vinfos[0].foffset = j0;
16870vinfos[0].indices[0] = _ij0[0];
16871vinfos[0].indices[1] = _ij0[1];
16872vinfos[0].maxsolutions = _nj0;
16873vinfos[1].jointtype = 1;
16874vinfos[1].foffset = j1;
16875vinfos[1].indices[0] = _ij1[0];
16876vinfos[1].indices[1] = _ij1[1];
16877vinfos[1].maxsolutions = _nj1;
16878vinfos[2].jointtype = 1;
16879vinfos[2].foffset = j2;
16880vinfos[2].indices[0] = _ij2[0];
16881vinfos[2].indices[1] = _ij2[1];
16882vinfos[2].maxsolutions = _nj2;
16883vinfos[3].jointtype = 1;
16884vinfos[3].foffset = j3;
16885vinfos[3].indices[0] = _ij3[0];
16886vinfos[3].indices[1] = _ij3[1];
16887vinfos[3].maxsolutions = _nj3;
16888vinfos[4].jointtype = 1;
16889vinfos[4].foffset = j4;
16890vinfos[4].indices[0] = _ij4[0];
16891vinfos[4].indices[1] = _ij4[1];
16892vinfos[4].maxsolutions = _nj4;
16893vinfos[5].jointtype = 1;
16894vinfos[5].foffset = j5;
16895vinfos[5].indices[0] = _ij5[0];
16896vinfos[5].indices[1] = _ij5[1];
16897vinfos[5].maxsolutions = _nj5;
16898std::vector<int> vfree(0);
16899solutions.AddSolution(vinfos,vfree);
16900}
16901}
16902}
16903
16904}
16905
16906}
16907
16908} else
16909{
16910{
16911IkReal j3array[1], cj3array[1], sj3array[1];
16912bool j3valid[1]={false};
16913_nj3 = 1;
16915if(!x1345.valid){
16916continue;
16917}
16918CheckValue<IkReal> x1346=IKPowWithIntegerCheck(gconst16,-1);
16919if(!x1346.valid){
16920continue;
16921}
16922if( IKabs(((-1.0)*gconst16*(x1345.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r01*(x1346.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*gconst16*(x1345.value)))+IKsqr((new_r01*(x1346.value)))-1) <= IKFAST_SINCOS_THRESH )
16923 continue;
16924j3array[0]=IKatan2(((-1.0)*gconst16*(x1345.value)), (new_r01*(x1346.value)));
16925sj3array[0]=IKsin(j3array[0]);
16926cj3array[0]=IKcos(j3array[0]);
16927if( j3array[0] > IKPI )
16928{
16929 j3array[0]-=IK2PI;
16930}
16931else if( j3array[0] < -IKPI )
16932{ j3array[0]+=IK2PI;
16933}
16934j3valid[0] = true;
16935for(int ij3 = 0; ij3 < 1; ++ij3)
16936{
16937if( !j3valid[ij3] )
16938{
16939 continue;
16940}
16941_ij3[0] = ij3; _ij3[1] = -1;
16942for(int iij3 = ij3+1; iij3 < 1; ++iij3)
16943{
16944if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
16945{
16946 j3valid[iij3]=false; _ij3[1] = iij3; break;
16947}
16948}
16949j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
16950{
16951IkReal evalcond[8];
16952IkReal x1347=IKsin(j3);
16953IkReal x1348=IKcos(j3);
16954IkReal x1349=((1.0)*gconst16);
16955IkReal x1350=((-1.0)*gconst16);
16956evalcond[0]=(new_r01*x1347);
16957evalcond[1]=(new_r00*x1348);
16958evalcond[2]=(x1347*x1350);
16959evalcond[3]=(x1348*x1350);
16960evalcond[4]=(gconst16+((new_r00*x1347)));
16961evalcond[5]=(((gconst16*x1347))+new_r00);
16962evalcond[6]=((((-1.0)*x1348*x1349))+new_r01);
16963evalcond[7]=((((-1.0)*x1349))+((new_r01*x1348)));
16964if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
16965{
16966continue;
16967}
16968}
16969
16970{
16971std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
16972vinfos[0].jointtype = 1;
16973vinfos[0].foffset = j0;
16974vinfos[0].indices[0] = _ij0[0];
16975vinfos[0].indices[1] = _ij0[1];
16976vinfos[0].maxsolutions = _nj0;
16977vinfos[1].jointtype = 1;
16978vinfos[1].foffset = j1;
16979vinfos[1].indices[0] = _ij1[0];
16980vinfos[1].indices[1] = _ij1[1];
16981vinfos[1].maxsolutions = _nj1;
16982vinfos[2].jointtype = 1;
16983vinfos[2].foffset = j2;
16984vinfos[2].indices[0] = _ij2[0];
16985vinfos[2].indices[1] = _ij2[1];
16986vinfos[2].maxsolutions = _nj2;
16987vinfos[3].jointtype = 1;
16988vinfos[3].foffset = j3;
16989vinfos[3].indices[0] = _ij3[0];
16990vinfos[3].indices[1] = _ij3[1];
16991vinfos[3].maxsolutions = _nj3;
16992vinfos[4].jointtype = 1;
16993vinfos[4].foffset = j4;
16994vinfos[4].indices[0] = _ij4[0];
16995vinfos[4].indices[1] = _ij4[1];
16996vinfos[4].maxsolutions = _nj4;
16997vinfos[5].jointtype = 1;
16998vinfos[5].foffset = j5;
16999vinfos[5].indices[0] = _ij5[0];
17000vinfos[5].indices[1] = _ij5[1];
17001vinfos[5].maxsolutions = _nj5;
17002std::vector<int> vfree(0);
17003solutions.AddSolution(vinfos,vfree);
17004}
17005}
17006}
17007
17008}
17009
17010}
17011
17012} else
17013{
17014{
17015IkReal j3array[1], cj3array[1], sj3array[1];
17016bool j3valid[1]={false};
17017_nj3 = 1;
17019if(!x1351.valid){
17020continue;
17021}
17023if(!x1352.valid){
17024continue;
17025}
17026j3array[0]=((-1.5707963267949)+(x1351.value)+(((1.5707963267949)*(x1352.value))));
17027sj3array[0]=IKsin(j3array[0]);
17028cj3array[0]=IKcos(j3array[0]);
17029if( j3array[0] > IKPI )
17030{
17031 j3array[0]-=IK2PI;
17032}
17033else if( j3array[0] < -IKPI )
17034{ j3array[0]+=IK2PI;
17035}
17036j3valid[0] = true;
17037for(int ij3 = 0; ij3 < 1; ++ij3)
17038{
17039if( !j3valid[ij3] )
17040{
17041 continue;
17042}
17043_ij3[0] = ij3; _ij3[1] = -1;
17044for(int iij3 = ij3+1; iij3 < 1; ++iij3)
17045{
17046if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
17047{
17048 j3valid[iij3]=false; _ij3[1] = iij3; break;
17049}
17050}
17051j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
17052{
17053IkReal evalcond[8];
17054IkReal x1353=IKsin(j3);
17055IkReal x1354=IKcos(j3);
17056IkReal x1355=((1.0)*gconst16);
17057IkReal x1356=((-1.0)*gconst16);
17058evalcond[0]=(new_r01*x1353);
17059evalcond[1]=(new_r00*x1354);
17060evalcond[2]=(x1353*x1356);
17061evalcond[3]=(x1354*x1356);
17062evalcond[4]=(gconst16+((new_r00*x1353)));
17063evalcond[5]=(new_r00+((gconst16*x1353)));
17064evalcond[6]=((((-1.0)*x1354*x1355))+new_r01);
17065evalcond[7]=((((-1.0)*x1355))+((new_r01*x1354)));
17066if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
17067{
17068continue;
17069}
17070}
17071
17072{
17073std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
17074vinfos[0].jointtype = 1;
17075vinfos[0].foffset = j0;
17076vinfos[0].indices[0] = _ij0[0];
17077vinfos[0].indices[1] = _ij0[1];
17078vinfos[0].maxsolutions = _nj0;
17079vinfos[1].jointtype = 1;
17080vinfos[1].foffset = j1;
17081vinfos[1].indices[0] = _ij1[0];
17082vinfos[1].indices[1] = _ij1[1];
17083vinfos[1].maxsolutions = _nj1;
17084vinfos[2].jointtype = 1;
17085vinfos[2].foffset = j2;
17086vinfos[2].indices[0] = _ij2[0];
17087vinfos[2].indices[1] = _ij2[1];
17088vinfos[2].maxsolutions = _nj2;
17089vinfos[3].jointtype = 1;
17090vinfos[3].foffset = j3;
17091vinfos[3].indices[0] = _ij3[0];
17092vinfos[3].indices[1] = _ij3[1];
17093vinfos[3].maxsolutions = _nj3;
17094vinfos[4].jointtype = 1;
17095vinfos[4].foffset = j4;
17096vinfos[4].indices[0] = _ij4[0];
17097vinfos[4].indices[1] = _ij4[1];
17098vinfos[4].maxsolutions = _nj4;
17099vinfos[5].jointtype = 1;
17100vinfos[5].foffset = j5;
17101vinfos[5].indices[0] = _ij5[0];
17102vinfos[5].indices[1] = _ij5[1];
17103vinfos[5].maxsolutions = _nj5;
17104std::vector<int> vfree(0);
17105solutions.AddSolution(vinfos,vfree);
17106}
17107}
17108}
17109
17110}
17111
17112}
17113
17114}
17115} while(0);
17116if( bgotonextstatement )
17117{
17118bool bgotonextstatement = true;
17119do
17120{
17121evalcond[0]=IKabs(new_r10);
17122if( IKabs(evalcond[0]) < 0.0000050000000000 )
17123{
17124bgotonextstatement=false;
17125{
17126IkReal j3eval[1];
17127IkReal x1357=((-1.0)*new_r00);
17128CheckValue<IkReal> x1359 = IKatan2WithCheck(IkReal(x1357),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
17129if(!x1359.valid){
17130continue;
17131}
17132IkReal x1358=((1.0)*(x1359.value));
17133sj4=0;
17134cj4=-1.0;
17135j4=3.14159265358979;
17136sj5=gconst16;
17137cj5=gconst17;
17138j5=((3.14159265)+(((-1.0)*x1358)));
17139new_r10=0;
17140IkReal gconst15=((3.14159265358979)+(((-1.0)*x1358)));
17141IkReal x1360 = new_r00*new_r00;
17142if(IKabs(x1360)==0){
17143continue;
17144}
17145IkReal gconst16=(x1357*(pow(x1360,-0.5)));
17146IkReal gconst17=0;
17147j3eval[0]=((IKabs(new_r11))+(IKabs(new_r01)));
17148if( IKabs(j3eval[0]) < 0.0000010000000000 )
17149{
17150{
17151IkReal j3eval[1];
17152IkReal x1361=((-1.0)*new_r00);
17153CheckValue<IkReal> x1363 = IKatan2WithCheck(IkReal(x1361),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
17154if(!x1363.valid){
17155continue;
17156}
17157IkReal x1362=((1.0)*(x1363.value));
17158sj4=0;
17159cj4=-1.0;
17160j4=3.14159265358979;
17161sj5=gconst16;
17162cj5=gconst17;
17163j5=((3.14159265)+(((-1.0)*x1362)));
17164new_r10=0;
17165IkReal gconst15=((3.14159265358979)+(((-1.0)*x1362)));
17166IkReal x1364 = new_r00*new_r00;
17167if(IKabs(x1364)==0){
17168continue;
17169}
17170IkReal gconst16=(x1361*(pow(x1364,-0.5)));
17171IkReal gconst17=0;
17172j3eval[0]=((IKabs(new_r00))+(IKabs(new_r01)));
17173if( IKabs(j3eval[0]) < 0.0000010000000000 )
17174{
17175{
17176IkReal j3eval[1];
17177IkReal x1365=((-1.0)*new_r00);
17178CheckValue<IkReal> x1367 = IKatan2WithCheck(IkReal(x1365),IkReal(0),IKFAST_ATAN2_MAGTHRESH);
17179if(!x1367.valid){
17180continue;
17181}
17182IkReal x1366=((1.0)*(x1367.value));
17183sj4=0;
17184cj4=-1.0;
17185j4=3.14159265358979;
17186sj5=gconst16;
17187cj5=gconst17;
17188j5=((3.14159265)+(((-1.0)*x1366)));
17189new_r10=0;
17190IkReal gconst15=((3.14159265358979)+(((-1.0)*x1366)));
17191IkReal x1368 = new_r00*new_r00;
17192if(IKabs(x1368)==0){
17193continue;
17194}
17195IkReal gconst16=(x1365*(pow(x1368,-0.5)));
17196IkReal gconst17=0;
17197j3eval[0]=new_r00;
17198if( IKabs(j3eval[0]) < 0.0000010000000000 )
17199{
17200continue; // 3 cases reached
17201
17202} else
17203{
17204{
17205IkReal j3array[1], cj3array[1], sj3array[1];
17206bool j3valid[1]={false};
17207_nj3 = 1;
17209if(!x1369.valid){
17210continue;
17211}
17212CheckValue<IkReal> x1370=IKPowWithIntegerCheck(gconst16,-1);
17213if(!x1370.valid){
17214continue;
17215}
17216if( IKabs(((-1.0)*gconst16*(x1369.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((new_r01*(x1370.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*gconst16*(x1369.value)))+IKsqr((new_r01*(x1370.value)))-1) <= IKFAST_SINCOS_THRESH )
17217 continue;
17218j3array[0]=IKatan2(((-1.0)*gconst16*(x1369.value)), (new_r01*(x1370.value)));
17219sj3array[0]=IKsin(j3array[0]);
17220cj3array[0]=IKcos(j3array[0]);
17221if( j3array[0] > IKPI )
17222{
17223 j3array[0]-=IK2PI;
17224}
17225else if( j3array[0] < -IKPI )
17226{ j3array[0]+=IK2PI;
17227}
17228j3valid[0] = true;
17229for(int ij3 = 0; ij3 < 1; ++ij3)
17230{
17231if( !j3valid[ij3] )
17232{
17233 continue;
17234}
17235_ij3[0] = ij3; _ij3[1] = -1;
17236for(int iij3 = ij3+1; iij3 < 1; ++iij3)
17237{
17238if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
17239{
17240 j3valid[iij3]=false; _ij3[1] = iij3; break;
17241}
17242}
17243j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
17244{
17245IkReal evalcond[8];
17246IkReal x1371=IKcos(j3);
17247IkReal x1372=IKsin(j3);
17248IkReal x1373=((1.0)*gconst16);
17249evalcond[0]=(new_r00*x1371);
17250evalcond[1]=((-1.0)*gconst16*x1371);
17251evalcond[2]=(gconst16+((new_r00*x1372)));
17252evalcond[3]=(new_r00+((gconst16*x1372)));
17253evalcond[4]=((((-1.0)*x1371*x1373))+new_r01);
17254evalcond[5]=((((-1.0)*x1372*x1373))+new_r11);
17255evalcond[6]=(((new_r01*x1372))+(((-1.0)*new_r11*x1371)));
17256evalcond[7]=((((-1.0)*x1373))+((new_r11*x1372))+((new_r01*x1371)));
17257if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
17258{
17259continue;
17260}
17261}
17262
17263{
17264std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
17265vinfos[0].jointtype = 1;
17266vinfos[0].foffset = j0;
17267vinfos[0].indices[0] = _ij0[0];
17268vinfos[0].indices[1] = _ij0[1];
17269vinfos[0].maxsolutions = _nj0;
17270vinfos[1].jointtype = 1;
17271vinfos[1].foffset = j1;
17272vinfos[1].indices[0] = _ij1[0];
17273vinfos[1].indices[1] = _ij1[1];
17274vinfos[1].maxsolutions = _nj1;
17275vinfos[2].jointtype = 1;
17276vinfos[2].foffset = j2;
17277vinfos[2].indices[0] = _ij2[0];
17278vinfos[2].indices[1] = _ij2[1];
17279vinfos[2].maxsolutions = _nj2;
17280vinfos[3].jointtype = 1;
17281vinfos[3].foffset = j3;
17282vinfos[3].indices[0] = _ij3[0];
17283vinfos[3].indices[1] = _ij3[1];
17284vinfos[3].maxsolutions = _nj3;
17285vinfos[4].jointtype = 1;
17286vinfos[4].foffset = j4;
17287vinfos[4].indices[0] = _ij4[0];
17288vinfos[4].indices[1] = _ij4[1];
17289vinfos[4].maxsolutions = _nj4;
17290vinfos[5].jointtype = 1;
17291vinfos[5].foffset = j5;
17292vinfos[5].indices[0] = _ij5[0];
17293vinfos[5].indices[1] = _ij5[1];
17294vinfos[5].maxsolutions = _nj5;
17295std::vector<int> vfree(0);
17296solutions.AddSolution(vinfos,vfree);
17297}
17298}
17299}
17300
17301}
17302
17303}
17304
17305} else
17306{
17307{
17308IkReal j3array[1], cj3array[1], sj3array[1];
17309bool j3valid[1]={false};
17310_nj3 = 1;
17312if(!x1374.valid){
17313continue;
17314}
17316if(!x1375.valid){
17317continue;
17318}
17319j3array[0]=((-1.5707963267949)+(x1374.value)+(((1.5707963267949)*(x1375.value))));
17320sj3array[0]=IKsin(j3array[0]);
17321cj3array[0]=IKcos(j3array[0]);
17322if( j3array[0] > IKPI )
17323{
17324 j3array[0]-=IK2PI;
17325}
17326else if( j3array[0] < -IKPI )
17327{ j3array[0]+=IK2PI;
17328}
17329j3valid[0] = true;
17330for(int ij3 = 0; ij3 < 1; ++ij3)
17331{
17332if( !j3valid[ij3] )
17333{
17334 continue;
17335}
17336_ij3[0] = ij3; _ij3[1] = -1;
17337for(int iij3 = ij3+1; iij3 < 1; ++iij3)
17338{
17339if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
17340{
17341 j3valid[iij3]=false; _ij3[1] = iij3; break;
17342}
17343}
17344j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
17345{
17346IkReal evalcond[8];
17347IkReal x1376=IKcos(j3);
17348IkReal x1377=IKsin(j3);
17349IkReal x1378=((1.0)*gconst16);
17350evalcond[0]=(new_r00*x1376);
17351evalcond[1]=((-1.0)*gconst16*x1376);
17352evalcond[2]=(gconst16+((new_r00*x1377)));
17353evalcond[3]=(new_r00+((gconst16*x1377)));
17354evalcond[4]=((((-1.0)*x1376*x1378))+new_r01);
17355evalcond[5]=((((-1.0)*x1377*x1378))+new_r11);
17356evalcond[6]=(((new_r01*x1377))+(((-1.0)*new_r11*x1376)));
17357evalcond[7]=((((-1.0)*x1378))+((new_r11*x1377))+((new_r01*x1376)));
17358if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
17359{
17360continue;
17361}
17362}
17363
17364{
17365std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
17366vinfos[0].jointtype = 1;
17367vinfos[0].foffset = j0;
17368vinfos[0].indices[0] = _ij0[0];
17369vinfos[0].indices[1] = _ij0[1];
17370vinfos[0].maxsolutions = _nj0;
17371vinfos[1].jointtype = 1;
17372vinfos[1].foffset = j1;
17373vinfos[1].indices[0] = _ij1[0];
17374vinfos[1].indices[1] = _ij1[1];
17375vinfos[1].maxsolutions = _nj1;
17376vinfos[2].jointtype = 1;
17377vinfos[2].foffset = j2;
17378vinfos[2].indices[0] = _ij2[0];
17379vinfos[2].indices[1] = _ij2[1];
17380vinfos[2].maxsolutions = _nj2;
17381vinfos[3].jointtype = 1;
17382vinfos[3].foffset = j3;
17383vinfos[3].indices[0] = _ij3[0];
17384vinfos[3].indices[1] = _ij3[1];
17385vinfos[3].maxsolutions = _nj3;
17386vinfos[4].jointtype = 1;
17387vinfos[4].foffset = j4;
17388vinfos[4].indices[0] = _ij4[0];
17389vinfos[4].indices[1] = _ij4[1];
17390vinfos[4].maxsolutions = _nj4;
17391vinfos[5].jointtype = 1;
17392vinfos[5].foffset = j5;
17393vinfos[5].indices[0] = _ij5[0];
17394vinfos[5].indices[1] = _ij5[1];
17395vinfos[5].maxsolutions = _nj5;
17396std::vector<int> vfree(0);
17397solutions.AddSolution(vinfos,vfree);
17398}
17399}
17400}
17401
17402}
17403
17404}
17405
17406} else
17407{
17408{
17409IkReal j3array[1], cj3array[1], sj3array[1];
17410bool j3valid[1]={false};
17411_nj3 = 1;
17413if(!x1379.valid){
17414continue;
17415}
17417if(!x1380.valid){
17418continue;
17419}
17420j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1379.value)))+(x1380.value));
17421sj3array[0]=IKsin(j3array[0]);
17422cj3array[0]=IKcos(j3array[0]);
17423if( j3array[0] > IKPI )
17424{
17425 j3array[0]-=IK2PI;
17426}
17427else if( j3array[0] < -IKPI )
17428{ j3array[0]+=IK2PI;
17429}
17430j3valid[0] = true;
17431for(int ij3 = 0; ij3 < 1; ++ij3)
17432{
17433if( !j3valid[ij3] )
17434{
17435 continue;
17436}
17437_ij3[0] = ij3; _ij3[1] = -1;
17438for(int iij3 = ij3+1; iij3 < 1; ++iij3)
17439{
17440if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
17441{
17442 j3valid[iij3]=false; _ij3[1] = iij3; break;
17443}
17444}
17445j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
17446{
17447IkReal evalcond[8];
17448IkReal x1381=IKcos(j3);
17449IkReal x1382=IKsin(j3);
17450IkReal x1383=((1.0)*gconst16);
17451evalcond[0]=(new_r00*x1381);
17452evalcond[1]=((-1.0)*gconst16*x1381);
17453evalcond[2]=(gconst16+((new_r00*x1382)));
17454evalcond[3]=(((gconst16*x1382))+new_r00);
17455evalcond[4]=((((-1.0)*x1381*x1383))+new_r01);
17456evalcond[5]=((((-1.0)*x1382*x1383))+new_r11);
17457evalcond[6]=((((-1.0)*new_r11*x1381))+((new_r01*x1382)));
17458evalcond[7]=((((-1.0)*x1383))+((new_r11*x1382))+((new_r01*x1381)));
17459if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
17460{
17461continue;
17462}
17463}
17464
17465{
17466std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
17467vinfos[0].jointtype = 1;
17468vinfos[0].foffset = j0;
17469vinfos[0].indices[0] = _ij0[0];
17470vinfos[0].indices[1] = _ij0[1];
17471vinfos[0].maxsolutions = _nj0;
17472vinfos[1].jointtype = 1;
17473vinfos[1].foffset = j1;
17474vinfos[1].indices[0] = _ij1[0];
17475vinfos[1].indices[1] = _ij1[1];
17476vinfos[1].maxsolutions = _nj1;
17477vinfos[2].jointtype = 1;
17478vinfos[2].foffset = j2;
17479vinfos[2].indices[0] = _ij2[0];
17480vinfos[2].indices[1] = _ij2[1];
17481vinfos[2].maxsolutions = _nj2;
17482vinfos[3].jointtype = 1;
17483vinfos[3].foffset = j3;
17484vinfos[3].indices[0] = _ij3[0];
17485vinfos[3].indices[1] = _ij3[1];
17486vinfos[3].maxsolutions = _nj3;
17487vinfos[4].jointtype = 1;
17488vinfos[4].foffset = j4;
17489vinfos[4].indices[0] = _ij4[0];
17490vinfos[4].indices[1] = _ij4[1];
17491vinfos[4].maxsolutions = _nj4;
17492vinfos[5].jointtype = 1;
17493vinfos[5].foffset = j5;
17494vinfos[5].indices[0] = _ij5[0];
17495vinfos[5].indices[1] = _ij5[1];
17496vinfos[5].maxsolutions = _nj5;
17497std::vector<int> vfree(0);
17498solutions.AddSolution(vinfos,vfree);
17499}
17500}
17501}
17502
17503}
17504
17505}
17506
17507}
17508} while(0);
17509if( bgotonextstatement )
17510{
17511bool bgotonextstatement = true;
17512do
17513{
17514if( 1 )
17515{
17516bgotonextstatement=false;
17517continue; // branch miss [j3]
17518
17519}
17520} while(0);
17521if( bgotonextstatement )
17522{
17523}
17524}
17525}
17526}
17527}
17528}
17529}
17530
17531} else
17532{
17533{
17534IkReal j3array[1], cj3array[1], sj3array[1];
17535bool j3valid[1]={false};
17536_nj3 = 1;
17537IkReal x1384=((1.0)*gconst17);
17538CheckValue<IkReal> x1385=IKPowWithIntegerCheck(IKsign((((gconst16*new_r00))+(((-1.0)*new_r10*x1384)))),-1);
17539if(!x1385.valid){
17540continue;
17541}
17542CheckValue<IkReal> x1386 = IKatan2WithCheck(IkReal(((((-1.0)*(new_r00*new_r00)))+(gconst17*gconst17))),IkReal((((new_r00*new_r10))+(((-1.0)*gconst16*x1384)))),IKFAST_ATAN2_MAGTHRESH);
17543if(!x1386.valid){
17544continue;
17545}
17546j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1385.value)))+(x1386.value));
17547sj3array[0]=IKsin(j3array[0]);
17548cj3array[0]=IKcos(j3array[0]);
17549if( j3array[0] > IKPI )
17550{
17551 j3array[0]-=IK2PI;
17552}
17553else if( j3array[0] < -IKPI )
17554{ j3array[0]+=IK2PI;
17555}
17556j3valid[0] = true;
17557for(int ij3 = 0; ij3 < 1; ++ij3)
17558{
17559if( !j3valid[ij3] )
17560{
17561 continue;
17562}
17563_ij3[0] = ij3; _ij3[1] = -1;
17564for(int iij3 = ij3+1; iij3 < 1; ++iij3)
17565{
17566if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
17567{
17568 j3valid[iij3]=false; _ij3[1] = iij3; break;
17569}
17570}
17571j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
17572{
17573IkReal evalcond[8];
17574IkReal x1387=IKsin(j3);
17575IkReal x1388=IKcos(j3);
17576IkReal x1389=((1.0)*gconst16);
17577IkReal x1390=(gconst17*x1387);
17578IkReal x1391=(gconst17*x1388);
17579IkReal x1392=((1.0)*x1388);
17580IkReal x1393=(x1388*x1389);
17581evalcond[0]=(((new_r10*x1387))+gconst17+((new_r00*x1388)));
17582evalcond[1]=(x1391+((gconst16*x1387))+new_r00);
17583evalcond[2]=(gconst16+((new_r00*x1387))+(((-1.0)*new_r10*x1392)));
17584evalcond[3]=(gconst17+((new_r01*x1387))+(((-1.0)*new_r11*x1392)));
17585evalcond[4]=(x1390+new_r01+(((-1.0)*x1393)));
17586evalcond[5]=(x1390+new_r10+(((-1.0)*x1393)));
17587evalcond[6]=((((-1.0)*x1389))+((new_r11*x1387))+((new_r01*x1388)));
17588evalcond[7]=((((-1.0)*x1391))+new_r11+(((-1.0)*x1387*x1389)));
17589if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
17590{
17591continue;
17592}
17593}
17594
17595{
17596std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
17597vinfos[0].jointtype = 1;
17598vinfos[0].foffset = j0;
17599vinfos[0].indices[0] = _ij0[0];
17600vinfos[0].indices[1] = _ij0[1];
17601vinfos[0].maxsolutions = _nj0;
17602vinfos[1].jointtype = 1;
17603vinfos[1].foffset = j1;
17604vinfos[1].indices[0] = _ij1[0];
17605vinfos[1].indices[1] = _ij1[1];
17606vinfos[1].maxsolutions = _nj1;
17607vinfos[2].jointtype = 1;
17608vinfos[2].foffset = j2;
17609vinfos[2].indices[0] = _ij2[0];
17610vinfos[2].indices[1] = _ij2[1];
17611vinfos[2].maxsolutions = _nj2;
17612vinfos[3].jointtype = 1;
17613vinfos[3].foffset = j3;
17614vinfos[3].indices[0] = _ij3[0];
17615vinfos[3].indices[1] = _ij3[1];
17616vinfos[3].maxsolutions = _nj3;
17617vinfos[4].jointtype = 1;
17618vinfos[4].foffset = j4;
17619vinfos[4].indices[0] = _ij4[0];
17620vinfos[4].indices[1] = _ij4[1];
17621vinfos[4].maxsolutions = _nj4;
17622vinfos[5].jointtype = 1;
17623vinfos[5].foffset = j5;
17624vinfos[5].indices[0] = _ij5[0];
17625vinfos[5].indices[1] = _ij5[1];
17626vinfos[5].maxsolutions = _nj5;
17627std::vector<int> vfree(0);
17628solutions.AddSolution(vinfos,vfree);
17629}
17630}
17631}
17632
17633}
17634
17635}
17636
17637} else
17638{
17639{
17640IkReal j3array[1], cj3array[1], sj3array[1];
17641bool j3valid[1]={false};
17642_nj3 = 1;
17643IkReal x1394=((1.0)*gconst17);
17644CheckValue<IkReal> x1395=IKPowWithIntegerCheck(IKsign(((((-1.0)*gconst16*new_r11))+(((-1.0)*new_r01*x1394)))),-1);
17645if(!x1395.valid){
17646continue;
17647}
17648CheckValue<IkReal> x1396 = IKatan2WithCheck(IkReal((((new_r00*new_r11))+(gconst17*gconst17))),IkReal(((((-1.0)*gconst16*x1394))+((new_r00*new_r01)))),IKFAST_ATAN2_MAGTHRESH);
17649if(!x1396.valid){
17650continue;
17651}
17652j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1395.value)))+(x1396.value));
17653sj3array[0]=IKsin(j3array[0]);
17654cj3array[0]=IKcos(j3array[0]);
17655if( j3array[0] > IKPI )
17656{
17657 j3array[0]-=IK2PI;
17658}
17659else if( j3array[0] < -IKPI )
17660{ j3array[0]+=IK2PI;
17661}
17662j3valid[0] = true;
17663for(int ij3 = 0; ij3 < 1; ++ij3)
17664{
17665if( !j3valid[ij3] )
17666{
17667 continue;
17668}
17669_ij3[0] = ij3; _ij3[1] = -1;
17670for(int iij3 = ij3+1; iij3 < 1; ++iij3)
17671{
17672if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
17673{
17674 j3valid[iij3]=false; _ij3[1] = iij3; break;
17675}
17676}
17677j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
17678{
17679IkReal evalcond[8];
17680IkReal x1397=IKsin(j3);
17681IkReal x1398=IKcos(j3);
17682IkReal x1399=((1.0)*gconst16);
17683IkReal x1400=(gconst17*x1397);
17684IkReal x1401=(gconst17*x1398);
17685IkReal x1402=((1.0)*x1398);
17686IkReal x1403=(x1398*x1399);
17687evalcond[0]=(((new_r10*x1397))+gconst17+((new_r00*x1398)));
17688evalcond[1]=(x1401+new_r00+((gconst16*x1397)));
17689evalcond[2]=(gconst16+((new_r00*x1397))+(((-1.0)*new_r10*x1402)));
17690evalcond[3]=(gconst17+((new_r01*x1397))+(((-1.0)*new_r11*x1402)));
17691evalcond[4]=((((-1.0)*x1403))+x1400+new_r01);
17692evalcond[5]=((((-1.0)*x1403))+x1400+new_r10);
17693evalcond[6]=(((new_r11*x1397))+((new_r01*x1398))+(((-1.0)*x1399)));
17694evalcond[7]=((((-1.0)*x1401))+(((-1.0)*x1397*x1399))+new_r11);
17695if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
17696{
17697continue;
17698}
17699}
17700
17701{
17702std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
17703vinfos[0].jointtype = 1;
17704vinfos[0].foffset = j0;
17705vinfos[0].indices[0] = _ij0[0];
17706vinfos[0].indices[1] = _ij0[1];
17707vinfos[0].maxsolutions = _nj0;
17708vinfos[1].jointtype = 1;
17709vinfos[1].foffset = j1;
17710vinfos[1].indices[0] = _ij1[0];
17711vinfos[1].indices[1] = _ij1[1];
17712vinfos[1].maxsolutions = _nj1;
17713vinfos[2].jointtype = 1;
17714vinfos[2].foffset = j2;
17715vinfos[2].indices[0] = _ij2[0];
17716vinfos[2].indices[1] = _ij2[1];
17717vinfos[2].maxsolutions = _nj2;
17718vinfos[3].jointtype = 1;
17719vinfos[3].foffset = j3;
17720vinfos[3].indices[0] = _ij3[0];
17721vinfos[3].indices[1] = _ij3[1];
17722vinfos[3].maxsolutions = _nj3;
17723vinfos[4].jointtype = 1;
17724vinfos[4].foffset = j4;
17725vinfos[4].indices[0] = _ij4[0];
17726vinfos[4].indices[1] = _ij4[1];
17727vinfos[4].maxsolutions = _nj4;
17728vinfos[5].jointtype = 1;
17729vinfos[5].foffset = j5;
17730vinfos[5].indices[0] = _ij5[0];
17731vinfos[5].indices[1] = _ij5[1];
17732vinfos[5].maxsolutions = _nj5;
17733std::vector<int> vfree(0);
17734solutions.AddSolution(vinfos,vfree);
17735}
17736}
17737}
17738
17739}
17740
17741}
17742
17743} else
17744{
17745{
17746IkReal j3array[1], cj3array[1], sj3array[1];
17747bool j3valid[1]={false};
17748_nj3 = 1;
17749IkReal x1404=((1.0)*new_r10);
17750CheckValue<IkReal> x1405 = IKatan2WithCheck(IkReal((((gconst17*new_r11))+((gconst17*new_r00)))),IkReal(((((-1.0)*gconst17*x1404))+((gconst17*new_r01)))),IKFAST_ATAN2_MAGTHRESH);
17751if(!x1405.valid){
17752continue;
17753}
17754CheckValue<IkReal> x1406=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r00*new_r01))+(((-1.0)*new_r11*x1404)))),-1);
17755if(!x1406.valid){
17756continue;
17757}
17758j3array[0]=((-1.5707963267949)+(x1405.value)+(((1.5707963267949)*(x1406.value))));
17759sj3array[0]=IKsin(j3array[0]);
17760cj3array[0]=IKcos(j3array[0]);
17761if( j3array[0] > IKPI )
17762{
17763 j3array[0]-=IK2PI;
17764}
17765else if( j3array[0] < -IKPI )
17766{ j3array[0]+=IK2PI;
17767}
17768j3valid[0] = true;
17769for(int ij3 = 0; ij3 < 1; ++ij3)
17770{
17771if( !j3valid[ij3] )
17772{
17773 continue;
17774}
17775_ij3[0] = ij3; _ij3[1] = -1;
17776for(int iij3 = ij3+1; iij3 < 1; ++iij3)
17777{
17778if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
17779{
17780 j3valid[iij3]=false; _ij3[1] = iij3; break;
17781}
17782}
17783j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
17784{
17785IkReal evalcond[8];
17786IkReal x1407=IKsin(j3);
17787IkReal x1408=IKcos(j3);
17788IkReal x1409=((1.0)*gconst16);
17789IkReal x1410=(gconst17*x1407);
17790IkReal x1411=(gconst17*x1408);
17791IkReal x1412=((1.0)*x1408);
17792IkReal x1413=(x1408*x1409);
17793evalcond[0]=(gconst17+((new_r10*x1407))+((new_r00*x1408)));
17794evalcond[1]=(((gconst16*x1407))+x1411+new_r00);
17795evalcond[2]=((((-1.0)*new_r10*x1412))+gconst16+((new_r00*x1407)));
17796evalcond[3]=((((-1.0)*new_r11*x1412))+((new_r01*x1407))+gconst17);
17797evalcond[4]=((((-1.0)*x1413))+x1410+new_r01);
17798evalcond[5]=((((-1.0)*x1413))+x1410+new_r10);
17799evalcond[6]=(((new_r01*x1408))+((new_r11*x1407))+(((-1.0)*x1409)));
17800evalcond[7]=((((-1.0)*x1407*x1409))+new_r11+(((-1.0)*x1411)));
17801if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
17802{
17803continue;
17804}
17805}
17806
17807{
17808std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
17809vinfos[0].jointtype = 1;
17810vinfos[0].foffset = j0;
17811vinfos[0].indices[0] = _ij0[0];
17812vinfos[0].indices[1] = _ij0[1];
17813vinfos[0].maxsolutions = _nj0;
17814vinfos[1].jointtype = 1;
17815vinfos[1].foffset = j1;
17816vinfos[1].indices[0] = _ij1[0];
17817vinfos[1].indices[1] = _ij1[1];
17818vinfos[1].maxsolutions = _nj1;
17819vinfos[2].jointtype = 1;
17820vinfos[2].foffset = j2;
17821vinfos[2].indices[0] = _ij2[0];
17822vinfos[2].indices[1] = _ij2[1];
17823vinfos[2].maxsolutions = _nj2;
17824vinfos[3].jointtype = 1;
17825vinfos[3].foffset = j3;
17826vinfos[3].indices[0] = _ij3[0];
17827vinfos[3].indices[1] = _ij3[1];
17828vinfos[3].maxsolutions = _nj3;
17829vinfos[4].jointtype = 1;
17830vinfos[4].foffset = j4;
17831vinfos[4].indices[0] = _ij4[0];
17832vinfos[4].indices[1] = _ij4[1];
17833vinfos[4].maxsolutions = _nj4;
17834vinfos[5].jointtype = 1;
17835vinfos[5].foffset = j5;
17836vinfos[5].indices[0] = _ij5[0];
17837vinfos[5].indices[1] = _ij5[1];
17838vinfos[5].maxsolutions = _nj5;
17839std::vector<int> vfree(0);
17840solutions.AddSolution(vinfos,vfree);
17841}
17842}
17843}
17844
17845}
17846
17847}
17848
17849}
17850} while(0);
17851if( bgotonextstatement )
17852{
17853bool bgotonextstatement = true;
17854do
17855{
17856evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j5)))), 6.28318530717959)));
17857if( IKabs(evalcond[0]) < 0.0000050000000000 )
17858{
17859bgotonextstatement=false;
17860{
17861IkReal j3array[1], cj3array[1], sj3array[1];
17862bool j3valid[1]={false};
17863_nj3 = 1;
17865 continue;
17866j3array[0]=IKatan2(((-1.0)*new_r00), new_r01);
17867sj3array[0]=IKsin(j3array[0]);
17868cj3array[0]=IKcos(j3array[0]);
17869if( j3array[0] > IKPI )
17870{
17871 j3array[0]-=IK2PI;
17872}
17873else if( j3array[0] < -IKPI )
17874{ j3array[0]+=IK2PI;
17875}
17876j3valid[0] = true;
17877for(int ij3 = 0; ij3 < 1; ++ij3)
17878{
17879if( !j3valid[ij3] )
17880{
17881 continue;
17882}
17883_ij3[0] = ij3; _ij3[1] = -1;
17884for(int iij3 = ij3+1; iij3 < 1; ++iij3)
17885{
17886if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
17887{
17888 j3valid[iij3]=false; _ij3[1] = iij3; break;
17889}
17890}
17891j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
17892{
17893IkReal evalcond[8];
17894IkReal x1414=IKsin(j3);
17895IkReal x1415=IKcos(j3);
17896IkReal x1416=((1.0)*x1415);
17897evalcond[0]=(x1414+new_r00);
17898evalcond[1]=((((-1.0)*x1416))+new_r01);
17899evalcond[2]=(new_r11+(((-1.0)*x1414)));
17900evalcond[3]=((((-1.0)*x1416))+new_r10);
17901evalcond[4]=(((new_r00*x1415))+((new_r10*x1414)));
17902evalcond[5]=((((-1.0)*new_r11*x1416))+((new_r01*x1414)));
17903evalcond[6]=((-1.0)+((new_r01*x1415))+((new_r11*x1414)));
17904evalcond[7]=((1.0)+(((-1.0)*new_r10*x1416))+((new_r00*x1414)));
17905if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
17906{
17907continue;
17908}
17909}
17910
17911{
17912std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
17913vinfos[0].jointtype = 1;
17914vinfos[0].foffset = j0;
17915vinfos[0].indices[0] = _ij0[0];
17916vinfos[0].indices[1] = _ij0[1];
17917vinfos[0].maxsolutions = _nj0;
17918vinfos[1].jointtype = 1;
17919vinfos[1].foffset = j1;
17920vinfos[1].indices[0] = _ij1[0];
17921vinfos[1].indices[1] = _ij1[1];
17922vinfos[1].maxsolutions = _nj1;
17923vinfos[2].jointtype = 1;
17924vinfos[2].foffset = j2;
17925vinfos[2].indices[0] = _ij2[0];
17926vinfos[2].indices[1] = _ij2[1];
17927vinfos[2].maxsolutions = _nj2;
17928vinfos[3].jointtype = 1;
17929vinfos[3].foffset = j3;
17930vinfos[3].indices[0] = _ij3[0];
17931vinfos[3].indices[1] = _ij3[1];
17932vinfos[3].maxsolutions = _nj3;
17933vinfos[4].jointtype = 1;
17934vinfos[4].foffset = j4;
17935vinfos[4].indices[0] = _ij4[0];
17936vinfos[4].indices[1] = _ij4[1];
17937vinfos[4].maxsolutions = _nj4;
17938vinfos[5].jointtype = 1;
17939vinfos[5].foffset = j5;
17940vinfos[5].indices[0] = _ij5[0];
17941vinfos[5].indices[1] = _ij5[1];
17942vinfos[5].maxsolutions = _nj5;
17943std::vector<int> vfree(0);
17944solutions.AddSolution(vinfos,vfree);
17945}
17946}
17947}
17948
17949}
17950} while(0);
17951if( bgotonextstatement )
17952{
17953bool bgotonextstatement = true;
17954do
17955{
17956evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j5)))), 6.28318530717959)));
17957if( IKabs(evalcond[0]) < 0.0000050000000000 )
17958{
17959bgotonextstatement=false;
17960{
17961IkReal j3array[1], cj3array[1], sj3array[1];
17962bool j3valid[1]={false};
17963_nj3 = 1;
17964if( IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r11))+IKsqr(((-1.0)*new_r01))-1) <= IKFAST_SINCOS_THRESH )
17965 continue;
17966j3array[0]=IKatan2(((-1.0)*new_r11), ((-1.0)*new_r01));
17967sj3array[0]=IKsin(j3array[0]);
17968cj3array[0]=IKcos(j3array[0]);
17969if( j3array[0] > IKPI )
17970{
17971 j3array[0]-=IK2PI;
17972}
17973else if( j3array[0] < -IKPI )
17974{ j3array[0]+=IK2PI;
17975}
17976j3valid[0] = true;
17977for(int ij3 = 0; ij3 < 1; ++ij3)
17978{
17979if( !j3valid[ij3] )
17980{
17981 continue;
17982}
17983_ij3[0] = ij3; _ij3[1] = -1;
17984for(int iij3 = ij3+1; iij3 < 1; ++iij3)
17985{
17986if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
17987{
17988 j3valid[iij3]=false; _ij3[1] = iij3; break;
17989}
17990}
17991j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
17992{
17993IkReal evalcond[8];
17994IkReal x1417=IKcos(j3);
17995IkReal x1418=IKsin(j3);
17996IkReal x1419=((1.0)*x1417);
17997evalcond[0]=(x1417+new_r01);
17998evalcond[1]=(x1418+new_r11);
17999evalcond[2]=(x1417+new_r10);
18000evalcond[3]=(new_r00+(((-1.0)*x1418)));
18001evalcond[4]=(((new_r00*x1417))+((new_r10*x1418)));
18002evalcond[5]=((((-1.0)*new_r11*x1419))+((new_r01*x1418)));
18003evalcond[6]=((1.0)+((new_r01*x1417))+((new_r11*x1418)));
18004evalcond[7]=((-1.0)+(((-1.0)*new_r10*x1419))+((new_r00*x1418)));
18005if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
18006{
18007continue;
18008}
18009}
18010
18011{
18012std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
18013vinfos[0].jointtype = 1;
18014vinfos[0].foffset = j0;
18015vinfos[0].indices[0] = _ij0[0];
18016vinfos[0].indices[1] = _ij0[1];
18017vinfos[0].maxsolutions = _nj0;
18018vinfos[1].jointtype = 1;
18019vinfos[1].foffset = j1;
18020vinfos[1].indices[0] = _ij1[0];
18021vinfos[1].indices[1] = _ij1[1];
18022vinfos[1].maxsolutions = _nj1;
18023vinfos[2].jointtype = 1;
18024vinfos[2].foffset = j2;
18025vinfos[2].indices[0] = _ij2[0];
18026vinfos[2].indices[1] = _ij2[1];
18027vinfos[2].maxsolutions = _nj2;
18028vinfos[3].jointtype = 1;
18029vinfos[3].foffset = j3;
18030vinfos[3].indices[0] = _ij3[0];
18031vinfos[3].indices[1] = _ij3[1];
18032vinfos[3].maxsolutions = _nj3;
18033vinfos[4].jointtype = 1;
18034vinfos[4].foffset = j4;
18035vinfos[4].indices[0] = _ij4[0];
18036vinfos[4].indices[1] = _ij4[1];
18037vinfos[4].maxsolutions = _nj4;
18038vinfos[5].jointtype = 1;
18039vinfos[5].foffset = j5;
18040vinfos[5].indices[0] = _ij5[0];
18041vinfos[5].indices[1] = _ij5[1];
18042vinfos[5].maxsolutions = _nj5;
18043std::vector<int> vfree(0);
18044solutions.AddSolution(vinfos,vfree);
18045}
18046}
18047}
18048
18049}
18050} while(0);
18051if( bgotonextstatement )
18052{
18053bool bgotonextstatement = true;
18054do
18055{
18056evalcond[0]=((IKabs(new_r11))+(IKabs(new_r00)));
18057if( IKabs(evalcond[0]) < 0.0000050000000000 )
18058{
18059bgotonextstatement=false;
18060{
18061IkReal j3eval[3];
18062sj4=0;
18063cj4=-1.0;
18064j4=3.14159265358979;
18065new_r11=0;
18066new_r00=0;
18067j3eval[0]=new_r10;
18068j3eval[1]=IKsign(new_r10);
18069j3eval[2]=((IKabs(cj5))+(IKabs(sj5)));
18070if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
18071{
18072{
18073IkReal j3eval[3];
18074sj4=0;
18075cj4=-1.0;
18076j4=3.14159265358979;
18077new_r11=0;
18078new_r00=0;
18079j3eval[0]=new_r01;
18080j3eval[1]=IKsign(new_r01);
18081j3eval[2]=((IKabs(cj5))+(IKabs(sj5)));
18082if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
18083{
18084{
18085IkReal j3eval[2];
18086sj4=0;
18087cj4=-1.0;
18088j4=3.14159265358979;
18089new_r11=0;
18090new_r00=0;
18091j3eval[0]=new_r01;
18092j3eval[1]=new_r10;
18093if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 )
18094{
18095continue; // no branches [j3]
18096
18097} else
18098{
18099{
18100IkReal j3array[1], cj3array[1], sj3array[1];
18101bool j3valid[1]={false};
18102_nj3 = 1;
18104if(!x1420.valid){
18105continue;
18106}
18108if(!x1421.valid){
18109continue;
18110}
18111if( IKabs(((-1.0)*cj5*(x1420.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((sj5*(x1421.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*cj5*(x1420.value)))+IKsqr((sj5*(x1421.value)))-1) <= IKFAST_SINCOS_THRESH )
18112 continue;
18113j3array[0]=IKatan2(((-1.0)*cj5*(x1420.value)), (sj5*(x1421.value)));
18114sj3array[0]=IKsin(j3array[0]);
18115cj3array[0]=IKcos(j3array[0]);
18116if( j3array[0] > IKPI )
18117{
18118 j3array[0]-=IK2PI;
18119}
18120else if( j3array[0] < -IKPI )
18121{ j3array[0]+=IK2PI;
18122}
18123j3valid[0] = true;
18124for(int ij3 = 0; ij3 < 1; ++ij3)
18125{
18126if( !j3valid[ij3] )
18127{
18128 continue;
18129}
18130_ij3[0] = ij3; _ij3[1] = -1;
18131for(int iij3 = ij3+1; iij3 < 1; ++iij3)
18132{
18133if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
18134{
18135 j3valid[iij3]=false; _ij3[1] = iij3; break;
18136}
18137}
18138j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
18139{
18140IkReal evalcond[7];
18141IkReal x1422=IKsin(j3);
18142IkReal x1423=IKcos(j3);
18143IkReal x1424=((1.0)*sj5);
18144IkReal x1425=(cj5*x1422);
18145IkReal x1426=(x1423*x1424);
18146evalcond[0]=(cj5+((new_r01*x1422)));
18147evalcond[1]=(cj5+((new_r10*x1422)));
18148evalcond[2]=(sj5+(((-1.0)*new_r10*x1423)));
18149evalcond[3]=(((new_r01*x1423))+(((-1.0)*x1424)));
18150evalcond[4]=(((sj5*x1422))+((cj5*x1423)));
18151evalcond[5]=(x1425+new_r01+(((-1.0)*x1426)));
18152evalcond[6]=(x1425+new_r10+(((-1.0)*x1426)));
18153if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH )
18154{
18155continue;
18156}
18157}
18158
18159{
18160std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
18161vinfos[0].jointtype = 1;
18162vinfos[0].foffset = j0;
18163vinfos[0].indices[0] = _ij0[0];
18164vinfos[0].indices[1] = _ij0[1];
18165vinfos[0].maxsolutions = _nj0;
18166vinfos[1].jointtype = 1;
18167vinfos[1].foffset = j1;
18168vinfos[1].indices[0] = _ij1[0];
18169vinfos[1].indices[1] = _ij1[1];
18170vinfos[1].maxsolutions = _nj1;
18171vinfos[2].jointtype = 1;
18172vinfos[2].foffset = j2;
18173vinfos[2].indices[0] = _ij2[0];
18174vinfos[2].indices[1] = _ij2[1];
18175vinfos[2].maxsolutions = _nj2;
18176vinfos[3].jointtype = 1;
18177vinfos[3].foffset = j3;
18178vinfos[3].indices[0] = _ij3[0];
18179vinfos[3].indices[1] = _ij3[1];
18180vinfos[3].maxsolutions = _nj3;
18181vinfos[4].jointtype = 1;
18182vinfos[4].foffset = j4;
18183vinfos[4].indices[0] = _ij4[0];
18184vinfos[4].indices[1] = _ij4[1];
18185vinfos[4].maxsolutions = _nj4;
18186vinfos[5].jointtype = 1;
18187vinfos[5].foffset = j5;
18188vinfos[5].indices[0] = _ij5[0];
18189vinfos[5].indices[1] = _ij5[1];
18190vinfos[5].maxsolutions = _nj5;
18191std::vector<int> vfree(0);
18192solutions.AddSolution(vinfos,vfree);
18193}
18194}
18195}
18196
18197}
18198
18199}
18200
18201} else
18202{
18203{
18204IkReal j3array[1], cj3array[1], sj3array[1];
18205bool j3valid[1]={false};
18206_nj3 = 1;
18208if(!x1427.valid){
18209continue;
18210}
18211CheckValue<IkReal> x1428 = IKatan2WithCheck(IkReal(((-1.0)*cj5)),IkReal(sj5),IKFAST_ATAN2_MAGTHRESH);
18212if(!x1428.valid){
18213continue;
18214}
18215j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1427.value)))+(x1428.value));
18216sj3array[0]=IKsin(j3array[0]);
18217cj3array[0]=IKcos(j3array[0]);
18218if( j3array[0] > IKPI )
18219{
18220 j3array[0]-=IK2PI;
18221}
18222else if( j3array[0] < -IKPI )
18223{ j3array[0]+=IK2PI;
18224}
18225j3valid[0] = true;
18226for(int ij3 = 0; ij3 < 1; ++ij3)
18227{
18228if( !j3valid[ij3] )
18229{
18230 continue;
18231}
18232_ij3[0] = ij3; _ij3[1] = -1;
18233for(int iij3 = ij3+1; iij3 < 1; ++iij3)
18234{
18235if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
18236{
18237 j3valid[iij3]=false; _ij3[1] = iij3; break;
18238}
18239}
18240j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
18241{
18242IkReal evalcond[7];
18243IkReal x1429=IKsin(j3);
18244IkReal x1430=IKcos(j3);
18245IkReal x1431=((1.0)*sj5);
18246IkReal x1432=(cj5*x1429);
18247IkReal x1433=(x1430*x1431);
18248evalcond[0]=(cj5+((new_r01*x1429)));
18249evalcond[1]=(cj5+((new_r10*x1429)));
18250evalcond[2]=(sj5+(((-1.0)*new_r10*x1430)));
18251evalcond[3]=(((new_r01*x1430))+(((-1.0)*x1431)));
18252evalcond[4]=(((cj5*x1430))+((sj5*x1429)));
18253evalcond[5]=((((-1.0)*x1433))+x1432+new_r01);
18254evalcond[6]=((((-1.0)*x1433))+x1432+new_r10);
18255if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH )
18256{
18257continue;
18258}
18259}
18260
18261{
18262std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
18263vinfos[0].jointtype = 1;
18264vinfos[0].foffset = j0;
18265vinfos[0].indices[0] = _ij0[0];
18266vinfos[0].indices[1] = _ij0[1];
18267vinfos[0].maxsolutions = _nj0;
18268vinfos[1].jointtype = 1;
18269vinfos[1].foffset = j1;
18270vinfos[1].indices[0] = _ij1[0];
18271vinfos[1].indices[1] = _ij1[1];
18272vinfos[1].maxsolutions = _nj1;
18273vinfos[2].jointtype = 1;
18274vinfos[2].foffset = j2;
18275vinfos[2].indices[0] = _ij2[0];
18276vinfos[2].indices[1] = _ij2[1];
18277vinfos[2].maxsolutions = _nj2;
18278vinfos[3].jointtype = 1;
18279vinfos[3].foffset = j3;
18280vinfos[3].indices[0] = _ij3[0];
18281vinfos[3].indices[1] = _ij3[1];
18282vinfos[3].maxsolutions = _nj3;
18283vinfos[4].jointtype = 1;
18284vinfos[4].foffset = j4;
18285vinfos[4].indices[0] = _ij4[0];
18286vinfos[4].indices[1] = _ij4[1];
18287vinfos[4].maxsolutions = _nj4;
18288vinfos[5].jointtype = 1;
18289vinfos[5].foffset = j5;
18290vinfos[5].indices[0] = _ij5[0];
18291vinfos[5].indices[1] = _ij5[1];
18292vinfos[5].maxsolutions = _nj5;
18293std::vector<int> vfree(0);
18294solutions.AddSolution(vinfos,vfree);
18295}
18296}
18297}
18298
18299}
18300
18301}
18302
18303} else
18304{
18305{
18306IkReal j3array[1], cj3array[1], sj3array[1];
18307bool j3valid[1]={false};
18308_nj3 = 1;
18310if(!x1434.valid){
18311continue;
18312}
18313CheckValue<IkReal> x1435 = IKatan2WithCheck(IkReal(((-1.0)*cj5)),IkReal(sj5),IKFAST_ATAN2_MAGTHRESH);
18314if(!x1435.valid){
18315continue;
18316}
18317j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1434.value)))+(x1435.value));
18318sj3array[0]=IKsin(j3array[0]);
18319cj3array[0]=IKcos(j3array[0]);
18320if( j3array[0] > IKPI )
18321{
18322 j3array[0]-=IK2PI;
18323}
18324else if( j3array[0] < -IKPI )
18325{ j3array[0]+=IK2PI;
18326}
18327j3valid[0] = true;
18328for(int ij3 = 0; ij3 < 1; ++ij3)
18329{
18330if( !j3valid[ij3] )
18331{
18332 continue;
18333}
18334_ij3[0] = ij3; _ij3[1] = -1;
18335for(int iij3 = ij3+1; iij3 < 1; ++iij3)
18336{
18337if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
18338{
18339 j3valid[iij3]=false; _ij3[1] = iij3; break;
18340}
18341}
18342j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
18343{
18344IkReal evalcond[7];
18345IkReal x1436=IKsin(j3);
18346IkReal x1437=IKcos(j3);
18347IkReal x1438=((1.0)*sj5);
18348IkReal x1439=(cj5*x1436);
18349IkReal x1440=(x1437*x1438);
18350evalcond[0]=(cj5+((new_r01*x1436)));
18351evalcond[1]=(cj5+((new_r10*x1436)));
18352evalcond[2]=(sj5+(((-1.0)*new_r10*x1437)));
18353evalcond[3]=(((new_r01*x1437))+(((-1.0)*x1438)));
18354evalcond[4]=(((sj5*x1436))+((cj5*x1437)));
18355evalcond[5]=(x1439+(((-1.0)*x1440))+new_r01);
18356evalcond[6]=(x1439+(((-1.0)*x1440))+new_r10);
18357if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH )
18358{
18359continue;
18360}
18361}
18362
18363{
18364std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
18365vinfos[0].jointtype = 1;
18366vinfos[0].foffset = j0;
18367vinfos[0].indices[0] = _ij0[0];
18368vinfos[0].indices[1] = _ij0[1];
18369vinfos[0].maxsolutions = _nj0;
18370vinfos[1].jointtype = 1;
18371vinfos[1].foffset = j1;
18372vinfos[1].indices[0] = _ij1[0];
18373vinfos[1].indices[1] = _ij1[1];
18374vinfos[1].maxsolutions = _nj1;
18375vinfos[2].jointtype = 1;
18376vinfos[2].foffset = j2;
18377vinfos[2].indices[0] = _ij2[0];
18378vinfos[2].indices[1] = _ij2[1];
18379vinfos[2].maxsolutions = _nj2;
18380vinfos[3].jointtype = 1;
18381vinfos[3].foffset = j3;
18382vinfos[3].indices[0] = _ij3[0];
18383vinfos[3].indices[1] = _ij3[1];
18384vinfos[3].maxsolutions = _nj3;
18385vinfos[4].jointtype = 1;
18386vinfos[4].foffset = j4;
18387vinfos[4].indices[0] = _ij4[0];
18388vinfos[4].indices[1] = _ij4[1];
18389vinfos[4].maxsolutions = _nj4;
18390vinfos[5].jointtype = 1;
18391vinfos[5].foffset = j5;
18392vinfos[5].indices[0] = _ij5[0];
18393vinfos[5].indices[1] = _ij5[1];
18394vinfos[5].maxsolutions = _nj5;
18395std::vector<int> vfree(0);
18396solutions.AddSolution(vinfos,vfree);
18397}
18398}
18399}
18400
18401}
18402
18403}
18404
18405}
18406} while(0);
18407if( bgotonextstatement )
18408{
18409bool bgotonextstatement = true;
18410do
18411{
18412evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01)));
18413if( IKabs(evalcond[0]) < 0.0000050000000000 )
18414{
18415bgotonextstatement=false;
18416{
18417IkReal j3eval[1];
18418sj4=0;
18419cj4=-1.0;
18420j4=3.14159265358979;
18421new_r11=0;
18422new_r01=0;
18423new_r22=0;
18424new_r20=0;
18425j3eval[0]=((IKabs(new_r10))+(IKabs(new_r00)));
18426if( IKabs(j3eval[0]) < 0.0000010000000000 )
18427{
18428continue; // no branches [j3]
18429
18430} else
18431{
18432{
18433IkReal j3array[2], cj3array[2], sj3array[2];
18434bool j3valid[2]={false};
18435_nj3 = 2;
18437if(!x1442.valid){
18438continue;
18439}
18440IkReal x1441=x1442.value;
18441j3array[0]=((-1.0)*x1441);
18442sj3array[0]=IKsin(j3array[0]);
18443cj3array[0]=IKcos(j3array[0]);
18444j3array[1]=((3.14159265358979)+(((-1.0)*x1441)));
18445sj3array[1]=IKsin(j3array[1]);
18446cj3array[1]=IKcos(j3array[1]);
18447if( j3array[0] > IKPI )
18448{
18449 j3array[0]-=IK2PI;
18450}
18451else if( j3array[0] < -IKPI )
18452{ j3array[0]+=IK2PI;
18453}
18454j3valid[0] = true;
18455if( j3array[1] > IKPI )
18456{
18457 j3array[1]-=IK2PI;
18458}
18459else if( j3array[1] < -IKPI )
18460{ j3array[1]+=IK2PI;
18461}
18462j3valid[1] = true;
18463for(int ij3 = 0; ij3 < 2; ++ij3)
18464{
18465if( !j3valid[ij3] )
18466{
18467 continue;
18468}
18469_ij3[0] = ij3; _ij3[1] = -1;
18470for(int iij3 = ij3+1; iij3 < 2; ++iij3)
18471{
18472if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
18473{
18474 j3valid[iij3]=false; _ij3[1] = iij3; break;
18475}
18476}
18477j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
18478{
18479IkReal evalcond[1];
18480evalcond[0]=(((new_r00*(IKsin(j3))))+(((-1.0)*new_r10*(IKcos(j3)))));
18481if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH )
18482{
18483continue;
18484}
18485}
18486
18487{
18488std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
18489vinfos[0].jointtype = 1;
18490vinfos[0].foffset = j0;
18491vinfos[0].indices[0] = _ij0[0];
18492vinfos[0].indices[1] = _ij0[1];
18493vinfos[0].maxsolutions = _nj0;
18494vinfos[1].jointtype = 1;
18495vinfos[1].foffset = j1;
18496vinfos[1].indices[0] = _ij1[0];
18497vinfos[1].indices[1] = _ij1[1];
18498vinfos[1].maxsolutions = _nj1;
18499vinfos[2].jointtype = 1;
18500vinfos[2].foffset = j2;
18501vinfos[2].indices[0] = _ij2[0];
18502vinfos[2].indices[1] = _ij2[1];
18503vinfos[2].maxsolutions = _nj2;
18504vinfos[3].jointtype = 1;
18505vinfos[3].foffset = j3;
18506vinfos[3].indices[0] = _ij3[0];
18507vinfos[3].indices[1] = _ij3[1];
18508vinfos[3].maxsolutions = _nj3;
18509vinfos[4].jointtype = 1;
18510vinfos[4].foffset = j4;
18511vinfos[4].indices[0] = _ij4[0];
18512vinfos[4].indices[1] = _ij4[1];
18513vinfos[4].maxsolutions = _nj4;
18514vinfos[5].jointtype = 1;
18515vinfos[5].foffset = j5;
18516vinfos[5].indices[0] = _ij5[0];
18517vinfos[5].indices[1] = _ij5[1];
18518vinfos[5].maxsolutions = _nj5;
18519std::vector<int> vfree(0);
18520solutions.AddSolution(vinfos,vfree);
18521}
18522}
18523}
18524
18525}
18526
18527}
18528
18529}
18530} while(0);
18531if( bgotonextstatement )
18532{
18533bool bgotonextstatement = true;
18534do
18535{
18536evalcond[0]=((IKabs(new_r10))+(IKabs(new_r00)));
18537if( IKabs(evalcond[0]) < 0.0000050000000000 )
18538{
18539bgotonextstatement=false;
18540{
18541IkReal j3eval[1];
18542sj4=0;
18543cj4=-1.0;
18544j4=3.14159265358979;
18545new_r00=0;
18546new_r10=0;
18547new_r21=0;
18548new_r22=0;
18549j3eval[0]=((IKabs(new_r11))+(IKabs(new_r01)));
18550if( IKabs(j3eval[0]) < 0.0000010000000000 )
18551{
18552continue; // no branches [j3]
18553
18554} else
18555{
18556{
18557IkReal j3array[2], cj3array[2], sj3array[2];
18558bool j3valid[2]={false};
18559_nj3 = 2;
18561if(!x1444.valid){
18562continue;
18563}
18564IkReal x1443=x1444.value;
18565j3array[0]=((-1.0)*x1443);
18566sj3array[0]=IKsin(j3array[0]);
18567cj3array[0]=IKcos(j3array[0]);
18568j3array[1]=((3.14159265358979)+(((-1.0)*x1443)));
18569sj3array[1]=IKsin(j3array[1]);
18570cj3array[1]=IKcos(j3array[1]);
18571if( j3array[0] > IKPI )
18572{
18573 j3array[0]-=IK2PI;
18574}
18575else if( j3array[0] < -IKPI )
18576{ j3array[0]+=IK2PI;
18577}
18578j3valid[0] = true;
18579if( j3array[1] > IKPI )
18580{
18581 j3array[1]-=IK2PI;
18582}
18583else if( j3array[1] < -IKPI )
18584{ j3array[1]+=IK2PI;
18585}
18586j3valid[1] = true;
18587for(int ij3 = 0; ij3 < 2; ++ij3)
18588{
18589if( !j3valid[ij3] )
18590{
18591 continue;
18592}
18593_ij3[0] = ij3; _ij3[1] = -1;
18594for(int iij3 = ij3+1; iij3 < 2; ++iij3)
18595{
18596if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
18597{
18598 j3valid[iij3]=false; _ij3[1] = iij3; break;
18599}
18600}
18601j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
18602{
18603IkReal evalcond[1];
18604evalcond[0]=(((new_r01*(IKsin(j3))))+(((-1.0)*new_r11*(IKcos(j3)))));
18605if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH )
18606{
18607continue;
18608}
18609}
18610
18611{
18612std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
18613vinfos[0].jointtype = 1;
18614vinfos[0].foffset = j0;
18615vinfos[0].indices[0] = _ij0[0];
18616vinfos[0].indices[1] = _ij0[1];
18617vinfos[0].maxsolutions = _nj0;
18618vinfos[1].jointtype = 1;
18619vinfos[1].foffset = j1;
18620vinfos[1].indices[0] = _ij1[0];
18621vinfos[1].indices[1] = _ij1[1];
18622vinfos[1].maxsolutions = _nj1;
18623vinfos[2].jointtype = 1;
18624vinfos[2].foffset = j2;
18625vinfos[2].indices[0] = _ij2[0];
18626vinfos[2].indices[1] = _ij2[1];
18627vinfos[2].maxsolutions = _nj2;
18628vinfos[3].jointtype = 1;
18629vinfos[3].foffset = j3;
18630vinfos[3].indices[0] = _ij3[0];
18631vinfos[3].indices[1] = _ij3[1];
18632vinfos[3].maxsolutions = _nj3;
18633vinfos[4].jointtype = 1;
18634vinfos[4].foffset = j4;
18635vinfos[4].indices[0] = _ij4[0];
18636vinfos[4].indices[1] = _ij4[1];
18637vinfos[4].maxsolutions = _nj4;
18638vinfos[5].jointtype = 1;
18639vinfos[5].foffset = j5;
18640vinfos[5].indices[0] = _ij5[0];
18641vinfos[5].indices[1] = _ij5[1];
18642vinfos[5].maxsolutions = _nj5;
18643std::vector<int> vfree(0);
18644solutions.AddSolution(vinfos,vfree);
18645}
18646}
18647}
18648
18649}
18650
18651}
18652
18653}
18654} while(0);
18655if( bgotonextstatement )
18656{
18657bool bgotonextstatement = true;
18658do
18659{
18660evalcond[0]=((IKabs(new_r10))+(IKabs(new_r01)));
18661if( IKabs(evalcond[0]) < 0.0000050000000000 )
18662{
18663bgotonextstatement=false;
18664{
18665IkReal j3eval[3];
18666sj4=0;
18667cj4=-1.0;
18668j4=3.14159265358979;
18669new_r01=0;
18670new_r10=0;
18671j3eval[0]=new_r00;
18672j3eval[1]=IKsign(new_r00);
18673j3eval[2]=((IKabs(cj5))+(IKabs(sj5)));
18674if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 )
18675{
18676{
18677IkReal j3eval[2];
18678sj4=0;
18679cj4=-1.0;
18680j4=3.14159265358979;
18681new_r01=0;
18682new_r10=0;
18683j3eval[0]=new_r00;
18684j3eval[1]=new_r11;
18685if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 )
18686{
18687continue; // no branches [j3]
18688
18689} else
18690{
18691{
18692IkReal j3array[1], cj3array[1], sj3array[1];
18693bool j3valid[1]={false};
18694_nj3 = 1;
18696if(!x1445.valid){
18697continue;
18698}
18700if(!x1446.valid){
18701continue;
18702}
18703if( IKabs(((-1.0)*sj5*(x1445.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs((cj5*(x1446.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*sj5*(x1445.value)))+IKsqr((cj5*(x1446.value)))-1) <= IKFAST_SINCOS_THRESH )
18704 continue;
18705j3array[0]=IKatan2(((-1.0)*sj5*(x1445.value)), (cj5*(x1446.value)));
18706sj3array[0]=IKsin(j3array[0]);
18707cj3array[0]=IKcos(j3array[0]);
18708if( j3array[0] > IKPI )
18709{
18710 j3array[0]-=IK2PI;
18711}
18712else if( j3array[0] < -IKPI )
18713{ j3array[0]+=IK2PI;
18714}
18715j3valid[0] = true;
18716for(int ij3 = 0; ij3 < 1; ++ij3)
18717{
18718if( !j3valid[ij3] )
18719{
18720 continue;
18721}
18722_ij3[0] = ij3; _ij3[1] = -1;
18723for(int iij3 = ij3+1; iij3 < 1; ++iij3)
18724{
18725if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
18726{
18727 j3valid[iij3]=false; _ij3[1] = iij3; break;
18728}
18729}
18730j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
18731{
18732IkReal evalcond[7];
18733IkReal x1447=IKcos(j3);
18734IkReal x1448=IKsin(j3);
18735IkReal x1449=((1.0)*sj5);
18736IkReal x1450=(cj5*x1447);
18737IkReal x1451=((1.0)*x1447);
18738evalcond[0]=(sj5+((new_r00*x1448)));
18739evalcond[1]=(cj5+((new_r00*x1447)));
18740evalcond[2]=(cj5+(((-1.0)*new_r11*x1451)));
18741evalcond[3]=(((new_r11*x1448))+(((-1.0)*x1449)));
18742evalcond[4]=((((-1.0)*x1447*x1449))+((cj5*x1448)));
18743evalcond[5]=(((sj5*x1448))+x1450+new_r00);
18744evalcond[6]=((((-1.0)*x1450))+new_r11+(((-1.0)*x1448*x1449)));
18745if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH )
18746{
18747continue;
18748}
18749}
18750
18751{
18752std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
18753vinfos[0].jointtype = 1;
18754vinfos[0].foffset = j0;
18755vinfos[0].indices[0] = _ij0[0];
18756vinfos[0].indices[1] = _ij0[1];
18757vinfos[0].maxsolutions = _nj0;
18758vinfos[1].jointtype = 1;
18759vinfos[1].foffset = j1;
18760vinfos[1].indices[0] = _ij1[0];
18761vinfos[1].indices[1] = _ij1[1];
18762vinfos[1].maxsolutions = _nj1;
18763vinfos[2].jointtype = 1;
18764vinfos[2].foffset = j2;
18765vinfos[2].indices[0] = _ij2[0];
18766vinfos[2].indices[1] = _ij2[1];
18767vinfos[2].maxsolutions = _nj2;
18768vinfos[3].jointtype = 1;
18769vinfos[3].foffset = j3;
18770vinfos[3].indices[0] = _ij3[0];
18771vinfos[3].indices[1] = _ij3[1];
18772vinfos[3].maxsolutions = _nj3;
18773vinfos[4].jointtype = 1;
18774vinfos[4].foffset = j4;
18775vinfos[4].indices[0] = _ij4[0];
18776vinfos[4].indices[1] = _ij4[1];
18777vinfos[4].maxsolutions = _nj4;
18778vinfos[5].jointtype = 1;
18779vinfos[5].foffset = j5;
18780vinfos[5].indices[0] = _ij5[0];
18781vinfos[5].indices[1] = _ij5[1];
18782vinfos[5].maxsolutions = _nj5;
18783std::vector<int> vfree(0);
18784solutions.AddSolution(vinfos,vfree);
18785}
18786}
18787}
18788
18789}
18790
18791}
18792
18793} else
18794{
18795{
18796IkReal j3array[1], cj3array[1], sj3array[1];
18797bool j3valid[1]={false};
18798_nj3 = 1;
18799CheckValue<IkReal> x1452 = IKatan2WithCheck(IkReal(((-1.0)*sj5)),IkReal(((-1.0)*cj5)),IKFAST_ATAN2_MAGTHRESH);
18800if(!x1452.valid){
18801continue;
18802}
18804if(!x1453.valid){
18805continue;
18806}
18807j3array[0]=((-1.5707963267949)+(x1452.value)+(((1.5707963267949)*(x1453.value))));
18808sj3array[0]=IKsin(j3array[0]);
18809cj3array[0]=IKcos(j3array[0]);
18810if( j3array[0] > IKPI )
18811{
18812 j3array[0]-=IK2PI;
18813}
18814else if( j3array[0] < -IKPI )
18815{ j3array[0]+=IK2PI;
18816}
18817j3valid[0] = true;
18818for(int ij3 = 0; ij3 < 1; ++ij3)
18819{
18820if( !j3valid[ij3] )
18821{
18822 continue;
18823}
18824_ij3[0] = ij3; _ij3[1] = -1;
18825for(int iij3 = ij3+1; iij3 < 1; ++iij3)
18826{
18827if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
18828{
18829 j3valid[iij3]=false; _ij3[1] = iij3; break;
18830}
18831}
18832j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
18833{
18834IkReal evalcond[7];
18835IkReal x1454=IKcos(j3);
18836IkReal x1455=IKsin(j3);
18837IkReal x1456=((1.0)*sj5);
18838IkReal x1457=(cj5*x1454);
18839IkReal x1458=((1.0)*x1454);
18840evalcond[0]=(sj5+((new_r00*x1455)));
18841evalcond[1]=(cj5+((new_r00*x1454)));
18842evalcond[2]=(cj5+(((-1.0)*new_r11*x1458)));
18843evalcond[3]=((((-1.0)*x1456))+((new_r11*x1455)));
18844evalcond[4]=(((cj5*x1455))+(((-1.0)*x1454*x1456)));
18845evalcond[5]=(((sj5*x1455))+x1457+new_r00);
18846evalcond[6]=((((-1.0)*x1457))+(((-1.0)*x1455*x1456))+new_r11);
18847if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH )
18848{
18849continue;
18850}
18851}
18852
18853{
18854std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
18855vinfos[0].jointtype = 1;
18856vinfos[0].foffset = j0;
18857vinfos[0].indices[0] = _ij0[0];
18858vinfos[0].indices[1] = _ij0[1];
18859vinfos[0].maxsolutions = _nj0;
18860vinfos[1].jointtype = 1;
18861vinfos[1].foffset = j1;
18862vinfos[1].indices[0] = _ij1[0];
18863vinfos[1].indices[1] = _ij1[1];
18864vinfos[1].maxsolutions = _nj1;
18865vinfos[2].jointtype = 1;
18866vinfos[2].foffset = j2;
18867vinfos[2].indices[0] = _ij2[0];
18868vinfos[2].indices[1] = _ij2[1];
18869vinfos[2].maxsolutions = _nj2;
18870vinfos[3].jointtype = 1;
18871vinfos[3].foffset = j3;
18872vinfos[3].indices[0] = _ij3[0];
18873vinfos[3].indices[1] = _ij3[1];
18874vinfos[3].maxsolutions = _nj3;
18875vinfos[4].jointtype = 1;
18876vinfos[4].foffset = j4;
18877vinfos[4].indices[0] = _ij4[0];
18878vinfos[4].indices[1] = _ij4[1];
18879vinfos[4].maxsolutions = _nj4;
18880vinfos[5].jointtype = 1;
18881vinfos[5].foffset = j5;
18882vinfos[5].indices[0] = _ij5[0];
18883vinfos[5].indices[1] = _ij5[1];
18884vinfos[5].maxsolutions = _nj5;
18885std::vector<int> vfree(0);
18886solutions.AddSolution(vinfos,vfree);
18887}
18888}
18889}
18890
18891}
18892
18893}
18894
18895}
18896} while(0);
18897if( bgotonextstatement )
18898{
18899bool bgotonextstatement = true;
18900do
18901{
18902if( 1 )
18903{
18904bgotonextstatement=false;
18905continue; // branch miss [j3]
18906
18907}
18908} while(0);
18909if( bgotonextstatement )
18910{
18911}
18912}
18913}
18914}
18915}
18916}
18917}
18918}
18919}
18920}
18921}
18922}
18923
18924} else
18925{
18926{
18927IkReal j3array[1], cj3array[1], sj3array[1];
18928bool j3valid[1]={false};
18929_nj3 = 1;
18930IkReal x1459=((1.0)*new_r00);
18931CheckValue<IkReal> x1460 = IKatan2WithCheck(IkReal(((((-1.0)*(cj5*cj5)))+(new_r00*new_r00))),IkReal(((((-1.0)*new_r10*x1459))+((cj5*sj5)))),IKFAST_ATAN2_MAGTHRESH);
18932if(!x1460.valid){
18933continue;
18934}
18935CheckValue<IkReal> x1461=IKPowWithIntegerCheck(IKsign((((cj5*new_r10))+(((-1.0)*sj5*x1459)))),-1);
18936if(!x1461.valid){
18937continue;
18938}
18939j3array[0]=((-1.5707963267949)+(x1460.value)+(((1.5707963267949)*(x1461.value))));
18940sj3array[0]=IKsin(j3array[0]);
18941cj3array[0]=IKcos(j3array[0]);
18942if( j3array[0] > IKPI )
18943{
18944 j3array[0]-=IK2PI;
18945}
18946else if( j3array[0] < -IKPI )
18947{ j3array[0]+=IK2PI;
18948}
18949j3valid[0] = true;
18950for(int ij3 = 0; ij3 < 1; ++ij3)
18951{
18952if( !j3valid[ij3] )
18953{
18954 continue;
18955}
18956_ij3[0] = ij3; _ij3[1] = -1;
18957for(int iij3 = ij3+1; iij3 < 1; ++iij3)
18958{
18959if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
18960{
18961 j3valid[iij3]=false; _ij3[1] = iij3; break;
18962}
18963}
18964j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
18965{
18966IkReal evalcond[8];
18967IkReal x1462=IKsin(j3);
18968IkReal x1463=IKcos(j3);
18969IkReal x1464=((1.0)*sj5);
18970IkReal x1465=(cj5*x1462);
18971IkReal x1466=((1.0)*x1463);
18972IkReal x1467=(x1463*x1464);
18973evalcond[0]=(((new_r00*x1463))+cj5+((new_r10*x1462)));
18974evalcond[1]=(((cj5*x1463))+new_r00+((sj5*x1462)));
18975evalcond[2]=((((-1.0)*new_r10*x1466))+((new_r00*x1462))+sj5);
18976evalcond[3]=(((new_r01*x1462))+cj5+(((-1.0)*new_r11*x1466)));
18977evalcond[4]=((((-1.0)*x1467))+x1465+new_r01);
18978evalcond[5]=((((-1.0)*x1467))+x1465+new_r10);
18979evalcond[6]=(((new_r01*x1463))+(((-1.0)*x1464))+((new_r11*x1462)));
18980evalcond[7]=((((-1.0)*cj5*x1466))+(((-1.0)*x1462*x1464))+new_r11);
18981if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
18982{
18983continue;
18984}
18985}
18986
18987{
18988std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
18989vinfos[0].jointtype = 1;
18990vinfos[0].foffset = j0;
18991vinfos[0].indices[0] = _ij0[0];
18992vinfos[0].indices[1] = _ij0[1];
18993vinfos[0].maxsolutions = _nj0;
18994vinfos[1].jointtype = 1;
18995vinfos[1].foffset = j1;
18996vinfos[1].indices[0] = _ij1[0];
18997vinfos[1].indices[1] = _ij1[1];
18998vinfos[1].maxsolutions = _nj1;
18999vinfos[2].jointtype = 1;
19000vinfos[2].foffset = j2;
19001vinfos[2].indices[0] = _ij2[0];
19002vinfos[2].indices[1] = _ij2[1];
19003vinfos[2].maxsolutions = _nj2;
19004vinfos[3].jointtype = 1;
19005vinfos[3].foffset = j3;
19006vinfos[3].indices[0] = _ij3[0];
19007vinfos[3].indices[1] = _ij3[1];
19008vinfos[3].maxsolutions = _nj3;
19009vinfos[4].jointtype = 1;
19010vinfos[4].foffset = j4;
19011vinfos[4].indices[0] = _ij4[0];
19012vinfos[4].indices[1] = _ij4[1];
19013vinfos[4].maxsolutions = _nj4;
19014vinfos[5].jointtype = 1;
19015vinfos[5].foffset = j5;
19016vinfos[5].indices[0] = _ij5[0];
19017vinfos[5].indices[1] = _ij5[1];
19018vinfos[5].maxsolutions = _nj5;
19019std::vector<int> vfree(0);
19020solutions.AddSolution(vinfos,vfree);
19021}
19022}
19023}
19024
19025}
19026
19027}
19028
19029} else
19030{
19031{
19032IkReal j3array[1], cj3array[1], sj3array[1];
19033bool j3valid[1]={false};
19034_nj3 = 1;
19035IkReal x1468=((1.0)*new_r10);
19036CheckValue<IkReal> x1469 = IKatan2WithCheck(IkReal((((new_r00*new_r01))+((cj5*sj5)))),IkReal(((((-1.0)*new_r01*x1468))+(cj5*cj5))),IKFAST_ATAN2_MAGTHRESH);
19037if(!x1469.valid){
19038continue;
19039}
19040CheckValue<IkReal> x1470=IKPowWithIntegerCheck(IKsign(((((-1.0)*cj5*new_r00))+(((-1.0)*sj5*x1468)))),-1);
19041if(!x1470.valid){
19042continue;
19043}
19044j3array[0]=((-1.5707963267949)+(x1469.value)+(((1.5707963267949)*(x1470.value))));
19045sj3array[0]=IKsin(j3array[0]);
19046cj3array[0]=IKcos(j3array[0]);
19047if( j3array[0] > IKPI )
19048{
19049 j3array[0]-=IK2PI;
19050}
19051else if( j3array[0] < -IKPI )
19052{ j3array[0]+=IK2PI;
19053}
19054j3valid[0] = true;
19055for(int ij3 = 0; ij3 < 1; ++ij3)
19056{
19057if( !j3valid[ij3] )
19058{
19059 continue;
19060}
19061_ij3[0] = ij3; _ij3[1] = -1;
19062for(int iij3 = ij3+1; iij3 < 1; ++iij3)
19063{
19064if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
19065{
19066 j3valid[iij3]=false; _ij3[1] = iij3; break;
19067}
19068}
19069j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
19070{
19071IkReal evalcond[8];
19072IkReal x1471=IKsin(j3);
19073IkReal x1472=IKcos(j3);
19074IkReal x1473=((1.0)*sj5);
19075IkReal x1474=(cj5*x1471);
19076IkReal x1475=((1.0)*x1472);
19077IkReal x1476=(x1472*x1473);
19078evalcond[0]=(((new_r10*x1471))+cj5+((new_r00*x1472)));
19079evalcond[1]=(((cj5*x1472))+((sj5*x1471))+new_r00);
19080evalcond[2]=(sj5+((new_r00*x1471))+(((-1.0)*new_r10*x1475)));
19081evalcond[3]=(cj5+(((-1.0)*new_r11*x1475))+((new_r01*x1471)));
19082evalcond[4]=(x1474+(((-1.0)*x1476))+new_r01);
19083evalcond[5]=(x1474+(((-1.0)*x1476))+new_r10);
19084evalcond[6]=(((new_r11*x1471))+((new_r01*x1472))+(((-1.0)*x1473)));
19085evalcond[7]=((((-1.0)*x1471*x1473))+(((-1.0)*cj5*x1475))+new_r11);
19086if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
19087{
19088continue;
19089}
19090}
19091
19092{
19093std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
19094vinfos[0].jointtype = 1;
19095vinfos[0].foffset = j0;
19096vinfos[0].indices[0] = _ij0[0];
19097vinfos[0].indices[1] = _ij0[1];
19098vinfos[0].maxsolutions = _nj0;
19099vinfos[1].jointtype = 1;
19100vinfos[1].foffset = j1;
19101vinfos[1].indices[0] = _ij1[0];
19102vinfos[1].indices[1] = _ij1[1];
19103vinfos[1].maxsolutions = _nj1;
19104vinfos[2].jointtype = 1;
19105vinfos[2].foffset = j2;
19106vinfos[2].indices[0] = _ij2[0];
19107vinfos[2].indices[1] = _ij2[1];
19108vinfos[2].maxsolutions = _nj2;
19109vinfos[3].jointtype = 1;
19110vinfos[3].foffset = j3;
19111vinfos[3].indices[0] = _ij3[0];
19112vinfos[3].indices[1] = _ij3[1];
19113vinfos[3].maxsolutions = _nj3;
19114vinfos[4].jointtype = 1;
19115vinfos[4].foffset = j4;
19116vinfos[4].indices[0] = _ij4[0];
19117vinfos[4].indices[1] = _ij4[1];
19118vinfos[4].maxsolutions = _nj4;
19119vinfos[5].jointtype = 1;
19120vinfos[5].foffset = j5;
19121vinfos[5].indices[0] = _ij5[0];
19122vinfos[5].indices[1] = _ij5[1];
19123vinfos[5].maxsolutions = _nj5;
19124std::vector<int> vfree(0);
19125solutions.AddSolution(vinfos,vfree);
19126}
19127}
19128}
19129
19130}
19131
19132}
19133
19134} else
19135{
19136{
19137IkReal j3array[1], cj3array[1], sj3array[1];
19138bool j3valid[1]={false};
19139_nj3 = 1;
19140IkReal x1477=((1.0)*new_r10);
19141CheckValue<IkReal> x1478 = IKatan2WithCheck(IkReal((((cj5*new_r11))+((cj5*new_r00)))),IkReal((((cj5*new_r01))+(((-1.0)*cj5*x1477)))),IKFAST_ATAN2_MAGTHRESH);
19142if(!x1478.valid){
19143continue;
19144}
19145CheckValue<IkReal> x1479=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r11*x1477))+(((-1.0)*new_r00*new_r01)))),-1);
19146if(!x1479.valid){
19147continue;
19148}
19149j3array[0]=((-1.5707963267949)+(x1478.value)+(((1.5707963267949)*(x1479.value))));
19150sj3array[0]=IKsin(j3array[0]);
19151cj3array[0]=IKcos(j3array[0]);
19152if( j3array[0] > IKPI )
19153{
19154 j3array[0]-=IK2PI;
19155}
19156else if( j3array[0] < -IKPI )
19157{ j3array[0]+=IK2PI;
19158}
19159j3valid[0] = true;
19160for(int ij3 = 0; ij3 < 1; ++ij3)
19161{
19162if( !j3valid[ij3] )
19163{
19164 continue;
19165}
19166_ij3[0] = ij3; _ij3[1] = -1;
19167for(int iij3 = ij3+1; iij3 < 1; ++iij3)
19168{
19169if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
19170{
19171 j3valid[iij3]=false; _ij3[1] = iij3; break;
19172}
19173}
19174j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
19175{
19176IkReal evalcond[8];
19177IkReal x1480=IKsin(j3);
19178IkReal x1481=IKcos(j3);
19179IkReal x1482=((1.0)*sj5);
19180IkReal x1483=(cj5*x1480);
19181IkReal x1484=((1.0)*x1481);
19182IkReal x1485=(x1481*x1482);
19183evalcond[0]=(cj5+((new_r00*x1481))+((new_r10*x1480)));
19184evalcond[1]=(((cj5*x1481))+new_r00+((sj5*x1480)));
19185evalcond[2]=(sj5+(((-1.0)*new_r10*x1484))+((new_r00*x1480)));
19186evalcond[3]=(cj5+(((-1.0)*new_r11*x1484))+((new_r01*x1480)));
19187evalcond[4]=((((-1.0)*x1485))+x1483+new_r01);
19188evalcond[5]=((((-1.0)*x1485))+x1483+new_r10);
19189evalcond[6]=((((-1.0)*x1482))+((new_r11*x1480))+((new_r01*x1481)));
19190evalcond[7]=((((-1.0)*x1480*x1482))+new_r11+(((-1.0)*cj5*x1484)));
19191if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH )
19192{
19193continue;
19194}
19195}
19196
19197{
19198std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
19199vinfos[0].jointtype = 1;
19200vinfos[0].foffset = j0;
19201vinfos[0].indices[0] = _ij0[0];
19202vinfos[0].indices[1] = _ij0[1];
19203vinfos[0].maxsolutions = _nj0;
19204vinfos[1].jointtype = 1;
19205vinfos[1].foffset = j1;
19206vinfos[1].indices[0] = _ij1[0];
19207vinfos[1].indices[1] = _ij1[1];
19208vinfos[1].maxsolutions = _nj1;
19209vinfos[2].jointtype = 1;
19210vinfos[2].foffset = j2;
19211vinfos[2].indices[0] = _ij2[0];
19212vinfos[2].indices[1] = _ij2[1];
19213vinfos[2].maxsolutions = _nj2;
19214vinfos[3].jointtype = 1;
19215vinfos[3].foffset = j3;
19216vinfos[3].indices[0] = _ij3[0];
19217vinfos[3].indices[1] = _ij3[1];
19218vinfos[3].maxsolutions = _nj3;
19219vinfos[4].jointtype = 1;
19220vinfos[4].foffset = j4;
19221vinfos[4].indices[0] = _ij4[0];
19222vinfos[4].indices[1] = _ij4[1];
19223vinfos[4].maxsolutions = _nj4;
19224vinfos[5].jointtype = 1;
19225vinfos[5].foffset = j5;
19226vinfos[5].indices[0] = _ij5[0];
19227vinfos[5].indices[1] = _ij5[1];
19228vinfos[5].maxsolutions = _nj5;
19229std::vector<int> vfree(0);
19230solutions.AddSolution(vinfos,vfree);
19231}
19232}
19233}
19234
19235}
19236
19237}
19238
19239}
19240} while(0);
19241if( bgotonextstatement )
19242{
19243bool bgotonextstatement = true;
19244do
19245{
19246evalcond[0]=((IKabs(new_r12))+(IKabs(new_r02)));
19247if( IKabs(evalcond[0]) < 0.0000050000000000 )
19248{
19249bgotonextstatement=false;
19250{
19251IkReal j3eval[1];
19252new_r02=0;
19253new_r12=0;
19254new_r20=0;
19255new_r21=0;
19256j3eval[0]=((IKabs(new_r11))+(IKabs(new_r01)));
19257if( IKabs(j3eval[0]) < 0.0000010000000000 )
19258{
19259{
19260IkReal j3eval[1];
19261new_r02=0;
19262new_r12=0;
19263new_r20=0;
19264new_r21=0;
19265j3eval[0]=((IKabs(new_r10))+(IKabs(new_r00)));
19266if( IKabs(j3eval[0]) < 0.0000010000000000 )
19267{
19268{
19269IkReal j3eval[1];
19270new_r02=0;
19271new_r12=0;
19272new_r20=0;
19273new_r21=0;
19274j3eval[0]=((IKabs((new_r10*new_r22)))+(IKabs((new_r00*new_r22))));
19275if( IKabs(j3eval[0]) < 0.0000010000000000 )
19276{
19277continue; // no branches [j3]
19278
19279} else
19280{
19281{
19282IkReal j3array[2], cj3array[2], sj3array[2];
19283bool j3valid[2]={false};
19284_nj3 = 2;
19285IkReal x1486=((-1.0)*new_r22);
19286CheckValue<IkReal> x1488 = IKatan2WithCheck(IkReal((new_r00*x1486)),IkReal((new_r10*x1486)),IKFAST_ATAN2_MAGTHRESH);
19287if(!x1488.valid){
19288continue;
19289}
19290IkReal x1487=x1488.value;
19291j3array[0]=((-1.0)*x1487);
19292sj3array[0]=IKsin(j3array[0]);
19293cj3array[0]=IKcos(j3array[0]);
19294j3array[1]=((3.14159265358979)+(((-1.0)*x1487)));
19295sj3array[1]=IKsin(j3array[1]);
19296cj3array[1]=IKcos(j3array[1]);
19297if( j3array[0] > IKPI )
19298{
19299 j3array[0]-=IK2PI;
19300}
19301else if( j3array[0] < -IKPI )
19302{ j3array[0]+=IK2PI;
19303}
19304j3valid[0] = true;
19305if( j3array[1] > IKPI )
19306{
19307 j3array[1]-=IK2PI;
19308}
19309else if( j3array[1] < -IKPI )
19310{ j3array[1]+=IK2PI;
19311}
19312j3valid[1] = true;
19313for(int ij3 = 0; ij3 < 2; ++ij3)
19314{
19315if( !j3valid[ij3] )
19316{
19317 continue;
19318}
19319_ij3[0] = ij3; _ij3[1] = -1;
19320for(int iij3 = ij3+1; iij3 < 2; ++iij3)
19321{
19322if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
19323{
19324 j3valid[iij3]=false; _ij3[1] = iij3; break;
19325}
19326}
19327j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
19328{
19329IkReal evalcond[5];
19330IkReal x1489=IKsin(j3);
19331IkReal x1490=IKcos(j3);
19332IkReal x1491=((1.0)*new_r11);
19333IkReal x1492=(new_r01*x1490);
19334evalcond[0]=(((new_r11*x1489))+x1492);
19335evalcond[1]=(((new_r00*x1490))+((new_r10*x1489)));
19336evalcond[2]=(((new_r00*x1489))+(((-1.0)*new_r10*x1490)));
19337evalcond[3]=(((new_r01*x1489))+(((-1.0)*x1490*x1491)));
19338evalcond[4]=((((-1.0)*new_r22*x1492))+(((-1.0)*new_r22*x1489*x1491)));
19339if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH )
19340{
19341continue;
19342}
19343}
19344
19345{
19346std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
19347vinfos[0].jointtype = 1;
19348vinfos[0].foffset = j0;
19349vinfos[0].indices[0] = _ij0[0];
19350vinfos[0].indices[1] = _ij0[1];
19351vinfos[0].maxsolutions = _nj0;
19352vinfos[1].jointtype = 1;
19353vinfos[1].foffset = j1;
19354vinfos[1].indices[0] = _ij1[0];
19355vinfos[1].indices[1] = _ij1[1];
19356vinfos[1].maxsolutions = _nj1;
19357vinfos[2].jointtype = 1;
19358vinfos[2].foffset = j2;
19359vinfos[2].indices[0] = _ij2[0];
19360vinfos[2].indices[1] = _ij2[1];
19361vinfos[2].maxsolutions = _nj2;
19362vinfos[3].jointtype = 1;
19363vinfos[3].foffset = j3;
19364vinfos[3].indices[0] = _ij3[0];
19365vinfos[3].indices[1] = _ij3[1];
19366vinfos[3].maxsolutions = _nj3;
19367vinfos[4].jointtype = 1;
19368vinfos[4].foffset = j4;
19369vinfos[4].indices[0] = _ij4[0];
19370vinfos[4].indices[1] = _ij4[1];
19371vinfos[4].maxsolutions = _nj4;
19372vinfos[5].jointtype = 1;
19373vinfos[5].foffset = j5;
19374vinfos[5].indices[0] = _ij5[0];
19375vinfos[5].indices[1] = _ij5[1];
19376vinfos[5].maxsolutions = _nj5;
19377std::vector<int> vfree(0);
19378solutions.AddSolution(vinfos,vfree);
19379}
19380}
19381}
19382
19383}
19384
19385}
19386
19387} else
19388{
19389{
19390IkReal j3array[2], cj3array[2], sj3array[2];
19391bool j3valid[2]={false};
19392_nj3 = 2;
19394if(!x1494.valid){
19395continue;
19396}
19397IkReal x1493=x1494.value;
19398j3array[0]=((-1.0)*x1493);
19399sj3array[0]=IKsin(j3array[0]);
19400cj3array[0]=IKcos(j3array[0]);
19401j3array[1]=((3.14159265358979)+(((-1.0)*x1493)));
19402sj3array[1]=IKsin(j3array[1]);
19403cj3array[1]=IKcos(j3array[1]);
19404if( j3array[0] > IKPI )
19405{
19406 j3array[0]-=IK2PI;
19407}
19408else if( j3array[0] < -IKPI )
19409{ j3array[0]+=IK2PI;
19410}
19411j3valid[0] = true;
19412if( j3array[1] > IKPI )
19413{
19414 j3array[1]-=IK2PI;
19415}
19416else if( j3array[1] < -IKPI )
19417{ j3array[1]+=IK2PI;
19418}
19419j3valid[1] = true;
19420for(int ij3 = 0; ij3 < 2; ++ij3)
19421{
19422if( !j3valid[ij3] )
19423{
19424 continue;
19425}
19426_ij3[0] = ij3; _ij3[1] = -1;
19427for(int iij3 = ij3+1; iij3 < 2; ++iij3)
19428{
19429if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
19430{
19431 j3valid[iij3]=false; _ij3[1] = iij3; break;
19432}
19433}
19434j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
19435{
19436IkReal evalcond[5];
19437IkReal x1495=IKsin(j3);
19438IkReal x1496=IKcos(j3);
19439IkReal x1497=((1.0)*x1496);
19440IkReal x1498=((1.0)*new_r22*x1495);
19441evalcond[0]=(((new_r01*x1496))+((new_r11*x1495)));
19442evalcond[1]=((((-1.0)*new_r10*x1497))+((new_r00*x1495)));
19443evalcond[2]=(((new_r01*x1495))+(((-1.0)*new_r11*x1497)));
19444evalcond[3]=((((-1.0)*new_r10*x1498))+(((-1.0)*new_r00*new_r22*x1497)));
19445evalcond[4]=((((-1.0)*new_r11*x1498))+(((-1.0)*new_r01*new_r22*x1497)));
19446if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH )
19447{
19448continue;
19449}
19450}
19451
19452{
19453std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
19454vinfos[0].jointtype = 1;
19455vinfos[0].foffset = j0;
19456vinfos[0].indices[0] = _ij0[0];
19457vinfos[0].indices[1] = _ij0[1];
19458vinfos[0].maxsolutions = _nj0;
19459vinfos[1].jointtype = 1;
19460vinfos[1].foffset = j1;
19461vinfos[1].indices[0] = _ij1[0];
19462vinfos[1].indices[1] = _ij1[1];
19463vinfos[1].maxsolutions = _nj1;
19464vinfos[2].jointtype = 1;
19465vinfos[2].foffset = j2;
19466vinfos[2].indices[0] = _ij2[0];
19467vinfos[2].indices[1] = _ij2[1];
19468vinfos[2].maxsolutions = _nj2;
19469vinfos[3].jointtype = 1;
19470vinfos[3].foffset = j3;
19471vinfos[3].indices[0] = _ij3[0];
19472vinfos[3].indices[1] = _ij3[1];
19473vinfos[3].maxsolutions = _nj3;
19474vinfos[4].jointtype = 1;
19475vinfos[4].foffset = j4;
19476vinfos[4].indices[0] = _ij4[0];
19477vinfos[4].indices[1] = _ij4[1];
19478vinfos[4].maxsolutions = _nj4;
19479vinfos[5].jointtype = 1;
19480vinfos[5].foffset = j5;
19481vinfos[5].indices[0] = _ij5[0];
19482vinfos[5].indices[1] = _ij5[1];
19483vinfos[5].maxsolutions = _nj5;
19484std::vector<int> vfree(0);
19485solutions.AddSolution(vinfos,vfree);
19486}
19487}
19488}
19489
19490}
19491
19492}
19493
19494} else
19495{
19496{
19497IkReal j3array[2], cj3array[2], sj3array[2];
19498bool j3valid[2]={false};
19499_nj3 = 2;
19501if(!x1500.valid){
19502continue;
19503}
19504IkReal x1499=x1500.value;
19505j3array[0]=((-1.0)*x1499);
19506sj3array[0]=IKsin(j3array[0]);
19507cj3array[0]=IKcos(j3array[0]);
19508j3array[1]=((3.14159265358979)+(((-1.0)*x1499)));
19509sj3array[1]=IKsin(j3array[1]);
19510cj3array[1]=IKcos(j3array[1]);
19511if( j3array[0] > IKPI )
19512{
19513 j3array[0]-=IK2PI;
19514}
19515else if( j3array[0] < -IKPI )
19516{ j3array[0]+=IK2PI;
19517}
19518j3valid[0] = true;
19519if( j3array[1] > IKPI )
19520{
19521 j3array[1]-=IK2PI;
19522}
19523else if( j3array[1] < -IKPI )
19524{ j3array[1]+=IK2PI;
19525}
19526j3valid[1] = true;
19527for(int ij3 = 0; ij3 < 2; ++ij3)
19528{
19529if( !j3valid[ij3] )
19530{
19531 continue;
19532}
19533_ij3[0] = ij3; _ij3[1] = -1;
19534for(int iij3 = ij3+1; iij3 < 2; ++iij3)
19535{
19536if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
19537{
19538 j3valid[iij3]=false; _ij3[1] = iij3; break;
19539}
19540}
19541j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
19542{
19543IkReal evalcond[5];
19544IkReal x1501=IKsin(j3);
19545IkReal x1502=IKcos(j3);
19546IkReal x1503=((1.0)*new_r22);
19547IkReal x1504=(new_r10*x1501);
19548IkReal x1505=((1.0)*x1502);
19549IkReal x1506=(new_r00*x1502);
19550evalcond[0]=(x1506+x1504);
19551evalcond[1]=((((-1.0)*new_r10*x1505))+((new_r00*x1501)));
19552evalcond[2]=((((-1.0)*new_r11*x1505))+((new_r01*x1501)));
19553evalcond[3]=((((-1.0)*x1503*x1506))+(((-1.0)*x1503*x1504)));
19554evalcond[4]=((((-1.0)*new_r11*x1501*x1503))+(((-1.0)*new_r01*x1502*x1503)));
19555if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH )
19556{
19557continue;
19558}
19559}
19560
19561{
19562std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
19563vinfos[0].jointtype = 1;
19564vinfos[0].foffset = j0;
19565vinfos[0].indices[0] = _ij0[0];
19566vinfos[0].indices[1] = _ij0[1];
19567vinfos[0].maxsolutions = _nj0;
19568vinfos[1].jointtype = 1;
19569vinfos[1].foffset = j1;
19570vinfos[1].indices[0] = _ij1[0];
19571vinfos[1].indices[1] = _ij1[1];
19572vinfos[1].maxsolutions = _nj1;
19573vinfos[2].jointtype = 1;
19574vinfos[2].foffset = j2;
19575vinfos[2].indices[0] = _ij2[0];
19576vinfos[2].indices[1] = _ij2[1];
19577vinfos[2].maxsolutions = _nj2;
19578vinfos[3].jointtype = 1;
19579vinfos[3].foffset = j3;
19580vinfos[3].indices[0] = _ij3[0];
19581vinfos[3].indices[1] = _ij3[1];
19582vinfos[3].maxsolutions = _nj3;
19583vinfos[4].jointtype = 1;
19584vinfos[4].foffset = j4;
19585vinfos[4].indices[0] = _ij4[0];
19586vinfos[4].indices[1] = _ij4[1];
19587vinfos[4].maxsolutions = _nj4;
19588vinfos[5].jointtype = 1;
19589vinfos[5].foffset = j5;
19590vinfos[5].indices[0] = _ij5[0];
19591vinfos[5].indices[1] = _ij5[1];
19592vinfos[5].maxsolutions = _nj5;
19593std::vector<int> vfree(0);
19594solutions.AddSolution(vinfos,vfree);
19595}
19596}
19597}
19598
19599}
19600
19601}
19602
19603}
19604} while(0);
19605if( bgotonextstatement )
19606{
19607bool bgotonextstatement = true;
19608do
19609{
19610if( 1 )
19611{
19612bgotonextstatement=false;
19613continue; // branch miss [j3]
19614
19615}
19616} while(0);
19617if( bgotonextstatement )
19618{
19619}
19620}
19621}
19622}
19623}
19624
19625} else
19626{
19627{
19628IkReal j3array[1], cj3array[1], sj3array[1];
19629bool j3valid[1]={false};
19630_nj3 = 1;
19632if(!x1508.valid){
19633continue;
19634}
19635IkReal x1507=x1508.value;
19637if(!x1509.valid){
19638continue;
19639}
19640if( IKabs((x1507*(x1509.value)*(((-1.0)+(new_r02*new_r02)+(cj4*cj4))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r02*x1507)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x1507*(x1509.value)*(((-1.0)+(new_r02*new_r02)+(cj4*cj4)))))+IKsqr(((-1.0)*new_r02*x1507))-1) <= IKFAST_SINCOS_THRESH )
19641 continue;
19642j3array[0]=IKatan2((x1507*(x1509.value)*(((-1.0)+(new_r02*new_r02)+(cj4*cj4)))), ((-1.0)*new_r02*x1507));
19643sj3array[0]=IKsin(j3array[0]);
19644cj3array[0]=IKcos(j3array[0]);
19645if( j3array[0] > IKPI )
19646{
19647 j3array[0]-=IK2PI;
19648}
19649else if( j3array[0] < -IKPI )
19650{ j3array[0]+=IK2PI;
19651}
19652j3valid[0] = true;
19653for(int ij3 = 0; ij3 < 1; ++ij3)
19654{
19655if( !j3valid[ij3] )
19656{
19657 continue;
19658}
19659_ij3[0] = ij3; _ij3[1] = -1;
19660for(int iij3 = ij3+1; iij3 < 1; ++iij3)
19661{
19662if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
19663{
19664 j3valid[iij3]=false; _ij3[1] = iij3; break;
19665}
19666}
19667j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
19668{
19669IkReal evalcond[18];
19670IkReal x1510=IKcos(j3);
19671IkReal x1511=IKsin(j3);
19672IkReal x1512=(cj4*cj5);
19673IkReal x1513=(cj4*sj5);
19674IkReal x1514=((1.0)*new_r20);
19675IkReal x1515=((1.0)*cj4);
19676IkReal x1516=((1.0)*sj4);
19677IkReal x1517=(sj4*x1511);
19678IkReal x1518=((1.0)*x1510);
19679IkReal x1519=(sj4*x1510);
19680IkReal x1520=(x1511*x1515);
19681evalcond[0]=(x1519+new_r02);
19682evalcond[1]=(x1517+new_r12);
19683evalcond[2]=((((-1.0)*new_r02*x1511))+((new_r12*x1510)));
19684evalcond[3]=(sj4+((new_r02*x1510))+((new_r12*x1511)));
19685evalcond[4]=(sj5+(((-1.0)*new_r10*x1518))+((new_r00*x1511)));
19686evalcond[5]=((((-1.0)*new_r11*x1518))+cj5+((new_r01*x1511)));
19687evalcond[6]=(((x1510*x1513))+((cj5*x1511))+new_r01);
19688evalcond[7]=(x1513+((new_r01*x1510))+((new_r11*x1511)));
19689evalcond[8]=(((sj5*x1511))+(((-1.0)*x1512*x1518))+new_r00);
19690evalcond[9]=((((-1.0)*cj5*x1518))+new_r11+((x1511*x1513)));
19691evalcond[10]=(((new_r10*x1511))+(((-1.0)*x1512))+((new_r00*x1510)));
19692evalcond[11]=((((-1.0)*x1511*x1512))+(((-1.0)*sj5*x1518))+new_r10);
19693evalcond[12]=(((new_r10*x1517))+(((-1.0)*cj4*x1514))+((new_r00*x1519)));
19694evalcond[13]=((((-1.0)*new_r21*x1515))+((new_r01*x1519))+((new_r11*x1517)));
19695evalcond[14]=((1.0)+(((-1.0)*new_r22*x1515))+((new_r02*x1519))+((new_r12*x1517)));
19696evalcond[15]=((((-1.0)*new_r22*x1516))+(((-1.0)*new_r12*x1520))+(((-1.0)*new_r02*x1510*x1515)));
19697evalcond[16]=(cj5+(((-1.0)*new_r00*x1510*x1515))+(((-1.0)*sj4*x1514))+(((-1.0)*new_r10*x1520)));
19698evalcond[17]=((((-1.0)*sj5))+(((-1.0)*new_r11*x1520))+(((-1.0)*new_r21*x1516))+(((-1.0)*new_r01*x1510*x1515)));
19699if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[12]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[13]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[14]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[15]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[16]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[17]) > IKFAST_EVALCOND_THRESH )
19700{
19701continue;
19702}
19703}
19704
19705{
19706std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
19707vinfos[0].jointtype = 1;
19708vinfos[0].foffset = j0;
19709vinfos[0].indices[0] = _ij0[0];
19710vinfos[0].indices[1] = _ij0[1];
19711vinfos[0].maxsolutions = _nj0;
19712vinfos[1].jointtype = 1;
19713vinfos[1].foffset = j1;
19714vinfos[1].indices[0] = _ij1[0];
19715vinfos[1].indices[1] = _ij1[1];
19716vinfos[1].maxsolutions = _nj1;
19717vinfos[2].jointtype = 1;
19718vinfos[2].foffset = j2;
19719vinfos[2].indices[0] = _ij2[0];
19720vinfos[2].indices[1] = _ij2[1];
19721vinfos[2].maxsolutions = _nj2;
19722vinfos[3].jointtype = 1;
19723vinfos[3].foffset = j3;
19724vinfos[3].indices[0] = _ij3[0];
19725vinfos[3].indices[1] = _ij3[1];
19726vinfos[3].maxsolutions = _nj3;
19727vinfos[4].jointtype = 1;
19728vinfos[4].foffset = j4;
19729vinfos[4].indices[0] = _ij4[0];
19730vinfos[4].indices[1] = _ij4[1];
19731vinfos[4].maxsolutions = _nj4;
19732vinfos[5].jointtype = 1;
19733vinfos[5].foffset = j5;
19734vinfos[5].indices[0] = _ij5[0];
19735vinfos[5].indices[1] = _ij5[1];
19736vinfos[5].maxsolutions = _nj5;
19737std::vector<int> vfree(0);
19738solutions.AddSolution(vinfos,vfree);
19739}
19740}
19741}
19742
19743}
19744
19745}
19746
19747} else
19748{
19749{
19750IkReal j3array[1], cj3array[1], sj3array[1];
19751bool j3valid[1]={false};
19752_nj3 = 1;
19754if(!x1521.valid){
19755continue;
19756}
19757CheckValue<IkReal> x1522 = IKatan2WithCheck(IkReal(((-1.0)*new_r12)),IkReal(((-1.0)*new_r02)),IKFAST_ATAN2_MAGTHRESH);
19758if(!x1522.valid){
19759continue;
19760}
19761j3array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1521.value)))+(x1522.value));
19762sj3array[0]=IKsin(j3array[0]);
19763cj3array[0]=IKcos(j3array[0]);
19764if( j3array[0] > IKPI )
19765{
19766 j3array[0]-=IK2PI;
19767}
19768else if( j3array[0] < -IKPI )
19769{ j3array[0]+=IK2PI;
19770}
19771j3valid[0] = true;
19772for(int ij3 = 0; ij3 < 1; ++ij3)
19773{
19774if( !j3valid[ij3] )
19775{
19776 continue;
19777}
19778_ij3[0] = ij3; _ij3[1] = -1;
19779for(int iij3 = ij3+1; iij3 < 1; ++iij3)
19780{
19781if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
19782{
19783 j3valid[iij3]=false; _ij3[1] = iij3; break;
19784}
19785}
19786j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
19787{
19788IkReal evalcond[18];
19789IkReal x1523=IKcos(j3);
19790IkReal x1524=IKsin(j3);
19791IkReal x1525=(cj4*cj5);
19792IkReal x1526=(cj4*sj5);
19793IkReal x1527=((1.0)*new_r20);
19794IkReal x1528=((1.0)*cj4);
19795IkReal x1529=((1.0)*sj4);
19796IkReal x1530=(sj4*x1524);
19797IkReal x1531=((1.0)*x1523);
19798IkReal x1532=(sj4*x1523);
19799IkReal x1533=(x1524*x1528);
19800evalcond[0]=(x1532+new_r02);
19801evalcond[1]=(x1530+new_r12);
19802evalcond[2]=(((new_r12*x1523))+(((-1.0)*new_r02*x1524)));
19803evalcond[3]=(((new_r12*x1524))+sj4+((new_r02*x1523)));
19804evalcond[4]=((((-1.0)*new_r10*x1531))+sj5+((new_r00*x1524)));
19805evalcond[5]=(cj5+((new_r01*x1524))+(((-1.0)*new_r11*x1531)));
19806evalcond[6]=(((x1523*x1526))+((cj5*x1524))+new_r01);
19807evalcond[7]=(((new_r01*x1523))+x1526+((new_r11*x1524)));
19808evalcond[8]=(((sj5*x1524))+(((-1.0)*x1525*x1531))+new_r00);
19809evalcond[9]=(((x1524*x1526))+(((-1.0)*cj5*x1531))+new_r11);
19810evalcond[10]=(((new_r00*x1523))+((new_r10*x1524))+(((-1.0)*x1525)));
19811evalcond[11]=((((-1.0)*x1524*x1525))+new_r10+(((-1.0)*sj5*x1531)));
19812evalcond[12]=((((-1.0)*cj4*x1527))+((new_r00*x1532))+((new_r10*x1530)));
19813evalcond[13]=((((-1.0)*new_r21*x1528))+((new_r01*x1532))+((new_r11*x1530)));
19814evalcond[14]=((1.0)+((new_r02*x1532))+(((-1.0)*new_r22*x1528))+((new_r12*x1530)));
19815evalcond[15]=((((-1.0)*new_r02*x1523*x1528))+(((-1.0)*new_r22*x1529))+(((-1.0)*new_r12*x1533)));
19816evalcond[16]=((((-1.0)*new_r10*x1533))+(((-1.0)*sj4*x1527))+cj5+(((-1.0)*new_r00*x1523*x1528)));
19817evalcond[17]=((((-1.0)*sj5))+(((-1.0)*new_r21*x1529))+(((-1.0)*new_r01*x1523*x1528))+(((-1.0)*new_r11*x1533)));
19818if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[3]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[4]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[5]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[6]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[7]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[8]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[9]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[10]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[11]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[12]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[13]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[14]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[15]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[16]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[17]) > IKFAST_EVALCOND_THRESH )
19819{
19820continue;
19821}
19822}
19823
19824{
19825std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6);
19826vinfos[0].jointtype = 1;
19827vinfos[0].foffset = j0;
19828vinfos[0].indices[0] = _ij0[0];
19829vinfos[0].indices[1] = _ij0[1];
19830vinfos[0].maxsolutions = _nj0;
19831vinfos[1].jointtype = 1;
19832vinfos[1].foffset = j1;
19833vinfos[1].indices[0] = _ij1[0];
19834vinfos[1].indices[1] = _ij1[1];
19835vinfos[1].maxsolutions = _nj1;
19836vinfos[2].jointtype = 1;
19837vinfos[2].foffset = j2;
19838vinfos[2].indices[0] = _ij2[0];
19839vinfos[2].indices[1] = _ij2[1];
19840vinfos[2].maxsolutions = _nj2;
19841vinfos[3].jointtype = 1;
19842vinfos[3].foffset = j3;
19843vinfos[3].indices[0] = _ij3[0];
19844vinfos[3].indices[1] = _ij3[1];
19845vinfos[3].maxsolutions = _nj3;
19846vinfos[4].jointtype = 1;
19847vinfos[4].foffset = j4;
19848vinfos[4].indices[0] = _ij4[0];
19849vinfos[4].indices[1] = _ij4[1];
19850vinfos[4].maxsolutions = _nj4;
19851vinfos[5].jointtype = 1;
19852vinfos[5].foffset = j5;
19853vinfos[5].indices[0] = _ij5[0];
19854vinfos[5].indices[1] = _ij5[1];
19855vinfos[5].maxsolutions = _nj5;
19856std::vector<int> vfree(0);
19857solutions.AddSolution(vinfos,vfree);
19858}
19859}
19860}
19861
19862}
19863
19864}
19865}
19866}
19867
19868}
19869
19870}
19871}
19872}
19873}
19874}static inline void polyroots3(IkReal rawcoeffs[3+1], IkReal rawroots[3], int& numroots)
19875{
19876 using std::complex;
19877 if( rawcoeffs[0] == 0 ) {
19878 // solve with one reduced degree
19879 polyroots2(&rawcoeffs[1], &rawroots[0], numroots);
19880 return;
19881 }
19882 IKFAST_ASSERT(rawcoeffs[0] != 0);
19883 const IkReal tol = 128.0*std::numeric_limits<IkReal>::epsilon();
19884 const IkReal tolsqrt = sqrt(std::numeric_limits<IkReal>::epsilon());
19885 complex<IkReal> coeffs[3];
19886 const int maxsteps = 110;
19887 for(int i = 0; i < 3; ++i) {
19888 coeffs[i] = complex<IkReal>(rawcoeffs[i+1]/rawcoeffs[0]);
19889 }
19890 complex<IkReal> roots[3];
19891 IkReal err[3];
19892 roots[0] = complex<IkReal>(1,0);
19893 roots[1] = complex<IkReal>(0.4,0.9); // any complex number not a root of unity works
19894 err[0] = 1.0;
19895 err[1] = 1.0;
19896 for(int i = 2; i < 3; ++i) {
19897 roots[i] = roots[i-1]*roots[1];
19898 err[i] = 1.0;
19899 }
19900 for(int step = 0; step < maxsteps; ++step) {
19901 bool changed = false;
19902 for(int i = 0; i < 3; ++i) {
19903 if ( err[i] >= tol ) {
19904 changed = true;
19905 // evaluate
19906 complex<IkReal> x = roots[i] + coeffs[0];
19907 for(int j = 1; j < 3; ++j) {
19908 x = roots[i] * x + coeffs[j];
19909 }
19910 for(int j = 0; j < 3; ++j) {
19911 if( i != j ) {
19912 if( roots[i] != roots[j] ) {
19913 x /= (roots[i] - roots[j]);
19914 }
19915 }
19916 }
19917 roots[i] -= x;
19918 err[i] = abs(x);
19919 }
19920 }
19921 if( !changed ) {
19922 break;
19923 }
19924 }
19925
19926 numroots = 0;
19927 bool visited[3] = {false};
19928 for(int i = 0; i < 3; ++i) {
19929 if( !visited[i] ) {
19930 // might be a multiple root, in which case it will have more error than the other roots
19931 // find any neighboring roots, and take the average
19932 complex<IkReal> newroot=roots[i];
19933 int n = 1;
19934 for(int j = i+1; j < 3; ++j) {
19935 // care about error in real much more than imaginary
19936 if( abs(real(roots[i])-real(roots[j])) < tolsqrt && abs(imag(roots[i])-imag(roots[j])) < 0.002 ) {
19937 newroot += roots[j];
19938 n += 1;
19939 visited[j] = true;
19940 }
19941 }
19942 if( n > 1 ) {
19943 newroot /= n;
19944 }
19945 // there are still cases where even the mean is not accurate enough, until a better multi-root algorithm is used, need to use the sqrt
19946 if( IKabs(imag(newroot)) < tolsqrt ) {
19947 rawroots[numroots++] = real(newroot);
19948 }
19949 }
19950 }
19951}
19952static inline void polyroots2(IkReal rawcoeffs[2+1], IkReal rawroots[2], int& numroots) {
19953 IkReal det = rawcoeffs[1]*rawcoeffs[1]-4*rawcoeffs[0]*rawcoeffs[2];
19954 if( det < 0 ) {
19955 numroots=0;
19956 }
19957 else if( det == 0 ) {
19958 rawroots[0] = -0.5*rawcoeffs[1]/rawcoeffs[0];
19959 numroots = 1;
19960 }
19961 else {
19962 det = IKsqrt(det);
19963 rawroots[0] = (-rawcoeffs[1]+det)/(2*rawcoeffs[0]);
19964 rawroots[1] = (-rawcoeffs[1]-det)/(2*rawcoeffs[0]);//rawcoeffs[2]/(rawcoeffs[0]*rawroots[0]);
19965 numroots = 2;
19966 }
19967}
19968static inline void polyroots4(IkReal rawcoeffs[4+1], IkReal rawroots[4], int& numroots)
19969{
19970 using std::complex;
19971 if( rawcoeffs[0] == 0 ) {
19972 // solve with one reduced degree
19973 polyroots3(&rawcoeffs[1], &rawroots[0], numroots);
19974 return;
19975 }
19976 IKFAST_ASSERT(rawcoeffs[0] != 0);
19977 const IkReal tol = 128.0*std::numeric_limits<IkReal>::epsilon();
19978 const IkReal tolsqrt = sqrt(std::numeric_limits<IkReal>::epsilon());
19979 complex<IkReal> coeffs[4];
19980 const int maxsteps = 110;
19981 for(int i = 0; i < 4; ++i) {
19982 coeffs[i] = complex<IkReal>(rawcoeffs[i+1]/rawcoeffs[0]);
19983 }
19984 complex<IkReal> roots[4];
19985 IkReal err[4];
19986 roots[0] = complex<IkReal>(1,0);
19987 roots[1] = complex<IkReal>(0.4,0.9); // any complex number not a root of unity works
19988 err[0] = 1.0;
19989 err[1] = 1.0;
19990 for(int i = 2; i < 4; ++i) {
19991 roots[i] = roots[i-1]*roots[1];
19992 err[i] = 1.0;
19993 }
19994 for(int step = 0; step < maxsteps; ++step) {
19995 bool changed = false;
19996 for(int i = 0; i < 4; ++i) {
19997 if ( err[i] >= tol ) {
19998 changed = true;
19999 // evaluate
20000 complex<IkReal> x = roots[i] + coeffs[0];
20001 for(int j = 1; j < 4; ++j) {
20002 x = roots[i] * x + coeffs[j];
20003 }
20004 for(int j = 0; j < 4; ++j) {
20005 if( i != j ) {
20006 if( roots[i] != roots[j] ) {
20007 x /= (roots[i] - roots[j]);
20008 }
20009 }
20010 }
20011 roots[i] -= x;
20012 err[i] = abs(x);
20013 }
20014 }
20015 if( !changed ) {
20016 break;
20017 }
20018 }
20019
20020 numroots = 0;
20021 bool visited[4] = {false};
20022 for(int i = 0; i < 4; ++i) {
20023 if( !visited[i] ) {
20024 // might be a multiple root, in which case it will have more error than the other roots
20025 // find any neighboring roots, and take the average
20026 complex<IkReal> newroot=roots[i];
20027 int n = 1;
20028 for(int j = i+1; j < 4; ++j) {
20029 // care about error in real much more than imaginary
20030 if( abs(real(roots[i])-real(roots[j])) < tolsqrt && abs(imag(roots[i])-imag(roots[j])) < 0.002 ) {
20031 newroot += roots[j];
20032 n += 1;
20033 visited[j] = true;
20034 }
20035 }
20036 if( n > 1 ) {
20037 newroot /= n;
20038 }
20039 // there are still cases where even the mean is not accurate enough, until a better multi-root algorithm is used, need to use the sqrt
20040 if( IKabs(imag(newroot)) < tolsqrt ) {
20041 rawroots[numroots++] = real(newroot);
20042 }
20043 }
20044 }
20045}
20046};
20047
20048
20051IKFAST_API bool ComputeIk(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions) {
20052IKSolver solver;
20053return solver.ComputeIk(eetrans,eerot,pfree,solutions);
20054}
20055
20056IKFAST_API bool ComputeIk2(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions, void* /* unused */) {
20057IKSolver solver;
20058return solver.ComputeIk(eetrans,eerot,pfree,solutions);
20059}
20060
20061IKFAST_API const char* GetKinematicsHash() { return "<robot:GenericRobot - prbt (11ad975bd60aa3f28e8d228465d0f213)>"; }
20062
20063IKFAST_API const char* GetIkFastVersion() { return "0x1000004a"; }
20064
20065#ifdef IKFAST_NAMESPACE
20066} // end namespace
20067#endif
20068
20069#ifndef IKFAST_NO_MAIN
20070#include <stdio.h>
20071#include <stdlib.h>
20072#ifdef IKFAST_NAMESPACE
20073using namespace IKFAST_NAMESPACE;
20074#endif
20075int main(int argc, char** argv)
20076{
20077 if( argc != 12+GetNumFreeParameters()+1 ) {
20078 printf("\nUsage: ./ik r00 r01 r02 t0 r10 r11 r12 t1 r20 r21 r22 t2 free0 ...\n\n"
20079 "Returns the ik solutions given the transformation of the end effector specified by\n"
20080 "a 3x3 rotation R (rXX), and a 3x1 translation (tX).\n"
20081 "There are %d free parameters that have to be specified.\n\n",GetNumFreeParameters());
20082 return 1;
20083 }
20084
20085 IkSolutionList<IkReal> solutions;
20086 std::vector<IkReal> vfree(GetNumFreeParameters());
20087 IkReal eerot[9],eetrans[3];
20088 eerot[0] = atof(argv[1]); eerot[1] = atof(argv[2]); eerot[2] = atof(argv[3]); eetrans[0] = atof(argv[4]);
20089 eerot[3] = atof(argv[5]); eerot[4] = atof(argv[6]); eerot[5] = atof(argv[7]); eetrans[1] = atof(argv[8]);
20090 eerot[6] = atof(argv[9]); eerot[7] = atof(argv[10]); eerot[8] = atof(argv[11]); eetrans[2] = atof(argv[12]);
20091 for(std::size_t i = 0; i < vfree.size(); ++i)
20092 vfree[i] = atof(argv[13+i]);
20093 bool bSuccess = ComputeIk(eetrans, eerot, vfree.size() > 0 ? &vfree[0] : nullptr, solutions);
20094
20095 if( !bSuccess ) {
20096 fprintf(stderr,"Failed to get ik solution\n");
20097 return -1;
20098 }
20099
20100 printf("Found %d ik solutions:\n", static_cast<int>(solutions.GetNumSolutions()));
20101 std::vector<IkReal> solvalues(GetNumJoints());
20102 for(std::size_t i = 0; i < solutions.GetNumSolutions(); ++i) {
20103 const IkSolutionBase<IkReal>& sol = solutions.GetSolution(i);
20104 printf("sol%d (free=%d): ", static_cast<int>(i), static_cast<int>(sol.GetFree().size()));
20105 std::vector<IkReal> vsolfree(sol.GetFree().size());
20106 sol.GetSolution(&solvalues[0],vsolfree.size()>0?&vsolfree[0]:nullptr);
20107 for( std::size_t j = 0; j < solvalues.size(); ++j)
20108 printf("%.15f, ", solvalues[j]);
20109 printf("\n");
20110 }
20111 return 0;
20112}
20113
20114#endif
void rotationfunction0(IkSolutionListBase< IkReal > &solutions)
static void polyroots2(IkReal rawcoeffs[2+1], IkReal rawroots[2], int &numroots)
static void polyroots3(IkReal rawcoeffs[3+1], IkReal rawroots[3], int &numroots)
static void polyroots4(IkReal rawcoeffs[4+1], IkReal rawroots[4], int &numroots)
bool ComputeIk(const IkReal *eetrans, const IkReal *eerot, const IkReal *, IkSolutionListBase< IkReal > &solutions)
The discrete solutions are returned in this structure.
Definition ikfast.h:70
virtual const std::vector< int > & GetFree() const =0
Gets the indices of the configuration space that have to be preset before a full solution can be retu...
virtual void GetSolution(T *solution, const T *freevalues) const =0
gets a concrete solution
manages all the solutions
Definition ikfast.h:100
virtual size_t GetNumSolutions() const =0
returns the number of solutions stored
virtual void Clear()=0
clears all current solutions, note that any memory addresses returned from GetSolution will be invali...
virtual size_t AddSolution(const std::vector< IkSingleDOFSolutionBase< T > > &vinfos, const std::vector< int > &vfree)=0
add one solution and return its index for later retrieval
Default implementation of IkSolutionListBase.
Definition ikfast.h:273
virtual const IkSolutionBase< T > & GetSolution(size_t index) const
returns the solution pointer
Definition ikfast.h:282
virtual size_t GetNumSolutions() const
returns the number of solutions stored
Definition ikfast.h:293
#define IKFAST_VERSION
Header file for all ikfast c++ files/shared objects.
Definition ikfast.h:42
#define IKPI
#define IKFAST_ATAN2_MAGTHRESH
#define IKPI_2
#define IKFAST_SINCOS_THRESH
#define IKFAST_ASSERT(b)
IKFAST_API bool ComputeIk2(const IkReal *eetrans, const IkReal *eerot, const IkReal *pfree, IkSolutionListBase< IkReal > &solutions, void *)
CheckValue< T > IKatan2WithCheck(T fy, T fx, T)
float IKasin(float f)
IKFAST_API int * GetFreeParameters()
float IKatan2Simple(float fy, float fx)
int main(int argc, char **argv)
IKFAST_API int GetNumJoints()
IKFAST_API const char * GetIkFastVersion()
float IKatan2(float fy, float fx)
IKFAST_API int GetIkRealSize()
float IKacos(float f)
IKFAST_API const char * GetKinematicsHash()
float IKsqrt(float f)
float IKsin(float f)
float IKsign(float f)
float IKfmod(float x, float y)
float IKcos(float f)
float IKsqr(float f)
IKFAST_API int GetIkType()
IKFAST_API void ComputeFk(const IkReal *j, IkReal *eetrans, IkReal *eerot)
float IKtan(float f)
IKFAST_API bool ComputeIk(const IkReal *eetrans, const IkReal *eerot, const IkReal *pfree, IkSolutionListBase< IkReal > &solutions)
CheckValue< T > IKPowWithIntegerCheck(T f, int n)
float IKlog(float f)
IKFAST_API int GetNumFreeParameters()
float IKabs(float f)