duaro_lower_arm_ikfast_solver.cpp
Go to the documentation of this file.
1 #define IKFAST_HAS_LIBRARY
22 #include "ikfast.h" // found inside share/openrave-X.Y/python/ikfast.h
23 using namespace ikfast;
24 
25 // check if the included ikfast version matches what this file was compiled with
26 #define IKFAST_COMPILE_ASSERT(x) extern int __dummy[(int)x]
28 
29 #include <cmath>
30 #include <vector>
31 #include <limits>
32 #include <algorithm>
33 #include <complex>
34 
35 #ifndef IKFAST_ASSERT
36 #include <stdexcept>
37 #include <sstream>
38 #include <iostream>
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 
76 // lapack routines
77 extern "C" {
78  void dgetrf_ (const int* m, const int* n, double* a, const int* lda, int* ipiv, int* info);
79  void zgetrf_ (const int* m, const int* n, std::complex<double>* a, const int* lda, int* ipiv, int* info);
80  void dgetri_(const int* n, const double* a, const int* lda, int* ipiv, double* work, const int* lwork, int* info);
81  void dgesv_ (const int* n, const int* nrhs, double* a, const int* lda, int* ipiv, double* b, const int* ldb, int* info);
82  void dgetrs_(const char *trans, const int *n, const int *nrhs, double *a, const int *lda, int *ipiv, double *b, const int *ldb, int *info);
83  void dgeev_(const char *jobvl, const char *jobvr, const int *n, double *a, const int *lda, double *wr, double *wi,double *vl, const int *ldvl, double *vr, const int *ldvr, double *work, const int *lwork, int *info);
84 }
85 
86 using namespace std; // necessary to get std math routines
87 
88 #ifdef IKFAST_NAMESPACE
89 namespace IKFAST_NAMESPACE {
90 #endif
91 
92 inline float IKabs(float f) { return fabsf(f); }
93 inline double IKabs(double f) { return fabs(f); }
94 
95 inline float IKsqr(float f) { return f*f; }
96 inline double IKsqr(double f) { return f*f; }
97 
98 inline float IKlog(float f) { return logf(f); }
99 inline double IKlog(double f) { return log(f); }
100 
101 // allows asin and acos to exceed 1. has to be smaller than thresholds used for branch conds and evaluation
102 #ifndef IKFAST_SINCOS_THRESH
103 #define IKFAST_SINCOS_THRESH ((IkReal)1e-7)
104 #endif
105 
106 // used to check input to atan2 for degenerate cases. has to be smaller than thresholds used for branch conds and evaluation
107 #ifndef IKFAST_ATAN2_MAGTHRESH
108 #define IKFAST_ATAN2_MAGTHRESH ((IkReal)1e-7)
109 #endif
110 
111 // minimum distance of separate solutions
112 #ifndef IKFAST_SOLUTION_THRESH
113 #define IKFAST_SOLUTION_THRESH ((IkReal)1e-6)
114 #endif
115 
116 // there are checkpoints in ikfast that are evaluated to make sure they are 0. This threshold speicfies by how much they can deviate
117 #ifndef IKFAST_EVALCOND_THRESH
118 #define IKFAST_EVALCOND_THRESH ((IkReal)0.00001)
119 #endif
120 
121 
122 inline float IKasin(float f)
123 {
124 IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
125 if( f <= -1 ) return float(-IKPI_2);
126 else if( f >= 1 ) return float(IKPI_2);
127 return asinf(f);
128 }
129 inline double IKasin(double f)
130 {
131 IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
132 if( f <= -1 ) return -IKPI_2;
133 else if( f >= 1 ) return IKPI_2;
134 return asin(f);
135 }
136 
137 // return positive value in [0,y)
138 inline float IKfmod(float x, float y)
139 {
140  while(x < 0) {
141  x += y;
142  }
143  return fmodf(x,y);
144 }
145 
146 // return positive value in [0,y)
147 inline double IKfmod(double x, double y)
148 {
149  while(x < 0) {
150  x += y;
151  }
152  return fmod(x,y);
153 }
154 
155 inline float IKacos(float f)
156 {
157 IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
158 if( f <= -1 ) return float(IKPI);
159 else if( f >= 1 ) return float(0);
160 return acosf(f);
161 }
162 inline double IKacos(double f)
163 {
164 IKFAST_ASSERT( f > -1-IKFAST_SINCOS_THRESH && f < 1+IKFAST_SINCOS_THRESH ); // any more error implies something is wrong with the solver
165 if( f <= -1 ) return IKPI;
166 else if( f >= 1 ) return 0;
167 return acos(f);
168 }
169 inline float IKsin(float f) { return sinf(f); }
170 inline double IKsin(double f) { return sin(f); }
171 inline float IKcos(float f) { return cosf(f); }
172 inline double IKcos(double f) { return cos(f); }
173 inline float IKtan(float f) { return tanf(f); }
174 inline double IKtan(double f) { return tan(f); }
175 inline float IKsqrt(float f) { if( f <= 0.0f ) return 0.0f; return sqrtf(f); }
176 inline double IKsqrt(double f) { if( f <= 0.0 ) return 0.0; return sqrt(f); }
177 inline float IKatan2Simple(float fy, float fx) {
178  return atan2f(fy,fx);
179 }
180 inline float IKatan2(float fy, float fx) {
181  if( isnan(fy) ) {
182  IKFAST_ASSERT(!isnan(fx)); // if both are nan, probably wrong value will be returned
183  return float(IKPI_2);
184  }
185  else if( isnan(fx) ) {
186  return 0;
187  }
188  return atan2f(fy,fx);
189 }
190 inline double IKatan2Simple(double fy, double fx) {
191  return atan2(fy,fx);
192 }
193 inline double IKatan2(double fy, double fx) {
194  if( isnan(fy) ) {
195  IKFAST_ASSERT(!isnan(fx)); // if both are nan, probably wrong value will be returned
196  return IKPI_2;
197  }
198  else if( isnan(fx) ) {
199  return 0;
200  }
201  return atan2(fy,fx);
202 }
203 
204 template <typename T>
206 {
207  T value;
208  bool valid;
209 };
210 
211 template <typename T>
212 inline CheckValue<T> IKatan2WithCheck(T fy, T fx, T epsilon)
213 {
214  CheckValue<T> ret;
215  ret.valid = false;
216  ret.value = 0;
217  if( !isnan(fy) && !isnan(fx) ) {
219  ret.value = IKatan2Simple(fy,fx);
220  ret.valid = true;
221  }
222  }
223  return ret;
224 }
225 
226 inline float IKsign(float f) {
227  if( f > 0 ) {
228  return float(1);
229  }
230  else if( f < 0 ) {
231  return float(-1);
232  }
233  return 0;
234 }
235 
236 inline double IKsign(double f) {
237  if( f > 0 ) {
238  return 1.0;
239  }
240  else if( f < 0 ) {
241  return -1.0;
242  }
243  return 0;
244 }
245 
246 template <typename T>
248 {
249  CheckValue<T> ret;
250  ret.valid = true;
251  if( n == 0 ) {
252  ret.value = 1.0;
253  return ret;
254  }
255  else if( n == 1 )
256  {
257  ret.value = f;
258  return ret;
259  }
260  else if( n < 0 )
261  {
262  if( f == 0 )
263  {
264  ret.valid = false;
265  ret.value = (T)1.0e30;
266  return ret;
267  }
268  if( n == -1 ) {
269  ret.value = T(1.0)/f;
270  return ret;
271  }
272  }
273 
274  int num = n > 0 ? n : -n;
275  if( num == 2 ) {
276  ret.value = f*f;
277  }
278  else if( num == 3 ) {
279  ret.value = f*f*f;
280  }
281  else {
282  ret.value = 1.0;
283  while(num>0) {
284  if( num & 1 ) {
285  ret.value *= f;
286  }
287  num >>= 1;
288  f *= f;
289  }
290  }
291 
292  if( n < 0 ) {
293  ret.value = T(1.0)/ret.value;
294  }
295  return ret;
296 }
297 
300 IKFAST_API void ComputeFk(const IkReal* j, IkReal* eetrans, IkReal* eerot) {
301 for(int dummyiter = 0; dummyiter < 1; ++dummyiter) {
302 IkReal x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11;
303 x0=IKsin(j[0]);
304 x1=IKcos(j[0]);
305 x2=IKcos(j[1]);
306 x3=IKsin(j[1]);
307 x4=IKcos(j[3]);
308 x5=IKsin(j[3]);
309 x6=((0.4)*x0);
310 x7=((0.4)*x1);
311 x8=((1.0)*x2);
312 x9=((1.0)*x3);
313 x10=(x0*x9);
314 x11=(((x0*x8))+((x1*x9)));
315 eetrans[0]=((((-0.36)*x0))+(((-1.0)*x2*x6))+(((-1.0)*x3*x7)));
316 eetrans[1]=(((x2*x7))+(((-1.0)*x3*x6))+(((0.36)*x1)));
317 eetrans[2]=((0.1405)+j[2]);
318 IkReal x12=((1.0)*x10);
319 CheckValue<IkReal> x13 = IKatan2WithCheck(IkReal((((x5*(((((-1.0)*x12))+((x1*x8))))))+((x11*x4)))),IkReal(((((-1.0)*x11*x5))+((x4*(((((-1.0)*x12))+((x1*x2)))))))),IKFAST_ATAN2_MAGTHRESH);
320 if(!x13.valid){
321 continue;
322 }
323 eerot[0]=x13.value;
324 return;
325 }
326 IKFAST_ASSERT(0);
327 }
328 
329 IKFAST_API int GetNumFreeParameters() { return 0; }
330 IKFAST_API int* GetFreeParameters() { return NULL; }
331 IKFAST_API int GetNumJoints() { return 4; }
332 
333 IKFAST_API int GetIkRealSize() { return sizeof(IkReal); }
334 
335 IKFAST_API int GetIkType() { return 0x4400000e; }
336 
337 class IKSolver {
338 public:
339 IkReal j0,cj0,sj0,htj0,j0mul,j1,cj1,sj1,htj1,j1mul,j2,cj2,sj2,htj2,j2mul,j3,cj3,sj3,htj3,j3mul,new_r00,r00,rxp0_0,new_r01,r01,rxp0_1,new_r02,r02,rxp0_2,new_px,px,npx,new_py,py,npy,new_pz,pz,npz,pp;
340 unsigned char _ij0[2], _nj0,_ij1[2], _nj1,_ij2[2], _nj2,_ij3[2], _nj3;
341 
342 IkReal j100, cj100, sj100;
343 unsigned char _ij100[2], _nj100;
344 bool ComputeIk(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions) {
345 j0=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;
346 for(int dummyiter = 0; dummyiter < 1; ++dummyiter) {
347  solutions.Clear();
348 px = eetrans[0]; py = eetrans[1]; pz = eetrans[2];
349 
350 r00 = eerot[0];
351 px = eetrans[0]; py = eetrans[1]; pz = eetrans[2];
352 new_px=px;
353 new_py=py;
354 new_pz=pz;
355 new_r00=r00;
356 r00 = new_r00; px = new_px; py = new_py; pz = new_pz;
357 
358 pp=((px*px)+(py*py)+(pz*pz));
359 {
360 IkReal verifyeval[1];
361 verifyeval[0]=0;
362 if( IKabs(verifyeval[0]) < 0.0000010000000000 )
363 {
364 {
365 IkReal j2array[1], cj2array[1], sj2array[1];
366 bool j2valid[1]={false};
367 _nj2 = 1;
368 j2array[0]=((-0.1405)+pz);
369 sj2array[0]=IKsin(j2array[0]);
370 cj2array[0]=IKcos(j2array[0]);
371 j2valid[0] = true;
372 for(int ij2 = 0; ij2 < 1; ++ij2)
373 {
374 if( !j2valid[ij2] )
375 {
376  continue;
377 }
378 _ij2[0] = ij2; _ij2[1] = -1;
379 for(int iij2 = ij2+1; iij2 < 1; ++iij2)
380 {
381 if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH )
382 {
383  j2valid[iij2]=false; _ij2[1] = iij2; break;
384 }
385 }
386 j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2];
387 
388 {
389 IkReal j0eval[2];
390 j0eval[0]=((IKabs(px))+(IKabs(py)));
391 j0eval[1]=((px*px)+(py*py));
392 if( IKabs(j0eval[0]) < 0.0000010000000000 || IKabs(j0eval[1]) < 0.0000010000000000 )
393 {
394 continue; // no branches [j0, j1]
395 
396 } else
397 {
398 {
399 IkReal j0array[2], cj0array[2], sj0array[2];
400 bool j0valid[2]={false};
401 _nj0 = 2;
402 IkReal x14=px*px;
403 IkReal x15=py*py;
404 CheckValue<IkReal> x18 = IKatan2WithCheck(IkReal(((0.72)*py)),IkReal(((-0.72)*px)),IKFAST_ATAN2_MAGTHRESH);
405 if(!x18.valid){
406 continue;
407 }
408 IkReal x16=((1.0)*(x18.value));
409 if((((((0.5184)*x14))+(((0.5184)*x15)))) < -0.00001)
410 continue;
411 CheckValue<IkReal> x19=IKPowWithIntegerCheck(IKabs(IKsqrt(((((0.5184)*x14))+(((0.5184)*x15))))),-1);
412 if(!x19.valid){
413 continue;
414 }
415 if( (((x19.value)*(((0.01065975)+(((-1.0)*x15))+(((-1.0)*x14))+(((-1.0)*(pz*pz)))+(((0.281)*pz))+(j2*j2))))) < -1-IKFAST_SINCOS_THRESH || (((x19.value)*(((0.01065975)+(((-1.0)*x15))+(((-1.0)*x14))+(((-1.0)*(pz*pz)))+(((0.281)*pz))+(j2*j2))))) > 1+IKFAST_SINCOS_THRESH )
416  continue;
417 IkReal x17=IKasin(((x19.value)*(((0.01065975)+(((-1.0)*x15))+(((-1.0)*x14))+(((-1.0)*(pz*pz)))+(((0.281)*pz))+(j2*j2)))));
418 j0array[0]=((((-1.0)*x16))+(((-1.0)*x17)));
419 sj0array[0]=IKsin(j0array[0]);
420 cj0array[0]=IKcos(j0array[0]);
421 j0array[1]=((3.14159265358979)+(((-1.0)*x16))+x17);
422 sj0array[1]=IKsin(j0array[1]);
423 cj0array[1]=IKcos(j0array[1]);
424 if( j0array[0] > IKPI )
425 {
426  j0array[0]-=IK2PI;
427 }
428 else if( j0array[0] < -IKPI )
429 { j0array[0]+=IK2PI;
430 }
431 j0valid[0] = true;
432 if( j0array[1] > IKPI )
433 {
434  j0array[1]-=IK2PI;
435 }
436 else if( j0array[1] < -IKPI )
437 { j0array[1]+=IK2PI;
438 }
439 j0valid[1] = true;
440 for(int ij0 = 0; ij0 < 2; ++ij0)
441 {
442 if( !j0valid[ij0] )
443 {
444  continue;
445 }
446 _ij0[0] = ij0; _ij0[1] = -1;
447 for(int iij0 = ij0+1; iij0 < 2; ++iij0)
448 {
449 if( j0valid[iij0] && IKabs(cj0array[ij0]-cj0array[iij0]) < IKFAST_SOLUTION_THRESH && IKabs(sj0array[ij0]-sj0array[iij0]) < IKFAST_SOLUTION_THRESH )
450 {
451  j0valid[iij0]=false; _ij0[1] = iij0; break;
452 }
453 }
454 j0 = j0array[ij0]; cj0 = cj0array[ij0]; sj0 = sj0array[ij0];
455 {
456 IkReal evalcond[1];
457 evalcond[0]=((0.05014025)+(((-1.0)*(px*px)))+(((-0.72)*px*(IKsin(j0))))+(((-1.0)*(pz*pz)))+(((2.0)*j2*pz))+(((0.72)*py*(IKcos(j0))))+(((-1.0)*(py*py)))+(((-1.0)*(j2*j2))));
458 if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH )
459 {
460 continue;
461 }
462 }
463 
464 {
465 IkReal j1eval[3];
466 IkReal x20=px*px;
467 IkReal x21=py*py;
468 IkReal x22=(cj0*py);
469 IkReal x23=(px*sj0);
470 j1eval[0]=((1.0)+(((7.71604938271605)*x21))+(((7.71604938271605)*x20))+(((5.55555555555556)*x23))+(((-5.55555555555556)*x22)));
471 j1eval[1]=IKsign(((0.648)+(((5.0)*x21))+(((5.0)*x20))+(((3.6)*x23))+(((-3.6)*x22))));
472 j1eval[2]=((IKabs(((-0.72)+(((-2.0)*x23))+(((2.0)*x22)))))+(IKabs(((((-2.0)*py*sj0))+(((-2.0)*cj0*px))))));
473 if( IKabs(j1eval[0]) < 0.0000010000000000 || IKabs(j1eval[1]) < 0.0000010000000000 || IKabs(j1eval[2]) < 0.0000010000000000 )
474 {
475 {
476 IkReal evalcond[1];
477 bool bgotonextstatement = true;
478 do
479 {
480 IkReal x24=py*py;
481 IkReal x25=px*px;
482 IkReal x26=((((30.8641975308642)*x24))+(((30.8641975308642)*x25)));
483 IkReal x27=((1.0)+(((7.71604938271605)*x24))+(((7.71604938271605)*x25)));
484 if((x26) < -0.00001)
485 continue;
486 IkReal x28=IKabs(IKsqrt(x26));
487 IkReal x35 = x26;
488 if(IKabs(x35)==0){
489 continue;
490 }
491 IkReal x29=pow(x35,-0.5);
493 if(!x36.valid){
494 continue;
495 }
496 IkReal x30=x36.value;
497 IkReal x31=((5.55555555555556)*px*x29);
498 IkReal x32=((5.55555555555556)*py*x29);
499 IkReal x33=(x27*x30);
500 if((((1.0)+(((-1.0)*(x33*x33))))) < -0.00001)
501 continue;
502 IkReal x34=IKsqrt(((1.0)+(((-1.0)*(x33*x33)))));
503 if( (x33) < -1-IKFAST_SINCOS_THRESH || (x33) > 1+IKFAST_SINCOS_THRESH )
504  continue;
505 CheckValue<IkReal> x37 = IKatan2WithCheck(IkReal(((-5.55555555555556)*py)),IkReal(((5.55555555555556)*px)),IKFAST_ATAN2_MAGTHRESH);
506 if(!x37.valid){
507 continue;
508 }
509 IkReal gconst0=((((-1.0)*(IKasin(x33))))+(((-1.0)*(x37.value))));
510 IkReal gconst1=((((-1.0)*x31*x33))+((x32*x34)));
511 IkReal gconst2=(((x32*x33))+((x31*x34)));
512 IkReal x38=py*py;
513 IkReal x39=px*px;
514 if((((((30.8641975308642)*x39))+(((30.8641975308642)*x38)))) < -0.00001)
515 continue;
516 CheckValue<IkReal> x42=IKPowWithIntegerCheck(IKabs(IKsqrt(((((30.8641975308642)*x39))+(((30.8641975308642)*x38))))),-1);
517 if(!x42.valid){
518 continue;
519 }
520 IkReal x40=x42.value;
521 IkReal x41=((7.71604938271605)*x40);
522 if( ((((x38*x41))+((x39*x41))+x40)) < -1-IKFAST_SINCOS_THRESH || ((((x38*x41))+((x39*x41))+x40)) > 1+IKFAST_SINCOS_THRESH )
523  continue;
524 CheckValue<IkReal> x43 = IKatan2WithCheck(IkReal(((-5.55555555555556)*py)),IkReal(((5.55555555555556)*px)),IKFAST_ATAN2_MAGTHRESH);
525 if(!x43.valid){
526 continue;
527 }
528 evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((IKasin((((x38*x41))+((x39*x41))+x40)))+(x43.value)+j0)))), 6.28318530717959)));
529 if( IKabs(evalcond[0]) < 0.0000050000000000 )
530 {
531 bgotonextstatement=false;
532 {
533 IkReal j1array[2], cj1array[2], sj1array[2];
534 bool j1valid[2]={false};
535 _nj1 = 2;
536 IkReal x44=((1.0)*gconst2);
537 CheckValue<IkReal> x46 = IKatan2WithCheck(IkReal(((((-1.0)*gconst1*py))+(((-1.0)*px*x44)))),IkReal(((0.36)+((gconst1*px))+(((-1.0)*py*x44)))),IKFAST_ATAN2_MAGTHRESH);
538 if(!x46.valid){
539 continue;
540 }
541 IkReal x45=x46.value;
542 j1array[0]=((-1.0)*x45);
543 sj1array[0]=IKsin(j1array[0]);
544 cj1array[0]=IKcos(j1array[0]);
545 j1array[1]=((3.14159265358979)+(((-1.0)*x45)));
546 sj1array[1]=IKsin(j1array[1]);
547 cj1array[1]=IKcos(j1array[1]);
548 if( j1array[0] > IKPI )
549 {
550  j1array[0]-=IK2PI;
551 }
552 else if( j1array[0] < -IKPI )
553 { j1array[0]+=IK2PI;
554 }
555 j1valid[0] = true;
556 if( j1array[1] > IKPI )
557 {
558  j1array[1]-=IK2PI;
559 }
560 else if( j1array[1] < -IKPI )
561 { j1array[1]+=IK2PI;
562 }
563 j1valid[1] = true;
564 for(int ij1 = 0; ij1 < 2; ++ij1)
565 {
566 if( !j1valid[ij1] )
567 {
568  continue;
569 }
570 _ij1[0] = ij1; _ij1[1] = -1;
571 for(int iij1 = ij1+1; iij1 < 2; ++iij1)
572 {
573 if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH )
574 {
575  j1valid[iij1]=false; _ij1[1] = iij1; break;
576 }
577 }
578 j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1];
579 {
580 IkReal evalcond[1];
581 IkReal x47=IKsin(j1);
582 IkReal x48=IKcos(j1);
583 evalcond[0]=((0.4)+(((-1.0)*gconst2*py*x48))+((gconst1*px*x48))+((gconst2*px*x47))+((gconst1*py*x47))+(((0.36)*x48)));
584 if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH )
585 {
586 continue;
587 }
588 }
589 
590 {
591 IkReal j3array[1], cj3array[1], sj3array[1];
592 bool j3valid[1]={false};
593 _nj3 = 1;
594 j3array[0]=(r00+(((-1.0)*j0))+(((-1.0)*j1)));
595 sj3array[0]=IKsin(j3array[0]);
596 cj3array[0]=IKcos(j3array[0]);
597 if( j3array[0] > IKPI )
598 {
599  j3array[0]-=IK2PI;
600 }
601 else if( j3array[0] < -IKPI )
602 { j3array[0]+=IK2PI;
603 }
604 j3valid[0] = true;
605 for(int ij3 = 0; ij3 < 1; ++ij3)
606 {
607 if( !j3valid[ij3] )
608 {
609  continue;
610 }
611 _ij3[0] = ij3; _ij3[1] = -1;
612 for(int iij3 = ij3+1; iij3 < 1; ++iij3)
613 {
614 if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
615 {
616  j3valid[iij3]=false; _ij3[1] = iij3; break;
617 }
618 }
619 j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
620 
621 {
622 std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(4);
623 vinfos[0].jointtype = 1;
624 vinfos[0].foffset = j0;
625 vinfos[0].indices[0] = _ij0[0];
626 vinfos[0].indices[1] = _ij0[1];
627 vinfos[0].maxsolutions = _nj0;
628 vinfos[1].jointtype = 1;
629 vinfos[1].foffset = j1;
630 vinfos[1].indices[0] = _ij1[0];
631 vinfos[1].indices[1] = _ij1[1];
632 vinfos[1].maxsolutions = _nj1;
633 vinfos[2].jointtype = 17;
634 vinfos[2].foffset = j2;
635 vinfos[2].indices[0] = _ij2[0];
636 vinfos[2].indices[1] = _ij2[1];
637 vinfos[2].maxsolutions = _nj2;
638 vinfos[3].jointtype = 1;
639 vinfos[3].foffset = j3;
640 vinfos[3].indices[0] = _ij3[0];
641 vinfos[3].indices[1] = _ij3[1];
642 vinfos[3].maxsolutions = _nj3;
643 std::vector<int> vfree(0);
644 solutions.AddSolution(vinfos,vfree);
645 }
646 }
647 }
648 }
649 }
650 
651 }
652 } while(0);
653 if( bgotonextstatement )
654 {
655 bool bgotonextstatement = true;
656 do
657 {
658 IkReal x49=py*py;
659 IkReal x50=px*px;
660 IkReal x51=((5.55555555555556)*px);
661 IkReal x52=((((30.8641975308642)*x50))+(((30.8641975308642)*x49)));
662 IkReal x53=((1.0)+(((7.71604938271605)*x49))+(((7.71604938271605)*x50)));
663 IkReal x60 = x52;
664 if(IKabs(x60)==0){
665 continue;
666 }
667 IkReal x54=pow(x60,-0.5);
668 if((x52) < -0.00001)
669 continue;
670 IkReal x55=IKabs(IKsqrt(x52));
672 if(!x61.valid){
673 continue;
674 }
675 IkReal x56=x61.value;
676 IkReal x57=(x53*x56);
677 if((((1.0)+(((-1.0)*(x57*x57))))) < -0.00001)
678 continue;
679 IkReal x58=IKsqrt(((1.0)+(((-1.0)*(x57*x57)))));
680 IkReal x59=((5.55555555555556)*x54*x58);
681 if( (x57) < -1-IKFAST_SINCOS_THRESH || (x57) > 1+IKFAST_SINCOS_THRESH )
682  continue;
683 CheckValue<IkReal> x62 = IKatan2WithCheck(IkReal(((-5.55555555555556)*py)),IkReal(x51),IKFAST_ATAN2_MAGTHRESH);
684 if(!x62.valid){
685 continue;
686 }
687 IkReal gconst3=((3.14159265358979)+(IKasin(x57))+(((-1.0)*(x62.value))));
688 IkReal gconst4=((((-1.0)*x51*x54*x57))+(((-1.0)*py*x59)));
689 IkReal gconst5=((((5.55555555555556)*py*x54*x57))+(((-1.0)*x51*x54*x58)));
690 IkReal x63=py*py;
691 IkReal x64=px*px;
692 if((((((30.8641975308642)*x63))+(((30.8641975308642)*x64)))) < -0.00001)
693 continue;
694 CheckValue<IkReal> x65=IKPowWithIntegerCheck(IKabs(IKsqrt(((((30.8641975308642)*x63))+(((30.8641975308642)*x64))))),-1);
695 if(!x65.valid){
696 continue;
697 }
698 if( (((x65.value)*(((1.0)+(((7.71604938271605)*x64))+(((7.71604938271605)*x63)))))) < -1-IKFAST_SINCOS_THRESH || (((x65.value)*(((1.0)+(((7.71604938271605)*x64))+(((7.71604938271605)*x63)))))) > 1+IKFAST_SINCOS_THRESH )
699  continue;
700 CheckValue<IkReal> x66 = IKatan2WithCheck(IkReal(((-5.55555555555556)*py)),IkReal(((5.55555555555556)*px)),IKFAST_ATAN2_MAGTHRESH);
701 if(!x66.valid){
702 continue;
703 }
704 evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+(((-1.0)*(IKasin(((x65.value)*(((1.0)+(((7.71604938271605)*x64))+(((7.71604938271605)*x63)))))))))+(x66.value)+j0)))), 6.28318530717959)));
705 if( IKabs(evalcond[0]) < 0.0000050000000000 )
706 {
707 bgotonextstatement=false;
708 {
709 IkReal j1array[1], cj1array[1], sj1array[1];
710 bool j1valid[1]={false};
711 _nj1 = 1;
712 IkReal x67=px*px;
713 IkReal x68=gconst4*gconst4;
714 IkReal x69=gconst5*gconst5;
715 IkReal x70=py*py;
716 IkReal x71=((2.0)*gconst4);
717 IkReal x72=((2.0)*gconst5);
718 IkReal x73=((5.0)*x70);
719 IkReal x74=((5.0)*x67);
720 CheckValue<IkReal> x75 = IKatan2WithCheck(IkReal(((((-1.0)*px*x72))+(((-1.0)*py*x71)))),IkReal(((-0.72)+((py*x72))+(((-1.0)*px*x71)))),IKFAST_ATAN2_MAGTHRESH);
721 if(!x75.valid){
722 continue;
723 }
724 CheckValue<IkReal> x76=IKPowWithIntegerCheck(IKsign(((0.648)+((x69*x74))+((x69*x73))+((x68*x73))+((x68*x74))+(((-3.6)*gconst5*py))+(((3.6)*gconst4*px)))),-1);
725 if(!x76.valid){
726 continue;
727 }
728 j1array[0]=((-1.5707963267949)+(x75.value)+(((1.5707963267949)*(x76.value))));
729 sj1array[0]=IKsin(j1array[0]);
730 cj1array[0]=IKcos(j1array[0]);
731 if( j1array[0] > IKPI )
732 {
733  j1array[0]-=IK2PI;
734 }
735 else if( j1array[0] < -IKPI )
736 { j1array[0]+=IK2PI;
737 }
738 j1valid[0] = true;
739 for(int ij1 = 0; ij1 < 1; ++ij1)
740 {
741 if( !j1valid[ij1] )
742 {
743  continue;
744 }
745 _ij1[0] = ij1; _ij1[1] = -1;
746 for(int iij1 = ij1+1; iij1 < 1; ++iij1)
747 {
748 if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH )
749 {
750  j1valid[iij1]=false; _ij1[1] = iij1; break;
751 }
752 }
753 j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1];
754 {
755 IkReal evalcond[2];
756 IkReal x77=IKsin(j1);
757 IkReal x78=IKcos(j1);
758 IkReal x79=((1.0)*gconst5);
759 IkReal x80=(gconst4*x77);
760 IkReal x81=(px*x78);
761 IkReal x82=(py*x78);
762 evalcond[0]=((0.4)+(((0.36)*x78))+(((-1.0)*x79*x82))+((py*x80))+((gconst4*x81))+((gconst5*px*x77)));
763 evalcond[1]=((((0.36)*x77))+(((-1.0)*x79*x81))+((px*x80))+(((-1.0)*gconst4*x82))+(((-1.0)*py*x77*x79)));
764 if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH )
765 {
766 continue;
767 }
768 }
769 
770 {
771 IkReal j3array[1], cj3array[1], sj3array[1];
772 bool j3valid[1]={false};
773 _nj3 = 1;
774 j3array[0]=(r00+(((-1.0)*j0))+(((-1.0)*j1)));
775 sj3array[0]=IKsin(j3array[0]);
776 cj3array[0]=IKcos(j3array[0]);
777 if( j3array[0] > IKPI )
778 {
779  j3array[0]-=IK2PI;
780 }
781 else if( j3array[0] < -IKPI )
782 { j3array[0]+=IK2PI;
783 }
784 j3valid[0] = true;
785 for(int ij3 = 0; ij3 < 1; ++ij3)
786 {
787 if( !j3valid[ij3] )
788 {
789  continue;
790 }
791 _ij3[0] = ij3; _ij3[1] = -1;
792 for(int iij3 = ij3+1; iij3 < 1; ++iij3)
793 {
794 if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
795 {
796  j3valid[iij3]=false; _ij3[1] = iij3; break;
797 }
798 }
799 j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
800 
801 {
802 std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(4);
803 vinfos[0].jointtype = 1;
804 vinfos[0].foffset = j0;
805 vinfos[0].indices[0] = _ij0[0];
806 vinfos[0].indices[1] = _ij0[1];
807 vinfos[0].maxsolutions = _nj0;
808 vinfos[1].jointtype = 1;
809 vinfos[1].foffset = j1;
810 vinfos[1].indices[0] = _ij1[0];
811 vinfos[1].indices[1] = _ij1[1];
812 vinfos[1].maxsolutions = _nj1;
813 vinfos[2].jointtype = 17;
814 vinfos[2].foffset = j2;
815 vinfos[2].indices[0] = _ij2[0];
816 vinfos[2].indices[1] = _ij2[1];
817 vinfos[2].maxsolutions = _nj2;
818 vinfos[3].jointtype = 1;
819 vinfos[3].foffset = j3;
820 vinfos[3].indices[0] = _ij3[0];
821 vinfos[3].indices[1] = _ij3[1];
822 vinfos[3].maxsolutions = _nj3;
823 std::vector<int> vfree(0);
824 solutions.AddSolution(vinfos,vfree);
825 }
826 }
827 }
828 }
829 }
830 
831 }
832 } while(0);
833 if( bgotonextstatement )
834 {
835 bool bgotonextstatement = true;
836 do
837 {
838 if( 1 )
839 {
840 bgotonextstatement=false;
841 continue; // branch miss [j1]
842 
843 }
844 } while(0);
845 if( bgotonextstatement )
846 {
847 }
848 }
849 }
850 }
851 
852 } else
853 {
854 {
855 IkReal j1array[1], cj1array[1], sj1array[1];
856 bool j1valid[1]={false};
857 _nj1 = 1;
858 IkReal x83=((2.0)*cj0);
859 IkReal x84=(px*sj0);
860 CheckValue<IkReal> x85 = IKatan2WithCheck(IkReal(((((-2.0)*py*sj0))+(((-1.0)*px*x83)))),IkReal(((-0.72)+((py*x83))+(((-2.0)*x84)))),IKFAST_ATAN2_MAGTHRESH);
861 if(!x85.valid){
862 continue;
863 }
864 CheckValue<IkReal> x86=IKPowWithIntegerCheck(IKsign(((0.648)+(((-3.6)*cj0*py))+(((5.0)*(px*px)))+(((5.0)*(py*py)))+(((3.6)*x84)))),-1);
865 if(!x86.valid){
866 continue;
867 }
868 j1array[0]=((-1.5707963267949)+(x85.value)+(((1.5707963267949)*(x86.value))));
869 sj1array[0]=IKsin(j1array[0]);
870 cj1array[0]=IKcos(j1array[0]);
871 if( j1array[0] > IKPI )
872 {
873  j1array[0]-=IK2PI;
874 }
875 else if( j1array[0] < -IKPI )
876 { j1array[0]+=IK2PI;
877 }
878 j1valid[0] = true;
879 for(int ij1 = 0; ij1 < 1; ++ij1)
880 {
881 if( !j1valid[ij1] )
882 {
883  continue;
884 }
885 _ij1[0] = ij1; _ij1[1] = -1;
886 for(int iij1 = ij1+1; iij1 < 1; ++iij1)
887 {
888 if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH )
889 {
890  j1valid[iij1]=false; _ij1[1] = iij1; break;
891 }
892 }
893 j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1];
894 {
895 IkReal evalcond[2];
896 IkReal x87=IKcos(j1);
897 IkReal x88=IKsin(j1);
898 IkReal x89=(py*sj0);
899 IkReal x90=(px*sj0);
900 IkReal x91=(cj0*px);
901 IkReal x92=(cj0*py);
902 IkReal x93=((1.0)*x87);
903 evalcond[0]=((0.4)+((x87*x90))+((x88*x91))+((x88*x89))+(((-1.0)*x92*x93))+(((0.36)*x87)));
904 evalcond[1]=((((-1.0)*x91*x93))+(((-1.0)*x88*x92))+((x88*x90))+(((0.36)*x88))+(((-1.0)*x89*x93)));
905 if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH )
906 {
907 continue;
908 }
909 }
910 
911 {
912 IkReal j3array[1], cj3array[1], sj3array[1];
913 bool j3valid[1]={false};
914 _nj3 = 1;
915 j3array[0]=(r00+(((-1.0)*j0))+(((-1.0)*j1)));
916 sj3array[0]=IKsin(j3array[0]);
917 cj3array[0]=IKcos(j3array[0]);
918 if( j3array[0] > IKPI )
919 {
920  j3array[0]-=IK2PI;
921 }
922 else if( j3array[0] < -IKPI )
923 { j3array[0]+=IK2PI;
924 }
925 j3valid[0] = true;
926 for(int ij3 = 0; ij3 < 1; ++ij3)
927 {
928 if( !j3valid[ij3] )
929 {
930  continue;
931 }
932 _ij3[0] = ij3; _ij3[1] = -1;
933 for(int iij3 = ij3+1; iij3 < 1; ++iij3)
934 {
935 if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH )
936 {
937  j3valid[iij3]=false; _ij3[1] = iij3; break;
938 }
939 }
940 j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3];
941 
942 {
943 std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(4);
944 vinfos[0].jointtype = 1;
945 vinfos[0].foffset = j0;
946 vinfos[0].indices[0] = _ij0[0];
947 vinfos[0].indices[1] = _ij0[1];
948 vinfos[0].maxsolutions = _nj0;
949 vinfos[1].jointtype = 1;
950 vinfos[1].foffset = j1;
951 vinfos[1].indices[0] = _ij1[0];
952 vinfos[1].indices[1] = _ij1[1];
953 vinfos[1].maxsolutions = _nj1;
954 vinfos[2].jointtype = 17;
955 vinfos[2].foffset = j2;
956 vinfos[2].indices[0] = _ij2[0];
957 vinfos[2].indices[1] = _ij2[1];
958 vinfos[2].maxsolutions = _nj2;
959 vinfos[3].jointtype = 1;
960 vinfos[3].foffset = j3;
961 vinfos[3].indices[0] = _ij3[0];
962 vinfos[3].indices[1] = _ij3[1];
963 vinfos[3].maxsolutions = _nj3;
964 std::vector<int> vfree(0);
965 solutions.AddSolution(vinfos,vfree);
966 }
967 }
968 }
969 }
970 }
971 
972 }
973 
974 }
975 }
976 }
977 
978 }
979 
980 }
981 }
982 }
983 
984 } else
985 {
986 continue; // verifyAllEquations
987 
988 }
989 
990 }
991 }
992 return solutions.GetNumSolutions()>0;
993 }
994 };
995 
996 
999 IKFAST_API bool ComputeIk(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions) {
1000 IKSolver solver;
1001 return solver.ComputeIk(eetrans,eerot,pfree,solutions);
1002 }
1003 
1004 IKFAST_API bool ComputeIk2(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions, void* pOpenRAVEManip) {
1005 IKSolver solver;
1006 return solver.ComputeIk(eetrans,eerot,pfree,solutions);
1007 }
1008 
1009 IKFAST_API const char* GetKinematicsHash() { return "f5648dba87d158b7a6ee8d512dec18b5"; }
1010 
1011 IKFAST_API const char* GetIkFastVersion() { return "0x1000004a"; }
1012 
1013 #ifdef IKFAST_NAMESPACE
1014 } // end namespace
1015 #endif
1016 
1017 #ifndef IKFAST_NO_MAIN
1018 #include <stdio.h>
1019 #include <stdlib.h>
1020 #ifdef IKFAST_NAMESPACE
1021 using namespace IKFAST_NAMESPACE;
1022 #endif
1023 int main(int argc, char** argv)
1024 {
1025  if( argc != 12+GetNumFreeParameters()+1 ) {
1026  printf("\nUsage: ./ik r00 r01 r02 t0 r10 r11 r12 t1 r20 r21 r22 t2 free0 ...\n\n"
1027  "Returns the ik solutions given the transformation of the end effector specified by\n"
1028  "a 3x3 rotation R (rXX), and a 3x1 translation (tX).\n"
1029  "There are %d free parameters that have to be specified.\n\n",GetNumFreeParameters());
1030  return 1;
1031  }
1032 
1033  IkSolutionList<IkReal> solutions;
1034  std::vector<IkReal> vfree(GetNumFreeParameters());
1035  IkReal eerot[9],eetrans[3];
1036  eerot[0] = atof(argv[1]); eerot[1] = atof(argv[2]); eerot[2] = atof(argv[3]); eetrans[0] = atof(argv[4]);
1037  eerot[3] = atof(argv[5]); eerot[4] = atof(argv[6]); eerot[5] = atof(argv[7]); eetrans[1] = atof(argv[8]);
1038  eerot[6] = atof(argv[9]); eerot[7] = atof(argv[10]); eerot[8] = atof(argv[11]); eetrans[2] = atof(argv[12]);
1039  for(std::size_t i = 0; i < vfree.size(); ++i)
1040  vfree[i] = atof(argv[13+i]);
1041  bool bSuccess = ComputeIk(eetrans, eerot, vfree.size() > 0 ? &vfree[0] : NULL, solutions);
1042 
1043  if( !bSuccess ) {
1044  fprintf(stderr,"Failed to get ik solution\n");
1045  return -1;
1046  }
1047 
1048  printf("Found %d ik solutions:\n", (int)solutions.GetNumSolutions());
1049  std::vector<IkReal> solvalues(GetNumJoints());
1050  for(std::size_t i = 0; i < solutions.GetNumSolutions(); ++i) {
1051  const IkSolutionBase<IkReal>& sol = solutions.GetSolution(i);
1052  printf("sol%d (free=%d): ", (int)i, (int)sol.GetFree().size());
1053  std::vector<IkReal> vsolfree(sol.GetFree().size());
1054  sol.GetSolution(&solvalues[0],vsolfree.size()>0?&vsolfree[0]:NULL);
1055  for( std::size_t j = 0; j < solvalues.size(); ++j)
1056  printf("%.15f, ", solvalues[j]);
1057  printf("\n");
1058  }
1059  return 0;
1060 }
1061 
1062 #endif
IKFAST_API bool ComputeIk(const IkReal *eetrans, const IkReal *eerot, const IkReal *pfree, IkSolutionListBase< IkReal > &solutions)
Definition: ikfast.h:45
virtual const IkSolutionBase< T > & GetSolution(size_t index) const
returns the solution pointer
Definition: ikfast.h:283
float IKlog(float f)
IKFAST_API int GetIkType()
float IKacos(float f)
IKFAST_API const char * GetKinematicsHash()
float IKsin(float f)
IKFAST_API int GetIkRealSize()
#define IKFAST_SOLUTION_THRESH
INLINE Rall1d< T, V, S > log(const Rall1d< T, V, S > &arg)
float IKsqr(float f)
virtual size_t GetNumSolutions() const
returns the number of solutions stored
Definition: ikfast.h:294
#define IKFAST_ASSERT(b)
void dgeev_(const char *jobvl, const char *jobvr, const int *n, double *a, const int *lda, double *wr, double *wi, double *vl, const int *ldvl, double *vr, const int *ldvr, double *work, const int *lwork, int *info)
void dgetri_(const int *n, const double *a, const int *lda, int *ipiv, double *work, const int *lwork, int *info)
The discrete solutions are returned in this structure.
Definition: ikfast.h:70
void dgesv_(const int *n, const int *nrhs, double *a, const int *lda, int *ipiv, double *b, const int *ldb, int *info)
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...
float IKatan2(float fy, float fx)
float IKcos(float f)
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
CheckValue< T > IKPowWithIntegerCheck(T f, int n)
#define IKFAST_EVALCOND_THRESH
IKFAST_API const char * GetIkFastVersion()
INLINE Rall1d< T, V, S > asin(const Rall1d< T, V, S > &x)
float IKtan(float f)
#define IKFAST_COMPILE_ASSERT(x)
float IKsqrt(float f)
virtual void Clear()=0
clears all current solutions, note that any memory addresses returned from GetSolution will be invali...
void dgetrs_(const char *trans, const int *n, const int *nrhs, double *a, const int *lda, int *ipiv, double *b, const int *ldb, int *info)
float IKabs(float f)
INLINE Rall1d< T, V, S > sqrt(const Rall1d< T, V, S > &arg)
float IKfmod(float x, float y)
int main(int argc, char **argv)
float IKsign(float f)
virtual void GetSolution(T *solution, const T *freevalues) const =0
gets a concrete solution
bool ComputeIk(const IkReal *eetrans, const IkReal *eerot, const IkReal *pfree, IkSolutionListBase< IkReal > &solutions)
INLINE Rall1d< T, V, S > pow(const Rall1d< T, V, S > &arg, double m)
IKFAST_API bool ComputeIk2(const IkReal *eetrans, const IkReal *eerot, const IkReal *pfree, IkSolutionListBase< IkReal > &solutions, void *pOpenRAVEManip)
INLINE Rall1d< T, V, S > acos(const Rall1d< T, V, S > &x)
Default implementation of IkSolutionListBase.
Definition: ikfast.h:273
INLINE Rall1d< T, V, S > atan2(const Rall1d< T, V, S > &y, const Rall1d< T, V, S > &x)
float IKasin(float f)
#define IKFAST_VERSION
Header file for all ikfast c++ files/shared objects.
Definition: ikfast.h:43
IKFAST_API int * GetFreeParameters()
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
INLINE Rall1d< T, V, S > tan(const Rall1d< T, V, S > &arg)
IKFAST_API void ComputeFk(const IkReal *j, IkReal *eetrans, IkReal *eerot)
#define IKFAST_ATAN2_MAGTHRESH
IKFAST_API int GetNumJoints()
float IKatan2Simple(float fy, float fx)
manages all the solutions
Definition: ikfast.h:100
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
void dgetrf_(const int *m, const int *n, double *a, const int *lda, int *ipiv, int *info)
virtual size_t GetNumSolutions() const =0
returns the number of solutions stored
IKFAST_API int GetNumFreeParameters()
CheckValue< T > IKatan2WithCheck(T fy, T fx, T epsilon)
void zgetrf_(const int *m, const int *n, std::complex< double > *a, const int *lda, int *ipiv, int *info)
#define IKFAST_SINCOS_THRESH


khi_duaro_ikfast_plugin
Author(s): matsui_hiro
autogenerated on Fri Mar 26 2021 02:34:14