Austin Schuh | 7400da0 | 2018-01-28 19:54:58 -0800 | [diff] [blame^] | 1 | /// autogenerated analytical inverse kinematics code from ikfast program part of OpenRAVE |
| 2 | /// \author Rosen Diankov |
| 3 | /// |
| 4 | /// Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | /// you may not use this file except in compliance with the License. |
| 6 | /// You may obtain a copy of the License at |
| 7 | /// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | /// |
| 9 | /// Unless required by applicable law or agreed to in writing, software |
| 10 | /// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | /// See the License for the specific language governing permissions and |
| 13 | /// limitations under the License. |
| 14 | /// |
| 15 | /// ikfast version 0x1000004a generated on 2017-12-12 14:08:54.348797 |
| 16 | /// Generated using solver transform6d |
| 17 | /// To compile with gcc: |
| 18 | /// gcc -lstdc++ ik.cpp |
| 19 | /// To compile without any main function as a shared object (might need -llapack): |
| 20 | /// gcc -fPIC -lstdc++ -DIKFAST_NO_MAIN -DIKFAST_CLIBRARY -shared -Wl,-soname,libik.so -o libik.so ik.cpp |
| 21 | #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] |
| 27 | IKFAST_COMPILE_ASSERT(IKFAST_VERSION==0x1000004a); |
| 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> |
| 205 | struct CheckValue |
| 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) ) { |
| 218 | if( IKabs(fy) >= IKFAST_ATAN2_MAGTHRESH || IKabs(fx) > IKFAST_ATAN2_MAGTHRESH ) { |
| 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> |
| 247 | inline CheckValue<T> IKPowWithIntegerCheck(T f, int n) |
| 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 | |
| 298 | /// solves the forward kinematics equations. |
| 299 | /// \param pfree is an array specifying the free joints of the chain. |
| 300 | IKFAST_API void ComputeFk(const IkReal* j, IkReal* eetrans, IkReal* eerot) { |
| 301 | IkReal 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,x47,x48,x49,x50,x51,x52,x53,x54,x55,x56,x57,x58,x59,x60,x61,x62,x63,x64; |
| 302 | x0=IKcos(j[0]); |
| 303 | x1=IKcos(j[3]); |
| 304 | x2=IKsin(j[0]); |
| 305 | x3=IKsin(j[3]); |
| 306 | x4=IKsin(j[4]); |
| 307 | x5=IKsin(j[1]); |
| 308 | x6=IKsin(j[2]); |
| 309 | x7=IKcos(j[1]); |
| 310 | x8=IKcos(j[2]); |
| 311 | x9=IKcos(j[4]); |
| 312 | x10=IKsin(j[5]); |
| 313 | x11=IKcos(j[5]); |
| 314 | x12=((0.134999999784)*x4); |
| 315 | x13=((5.39999999136e-6)*x4); |
| 316 | x14=((0.9999999992)*x4); |
| 317 | x15=((1.271)*x0); |
| 318 | x16=((1.271)*x2); |
| 319 | x17=((5.39999999136e-6)*x0); |
| 320 | x18=((0.175)*x0); |
| 321 | x19=((3.9999999968e-5)*x4); |
| 322 | x20=((5.39999999136e-6)*x9); |
| 323 | x21=((0.175)*x2); |
| 324 | x22=((0.134999999784)*x9); |
| 325 | x23=((3.9999999968e-5)*x9); |
| 326 | x24=((0.9999999992)*x9); |
| 327 | x25=((1.0)*x2); |
| 328 | x26=((5.39999999136e-6)*x1); |
| 329 | x27=((1.095)*x5); |
| 330 | x28=((2.159999996544e-10)*x0); |
| 331 | x29=((1.0)*x0); |
| 332 | x30=((2.159999996544e-10)*x2); |
| 333 | x31=((2.159999996544e-10)*x1); |
| 334 | x32=((5.39999999136e-6)*x2); |
| 335 | x33=(x5*x6); |
| 336 | x34=(x7*x8); |
| 337 | x35=(x1*x9); |
| 338 | x36=(x2*x3); |
| 339 | x37=(x6*x7); |
| 340 | x38=(x5*x8); |
| 341 | x39=((1.0)*x34); |
| 342 | x40=(x29*x33); |
| 343 | x41=(x25*x33); |
| 344 | x42=((((-1.0)*x39))+x33); |
| 345 | x43=((((-1.0)*x33))+x39); |
| 346 | x44=((((1.0)*x38))+(((1.0)*x37))); |
| 347 | x45=((-1.0)*x44); |
| 348 | x46=(x1*x42); |
| 349 | x47=(x3*x43); |
| 350 | x48=((((-1.0)*x40))+((x0*x34))); |
| 351 | x49=((((-1.0)*x41))+((x2*x34))); |
| 352 | x50=((((-1.0)*x29*x34))+x40); |
| 353 | x51=((((-1.0)*x25*x34))+x41); |
| 354 | x52=(x29*((x38+x37))); |
| 355 | x53=((-1.0)*x52); |
| 356 | x54=(x25*((x38+x37))); |
| 357 | x55=((-1.0)*x54); |
| 358 | x56=(x1*x55); |
| 359 | x57=((((-1.0)*x25*x3))+((x1*x53))); |
| 360 | x58=(((x3*x52))+(((-1.0)*x1*x25))); |
| 361 | x59=(((x0*x3))+x56); |
| 362 | x60=(((x0*x1))+((x3*x54))); |
| 363 | x61=(x4*x57); |
| 364 | x62=(((x19*x46))+((x23*x45))+((x14*x44))+((x24*x46))); |
| 365 | x63=(((x14*x50))+((x23*x48))+((x19*x57))+((x24*x57))); |
| 366 | x64=(((x14*x51))+((x23*x49))+((x19*x59))+((x24*x59))); |
| 367 | eerot[0]=(((x11*x63))+((x10*x58))); |
| 368 | eerot[1]=((((-1.0)*x10*x63))+((x11*x58))); |
| 369 | eerot[2]=(((x14*x57))+(((-1.0)*x23*x57))+(((-1.0)*x19*x50))+((x24*x48))); |
| 370 | IkReal x65=((1.0)*x33); |
| 371 | eetrans[0]=(((x12*x57))+((x0*x27))+(((-1.0)*x15*x65))+((x18*x37))+((x18*x38))+(((-1.0)*x20*x57))+((x22*x48))+((x4*(((((-2.159999996544e-10)*x36))+((x31*x53))))))+((x15*x34))+((x9*((((x28*x34))+(((-1.0)*x28*x65))))))+x18+((x9*((((x26*x53))+(((-5.39999999136e-6)*x36))))))+(((-1.0)*x13*x50))+((x4*((((x17*x33))+(((-1.0)*x17*x34))))))); |
| 372 | eerot[3]=(((x11*x64))+((x10*x60))); |
| 373 | eerot[4]=((((-1.0)*x10*x64))+((x11*x60))); |
| 374 | eerot[5]=(((x14*x59))+(((-1.0)*x23*x59))+(((-1.0)*x19*x51))+((x24*x49))); |
| 375 | IkReal x66=((1.0)*x33); |
| 376 | eetrans[1]=((((-1.0)*x16*x66))+((x12*x59))+((x4*((((x31*x55))+((x28*x3))))))+((x16*x34))+(((-1.0)*x20*x59))+((x4*((((x32*x33))+(((-1.0)*x32*x34))))))+((x22*x49))+((x21*x38))+((x21*x37))+((x9*(((((-1.0)*x30*x66))+((x30*x34))))))+((x2*x27))+x21+(((-1.0)*x13*x51))+((x9*((((x26*x55))+((x17*x3))))))); |
| 377 | eerot[6]=(((x10*x47))+((x11*x62))); |
| 378 | eerot[7]=((((-1.0)*x10*x62))+((x11*x47))); |
| 379 | eerot[8]=(((x14*x46))+(((-1.0)*x19*x44))+((x24*x45))+(((-1.0)*x23*x46))); |
| 380 | eetrans[2]=((0.495)+(((-0.175)*x33))+(((-1.0)*x20*x46))+(((0.175)*x34))+((x22*x45))+(((-1.271)*x38))+(((-1.271)*x37))+((x4*(((((5.39999999136e-6)*x38))+(((5.39999999136e-6)*x37))))))+((x1*x4*(((((-2.159999996544e-10)*x34))+(((2.159999996544e-10)*x33))))))+((x35*(((((5.39999999136e-6)*x33))+(((-5.39999999136e-6)*x34))))))+(((1.095)*x7))+((x12*x46))+((x9*(((((-2.159999996544e-10)*x37))+(((-2.159999996544e-10)*x38))))))+(((-1.0)*x13*x44))); |
| 381 | } |
| 382 | |
| 383 | IKFAST_API int GetNumFreeParameters() { return 0; } |
| 384 | IKFAST_API int* GetFreeParameters() { return NULL; } |
| 385 | IKFAST_API int GetNumJoints() { return 6; } |
| 386 | |
| 387 | IKFAST_API int GetIkRealSize() { return sizeof(IkReal); } |
| 388 | |
| 389 | IKFAST_API int GetIkType() { return 0x67000001; } |
| 390 | |
| 391 | class IKSolver { |
| 392 | public: |
| 393 | IkReal j0,cj0,sj0,htj0,j0mul,j1,cj1,sj1,htj1,j1mul,j2,cj2,sj2,htj2,j2mul,j3,cj3,sj3,htj3,j3mul,j4,cj4,sj4,htj4,j4mul,j5,cj5,sj5,htj5,j5mul,new_r00,r00,rxp0_0,new_r01,r01,rxp0_1,new_r02,r02,rxp0_2,new_r10,r10,rxp1_0,new_r11,r11,rxp1_1,new_r12,r12,rxp1_2,new_r20,r20,rxp2_0,new_r21,r21,rxp2_1,new_r22,r22,rxp2_2,new_px,px,npx,new_py,py,npy,new_pz,pz,npz,pp; |
| 394 | unsigned char _ij0[2], _nj0,_ij1[2], _nj1,_ij2[2], _nj2,_ij3[2], _nj3,_ij4[2], _nj4,_ij5[2], _nj5; |
| 395 | |
| 396 | IkReal j100, cj100, sj100; |
| 397 | unsigned char _ij100[2], _nj100; |
| 398 | bool ComputeIk(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions) { |
| 399 | 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; 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; |
| 400 | for(int dummyiter = 0; dummyiter < 1; ++dummyiter) { |
| 401 | solutions.Clear(); |
| 402 | r00 = eerot[0*3+0]; |
| 403 | r01 = eerot[0*3+1]; |
| 404 | r02 = eerot[0*3+2]; |
| 405 | r10 = eerot[1*3+0]; |
| 406 | r11 = eerot[1*3+1]; |
| 407 | r12 = eerot[1*3+2]; |
| 408 | r20 = eerot[2*3+0]; |
| 409 | r21 = eerot[2*3+1]; |
| 410 | r22 = eerot[2*3+2]; |
| 411 | px = eetrans[0]; py = eetrans[1]; pz = eetrans[2]; |
| 412 | |
| 413 | new_r00=r00; |
| 414 | new_r01=r01; |
| 415 | new_r02=r02; |
| 416 | new_px=((((-0.134999999892)*r02))+px); |
| 417 | new_r10=r10; |
| 418 | new_r11=r11; |
| 419 | new_r12=r12; |
| 420 | new_py=((((-0.134999999892)*r12))+py); |
| 421 | new_r20=r20; |
| 422 | new_r21=r21; |
| 423 | new_r22=r22; |
| 424 | new_pz=((-0.495)+pz+(((-0.134999999892)*r22))); |
| 425 | r00 = new_r00; r01 = new_r01; r02 = new_r02; r10 = new_r10; r11 = new_r11; r12 = new_r12; r20 = new_r20; r21 = new_r21; r22 = new_r22; px = new_px; py = new_py; pz = new_pz; |
| 426 | IkReal x67=((1.0)*px); |
| 427 | IkReal x68=((1.0)*pz); |
| 428 | IkReal x69=((1.0)*py); |
| 429 | pp=((px*px)+(py*py)+(pz*pz)); |
| 430 | npx=(((px*r00))+((py*r10))+((pz*r20))); |
| 431 | npy=(((px*r01))+((py*r11))+((pz*r21))); |
| 432 | npz=(((px*r02))+((py*r12))+((pz*r22))); |
| 433 | rxp0_0=((((-1.0)*r20*x69))+((pz*r10))); |
| 434 | rxp0_1=(((px*r20))+(((-1.0)*r00*x68))); |
| 435 | rxp0_2=((((-1.0)*r10*x67))+((py*r00))); |
| 436 | rxp1_0=((((-1.0)*r21*x69))+((pz*r11))); |
| 437 | rxp1_1=(((px*r21))+(((-1.0)*r01*x68))); |
| 438 | rxp1_2=((((-1.0)*r11*x67))+((py*r01))); |
| 439 | rxp2_0=(((pz*r12))+(((-1.0)*r22*x69))); |
| 440 | rxp2_1=(((px*r22))+(((-1.0)*r02*x68))); |
| 441 | rxp2_2=((((-1.0)*r12*x67))+((py*r02))); |
| 442 | { |
| 443 | IkReal j0eval[1]; |
| 444 | j0eval[0]=((IKabs(px))+(IKabs(py))); |
| 445 | if( IKabs(j0eval[0]) < 0.0000010000000000 ) |
| 446 | { |
| 447 | continue; // no branches [j0, j1, j2] |
| 448 | |
| 449 | } else |
| 450 | { |
| 451 | { |
| 452 | IkReal j0array[2], cj0array[2], sj0array[2]; |
| 453 | bool j0valid[2]={false}; |
| 454 | _nj0 = 2; |
| 455 | CheckValue<IkReal> x71 = IKatan2WithCheck(IkReal(py),IkReal(((-1.0)*px)),IKFAST_ATAN2_MAGTHRESH); |
| 456 | if(!x71.valid){ |
| 457 | continue; |
| 458 | } |
| 459 | IkReal x70=x71.value; |
| 460 | j0array[0]=((-1.0)*x70); |
| 461 | sj0array[0]=IKsin(j0array[0]); |
| 462 | cj0array[0]=IKcos(j0array[0]); |
| 463 | j0array[1]=((3.14159265358979)+(((-1.0)*x70))); |
| 464 | sj0array[1]=IKsin(j0array[1]); |
| 465 | cj0array[1]=IKcos(j0array[1]); |
| 466 | if( j0array[0] > IKPI ) |
| 467 | { |
| 468 | j0array[0]-=IK2PI; |
| 469 | } |
| 470 | else if( j0array[0] < -IKPI ) |
| 471 | { j0array[0]+=IK2PI; |
| 472 | } |
| 473 | j0valid[0] = true; |
| 474 | if( j0array[1] > IKPI ) |
| 475 | { |
| 476 | j0array[1]-=IK2PI; |
| 477 | } |
| 478 | else if( j0array[1] < -IKPI ) |
| 479 | { j0array[1]+=IK2PI; |
| 480 | } |
| 481 | j0valid[1] = true; |
| 482 | for(int ij0 = 0; ij0 < 2; ++ij0) |
| 483 | { |
| 484 | if( !j0valid[ij0] ) |
| 485 | { |
| 486 | continue; |
| 487 | } |
| 488 | _ij0[0] = ij0; _ij0[1] = -1; |
| 489 | for(int iij0 = ij0+1; iij0 < 2; ++iij0) |
| 490 | { |
| 491 | if( j0valid[iij0] && IKabs(cj0array[ij0]-cj0array[iij0]) < IKFAST_SOLUTION_THRESH && IKabs(sj0array[ij0]-sj0array[iij0]) < IKFAST_SOLUTION_THRESH ) |
| 492 | { |
| 493 | j0valid[iij0]=false; _ij0[1] = iij0; break; |
| 494 | } |
| 495 | } |
| 496 | j0 = j0array[ij0]; cj0 = cj0array[ij0]; sj0 = sj0array[ij0]; |
| 497 | |
| 498 | { |
| 499 | IkReal j2array[2], cj2array[2], sj2array[2]; |
| 500 | bool j2valid[2]={false}; |
| 501 | _nj2 = 2; |
| 502 | IkReal x72=px*px; |
| 503 | IkReal x73=r10*r10; |
| 504 | IkReal x74=r01*r01; |
| 505 | IkReal x75=py*py; |
| 506 | IkReal x76=r11*r11; |
| 507 | IkReal x77=r00*r00; |
| 508 | IkReal x78=r20*r20; |
| 509 | IkReal x79=r21*r21; |
| 510 | IkReal x80=pz*pz; |
| 511 | IkReal x81=r12*r12; |
| 512 | IkReal x82=r22*r22; |
| 513 | IkReal x83=r02*r02; |
| 514 | IkReal x84=((0.355903503251059)*x80); |
| 515 | IkReal x85=((0.124566226137871)*cj0*px); |
| 516 | IkReal x86=((0.355903503251059)*x72); |
| 517 | IkReal x87=((0.355903503251059)*x75); |
| 518 | IkReal x88=((0.124566226137871)*py*sj0); |
| 519 | IkReal x89=(x74*x76); |
| 520 | IkReal x90=(x77*x78); |
| 521 | IkReal x91=(x76*x79); |
| 522 | IkReal x92=(x81*x83); |
| 523 | IkReal x93=(x82*x83); |
| 524 | IkReal x94=(x81*x82); |
| 525 | IkReal x95=(x74*x79); |
| 526 | IkReal x96=(x73*x87); |
| 527 | if( (((-1.00167830918099)+(((-1.0)*x81*x88))+((x77*x86))+((x87*x91))+((x79*x84))+(((-1.0)*x73*x88))+(((-1.0)*x83*x85))+((x78*x84))+((x82*x84))+((x81*x87))+((x78*x96))+((x86*x90))+((x86*x95))+(((-1.0)*x77*x85))+((x86*x89))+((x74*x86))+(((-0.711807006502117)*x78*x79*x80))+(((-1.0)*x87*x92))+(((-1.0)*x87*x94))+(((-1.0)*x86*x93))+(((-1.0)*x86*x92))+((x76*x87))+((x73*x77*x86))+x96+(((-1.0)*x74*x85))+(((-0.711807006502117)*x73*x75*x76))+(((-1.0)*x76*x88))+(((-1.0)*x84*x94))+(((-1.0)*x84*x93))+((x83*x86))+(((-0.711807006502117)*x72*x74*x77))+((x73*x78*x84))+((x84*x91))+((x84*x90))+((x84*x95))+((x77*x96))+((x87*x89)))) < -1-IKFAST_SINCOS_THRESH || (((-1.00167830918099)+(((-1.0)*x81*x88))+((x77*x86))+((x87*x91))+((x79*x84))+(((-1.0)*x73*x88))+(((-1.0)*x83*x85))+((x78*x84))+((x82*x84))+((x81*x87))+((x78*x96))+((x86*x90))+((x86*x95))+(((-1.0)*x77*x85))+((x86*x89))+((x74*x86))+(((-0.711807006502117)*x78*x79*x80))+(((-1.0)*x87*x92))+(((-1.0)*x87*x94))+(((-1.0)*x86*x93))+(((-1.0)*x86*x92))+((x76*x87))+((x73*x77*x86))+x96+(((-1.0)*x74*x85))+(((-0.711807006502117)*x73*x75*x76))+(((-1.0)*x76*x88))+(((-1.0)*x84*x94))+(((-1.0)*x84*x93))+((x83*x86))+(((-0.711807006502117)*x72*x74*x77))+((x73*x78*x84))+((x84*x91))+((x84*x90))+((x84*x95))+((x77*x96))+((x87*x89)))) > 1+IKFAST_SINCOS_THRESH ) |
| 528 | continue; |
| 529 | IkReal x97=IKasin(((-1.00167830918099)+(((-1.0)*x81*x88))+((x77*x86))+((x87*x91))+((x79*x84))+(((-1.0)*x73*x88))+(((-1.0)*x83*x85))+((x78*x84))+((x82*x84))+((x81*x87))+((x78*x96))+((x86*x90))+((x86*x95))+(((-1.0)*x77*x85))+((x86*x89))+((x74*x86))+(((-0.711807006502117)*x78*x79*x80))+(((-1.0)*x87*x92))+(((-1.0)*x87*x94))+(((-1.0)*x86*x93))+(((-1.0)*x86*x92))+((x76*x87))+((x73*x77*x86))+x96+(((-1.0)*x74*x85))+(((-0.711807006502117)*x73*x75*x76))+(((-1.0)*x76*x88))+(((-1.0)*x84*x94))+(((-1.0)*x84*x93))+((x83*x86))+(((-0.711807006502117)*x72*x74*x77))+((x73*x78*x84))+((x84*x91))+((x84*x90))+((x84*x95))+((x77*x96))+((x87*x89)))); |
| 530 | j2array[0]=((0.136826551321617)+(((-1.0)*x97))); |
| 531 | sj2array[0]=IKsin(j2array[0]); |
| 532 | cj2array[0]=IKcos(j2array[0]); |
| 533 | j2array[1]=((3.27841920491141)+x97); |
| 534 | sj2array[1]=IKsin(j2array[1]); |
| 535 | cj2array[1]=IKcos(j2array[1]); |
| 536 | if( j2array[0] > IKPI ) |
| 537 | { |
| 538 | j2array[0]-=IK2PI; |
| 539 | } |
| 540 | else if( j2array[0] < -IKPI ) |
| 541 | { j2array[0]+=IK2PI; |
| 542 | } |
| 543 | j2valid[0] = true; |
| 544 | if( j2array[1] > IKPI ) |
| 545 | { |
| 546 | j2array[1]-=IK2PI; |
| 547 | } |
| 548 | else if( j2array[1] < -IKPI ) |
| 549 | { j2array[1]+=IK2PI; |
| 550 | } |
| 551 | j2valid[1] = true; |
| 552 | for(int ij2 = 0; ij2 < 2; ++ij2) |
| 553 | { |
| 554 | if( !j2valid[ij2] ) |
| 555 | { |
| 556 | continue; |
| 557 | } |
| 558 | _ij2[0] = ij2; _ij2[1] = -1; |
| 559 | for(int iij2 = ij2+1; iij2 < 2; ++iij2) |
| 560 | { |
| 561 | if( j2valid[iij2] && IKabs(cj2array[ij2]-cj2array[iij2]) < IKFAST_SOLUTION_THRESH && IKabs(sj2array[ij2]-sj2array[iij2]) < IKFAST_SOLUTION_THRESH ) |
| 562 | { |
| 563 | j2valid[iij2]=false; _ij2[1] = iij2; break; |
| 564 | } |
| 565 | } |
| 566 | j2 = j2array[ij2]; cj2 = cj2array[ij2]; sj2 = sj2array[ij2]; |
| 567 | |
| 568 | { |
| 569 | IkReal j1eval[2]; |
| 570 | IkReal x98=(py*sj0); |
| 571 | IkReal x99=((41.5020408163265)*cj2); |
| 572 | IkReal x100=(pz*sj2); |
| 573 | IkReal x101=((5.71428571428571)*sj2); |
| 574 | IkReal x102=(cj2*pz); |
| 575 | IkReal x103=(cj0*px); |
| 576 | IkReal x104=((1.271)*cj2); |
| 577 | IkReal x105=((0.175)*sj2); |
| 578 | j1eval[0]=((((-35.7551020408163)*pz))+(((-1.0)*sj2))+(((41.5020408163265)*x100))+((x103*x99))+((x101*x98))+(((-5.71428571428571)*x102))+((x98*x99))+((x101*x103))+(((-7.26285714285714)*cj2))); |
| 579 | j1eval[1]=IKsign(((((-1.095)*pz))+(((-0.175)*x102))+((x103*x105))+((x103*x104))+(((-0.030625)*sj2))+((x105*x98))+(((1.271)*x100))+((x104*x98))+(((-0.222425)*cj2)))); |
| 580 | if( IKabs(j1eval[0]) < 0.0000010000000000 || IKabs(j1eval[1]) < 0.0000010000000000 ) |
| 581 | { |
| 582 | { |
| 583 | IkReal j1eval[2]; |
| 584 | j1eval[0]=((7.42359034572733)+(((-7.26285714285714)*sj2))+cj2); |
| 585 | j1eval[1]=IKsign(((2.845091)+(((0.38325)*cj2))+(((-2.78349)*sj2)))); |
| 586 | if( IKabs(j1eval[0]) < 0.0000010000000000 || IKabs(j1eval[1]) < 0.0000010000000000 ) |
| 587 | { |
| 588 | { |
| 589 | IkReal j1eval[2]; |
| 590 | IkReal x106=(py*sj0); |
| 591 | IkReal x107=((0.175)*cj2); |
| 592 | IkReal x108=((5.71428571428571)*cj2); |
| 593 | IkReal x109=(cj0*px); |
| 594 | IkReal x110=((1.271)*sj2); |
| 595 | IkReal x111=(pz*sj2); |
| 596 | IkReal x112=(cj2*pz); |
| 597 | IkReal x113=((41.5020408163265)*sj2); |
| 598 | j1eval[0]=((6.25714285714286)+(((-7.26285714285714)*sj2))+(((-35.7551020408163)*x109))+(((-35.7551020408163)*x106))+cj2+((x106*x113))+(((-5.71428571428571)*x111))+(((-41.5020408163265)*x112))+((x109*x113))+(((-1.0)*x106*x108))+(((-1.0)*x108*x109))); |
| 599 | j1eval[1]=IKsign(((0.191625)+(((-0.175)*x111))+(((-1.271)*x112))+(((-1.095)*x106))+(((-1.095)*x109))+(((0.030625)*cj2))+((x106*x110))+(((-1.0)*x107*x109))+((x109*x110))+(((-1.0)*x106*x107))+(((-0.222425)*sj2)))); |
| 600 | if( IKabs(j1eval[0]) < 0.0000010000000000 || IKabs(j1eval[1]) < 0.0000010000000000 ) |
| 601 | { |
| 602 | continue; // no branches [j1] |
| 603 | |
| 604 | } else |
| 605 | { |
| 606 | { |
| 607 | IkReal j1array[1], cj1array[1], sj1array[1]; |
| 608 | bool j1valid[1]={false}; |
| 609 | _nj1 = 1; |
| 610 | IkReal x114=cj2*cj2; |
| 611 | IkReal x115=(cj2*sj2); |
| 612 | IkReal x116=(py*sj0); |
| 613 | IkReal x117=((1.271)*sj2); |
| 614 | IkReal x118=((0.175)*cj2); |
| 615 | IkReal x119=(cj0*px); |
| 616 | IkReal x120=((0.175)*pz); |
| 617 | IkReal x121=((1.0)*pz); |
| 618 | CheckValue<IkReal> x122=IKPowWithIntegerCheck(IKsign(((0.191625)+(((-1.095)*x116))+(((-1.095)*x119))+(((-1.0)*x118*x119))+(((-1.0)*sj2*x120))+(((-1.271)*cj2*pz))+(((0.030625)*cj2))+(((-1.0)*x116*x118))+(((-0.222425)*sj2))+((x116*x117))+((x117*x119)))),-1); |
| 619 | if(!x122.valid){ |
| 620 | continue; |
| 621 | } |
| 622 | CheckValue<IkReal> x123 = IKatan2WithCheck(IkReal(((-2.814466)+(((0.44485)*x115))+(((2.78349)*sj2))+(((-0.38325)*cj2))+(pz*pz)+(((1.584816)*x114)))),IkReal(((0.222425)+(((-0.191625)*sj2))+(((-1.0)*x119*x121))+(((-1.0)*x116*x121))+(((-1.391745)*cj2))+x120+(((1.584816)*x115))+(((-0.44485)*x114)))),IKFAST_ATAN2_MAGTHRESH); |
| 623 | if(!x123.valid){ |
| 624 | continue; |
| 625 | } |
| 626 | j1array[0]=((-1.5707963267949)+(((1.5707963267949)*(x122.value)))+(x123.value)); |
| 627 | sj1array[0]=IKsin(j1array[0]); |
| 628 | cj1array[0]=IKcos(j1array[0]); |
| 629 | if( j1array[0] > IKPI ) |
| 630 | { |
| 631 | j1array[0]-=IK2PI; |
| 632 | } |
| 633 | else if( j1array[0] < -IKPI ) |
| 634 | { j1array[0]+=IK2PI; |
| 635 | } |
| 636 | j1valid[0] = true; |
| 637 | for(int ij1 = 0; ij1 < 1; ++ij1) |
| 638 | { |
| 639 | if( !j1valid[ij1] ) |
| 640 | { |
| 641 | continue; |
| 642 | } |
| 643 | _ij1[0] = ij1; _ij1[1] = -1; |
| 644 | for(int iij1 = ij1+1; iij1 < 1; ++iij1) |
| 645 | { |
| 646 | if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH ) |
| 647 | { |
| 648 | j1valid[iij1]=false; _ij1[1] = iij1; break; |
| 649 | } |
| 650 | } |
| 651 | j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1]; |
| 652 | { |
| 653 | IkReal evalcond[5]; |
| 654 | IkReal x124=IKcos(j1); |
| 655 | IkReal x125=IKsin(j1); |
| 656 | IkReal x126=py*py; |
| 657 | IkReal x127=r11*r11; |
| 658 | IkReal x128=r21*r21; |
| 659 | IkReal x129=r01*r01; |
| 660 | IkReal x130=px*px; |
| 661 | IkReal x131=pz*pz; |
| 662 | IkReal x132=r10*r10; |
| 663 | IkReal x133=r00*r00; |
| 664 | IkReal x134=r20*r20; |
| 665 | IkReal x135=r02*r02; |
| 666 | IkReal x136=r22*r22; |
| 667 | IkReal x137=r12*r12; |
| 668 | IkReal x138=((1.271)*cj2); |
| 669 | IkReal x139=(cj0*px); |
| 670 | IkReal x140=((0.175)*cj2); |
| 671 | IkReal x141=(py*sj0); |
| 672 | IkReal x142=(sj2*x124); |
| 673 | IkReal x143=((1.0)*x125); |
| 674 | IkReal x144=((1.0)*x136); |
| 675 | IkReal x145=(sj2*x125); |
| 676 | IkReal x146=(x130*x133); |
| 677 | IkReal x147=(x130*x135); |
| 678 | IkReal x148=(x128*x131); |
| 679 | IkReal x149=(x126*x137); |
| 680 | IkReal x150=(x131*x134); |
| 681 | IkReal x151=(x126*x132); |
| 682 | IkReal x152=(x126*x127); |
| 683 | IkReal x153=(x129*x130); |
| 684 | evalcond[0]=(((x124*x141))+(((-1.0)*pz*x143))+(((-0.175)*sj2))+(((-1.0)*x138))+((x124*x139))+(((-0.175)*x124))); |
| 685 | evalcond[1]=((((1.271)*x142))+(((-1.0)*x124*x140))+(((0.175)*x145))+((x125*x138))+pz+(((-1.095)*x124))); |
| 686 | evalcond[2]=((1.095)+(((-1.0)*x139*x143))+x140+(((-1.0)*pz*x124))+(((-1.0)*x141*x143))+(((0.175)*x125))+(((-1.271)*sj2))); |
| 687 | evalcond[3]=((-0.175)+(((1.271)*x145))+(((-1.0)*x125*x140))+(((-0.175)*x142))+(((-1.0)*x124*x138))+x141+x139+(((-1.095)*x125))); |
| 688 | evalcond[4]=((-2.875716)+(((-2.0)*x129*x146))+(((-0.38325)*x125))+(((-0.44485)*cj2*x124))+(((-1.0)*x131*x137*x144))+((x128*x153))+((x128*x152))+(((2.78349)*sj2))+(((-0.38325)*cj2))+(((-1.0)*x144*x147))+(((-1.0)*x144*x149))+(((-2.0)*x134*x148))+(((-1.0)*x137*x147))+x153+x152+x151+x150+x146+x147+x148+x149+(((-0.06125)*x142))+((x129*x148))+((x127*x148))+((x131*x136))+((x129*x152))+(((-2.0)*x127*x151))+((x127*x153))+(((-1.0)*x131*x135*x144))+((x134*x146))+(((-0.06125)*cj2*x125))+((x134*x151))+((x132*x146))+((x133*x150))+((x133*x151))+((x132*x150))+(((-1.0)*x135*x149))+(((0.44485)*x145))); |
| 689 | if( 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 ) |
| 690 | { |
| 691 | continue; |
| 692 | } |
| 693 | } |
| 694 | |
| 695 | rotationfunction0(solutions); |
| 696 | } |
| 697 | } |
| 698 | |
| 699 | } |
| 700 | |
| 701 | } |
| 702 | |
| 703 | } else |
| 704 | { |
| 705 | { |
| 706 | IkReal j1array[1], cj1array[1], sj1array[1]; |
| 707 | bool j1valid[1]={false}; |
| 708 | _nj1 = 1; |
| 709 | IkReal x2707=((0.175)*cj2); |
| 710 | IkReal x2708=(cj0*px); |
| 711 | IkReal x2709=(py*sj0); |
| 712 | IkReal x2710=((1.271)*pz); |
| 713 | IkReal x2711=((0.175)*sj2); |
| 714 | IkReal x2712=((1.271)*x2709); |
| 715 | CheckValue<IkReal> x2713 = IKatan2WithCheck(IkReal(((-0.191625)+(((-0.030625)*cj2))+(((-1.0)*cj2*x2710))+(((-1.271)*sj2*x2708))+((x2707*x2708))+((x2707*x2709))+(((-1.0)*sj2*x2712))+(((-1.0)*pz*x2711))+(((0.222425)*sj2))+(((1.095)*x2708))+(((1.095)*x2709)))),IkReal((((x2708*x2711))+((cj2*x2712))+(((1.095)*pz))+((x2709*x2711))+(((1.271)*cj2*x2708))+((pz*x2707))+(((-1.0)*sj2*x2710))+(((-0.030625)*sj2))+(((-0.222425)*cj2)))),IKFAST_ATAN2_MAGTHRESH); |
| 716 | if(!x2713.valid){ |
| 717 | continue; |
| 718 | } |
| 719 | CheckValue<IkReal> x2714=IKPowWithIntegerCheck(IKsign(((2.845091)+(((0.38325)*cj2))+(((-2.78349)*sj2)))),-1); |
| 720 | if(!x2714.valid){ |
| 721 | continue; |
| 722 | } |
| 723 | j1array[0]=((-1.5707963267949)+(x2713.value)+(((1.5707963267949)*(x2714.value)))); |
| 724 | sj1array[0]=IKsin(j1array[0]); |
| 725 | cj1array[0]=IKcos(j1array[0]); |
| 726 | if( j1array[0] > IKPI ) |
| 727 | { |
| 728 | j1array[0]-=IK2PI; |
| 729 | } |
| 730 | else if( j1array[0] < -IKPI ) |
| 731 | { j1array[0]+=IK2PI; |
| 732 | } |
| 733 | j1valid[0] = true; |
| 734 | for(int ij1 = 0; ij1 < 1; ++ij1) |
| 735 | { |
| 736 | if( !j1valid[ij1] ) |
| 737 | { |
| 738 | continue; |
| 739 | } |
| 740 | _ij1[0] = ij1; _ij1[1] = -1; |
| 741 | for(int iij1 = ij1+1; iij1 < 1; ++iij1) |
| 742 | { |
| 743 | if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH ) |
| 744 | { |
| 745 | j1valid[iij1]=false; _ij1[1] = iij1; break; |
| 746 | } |
| 747 | } |
| 748 | j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1]; |
| 749 | { |
| 750 | IkReal evalcond[5]; |
| 751 | IkReal x2715=IKcos(j1); |
| 752 | IkReal x2716=IKsin(j1); |
| 753 | IkReal x2717=py*py; |
| 754 | IkReal x2718=r11*r11; |
| 755 | IkReal x2719=r21*r21; |
| 756 | IkReal x2720=r01*r01; |
| 757 | IkReal x2721=px*px; |
| 758 | IkReal x2722=pz*pz; |
| 759 | IkReal x2723=r10*r10; |
| 760 | IkReal x2724=r00*r00; |
| 761 | IkReal x2725=r20*r20; |
| 762 | IkReal x2726=r02*r02; |
| 763 | IkReal x2727=r22*r22; |
| 764 | IkReal x2728=r12*r12; |
| 765 | IkReal x2729=((1.271)*cj2); |
| 766 | IkReal x2730=(cj0*px); |
| 767 | IkReal x2731=((0.175)*cj2); |
| 768 | IkReal x2732=(py*sj0); |
| 769 | IkReal x2733=(sj2*x2715); |
| 770 | IkReal x2734=((1.0)*x2716); |
| 771 | IkReal x2735=((1.0)*x2727); |
| 772 | IkReal x2736=(sj2*x2716); |
| 773 | IkReal x2737=(x2721*x2724); |
| 774 | IkReal x2738=(x2721*x2726); |
| 775 | IkReal x2739=(x2719*x2722); |
| 776 | IkReal x2740=(x2717*x2728); |
| 777 | IkReal x2741=(x2722*x2725); |
| 778 | IkReal x2742=(x2717*x2723); |
| 779 | IkReal x2743=(x2717*x2718); |
| 780 | IkReal x2744=(x2720*x2721); |
| 781 | evalcond[0]=((((-1.0)*pz*x2734))+((x2715*x2732))+((x2715*x2730))+(((-0.175)*sj2))+(((-1.0)*x2729))+(((-0.175)*x2715))); |
| 782 | evalcond[1]=((((-1.095)*x2715))+(((-1.0)*x2715*x2731))+(((0.175)*x2736))+(((1.271)*x2733))+pz+((x2716*x2729))); |
| 783 | evalcond[2]=((1.095)+x2731+(((-1.0)*x2730*x2734))+(((0.175)*x2716))+(((-1.0)*pz*x2715))+(((-1.271)*sj2))+(((-1.0)*x2732*x2734))); |
| 784 | evalcond[3]=((-0.175)+x2730+x2732+(((-1.095)*x2716))+(((1.271)*x2736))+(((-1.0)*x2715*x2729))+(((-0.175)*x2733))+(((-1.0)*x2716*x2731))); |
| 785 | evalcond[4]=((-2.875716)+(((-2.0)*x2725*x2739))+x2741+x2740+x2743+x2742+x2744+x2737+x2738+x2739+(((-2.0)*x2720*x2737))+(((-1.0)*x2726*x2740))+(((2.78349)*sj2))+(((-0.44485)*cj2*x2715))+(((-0.38325)*cj2))+(((-1.0)*x2722*x2726*x2735))+((x2725*x2737))+((x2723*x2741))+((x2720*x2739))+(((-0.06125)*cj2*x2716))+(((-0.06125)*x2733))+(((-1.0)*x2735*x2738))+(((-1.0)*x2735*x2740))+((x2718*x2739))+((x2723*x2737))+((x2724*x2741))+((x2724*x2742))+((x2720*x2743))+(((-1.0)*x2728*x2738))+(((-0.38325)*x2716))+((x2722*x2727))+((x2725*x2742))+(((-2.0)*x2718*x2742))+((x2719*x2744))+((x2719*x2743))+(((-1.0)*x2722*x2728*x2735))+(((0.44485)*x2736))+((x2718*x2744))); |
| 786 | if( 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 ) |
| 787 | { |
| 788 | continue; |
| 789 | } |
| 790 | } |
| 791 | |
| 792 | rotationfunction0(solutions); |
| 793 | } |
| 794 | } |
| 795 | |
| 796 | } |
| 797 | |
| 798 | } |
| 799 | |
| 800 | } else |
| 801 | { |
| 802 | { |
| 803 | IkReal j1array[1], cj1array[1], sj1array[1]; |
| 804 | bool j1valid[1]={false}; |
| 805 | _nj1 = 1; |
| 806 | IkReal x2745=cj2*cj2; |
| 807 | IkReal x2746=(cj2*sj2); |
| 808 | IkReal x2747=((0.175)*pz); |
| 809 | IkReal x2748=((1.271)*cj2); |
| 810 | IkReal x2749=(py*sj0); |
| 811 | IkReal x2750=(cj0*px); |
| 812 | IkReal x2751=((0.175)*sj2); |
| 813 | IkReal x2752=((1.0)*pz); |
| 814 | CheckValue<IkReal> x2753 = IKatan2WithCheck(IkReal(((-0.222425)+x2747+(((-1.584816)*x2746))+(((0.191625)*sj2))+(((-1.0)*x2750*x2752))+(((-1.0)*x2749*x2752))+(((1.391745)*cj2))+(((0.44485)*x2745)))),IkReal(((0.030625)+(((-1.0)*pz*x2752))+(((1.584816)*x2745))+(((0.44485)*x2746)))),IKFAST_ATAN2_MAGTHRESH); |
| 815 | if(!x2753.valid){ |
| 816 | continue; |
| 817 | } |
| 818 | CheckValue<IkReal> x2754=IKPowWithIntegerCheck(IKsign((((x2749*x2751))+(((-1.095)*pz))+(((1.271)*pz*sj2))+((x2750*x2751))+(((-1.0)*cj2*x2747))+((x2748*x2749))+((x2748*x2750))+(((-0.030625)*sj2))+(((-0.222425)*cj2)))),-1); |
| 819 | if(!x2754.valid){ |
| 820 | continue; |
| 821 | } |
| 822 | j1array[0]=((-1.5707963267949)+(x2753.value)+(((1.5707963267949)*(x2754.value)))); |
| 823 | sj1array[0]=IKsin(j1array[0]); |
| 824 | cj1array[0]=IKcos(j1array[0]); |
| 825 | if( j1array[0] > IKPI ) |
| 826 | { |
| 827 | j1array[0]-=IK2PI; |
| 828 | } |
| 829 | else if( j1array[0] < -IKPI ) |
| 830 | { j1array[0]+=IK2PI; |
| 831 | } |
| 832 | j1valid[0] = true; |
| 833 | for(int ij1 = 0; ij1 < 1; ++ij1) |
| 834 | { |
| 835 | if( !j1valid[ij1] ) |
| 836 | { |
| 837 | continue; |
| 838 | } |
| 839 | _ij1[0] = ij1; _ij1[1] = -1; |
| 840 | for(int iij1 = ij1+1; iij1 < 1; ++iij1) |
| 841 | { |
| 842 | if( j1valid[iij1] && IKabs(cj1array[ij1]-cj1array[iij1]) < IKFAST_SOLUTION_THRESH && IKabs(sj1array[ij1]-sj1array[iij1]) < IKFAST_SOLUTION_THRESH ) |
| 843 | { |
| 844 | j1valid[iij1]=false; _ij1[1] = iij1; break; |
| 845 | } |
| 846 | } |
| 847 | j1 = j1array[ij1]; cj1 = cj1array[ij1]; sj1 = sj1array[ij1]; |
| 848 | { |
| 849 | IkReal evalcond[5]; |
| 850 | IkReal x2755=IKcos(j1); |
| 851 | IkReal x2756=IKsin(j1); |
| 852 | IkReal x2757=py*py; |
| 853 | IkReal x2758=r11*r11; |
| 854 | IkReal x2759=r21*r21; |
| 855 | IkReal x2760=r01*r01; |
| 856 | IkReal x2761=px*px; |
| 857 | IkReal x2762=pz*pz; |
| 858 | IkReal x2763=r10*r10; |
| 859 | IkReal x2764=r00*r00; |
| 860 | IkReal x2765=r20*r20; |
| 861 | IkReal x2766=r02*r02; |
| 862 | IkReal x2767=r22*r22; |
| 863 | IkReal x2768=r12*r12; |
| 864 | IkReal x2769=((1.271)*cj2); |
| 865 | IkReal x2770=(cj0*px); |
| 866 | IkReal x2771=((0.175)*cj2); |
| 867 | IkReal x2772=(py*sj0); |
| 868 | IkReal x2773=(sj2*x2755); |
| 869 | IkReal x2774=((1.0)*x2756); |
| 870 | IkReal x2775=((1.0)*x2767); |
| 871 | IkReal x2776=(sj2*x2756); |
| 872 | IkReal x2777=(x2761*x2764); |
| 873 | IkReal x2778=(x2761*x2766); |
| 874 | IkReal x2779=(x2759*x2762); |
| 875 | IkReal x2780=(x2757*x2768); |
| 876 | IkReal x2781=(x2762*x2765); |
| 877 | IkReal x2782=(x2757*x2763); |
| 878 | IkReal x2783=(x2757*x2758); |
| 879 | IkReal x2784=(x2760*x2761); |
| 880 | evalcond[0]=((((-0.175)*x2755))+(((-0.175)*sj2))+(((-1.0)*pz*x2774))+((x2755*x2770))+((x2755*x2772))+(((-1.0)*x2769))); |
| 881 | evalcond[1]=(((x2756*x2769))+(((0.175)*x2776))+(((-1.095)*x2755))+pz+(((1.271)*x2773))+(((-1.0)*x2755*x2771))); |
| 882 | evalcond[2]=((1.095)+x2771+(((-1.0)*pz*x2755))+(((-1.0)*x2770*x2774))+(((-1.0)*x2772*x2774))+(((0.175)*x2756))+(((-1.271)*sj2))); |
| 883 | evalcond[3]=((-0.175)+x2770+x2772+(((-1.0)*x2755*x2769))+(((-1.0)*x2756*x2771))+(((-1.095)*x2756))+(((1.271)*x2776))+(((-0.175)*x2773))); |
| 884 | evalcond[4]=((-2.875716)+((x2758*x2779))+x2778+x2779+x2777+x2784+x2781+x2780+x2783+x2782+((x2763*x2777))+(((-1.0)*x2766*x2780))+(((-1.0)*x2762*x2768*x2775))+(((-0.06125)*cj2*x2756))+(((-1.0)*x2762*x2766*x2775))+((x2765*x2782))+(((-2.0)*x2760*x2777))+((x2764*x2782))+((x2764*x2781))+(((2.78349)*sj2))+(((-0.06125)*x2773))+((x2760*x2783))+(((-0.38325)*cj2))+(((-1.0)*x2768*x2778))+((x2762*x2767))+((x2759*x2783))+((x2759*x2784))+(((-0.38325)*x2756))+((x2763*x2781))+((x2758*x2784))+(((-2.0)*x2758*x2782))+(((-1.0)*x2775*x2778))+(((-0.44485)*cj2*x2755))+(((-2.0)*x2765*x2779))+(((0.44485)*x2776))+((x2765*x2777))+((x2760*x2779))+(((-1.0)*x2775*x2780))); |
| 885 | if( 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 ) |
| 886 | { |
| 887 | continue; |
| 888 | } |
| 889 | } |
| 890 | |
| 891 | rotationfunction0(solutions); |
| 892 | } |
| 893 | } |
| 894 | |
| 895 | } |
| 896 | |
| 897 | } |
| 898 | } |
| 899 | } |
| 900 | } |
| 901 | } |
| 902 | |
| 903 | } |
| 904 | |
| 905 | } |
| 906 | } |
| 907 | return solutions.GetNumSolutions()>0; |
| 908 | } |
| 909 | inline void rotationfunction0(IkSolutionListBase<IkReal>& solutions) { |
| 910 | for(int rotationiter = 0; rotationiter < 1; ++rotationiter) { |
| 911 | IkReal x154=((1.0)*cj1); |
| 912 | IkReal x155=((1.0)*sj1); |
| 913 | IkReal x156=((1.0)*sj0); |
| 914 | IkReal x157=((1.0)*sj2); |
| 915 | IkReal x158=(((r10*sj0))+((cj0*r00))); |
| 916 | IkReal x159=(((r11*sj0))+((cj0*r01))); |
| 917 | IkReal x160=(((r12*sj0))+((cj0*r02))); |
| 918 | IkReal x161=((((-1.0)*r20*x155))+((cj1*x158))); |
| 919 | IkReal x162=(((cj1*x159))+(((-1.0)*r21*x155))); |
| 920 | IkReal x163=(((cj1*x160))+(((-1.0)*r22*x155))); |
| 921 | IkReal x164=((((-1.0)*x155*x158))+(((-1.0)*r20*x154))); |
| 922 | IkReal x165=((((-1.0)*x155*x159))+(((-1.0)*r21*x154))); |
| 923 | IkReal x166=((((-1.0)*x155*x160))+(((-1.0)*r22*x154))); |
| 924 | new_r00=((((-1.0)*x157*x161))+((cj2*x164))); |
| 925 | new_r01=((((-1.0)*r00*x156))+((cj0*r10))); |
| 926 | new_r02=(((cj2*x161))+((sj2*x164))); |
| 927 | new_r10=((((-1.0)*x157*x162))+((cj2*x165))); |
| 928 | new_r11=((((-1.0)*r01*x156))+((cj0*r11))); |
| 929 | new_r12=(((cj2*x162))+((sj2*x165))); |
| 930 | new_r20=((((-1.0)*x157*x163))+((cj2*x166))); |
| 931 | new_r21=((((-1.0)*r02*x156))+((cj0*r12))); |
| 932 | new_r22=(((cj2*x163))+((sj2*x166))); |
| 933 | { |
| 934 | IkReal j4array[2], cj4array[2], sj4array[2]; |
| 935 | bool j4valid[2]={false}; |
| 936 | _nj4 = 2; |
| 937 | if( (new_r22) < -1-IKFAST_SINCOS_THRESH || (new_r22) > 1+IKFAST_SINCOS_THRESH ) |
| 938 | continue; |
| 939 | IkReal x167=IKasin(new_r22); |
| 940 | j4array[0]=((1.57083632679488)+(((-1.0)*x167))); |
| 941 | sj4array[0]=IKsin(j4array[0]); |
| 942 | cj4array[0]=IKcos(j4array[0]); |
| 943 | j4array[1]=((4.71242898038467)+x167); |
| 944 | sj4array[1]=IKsin(j4array[1]); |
| 945 | cj4array[1]=IKcos(j4array[1]); |
| 946 | if( j4array[0] > IKPI ) |
| 947 | { |
| 948 | j4array[0]-=IK2PI; |
| 949 | } |
| 950 | else if( j4array[0] < -IKPI ) |
| 951 | { j4array[0]+=IK2PI; |
| 952 | } |
| 953 | j4valid[0] = true; |
| 954 | if( j4array[1] > IKPI ) |
| 955 | { |
| 956 | j4array[1]-=IK2PI; |
| 957 | } |
| 958 | else if( j4array[1] < -IKPI ) |
| 959 | { j4array[1]+=IK2PI; |
| 960 | } |
| 961 | j4valid[1] = true; |
| 962 | for(int ij4 = 0; ij4 < 2; ++ij4) |
| 963 | { |
| 964 | if( !j4valid[ij4] ) |
| 965 | { |
| 966 | continue; |
| 967 | } |
| 968 | _ij4[0] = ij4; _ij4[1] = -1; |
| 969 | for(int iij4 = ij4+1; iij4 < 2; ++iij4) |
| 970 | { |
| 971 | if( j4valid[iij4] && IKabs(cj4array[ij4]-cj4array[iij4]) < IKFAST_SOLUTION_THRESH && IKabs(sj4array[ij4]-sj4array[iij4]) < IKFAST_SOLUTION_THRESH ) |
| 972 | { |
| 973 | j4valid[iij4]=false; _ij4[1] = iij4; break; |
| 974 | } |
| 975 | } |
| 976 | j4 = j4array[ij4]; cj4 = cj4array[ij4]; sj4 = sj4array[ij4]; |
| 977 | |
| 978 | { |
| 979 | IkReal j5eval[3]; |
| 980 | j5eval[0]=((((25000.0)*sj4))+(((-1.0)*cj4))); |
| 981 | j5eval[1]=((IKabs(new_r12))+(IKabs(new_r02))); |
| 982 | j5eval[2]=IKsign(((((-3.9999999968e-5)*cj4))+(((0.9999999992)*sj4)))); |
| 983 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 984 | { |
| 985 | { |
| 986 | IkReal j3eval[3]; |
| 987 | j3eval[0]=((((-25000.0)*sj4))+cj4); |
| 988 | j3eval[1]=IKsign(((((-0.9999999992)*sj4))+(((3.9999999968e-5)*cj4)))); |
| 989 | j3eval[2]=((IKabs(new_r20))+(IKabs(new_r21))); |
| 990 | if( IKabs(j3eval[0]) < 0.0000010000000000 || IKabs(j3eval[1]) < 0.0000010000000000 || IKabs(j3eval[2]) < 0.0000010000000000 ) |
| 991 | { |
| 992 | { |
| 993 | IkReal j5eval[3]; |
| 994 | IkReal x168=((625000000.5)*sj4); |
| 995 | IkReal x169=((25000.00002)*cj4); |
| 996 | IkReal x170=((new_r12*new_r12)+(new_r02*new_r02)); |
| 997 | j5eval[0]=x170; |
| 998 | j5eval[1]=((IKabs((((new_r12*x168))+(((-1.0)*new_r12*x169)))))+(IKabs(((((-1.0)*new_r02*x168))+((new_r02*x169)))))); |
| 999 | j5eval[2]=IKsign(x170); |
| 1000 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 1001 | { |
| 1002 | { |
| 1003 | IkReal evalcond[5]; |
| 1004 | bool bgotonextstatement = true; |
| 1005 | do |
| 1006 | { |
| 1007 | evalcond[0]=((new_r12*new_r12)+(new_r02*new_r02)); |
| 1008 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 1009 | { |
| 1010 | bgotonextstatement=false; |
| 1011 | { |
| 1012 | IkReal j5eval[1]; |
| 1013 | new_r12=0; |
| 1014 | new_r02=0; |
| 1015 | j5eval[0]=IKabs(((((-25000.0)*sj4))+cj4)); |
| 1016 | if( IKabs(j5eval[0]) < 0.0000000100000000 ) |
| 1017 | { |
| 1018 | { |
| 1019 | IkReal j5eval[1]; |
| 1020 | new_r12=0; |
| 1021 | new_r02=0; |
| 1022 | j5eval[0]=IKabs(((((-0.9999999992)*sj4))+(((3.9999999968e-5)*cj4)))); |
| 1023 | if( IKabs(j5eval[0]) < 0.0000000100000000 ) |
| 1024 | { |
| 1025 | continue; // no branches [j3, j5] |
| 1026 | |
| 1027 | } else |
| 1028 | { |
| 1029 | IkReal op[2+1], zeror[2]; |
| 1030 | int numroots; |
| 1031 | IkReal x171=((0.9999999992)*sj4); |
| 1032 | IkReal x172=((3.9999999968e-5)*cj4); |
| 1033 | op[0]=((((-1.0)*x171))+x172); |
| 1034 | op[1]=0; |
| 1035 | op[2]=((((-1.0)*x172))+x171); |
| 1036 | polyroots2(op,zeror,numroots); |
| 1037 | IkReal j5array[2], cj5array[2], sj5array[2], tempj5array[1]; |
| 1038 | int numsolutions = 0; |
| 1039 | for(int ij5 = 0; ij5 < numroots; ++ij5) |
| 1040 | { |
| 1041 | IkReal htj5 = zeror[ij5]; |
| 1042 | tempj5array[0]=((2.0)*(atan(htj5))); |
| 1043 | for(int kj5 = 0; kj5 < 1; ++kj5) |
| 1044 | { |
| 1045 | j5array[numsolutions] = tempj5array[kj5]; |
| 1046 | if( j5array[numsolutions] > IKPI ) |
| 1047 | { |
| 1048 | j5array[numsolutions]-=IK2PI; |
| 1049 | } |
| 1050 | else if( j5array[numsolutions] < -IKPI ) |
| 1051 | { |
| 1052 | j5array[numsolutions]+=IK2PI; |
| 1053 | } |
| 1054 | sj5array[numsolutions] = IKsin(j5array[numsolutions]); |
| 1055 | cj5array[numsolutions] = IKcos(j5array[numsolutions]); |
| 1056 | numsolutions++; |
| 1057 | } |
| 1058 | } |
| 1059 | bool j5valid[2]={true,true}; |
| 1060 | _nj5 = 2; |
| 1061 | for(int ij5 = 0; ij5 < numsolutions; ++ij5) |
| 1062 | { |
| 1063 | if( !j5valid[ij5] ) |
| 1064 | { |
| 1065 | continue; |
| 1066 | } |
| 1067 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 1068 | htj5 = IKtan(j5/2); |
| 1069 | |
| 1070 | _ij5[0] = ij5; _ij5[1] = -1; |
| 1071 | for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5) |
| 1072 | { |
| 1073 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 1074 | { |
| 1075 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 1076 | } |
| 1077 | } |
| 1078 | { |
| 1079 | IkReal j3array[1], cj3array[1], sj3array[1]; |
| 1080 | bool j3valid[1]={false}; |
| 1081 | _nj3 = 1; |
| 1082 | if( IKabs(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj5*new_r11))+((new_r01*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))))+IKsqr((((cj5*new_r11))+((new_r01*sj5))))-1) <= IKFAST_SINCOS_THRESH ) |
| 1083 | continue; |
| 1084 | j3array[0]=IKatan2(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))), (((cj5*new_r11))+((new_r01*sj5)))); |
| 1085 | sj3array[0]=IKsin(j3array[0]); |
| 1086 | cj3array[0]=IKcos(j3array[0]); |
| 1087 | if( j3array[0] > IKPI ) |
| 1088 | { |
| 1089 | j3array[0]-=IK2PI; |
| 1090 | } |
| 1091 | else if( j3array[0] < -IKPI ) |
| 1092 | { j3array[0]+=IK2PI; |
| 1093 | } |
| 1094 | j3valid[0] = true; |
| 1095 | for(int ij3 = 0; ij3 < 1; ++ij3) |
| 1096 | { |
| 1097 | if( !j3valid[ij3] ) |
| 1098 | { |
| 1099 | continue; |
| 1100 | } |
| 1101 | _ij3[0] = ij3; _ij3[1] = -1; |
| 1102 | for(int iij3 = ij3+1; iij3 < 1; ++iij3) |
| 1103 | { |
| 1104 | if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH ) |
| 1105 | { |
| 1106 | j3valid[iij3]=false; _ij3[1] = iij3; break; |
| 1107 | } |
| 1108 | } |
| 1109 | j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3]; |
| 1110 | { |
| 1111 | IkReal evalcond[10]; |
| 1112 | IkReal x173=IKsin(j3); |
| 1113 | IkReal x174=IKcos(j3); |
| 1114 | IkReal x175=(cj5*new_r01); |
| 1115 | IkReal x176=((25000.00002)*sj4); |
| 1116 | IkReal x177=(cj5*new_r00); |
| 1117 | IkReal x178=((1.0)*sj5); |
| 1118 | IkReal x179=((1.0)*x174); |
| 1119 | IkReal x180=(sj5*x173); |
| 1120 | IkReal x181=(cj5*x174); |
| 1121 | IkReal x182=(cj5*x173); |
| 1122 | evalcond[0]=(((cj5*new_r10))+((new_r00*sj5))+x173); |
| 1123 | evalcond[1]=((((-1.0)*x179))+((cj5*new_r11))+((new_r01*sj5))); |
| 1124 | evalcond[2]=(x182+((sj5*x174*x176))+new_r10); |
| 1125 | evalcond[3]=((((-1.0)*x174*x176))+(((-1.0)*new_r10*x178))+x177); |
| 1126 | evalcond[4]=((((-1.0)*new_r11*x178))+x175+(((-1.0)*x173*x176))); |
| 1127 | evalcond[5]=(x180+(((-1.0)*x176*x181))+new_r00); |
| 1128 | evalcond[6]=((((-1.0)*cj5*x179))+((x176*x180))+new_r11); |
| 1129 | evalcond[7]=((((-1.0)*x174*x178))+(((-1.0)*x176*x182))+new_r01); |
| 1130 | evalcond[8]=(((x176*x177))+(((-1.0)*x179))+(((-1.0)*new_r10*sj5*x176))); |
| 1131 | evalcond[9]=((((-1.0)*new_r11*sj5*x176))+(((-1.0)*x173))+((x175*x176))); |
| 1132 | if( 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 ) |
| 1133 | { |
| 1134 | continue; |
| 1135 | } |
| 1136 | } |
| 1137 | |
| 1138 | { |
| 1139 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 1140 | vinfos[0].jointtype = 1; |
| 1141 | vinfos[0].foffset = j0; |
| 1142 | vinfos[0].indices[0] = _ij0[0]; |
| 1143 | vinfos[0].indices[1] = _ij0[1]; |
| 1144 | vinfos[0].maxsolutions = _nj0; |
| 1145 | vinfos[1].jointtype = 1; |
| 1146 | vinfos[1].foffset = j1; |
| 1147 | vinfos[1].indices[0] = _ij1[0]; |
| 1148 | vinfos[1].indices[1] = _ij1[1]; |
| 1149 | vinfos[1].maxsolutions = _nj1; |
| 1150 | vinfos[2].jointtype = 1; |
| 1151 | vinfos[2].foffset = j2; |
| 1152 | vinfos[2].indices[0] = _ij2[0]; |
| 1153 | vinfos[2].indices[1] = _ij2[1]; |
| 1154 | vinfos[2].maxsolutions = _nj2; |
| 1155 | vinfos[3].jointtype = 1; |
| 1156 | vinfos[3].foffset = j3; |
| 1157 | vinfos[3].indices[0] = _ij3[0]; |
| 1158 | vinfos[3].indices[1] = _ij3[1]; |
| 1159 | vinfos[3].maxsolutions = _nj3; |
| 1160 | vinfos[4].jointtype = 1; |
| 1161 | vinfos[4].foffset = j4; |
| 1162 | vinfos[4].indices[0] = _ij4[0]; |
| 1163 | vinfos[4].indices[1] = _ij4[1]; |
| 1164 | vinfos[4].maxsolutions = _nj4; |
| 1165 | vinfos[5].jointtype = 1; |
| 1166 | vinfos[5].foffset = j5; |
| 1167 | vinfos[5].indices[0] = _ij5[0]; |
| 1168 | vinfos[5].indices[1] = _ij5[1]; |
| 1169 | vinfos[5].maxsolutions = _nj5; |
| 1170 | std::vector<int> vfree(0); |
| 1171 | solutions.AddSolution(vinfos,vfree); |
| 1172 | } |
| 1173 | } |
| 1174 | } |
| 1175 | } |
| 1176 | |
| 1177 | } |
| 1178 | |
| 1179 | } |
| 1180 | |
| 1181 | } else |
| 1182 | { |
| 1183 | IkReal op[2+1], zeror[2]; |
| 1184 | int numroots; |
| 1185 | IkReal x183=((25000.0)*sj4); |
| 1186 | op[0]=(cj4+(((-1.0)*x183))); |
| 1187 | op[1]=0; |
| 1188 | op[2]=(x183+(((-1.0)*cj4))); |
| 1189 | polyroots2(op,zeror,numroots); |
| 1190 | IkReal j5array[2], cj5array[2], sj5array[2], tempj5array[1]; |
| 1191 | int numsolutions = 0; |
| 1192 | for(int ij5 = 0; ij5 < numroots; ++ij5) |
| 1193 | { |
| 1194 | IkReal htj5 = zeror[ij5]; |
| 1195 | tempj5array[0]=((2.0)*(atan(htj5))); |
| 1196 | for(int kj5 = 0; kj5 < 1; ++kj5) |
| 1197 | { |
| 1198 | j5array[numsolutions] = tempj5array[kj5]; |
| 1199 | if( j5array[numsolutions] > IKPI ) |
| 1200 | { |
| 1201 | j5array[numsolutions]-=IK2PI; |
| 1202 | } |
| 1203 | else if( j5array[numsolutions] < -IKPI ) |
| 1204 | { |
| 1205 | j5array[numsolutions]+=IK2PI; |
| 1206 | } |
| 1207 | sj5array[numsolutions] = IKsin(j5array[numsolutions]); |
| 1208 | cj5array[numsolutions] = IKcos(j5array[numsolutions]); |
| 1209 | numsolutions++; |
| 1210 | } |
| 1211 | } |
| 1212 | bool j5valid[2]={true,true}; |
| 1213 | _nj5 = 2; |
| 1214 | for(int ij5 = 0; ij5 < numsolutions; ++ij5) |
| 1215 | { |
| 1216 | if( !j5valid[ij5] ) |
| 1217 | { |
| 1218 | continue; |
| 1219 | } |
| 1220 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 1221 | htj5 = IKtan(j5/2); |
| 1222 | |
| 1223 | _ij5[0] = ij5; _ij5[1] = -1; |
| 1224 | for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5) |
| 1225 | { |
| 1226 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 1227 | { |
| 1228 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 1229 | } |
| 1230 | } |
| 1231 | { |
| 1232 | IkReal j3array[1], cj3array[1], sj3array[1]; |
| 1233 | bool j3valid[1]={false}; |
| 1234 | _nj3 = 1; |
| 1235 | if( IKabs(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj5*new_r11))+((new_r01*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))))+IKsqr((((cj5*new_r11))+((new_r01*sj5))))-1) <= IKFAST_SINCOS_THRESH ) |
| 1236 | continue; |
| 1237 | j3array[0]=IKatan2(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))), (((cj5*new_r11))+((new_r01*sj5)))); |
| 1238 | sj3array[0]=IKsin(j3array[0]); |
| 1239 | cj3array[0]=IKcos(j3array[0]); |
| 1240 | if( j3array[0] > IKPI ) |
| 1241 | { |
| 1242 | j3array[0]-=IK2PI; |
| 1243 | } |
| 1244 | else if( j3array[0] < -IKPI ) |
| 1245 | { j3array[0]+=IK2PI; |
| 1246 | } |
| 1247 | j3valid[0] = true; |
| 1248 | for(int ij3 = 0; ij3 < 1; ++ij3) |
| 1249 | { |
| 1250 | if( !j3valid[ij3] ) |
| 1251 | { |
| 1252 | continue; |
| 1253 | } |
| 1254 | _ij3[0] = ij3; _ij3[1] = -1; |
| 1255 | for(int iij3 = ij3+1; iij3 < 1; ++iij3) |
| 1256 | { |
| 1257 | if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH ) |
| 1258 | { |
| 1259 | j3valid[iij3]=false; _ij3[1] = iij3; break; |
| 1260 | } |
| 1261 | } |
| 1262 | j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3]; |
| 1263 | { |
| 1264 | IkReal evalcond[10]; |
| 1265 | IkReal x184=IKsin(j3); |
| 1266 | IkReal x185=IKcos(j3); |
| 1267 | IkReal x186=(cj5*new_r01); |
| 1268 | IkReal x187=((25000.00002)*sj4); |
| 1269 | IkReal x188=(cj5*new_r00); |
| 1270 | IkReal x189=((1.0)*sj5); |
| 1271 | IkReal x190=((1.0)*x185); |
| 1272 | IkReal x191=(sj5*x184); |
| 1273 | IkReal x192=(cj5*x185); |
| 1274 | IkReal x193=(cj5*x184); |
| 1275 | evalcond[0]=(((cj5*new_r10))+((new_r00*sj5))+x184); |
| 1276 | evalcond[1]=(((cj5*new_r11))+((new_r01*sj5))+(((-1.0)*x190))); |
| 1277 | evalcond[2]=(x193+new_r10+((sj5*x185*x187))); |
| 1278 | evalcond[3]=(x188+(((-1.0)*new_r10*x189))+(((-1.0)*x185*x187))); |
| 1279 | evalcond[4]=(x186+(((-1.0)*new_r11*x189))+(((-1.0)*x184*x187))); |
| 1280 | evalcond[5]=(x191+(((-1.0)*x187*x192))+new_r00); |
| 1281 | evalcond[6]=(((x187*x191))+(((-1.0)*cj5*x190))+new_r11); |
| 1282 | evalcond[7]=((((-1.0)*x187*x193))+(((-1.0)*x185*x189))+new_r01); |
| 1283 | evalcond[8]=((((-1.0)*new_r10*sj5*x187))+((x187*x188))+(((-1.0)*x190))); |
| 1284 | evalcond[9]=(((x186*x187))+(((-1.0)*x184))+(((-1.0)*new_r11*sj5*x187))); |
| 1285 | if( 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 ) |
| 1286 | { |
| 1287 | continue; |
| 1288 | } |
| 1289 | } |
| 1290 | |
| 1291 | { |
| 1292 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 1293 | vinfos[0].jointtype = 1; |
| 1294 | vinfos[0].foffset = j0; |
| 1295 | vinfos[0].indices[0] = _ij0[0]; |
| 1296 | vinfos[0].indices[1] = _ij0[1]; |
| 1297 | vinfos[0].maxsolutions = _nj0; |
| 1298 | vinfos[1].jointtype = 1; |
| 1299 | vinfos[1].foffset = j1; |
| 1300 | vinfos[1].indices[0] = _ij1[0]; |
| 1301 | vinfos[1].indices[1] = _ij1[1]; |
| 1302 | vinfos[1].maxsolutions = _nj1; |
| 1303 | vinfos[2].jointtype = 1; |
| 1304 | vinfos[2].foffset = j2; |
| 1305 | vinfos[2].indices[0] = _ij2[0]; |
| 1306 | vinfos[2].indices[1] = _ij2[1]; |
| 1307 | vinfos[2].maxsolutions = _nj2; |
| 1308 | vinfos[3].jointtype = 1; |
| 1309 | vinfos[3].foffset = j3; |
| 1310 | vinfos[3].indices[0] = _ij3[0]; |
| 1311 | vinfos[3].indices[1] = _ij3[1]; |
| 1312 | vinfos[3].maxsolutions = _nj3; |
| 1313 | vinfos[4].jointtype = 1; |
| 1314 | vinfos[4].foffset = j4; |
| 1315 | vinfos[4].indices[0] = _ij4[0]; |
| 1316 | vinfos[4].indices[1] = _ij4[1]; |
| 1317 | vinfos[4].maxsolutions = _nj4; |
| 1318 | vinfos[5].jointtype = 1; |
| 1319 | vinfos[5].foffset = j5; |
| 1320 | vinfos[5].indices[0] = _ij5[0]; |
| 1321 | vinfos[5].indices[1] = _ij5[1]; |
| 1322 | vinfos[5].maxsolutions = _nj5; |
| 1323 | std::vector<int> vfree(0); |
| 1324 | solutions.AddSolution(vinfos,vfree); |
| 1325 | } |
| 1326 | } |
| 1327 | } |
| 1328 | } |
| 1329 | |
| 1330 | } |
| 1331 | |
| 1332 | } |
| 1333 | |
| 1334 | } |
| 1335 | } while(0); |
| 1336 | if( bgotonextstatement ) |
| 1337 | { |
| 1338 | bool bgotonextstatement = true; |
| 1339 | do |
| 1340 | { |
| 1341 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((3.14155265358981)+j4)))), 6.28318530717959))); |
| 1342 | evalcond[1]=new_r02; |
| 1343 | evalcond[2]=new_r12; |
| 1344 | evalcond[3]=new_r20; |
| 1345 | evalcond[4]=new_r21; |
| 1346 | if( 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 ) |
| 1347 | { |
| 1348 | bgotonextstatement=false; |
| 1349 | { |
| 1350 | IkReal j5eval[1]; |
| 1351 | sj4=-4.0e-5; |
| 1352 | cj4=-1.0; |
| 1353 | j4=-3.14155264453703; |
| 1354 | j5eval[0]=((((5.12e-8)*(IKabs(new_r10))))+(IKabs(((((8.0000000064)*new_r11))+(((8.0)*new_r00)))))+(IKabs(((((16.0000000128)*new_r11))+(((16.0000000512)*new_r00)))))+(IKabs(((((-8.0000000064)*new_r10))+(((8.0)*new_r01)))))+(((2.0)*(IKabs(((((16.0000000128)*new_r00))+(((16.0)*new_r11)))))))); |
| 1355 | if( IKabs(j5eval[0]) < 0.0000000100000000 ) |
| 1356 | { |
| 1357 | continue; // no branches [j3, j5] |
| 1358 | |
| 1359 | } else |
| 1360 | { |
| 1361 | IkReal op[4+1], zeror[4]; |
| 1362 | int numroots; |
| 1363 | IkReal j5evalpoly[1]; |
| 1364 | IkReal x194=((((8.0000000064)*new_r11))+(((8.0)*new_r00))); |
| 1365 | op[0]=x194; |
| 1366 | op[1]=((-2.56e-8)*new_r10); |
| 1367 | op[2]=((((16.0000000128)*new_r11))+(((16.0000000512)*new_r00))); |
| 1368 | op[3]=((2.56e-8)*new_r10); |
| 1369 | op[4]=x194; |
| 1370 | polyroots4(op,zeror,numroots); |
| 1371 | IkReal j5array[4], cj5array[4], sj5array[4], tempj5array[1]; |
| 1372 | int numsolutions = 0; |
| 1373 | for(int ij5 = 0; ij5 < numroots; ++ij5) |
| 1374 | { |
| 1375 | IkReal htj5 = zeror[ij5]; |
| 1376 | tempj5array[0]=((2.0)*(atan(htj5))); |
| 1377 | for(int kj5 = 0; kj5 < 1; ++kj5) |
| 1378 | { |
| 1379 | j5array[numsolutions] = tempj5array[kj5]; |
| 1380 | if( j5array[numsolutions] > IKPI ) |
| 1381 | { |
| 1382 | j5array[numsolutions]-=IK2PI; |
| 1383 | } |
| 1384 | else if( j5array[numsolutions] < -IKPI ) |
| 1385 | { |
| 1386 | j5array[numsolutions]+=IK2PI; |
| 1387 | } |
| 1388 | sj5array[numsolutions] = IKsin(j5array[numsolutions]); |
| 1389 | cj5array[numsolutions] = IKcos(j5array[numsolutions]); |
| 1390 | numsolutions++; |
| 1391 | } |
| 1392 | } |
| 1393 | bool j5valid[4]={true,true,true,true}; |
| 1394 | _nj5 = 4; |
| 1395 | for(int ij5 = 0; ij5 < numsolutions; ++ij5) |
| 1396 | { |
| 1397 | if( !j5valid[ij5] ) |
| 1398 | { |
| 1399 | continue; |
| 1400 | } |
| 1401 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 1402 | htj5 = IKtan(j5/2); |
| 1403 | |
| 1404 | IkReal x195=((8.0000000064)*new_r10); |
| 1405 | IkReal x196=((8.0)*new_r01); |
| 1406 | IkReal x197=((((16.0000000128)*new_r00))+(((16.0)*new_r11))); |
| 1407 | j5evalpoly[0]=((((htj5*htj5*htj5*htj5)*(((((-1.0)*x195))+x196))))+(((-1.0)*x196))+x195+((htj5*x197))+((x197*(htj5*htj5*htj5)))); |
| 1408 | if( IKabs(j5evalpoly[0]) > 0.0000001000000000 ) |
| 1409 | { |
| 1410 | continue; |
| 1411 | } |
| 1412 | _ij5[0] = ij5; _ij5[1] = -1; |
| 1413 | for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5) |
| 1414 | { |
| 1415 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 1416 | { |
| 1417 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 1418 | } |
| 1419 | } |
| 1420 | { |
| 1421 | IkReal j3array[1], cj3array[1], sj3array[1]; |
| 1422 | bool j3valid[1]={false}; |
| 1423 | _nj3 = 1; |
| 1424 | if( IKabs(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj5*new_r11))+((new_r01*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))))+IKsqr((((cj5*new_r11))+((new_r01*sj5))))-1) <= IKFAST_SINCOS_THRESH ) |
| 1425 | continue; |
| 1426 | j3array[0]=IKatan2(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))), (((cj5*new_r11))+((new_r01*sj5)))); |
| 1427 | sj3array[0]=IKsin(j3array[0]); |
| 1428 | cj3array[0]=IKcos(j3array[0]); |
| 1429 | if( j3array[0] > IKPI ) |
| 1430 | { |
| 1431 | j3array[0]-=IK2PI; |
| 1432 | } |
| 1433 | else if( j3array[0] < -IKPI ) |
| 1434 | { j3array[0]+=IK2PI; |
| 1435 | } |
| 1436 | j3valid[0] = true; |
| 1437 | for(int ij3 = 0; ij3 < 1; ++ij3) |
| 1438 | { |
| 1439 | if( !j3valid[ij3] ) |
| 1440 | { |
| 1441 | continue; |
| 1442 | } |
| 1443 | _ij3[0] = ij3; _ij3[1] = -1; |
| 1444 | for(int iij3 = ij3+1; iij3 < 1; ++iij3) |
| 1445 | { |
| 1446 | if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH ) |
| 1447 | { |
| 1448 | j3valid[iij3]=false; _ij3[1] = iij3; break; |
| 1449 | } |
| 1450 | } |
| 1451 | j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3]; |
| 1452 | { |
| 1453 | IkReal evalcond[10]; |
| 1454 | IkReal x198=IKcos(j3); |
| 1455 | IkReal x199=IKsin(j3); |
| 1456 | IkReal x200=((1.0000000008)*sj5); |
| 1457 | IkReal x201=(cj5*new_r01); |
| 1458 | IkReal x202=((1.0)*sj5); |
| 1459 | IkReal x203=(cj5*new_r00); |
| 1460 | IkReal x204=((1.0)*x198); |
| 1461 | IkReal x205=((1.0000000008)*x199); |
| 1462 | IkReal x206=((1.0000000008)*x198); |
| 1463 | evalcond[0]=(((cj5*new_r10))+((new_r00*sj5))+x199); |
| 1464 | evalcond[1]=(((cj5*new_r11))+((new_r01*sj5))+(((-1.0)*x204))); |
| 1465 | evalcond[2]=(x206+x203+(((-1.0)*new_r10*x202))); |
| 1466 | evalcond[3]=(x205+x201+(((-1.0)*new_r11*x202))); |
| 1467 | evalcond[4]=(((cj5*x206))+new_r00+((sj5*x199))); |
| 1468 | evalcond[5]=(((cj5*x199))+(((-1.0)*x198*x200))+new_r10); |
| 1469 | evalcond[6]=(((cj5*x205))+(((-1.0)*x198*x202))+new_r01); |
| 1470 | evalcond[7]=((((-1.0)*cj5*x204))+(((-1.0)*x199*x200))+new_r11); |
| 1471 | evalcond[8]=(((new_r10*x200))+(((-1.0000000008)*x203))+(((-1.0)*x204))); |
| 1472 | evalcond[9]=(((new_r11*x200))+(((-1.0)*x199))+(((-1.0000000008)*x201))); |
| 1473 | if( 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 ) |
| 1474 | { |
| 1475 | continue; |
| 1476 | } |
| 1477 | } |
| 1478 | |
| 1479 | { |
| 1480 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 1481 | vinfos[0].jointtype = 1; |
| 1482 | vinfos[0].foffset = j0; |
| 1483 | vinfos[0].indices[0] = _ij0[0]; |
| 1484 | vinfos[0].indices[1] = _ij0[1]; |
| 1485 | vinfos[0].maxsolutions = _nj0; |
| 1486 | vinfos[1].jointtype = 1; |
| 1487 | vinfos[1].foffset = j1; |
| 1488 | vinfos[1].indices[0] = _ij1[0]; |
| 1489 | vinfos[1].indices[1] = _ij1[1]; |
| 1490 | vinfos[1].maxsolutions = _nj1; |
| 1491 | vinfos[2].jointtype = 1; |
| 1492 | vinfos[2].foffset = j2; |
| 1493 | vinfos[2].indices[0] = _ij2[0]; |
| 1494 | vinfos[2].indices[1] = _ij2[1]; |
| 1495 | vinfos[2].maxsolutions = _nj2; |
| 1496 | vinfos[3].jointtype = 1; |
| 1497 | vinfos[3].foffset = j3; |
| 1498 | vinfos[3].indices[0] = _ij3[0]; |
| 1499 | vinfos[3].indices[1] = _ij3[1]; |
| 1500 | vinfos[3].maxsolutions = _nj3; |
| 1501 | vinfos[4].jointtype = 1; |
| 1502 | vinfos[4].foffset = j4; |
| 1503 | vinfos[4].indices[0] = _ij4[0]; |
| 1504 | vinfos[4].indices[1] = _ij4[1]; |
| 1505 | vinfos[4].maxsolutions = _nj4; |
| 1506 | vinfos[5].jointtype = 1; |
| 1507 | vinfos[5].foffset = j5; |
| 1508 | vinfos[5].indices[0] = _ij5[0]; |
| 1509 | vinfos[5].indices[1] = _ij5[1]; |
| 1510 | vinfos[5].maxsolutions = _nj5; |
| 1511 | std::vector<int> vfree(0); |
| 1512 | solutions.AddSolution(vinfos,vfree); |
| 1513 | } |
| 1514 | } |
| 1515 | } |
| 1516 | } |
| 1517 | |
| 1518 | } |
| 1519 | |
| 1520 | } |
| 1521 | |
| 1522 | } |
| 1523 | } while(0); |
| 1524 | if( bgotonextstatement ) |
| 1525 | { |
| 1526 | bool bgotonextstatement = true; |
| 1527 | do |
| 1528 | { |
| 1529 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.99999999786682e-5)+j4)))), 6.28318530717959))); |
| 1530 | evalcond[1]=new_r02; |
| 1531 | evalcond[2]=new_r12; |
| 1532 | evalcond[3]=new_r20; |
| 1533 | evalcond[4]=new_r21; |
| 1534 | if( 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 ) |
| 1535 | { |
| 1536 | bgotonextstatement=false; |
| 1537 | { |
| 1538 | IkReal j5eval[1]; |
| 1539 | sj4=4.0e-5; |
| 1540 | cj4=1.0; |
| 1541 | j4=4.0e-5; |
| 1542 | j5eval[0]=((((5.12e-8)*(IKabs(new_r10))))+(IKabs(((((8.0000000064)*new_r10))+(((8.0)*new_r01)))))+(((2.0)*(IKabs(((((-16.0000000128)*new_r00))+(((16.0)*new_r11)))))))+(IKabs(((((-8.0000000064)*new_r11))+(((8.0)*new_r00)))))+(IKabs(((((16.0000000512)*new_r00))+(((-16.0000000128)*new_r11)))))); |
| 1543 | if( IKabs(j5eval[0]) < 0.0000000100000000 ) |
| 1544 | { |
| 1545 | continue; // no branches [j3, j5] |
| 1546 | |
| 1547 | } else |
| 1548 | { |
| 1549 | IkReal op[4+1], zeror[4]; |
| 1550 | int numroots; |
| 1551 | IkReal j5evalpoly[1]; |
| 1552 | IkReal x207=((((-8.0000000064)*new_r11))+(((8.0)*new_r00))); |
| 1553 | op[0]=x207; |
| 1554 | op[1]=((-2.56e-8)*new_r10); |
| 1555 | op[2]=((((16.0000000512)*new_r00))+(((-16.0000000128)*new_r11))); |
| 1556 | op[3]=((2.56e-8)*new_r10); |
| 1557 | op[4]=x207; |
| 1558 | polyroots4(op,zeror,numroots); |
| 1559 | IkReal j5array[4], cj5array[4], sj5array[4], tempj5array[1]; |
| 1560 | int numsolutions = 0; |
| 1561 | for(int ij5 = 0; ij5 < numroots; ++ij5) |
| 1562 | { |
| 1563 | IkReal htj5 = zeror[ij5]; |
| 1564 | tempj5array[0]=((2.0)*(atan(htj5))); |
| 1565 | for(int kj5 = 0; kj5 < 1; ++kj5) |
| 1566 | { |
| 1567 | j5array[numsolutions] = tempj5array[kj5]; |
| 1568 | if( j5array[numsolutions] > IKPI ) |
| 1569 | { |
| 1570 | j5array[numsolutions]-=IK2PI; |
| 1571 | } |
| 1572 | else if( j5array[numsolutions] < -IKPI ) |
| 1573 | { |
| 1574 | j5array[numsolutions]+=IK2PI; |
| 1575 | } |
| 1576 | sj5array[numsolutions] = IKsin(j5array[numsolutions]); |
| 1577 | cj5array[numsolutions] = IKcos(j5array[numsolutions]); |
| 1578 | numsolutions++; |
| 1579 | } |
| 1580 | } |
| 1581 | bool j5valid[4]={true,true,true,true}; |
| 1582 | _nj5 = 4; |
| 1583 | for(int ij5 = 0; ij5 < numsolutions; ++ij5) |
| 1584 | { |
| 1585 | if( !j5valid[ij5] ) |
| 1586 | { |
| 1587 | continue; |
| 1588 | } |
| 1589 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 1590 | htj5 = IKtan(j5/2); |
| 1591 | |
| 1592 | IkReal x208=((((-16.0000000128)*new_r00))+(((16.0)*new_r11))); |
| 1593 | IkReal x209=((((8.0000000064)*new_r10))+(((8.0)*new_r01))); |
| 1594 | j5evalpoly[0]=(((x208*(htj5*htj5*htj5)))+((htj5*x208))+(((-1.0)*x209))+((x209*(htj5*htj5*htj5*htj5)))); |
| 1595 | if( IKabs(j5evalpoly[0]) > 0.0000001000000000 ) |
| 1596 | { |
| 1597 | continue; |
| 1598 | } |
| 1599 | _ij5[0] = ij5; _ij5[1] = -1; |
| 1600 | for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5) |
| 1601 | { |
| 1602 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 1603 | { |
| 1604 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 1605 | } |
| 1606 | } |
| 1607 | { |
| 1608 | IkReal j3array[1], cj3array[1], sj3array[1]; |
| 1609 | bool j3valid[1]={false}; |
| 1610 | _nj3 = 1; |
| 1611 | if( IKabs(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj5*new_r11))+((new_r01*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))))+IKsqr((((cj5*new_r11))+((new_r01*sj5))))-1) <= IKFAST_SINCOS_THRESH ) |
| 1612 | continue; |
| 1613 | j3array[0]=IKatan2(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))), (((cj5*new_r11))+((new_r01*sj5)))); |
| 1614 | sj3array[0]=IKsin(j3array[0]); |
| 1615 | cj3array[0]=IKcos(j3array[0]); |
| 1616 | if( j3array[0] > IKPI ) |
| 1617 | { |
| 1618 | j3array[0]-=IK2PI; |
| 1619 | } |
| 1620 | else if( j3array[0] < -IKPI ) |
| 1621 | { j3array[0]+=IK2PI; |
| 1622 | } |
| 1623 | j3valid[0] = true; |
| 1624 | for(int ij3 = 0; ij3 < 1; ++ij3) |
| 1625 | { |
| 1626 | if( !j3valid[ij3] ) |
| 1627 | { |
| 1628 | continue; |
| 1629 | } |
| 1630 | _ij3[0] = ij3; _ij3[1] = -1; |
| 1631 | for(int iij3 = ij3+1; iij3 < 1; ++iij3) |
| 1632 | { |
| 1633 | if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH ) |
| 1634 | { |
| 1635 | j3valid[iij3]=false; _ij3[1] = iij3; break; |
| 1636 | } |
| 1637 | } |
| 1638 | j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3]; |
| 1639 | { |
| 1640 | IkReal evalcond[10]; |
| 1641 | IkReal x210=IKcos(j3); |
| 1642 | IkReal x211=IKsin(j3); |
| 1643 | IkReal x212=((1.0000000008)*sj5); |
| 1644 | IkReal x213=(cj5*new_r01); |
| 1645 | IkReal x214=((1.0)*sj5); |
| 1646 | IkReal x215=(cj5*new_r00); |
| 1647 | IkReal x216=((1.0)*x210); |
| 1648 | IkReal x217=((1.0000000008)*x211); |
| 1649 | IkReal x218=((1.0000000008)*x210); |
| 1650 | evalcond[0]=(((cj5*new_r10))+((new_r00*sj5))+x211); |
| 1651 | evalcond[1]=(((cj5*new_r11))+((new_r01*sj5))+(((-1.0)*x216))); |
| 1652 | evalcond[2]=((((-1.0)*new_r10*x214))+x215+(((-1.0)*x218))); |
| 1653 | evalcond[3]=((((-1.0)*new_r11*x214))+x213+(((-1.0)*x217))); |
| 1654 | evalcond[4]=(((sj5*x211))+(((-1.0)*cj5*x218))+new_r00); |
| 1655 | evalcond[5]=(((x210*x212))+((cj5*x211))+new_r10); |
| 1656 | evalcond[6]=((((-1.0)*x210*x214))+(((-1.0)*cj5*x217))+new_r01); |
| 1657 | evalcond[7]=(((x211*x212))+(((-1.0)*cj5*x216))+new_r11); |
| 1658 | evalcond[8]=((((1.0000000008)*x215))+(((-1.0)*new_r10*x212))+(((-1.0)*x216))); |
| 1659 | evalcond[9]=((((1.0000000008)*x213))+(((-1.0)*new_r11*x212))+(((-1.0)*x211))); |
| 1660 | if( 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 ) |
| 1661 | { |
| 1662 | continue; |
| 1663 | } |
| 1664 | } |
| 1665 | |
| 1666 | { |
| 1667 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 1668 | vinfos[0].jointtype = 1; |
| 1669 | vinfos[0].foffset = j0; |
| 1670 | vinfos[0].indices[0] = _ij0[0]; |
| 1671 | vinfos[0].indices[1] = _ij0[1]; |
| 1672 | vinfos[0].maxsolutions = _nj0; |
| 1673 | vinfos[1].jointtype = 1; |
| 1674 | vinfos[1].foffset = j1; |
| 1675 | vinfos[1].indices[0] = _ij1[0]; |
| 1676 | vinfos[1].indices[1] = _ij1[1]; |
| 1677 | vinfos[1].maxsolutions = _nj1; |
| 1678 | vinfos[2].jointtype = 1; |
| 1679 | vinfos[2].foffset = j2; |
| 1680 | vinfos[2].indices[0] = _ij2[0]; |
| 1681 | vinfos[2].indices[1] = _ij2[1]; |
| 1682 | vinfos[2].maxsolutions = _nj2; |
| 1683 | vinfos[3].jointtype = 1; |
| 1684 | vinfos[3].foffset = j3; |
| 1685 | vinfos[3].indices[0] = _ij3[0]; |
| 1686 | vinfos[3].indices[1] = _ij3[1]; |
| 1687 | vinfos[3].maxsolutions = _nj3; |
| 1688 | vinfos[4].jointtype = 1; |
| 1689 | vinfos[4].foffset = j4; |
| 1690 | vinfos[4].indices[0] = _ij4[0]; |
| 1691 | vinfos[4].indices[1] = _ij4[1]; |
| 1692 | vinfos[4].maxsolutions = _nj4; |
| 1693 | vinfos[5].jointtype = 1; |
| 1694 | vinfos[5].foffset = j5; |
| 1695 | vinfos[5].indices[0] = _ij5[0]; |
| 1696 | vinfos[5].indices[1] = _ij5[1]; |
| 1697 | vinfos[5].maxsolutions = _nj5; |
| 1698 | std::vector<int> vfree(0); |
| 1699 | solutions.AddSolution(vinfos,vfree); |
| 1700 | } |
| 1701 | } |
| 1702 | } |
| 1703 | } |
| 1704 | |
| 1705 | } |
| 1706 | |
| 1707 | } |
| 1708 | |
| 1709 | } |
| 1710 | } while(0); |
| 1711 | if( bgotonextstatement ) |
| 1712 | { |
| 1713 | bool bgotonextstatement = true; |
| 1714 | do |
| 1715 | { |
| 1716 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.99999999786667e-5)+j4)))), 6.28318530717959))); |
| 1717 | evalcond[1]=new_r02; |
| 1718 | evalcond[2]=new_r12; |
| 1719 | evalcond[3]=new_r20; |
| 1720 | evalcond[4]=new_r21; |
| 1721 | if( 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 ) |
| 1722 | { |
| 1723 | bgotonextstatement=false; |
| 1724 | { |
| 1725 | IkReal j5eval[1]; |
| 1726 | sj4=4.0e-5; |
| 1727 | cj4=1.0; |
| 1728 | j4=4.0e-5; |
| 1729 | j5eval[0]=((((5.12e-8)*(IKabs(new_r10))))+(IKabs(((((8.0000000064)*new_r10))+(((8.0)*new_r01)))))+(((2.0)*(IKabs(((((-16.0000000128)*new_r00))+(((16.0)*new_r11)))))))+(IKabs(((((-8.0000000064)*new_r11))+(((8.0)*new_r00)))))+(IKabs(((((16.0000000512)*new_r00))+(((-16.0000000128)*new_r11)))))); |
| 1730 | if( IKabs(j5eval[0]) < 0.0000000100000000 ) |
| 1731 | { |
| 1732 | continue; // no branches [j3, j5] |
| 1733 | |
| 1734 | } else |
| 1735 | { |
| 1736 | IkReal op[4+1], zeror[4]; |
| 1737 | int numroots; |
| 1738 | IkReal j5evalpoly[1]; |
| 1739 | IkReal x219=((((-8.0000000064)*new_r11))+(((8.0)*new_r00))); |
| 1740 | op[0]=x219; |
| 1741 | op[1]=((-2.56e-8)*new_r10); |
| 1742 | op[2]=((((16.0000000512)*new_r00))+(((-16.0000000128)*new_r11))); |
| 1743 | op[3]=((2.56e-8)*new_r10); |
| 1744 | op[4]=x219; |
| 1745 | polyroots4(op,zeror,numroots); |
| 1746 | IkReal j5array[4], cj5array[4], sj5array[4], tempj5array[1]; |
| 1747 | int numsolutions = 0; |
| 1748 | for(int ij5 = 0; ij5 < numroots; ++ij5) |
| 1749 | { |
| 1750 | IkReal htj5 = zeror[ij5]; |
| 1751 | tempj5array[0]=((2.0)*(atan(htj5))); |
| 1752 | for(int kj5 = 0; kj5 < 1; ++kj5) |
| 1753 | { |
| 1754 | j5array[numsolutions] = tempj5array[kj5]; |
| 1755 | if( j5array[numsolutions] > IKPI ) |
| 1756 | { |
| 1757 | j5array[numsolutions]-=IK2PI; |
| 1758 | } |
| 1759 | else if( j5array[numsolutions] < -IKPI ) |
| 1760 | { |
| 1761 | j5array[numsolutions]+=IK2PI; |
| 1762 | } |
| 1763 | sj5array[numsolutions] = IKsin(j5array[numsolutions]); |
| 1764 | cj5array[numsolutions] = IKcos(j5array[numsolutions]); |
| 1765 | numsolutions++; |
| 1766 | } |
| 1767 | } |
| 1768 | bool j5valid[4]={true,true,true,true}; |
| 1769 | _nj5 = 4; |
| 1770 | for(int ij5 = 0; ij5 < numsolutions; ++ij5) |
| 1771 | { |
| 1772 | if( !j5valid[ij5] ) |
| 1773 | { |
| 1774 | continue; |
| 1775 | } |
| 1776 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 1777 | htj5 = IKtan(j5/2); |
| 1778 | |
| 1779 | IkReal x220=((((-16.0000000128)*new_r00))+(((16.0)*new_r11))); |
| 1780 | IkReal x221=((((8.0000000064)*new_r10))+(((8.0)*new_r01))); |
| 1781 | j5evalpoly[0]=(((x220*(htj5*htj5*htj5)))+((x221*(htj5*htj5*htj5*htj5)))+(((-1.0)*x221))+((htj5*x220))); |
| 1782 | if( IKabs(j5evalpoly[0]) > 0.0000001000000000 ) |
| 1783 | { |
| 1784 | continue; |
| 1785 | } |
| 1786 | _ij5[0] = ij5; _ij5[1] = -1; |
| 1787 | for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5) |
| 1788 | { |
| 1789 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 1790 | { |
| 1791 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 1792 | } |
| 1793 | } |
| 1794 | { |
| 1795 | IkReal j3array[1], cj3array[1], sj3array[1]; |
| 1796 | bool j3valid[1]={false}; |
| 1797 | _nj3 = 1; |
| 1798 | if( IKabs(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj5*new_r11))+((new_r01*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))))+IKsqr((((cj5*new_r11))+((new_r01*sj5))))-1) <= IKFAST_SINCOS_THRESH ) |
| 1799 | continue; |
| 1800 | j3array[0]=IKatan2(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))), (((cj5*new_r11))+((new_r01*sj5)))); |
| 1801 | sj3array[0]=IKsin(j3array[0]); |
| 1802 | cj3array[0]=IKcos(j3array[0]); |
| 1803 | if( j3array[0] > IKPI ) |
| 1804 | { |
| 1805 | j3array[0]-=IK2PI; |
| 1806 | } |
| 1807 | else if( j3array[0] < -IKPI ) |
| 1808 | { j3array[0]+=IK2PI; |
| 1809 | } |
| 1810 | j3valid[0] = true; |
| 1811 | for(int ij3 = 0; ij3 < 1; ++ij3) |
| 1812 | { |
| 1813 | if( !j3valid[ij3] ) |
| 1814 | { |
| 1815 | continue; |
| 1816 | } |
| 1817 | _ij3[0] = ij3; _ij3[1] = -1; |
| 1818 | for(int iij3 = ij3+1; iij3 < 1; ++iij3) |
| 1819 | { |
| 1820 | if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH ) |
| 1821 | { |
| 1822 | j3valid[iij3]=false; _ij3[1] = iij3; break; |
| 1823 | } |
| 1824 | } |
| 1825 | j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3]; |
| 1826 | { |
| 1827 | IkReal evalcond[10]; |
| 1828 | IkReal x222=IKcos(j3); |
| 1829 | IkReal x223=IKsin(j3); |
| 1830 | IkReal x224=((1.0000000008)*sj5); |
| 1831 | IkReal x225=(cj5*new_r01); |
| 1832 | IkReal x226=((1.0)*sj5); |
| 1833 | IkReal x227=(cj5*new_r00); |
| 1834 | IkReal x228=((1.0)*x222); |
| 1835 | IkReal x229=((1.0000000008)*x223); |
| 1836 | IkReal x230=((1.0000000008)*x222); |
| 1837 | evalcond[0]=(((cj5*new_r10))+((new_r00*sj5))+x223); |
| 1838 | evalcond[1]=(((cj5*new_r11))+((new_r01*sj5))+(((-1.0)*x228))); |
| 1839 | evalcond[2]=((((-1.0)*new_r10*x226))+(((-1.0)*x230))+x227); |
| 1840 | evalcond[3]=((((-1.0)*new_r11*x226))+x225+(((-1.0)*x229))); |
| 1841 | evalcond[4]=((((-1.0)*cj5*x230))+((sj5*x223))+new_r00); |
| 1842 | evalcond[5]=(((x222*x224))+((cj5*x223))+new_r10); |
| 1843 | evalcond[6]=((((-1.0)*cj5*x229))+(((-1.0)*x222*x226))+new_r01); |
| 1844 | evalcond[7]=((((-1.0)*cj5*x228))+((x223*x224))+new_r11); |
| 1845 | evalcond[8]=((((-1.0)*new_r10*x224))+(((1.0000000008)*x227))+(((-1.0)*x228))); |
| 1846 | evalcond[9]=((((-1.0)*new_r11*x224))+(((1.0000000008)*x225))+(((-1.0)*x223))); |
| 1847 | if( 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 ) |
| 1848 | { |
| 1849 | continue; |
| 1850 | } |
| 1851 | } |
| 1852 | |
| 1853 | { |
| 1854 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 1855 | vinfos[0].jointtype = 1; |
| 1856 | vinfos[0].foffset = j0; |
| 1857 | vinfos[0].indices[0] = _ij0[0]; |
| 1858 | vinfos[0].indices[1] = _ij0[1]; |
| 1859 | vinfos[0].maxsolutions = _nj0; |
| 1860 | vinfos[1].jointtype = 1; |
| 1861 | vinfos[1].foffset = j1; |
| 1862 | vinfos[1].indices[0] = _ij1[0]; |
| 1863 | vinfos[1].indices[1] = _ij1[1]; |
| 1864 | vinfos[1].maxsolutions = _nj1; |
| 1865 | vinfos[2].jointtype = 1; |
| 1866 | vinfos[2].foffset = j2; |
| 1867 | vinfos[2].indices[0] = _ij2[0]; |
| 1868 | vinfos[2].indices[1] = _ij2[1]; |
| 1869 | vinfos[2].maxsolutions = _nj2; |
| 1870 | vinfos[3].jointtype = 1; |
| 1871 | vinfos[3].foffset = j3; |
| 1872 | vinfos[3].indices[0] = _ij3[0]; |
| 1873 | vinfos[3].indices[1] = _ij3[1]; |
| 1874 | vinfos[3].maxsolutions = _nj3; |
| 1875 | vinfos[4].jointtype = 1; |
| 1876 | vinfos[4].foffset = j4; |
| 1877 | vinfos[4].indices[0] = _ij4[0]; |
| 1878 | vinfos[4].indices[1] = _ij4[1]; |
| 1879 | vinfos[4].maxsolutions = _nj4; |
| 1880 | vinfos[5].jointtype = 1; |
| 1881 | vinfos[5].foffset = j5; |
| 1882 | vinfos[5].indices[0] = _ij5[0]; |
| 1883 | vinfos[5].indices[1] = _ij5[1]; |
| 1884 | vinfos[5].maxsolutions = _nj5; |
| 1885 | std::vector<int> vfree(0); |
| 1886 | solutions.AddSolution(vinfos,vfree); |
| 1887 | } |
| 1888 | } |
| 1889 | } |
| 1890 | } |
| 1891 | |
| 1892 | } |
| 1893 | |
| 1894 | } |
| 1895 | |
| 1896 | } |
| 1897 | } while(0); |
| 1898 | if( bgotonextstatement ) |
| 1899 | { |
| 1900 | bool bgotonextstatement = true; |
| 1901 | do |
| 1902 | { |
| 1903 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14163265358977)+j4)))), 6.28318530717959))); |
| 1904 | evalcond[1]=new_r02; |
| 1905 | evalcond[2]=new_r12; |
| 1906 | evalcond[3]=new_r20; |
| 1907 | evalcond[4]=new_r21; |
| 1908 | if( 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 ) |
| 1909 | { |
| 1910 | bgotonextstatement=false; |
| 1911 | { |
| 1912 | IkReal j5eval[1]; |
| 1913 | sj4=-4.0e-5; |
| 1914 | cj4=-1.0; |
| 1915 | j4=3.14163265; |
| 1916 | j5eval[0]=((((5.12e-8)*(IKabs(new_r10))))+(IKabs(((((8.0000000064)*new_r11))+(((8.0)*new_r00)))))+(IKabs(((((16.0000000128)*new_r11))+(((16.0000000512)*new_r00)))))+(IKabs(((((-8.0000000064)*new_r10))+(((8.0)*new_r01)))))+(((2.0)*(IKabs(((((16.0000000128)*new_r00))+(((16.0)*new_r11)))))))); |
| 1917 | if( IKabs(j5eval[0]) < 0.0000000100000000 ) |
| 1918 | { |
| 1919 | continue; // no branches [j3, j5] |
| 1920 | |
| 1921 | } else |
| 1922 | { |
| 1923 | IkReal op[4+1], zeror[4]; |
| 1924 | int numroots; |
| 1925 | IkReal j5evalpoly[1]; |
| 1926 | IkReal x231=((((8.0000000064)*new_r11))+(((8.0)*new_r00))); |
| 1927 | op[0]=x231; |
| 1928 | op[1]=((-2.56e-8)*new_r10); |
| 1929 | op[2]=((((16.0000000128)*new_r11))+(((16.0000000512)*new_r00))); |
| 1930 | op[3]=((2.56e-8)*new_r10); |
| 1931 | op[4]=x231; |
| 1932 | polyroots4(op,zeror,numroots); |
| 1933 | IkReal j5array[4], cj5array[4], sj5array[4], tempj5array[1]; |
| 1934 | int numsolutions = 0; |
| 1935 | for(int ij5 = 0; ij5 < numroots; ++ij5) |
| 1936 | { |
| 1937 | IkReal htj5 = zeror[ij5]; |
| 1938 | tempj5array[0]=((2.0)*(atan(htj5))); |
| 1939 | for(int kj5 = 0; kj5 < 1; ++kj5) |
| 1940 | { |
| 1941 | j5array[numsolutions] = tempj5array[kj5]; |
| 1942 | if( j5array[numsolutions] > IKPI ) |
| 1943 | { |
| 1944 | j5array[numsolutions]-=IK2PI; |
| 1945 | } |
| 1946 | else if( j5array[numsolutions] < -IKPI ) |
| 1947 | { |
| 1948 | j5array[numsolutions]+=IK2PI; |
| 1949 | } |
| 1950 | sj5array[numsolutions] = IKsin(j5array[numsolutions]); |
| 1951 | cj5array[numsolutions] = IKcos(j5array[numsolutions]); |
| 1952 | numsolutions++; |
| 1953 | } |
| 1954 | } |
| 1955 | bool j5valid[4]={true,true,true,true}; |
| 1956 | _nj5 = 4; |
| 1957 | for(int ij5 = 0; ij5 < numsolutions; ++ij5) |
| 1958 | { |
| 1959 | if( !j5valid[ij5] ) |
| 1960 | { |
| 1961 | continue; |
| 1962 | } |
| 1963 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 1964 | htj5 = IKtan(j5/2); |
| 1965 | |
| 1966 | IkReal x232=((8.0000000064)*new_r10); |
| 1967 | IkReal x233=((8.0)*new_r01); |
| 1968 | IkReal x234=((((16.0000000128)*new_r00))+(((16.0)*new_r11))); |
| 1969 | j5evalpoly[0]=((((htj5*htj5*htj5*htj5)*(((((-1.0)*x232))+x233))))+((htj5*x234))+(((-1.0)*x233))+x232+((x234*(htj5*htj5*htj5)))); |
| 1970 | if( IKabs(j5evalpoly[0]) > 0.0000001000000000 ) |
| 1971 | { |
| 1972 | continue; |
| 1973 | } |
| 1974 | _ij5[0] = ij5; _ij5[1] = -1; |
| 1975 | for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5) |
| 1976 | { |
| 1977 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 1978 | { |
| 1979 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 1980 | } |
| 1981 | } |
| 1982 | { |
| 1983 | IkReal j3array[1], cj3array[1], sj3array[1]; |
| 1984 | bool j3valid[1]={false}; |
| 1985 | _nj3 = 1; |
| 1986 | if( IKabs(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj5*new_r11))+((new_r01*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))))+IKsqr((((cj5*new_r11))+((new_r01*sj5))))-1) <= IKFAST_SINCOS_THRESH ) |
| 1987 | continue; |
| 1988 | j3array[0]=IKatan2(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))), (((cj5*new_r11))+((new_r01*sj5)))); |
| 1989 | sj3array[0]=IKsin(j3array[0]); |
| 1990 | cj3array[0]=IKcos(j3array[0]); |
| 1991 | if( j3array[0] > IKPI ) |
| 1992 | { |
| 1993 | j3array[0]-=IK2PI; |
| 1994 | } |
| 1995 | else if( j3array[0] < -IKPI ) |
| 1996 | { j3array[0]+=IK2PI; |
| 1997 | } |
| 1998 | j3valid[0] = true; |
| 1999 | for(int ij3 = 0; ij3 < 1; ++ij3) |
| 2000 | { |
| 2001 | if( !j3valid[ij3] ) |
| 2002 | { |
| 2003 | continue; |
| 2004 | } |
| 2005 | _ij3[0] = ij3; _ij3[1] = -1; |
| 2006 | for(int iij3 = ij3+1; iij3 < 1; ++iij3) |
| 2007 | { |
| 2008 | if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH ) |
| 2009 | { |
| 2010 | j3valid[iij3]=false; _ij3[1] = iij3; break; |
| 2011 | } |
| 2012 | } |
| 2013 | j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3]; |
| 2014 | { |
| 2015 | IkReal evalcond[10]; |
| 2016 | IkReal x235=IKcos(j3); |
| 2017 | IkReal x236=IKsin(j3); |
| 2018 | IkReal x237=((1.0000000008)*sj5); |
| 2019 | IkReal x238=(cj5*new_r01); |
| 2020 | IkReal x239=((1.0)*sj5); |
| 2021 | IkReal x240=(cj5*new_r00); |
| 2022 | IkReal x241=((1.0)*x235); |
| 2023 | IkReal x242=((1.0000000008)*x236); |
| 2024 | IkReal x243=((1.0000000008)*x235); |
| 2025 | evalcond[0]=(((cj5*new_r10))+((new_r00*sj5))+x236); |
| 2026 | evalcond[1]=(((cj5*new_r11))+((new_r01*sj5))+(((-1.0)*x241))); |
| 2027 | evalcond[2]=(x243+x240+(((-1.0)*new_r10*x239))); |
| 2028 | evalcond[3]=(x238+x242+(((-1.0)*new_r11*x239))); |
| 2029 | evalcond[4]=(((cj5*x243))+new_r00+((sj5*x236))); |
| 2030 | evalcond[5]=((((-1.0)*x235*x237))+((cj5*x236))+new_r10); |
| 2031 | evalcond[6]=((((-1.0)*x235*x239))+((cj5*x242))+new_r01); |
| 2032 | evalcond[7]=((((-1.0)*cj5*x241))+(((-1.0)*x236*x237))+new_r11); |
| 2033 | evalcond[8]=(((new_r10*x237))+(((-1.0000000008)*x240))+(((-1.0)*x241))); |
| 2034 | evalcond[9]=(((new_r11*x237))+(((-1.0000000008)*x238))+(((-1.0)*x236))); |
| 2035 | if( 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 ) |
| 2036 | { |
| 2037 | continue; |
| 2038 | } |
| 2039 | } |
| 2040 | |
| 2041 | { |
| 2042 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 2043 | vinfos[0].jointtype = 1; |
| 2044 | vinfos[0].foffset = j0; |
| 2045 | vinfos[0].indices[0] = _ij0[0]; |
| 2046 | vinfos[0].indices[1] = _ij0[1]; |
| 2047 | vinfos[0].maxsolutions = _nj0; |
| 2048 | vinfos[1].jointtype = 1; |
| 2049 | vinfos[1].foffset = j1; |
| 2050 | vinfos[1].indices[0] = _ij1[0]; |
| 2051 | vinfos[1].indices[1] = _ij1[1]; |
| 2052 | vinfos[1].maxsolutions = _nj1; |
| 2053 | vinfos[2].jointtype = 1; |
| 2054 | vinfos[2].foffset = j2; |
| 2055 | vinfos[2].indices[0] = _ij2[0]; |
| 2056 | vinfos[2].indices[1] = _ij2[1]; |
| 2057 | vinfos[2].maxsolutions = _nj2; |
| 2058 | vinfos[3].jointtype = 1; |
| 2059 | vinfos[3].foffset = j3; |
| 2060 | vinfos[3].indices[0] = _ij3[0]; |
| 2061 | vinfos[3].indices[1] = _ij3[1]; |
| 2062 | vinfos[3].maxsolutions = _nj3; |
| 2063 | vinfos[4].jointtype = 1; |
| 2064 | vinfos[4].foffset = j4; |
| 2065 | vinfos[4].indices[0] = _ij4[0]; |
| 2066 | vinfos[4].indices[1] = _ij4[1]; |
| 2067 | vinfos[4].maxsolutions = _nj4; |
| 2068 | vinfos[5].jointtype = 1; |
| 2069 | vinfos[5].foffset = j5; |
| 2070 | vinfos[5].indices[0] = _ij5[0]; |
| 2071 | vinfos[5].indices[1] = _ij5[1]; |
| 2072 | vinfos[5].maxsolutions = _nj5; |
| 2073 | std::vector<int> vfree(0); |
| 2074 | solutions.AddSolution(vinfos,vfree); |
| 2075 | } |
| 2076 | } |
| 2077 | } |
| 2078 | } |
| 2079 | |
| 2080 | } |
| 2081 | |
| 2082 | } |
| 2083 | |
| 2084 | } |
| 2085 | } while(0); |
| 2086 | if( bgotonextstatement ) |
| 2087 | { |
| 2088 | bool bgotonextstatement = true; |
| 2089 | do |
| 2090 | { |
| 2091 | evalcond[0]=((IKabs(new_r12))+(IKabs(new_r02))); |
| 2092 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 2093 | { |
| 2094 | bgotonextstatement=false; |
| 2095 | { |
| 2096 | IkReal j3eval[1]; |
| 2097 | new_r02=0; |
| 2098 | new_r12=0; |
| 2099 | new_r20=0; |
| 2100 | new_r21=0; |
| 2101 | j3eval[0]=IKabs(((((-3.9999999968e-5)*cj4))+(((0.9999999992)*sj4)))); |
| 2102 | if( IKabs(j3eval[0]) < 0.0000000100000000 ) |
| 2103 | { |
| 2104 | { |
| 2105 | IkReal j5eval[1]; |
| 2106 | new_r02=0; |
| 2107 | new_r12=0; |
| 2108 | new_r20=0; |
| 2109 | new_r21=0; |
| 2110 | IkReal x244=((625000000.5)*sj4); |
| 2111 | IkReal x245=((25000.00002)*cj4); |
| 2112 | j5eval[0]=((IKabs(((((-1.0)*new_r00*x244))+((new_r00*x245)))))+(IKabs(((((-1.0)*new_r10*x245))+((new_r10*x244)))))); |
| 2113 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 2114 | { |
| 2115 | { |
| 2116 | IkReal j5eval[1]; |
| 2117 | new_r02=0; |
| 2118 | new_r12=0; |
| 2119 | new_r20=0; |
| 2120 | new_r21=0; |
| 2121 | IkReal x246=((625000000.5)*sj4); |
| 2122 | IkReal x247=((25000.00002)*cj4); |
| 2123 | j5eval[0]=((IKabs(((((-1.0)*new_r01*x246))+((new_r01*x247)))))+(IKabs(((((-1.0)*new_r11*x247))+((new_r11*x246)))))); |
| 2124 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 2125 | { |
| 2126 | continue; // no branches [j3, j5] |
| 2127 | |
| 2128 | } else |
| 2129 | { |
| 2130 | { |
| 2131 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 2132 | bool j5valid[2]={false}; |
| 2133 | _nj5 = 2; |
| 2134 | IkReal x248=((3.9999999968e-5)*cj4); |
| 2135 | IkReal x249=((0.9999999992)*sj4); |
| 2136 | CheckValue<IkReal> x251 = IKatan2WithCheck(IkReal(((((-1.0)*new_r01*x249))+((new_r01*x248)))),IkReal(((((-1.0)*new_r11*x248))+((new_r11*x249)))),IKFAST_ATAN2_MAGTHRESH); |
| 2137 | if(!x251.valid){ |
| 2138 | continue; |
| 2139 | } |
| 2140 | IkReal x250=x251.value; |
| 2141 | j5array[0]=((-1.0)*x250); |
| 2142 | sj5array[0]=IKsin(j5array[0]); |
| 2143 | cj5array[0]=IKcos(j5array[0]); |
| 2144 | j5array[1]=((3.14159265358979)+(((-1.0)*x250))); |
| 2145 | sj5array[1]=IKsin(j5array[1]); |
| 2146 | cj5array[1]=IKcos(j5array[1]); |
| 2147 | if( j5array[0] > IKPI ) |
| 2148 | { |
| 2149 | j5array[0]-=IK2PI; |
| 2150 | } |
| 2151 | else if( j5array[0] < -IKPI ) |
| 2152 | { j5array[0]+=IK2PI; |
| 2153 | } |
| 2154 | j5valid[0] = true; |
| 2155 | if( j5array[1] > IKPI ) |
| 2156 | { |
| 2157 | j5array[1]-=IK2PI; |
| 2158 | } |
| 2159 | else if( j5array[1] < -IKPI ) |
| 2160 | { j5array[1]+=IK2PI; |
| 2161 | } |
| 2162 | j5valid[1] = true; |
| 2163 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 2164 | { |
| 2165 | if( !j5valid[ij5] ) |
| 2166 | { |
| 2167 | continue; |
| 2168 | } |
| 2169 | _ij5[0] = ij5; _ij5[1] = -1; |
| 2170 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 2171 | { |
| 2172 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 2173 | { |
| 2174 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 2175 | } |
| 2176 | } |
| 2177 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 2178 | { |
| 2179 | IkReal evalcond[3]; |
| 2180 | IkReal x252=IKcos(j5); |
| 2181 | IkReal x253=IKsin(j5); |
| 2182 | IkReal x254=((0.9999999992)*sj4); |
| 2183 | IkReal x255=((3.9999999968e-5)*cj4); |
| 2184 | IkReal x256=(new_r00*x252); |
| 2185 | IkReal x257=(x253*x255); |
| 2186 | evalcond[0]=((((-1.0)*x252*x255))+((x252*x254))); |
| 2187 | evalcond[1]=(x257+(((-1.0)*x253*x254))); |
| 2188 | evalcond[2]=((((-1.0)*new_r10*x257))+(((-1.0)*x254*x256))+((new_r10*x253*x254))+((x255*x256))); |
| 2189 | if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) |
| 2190 | { |
| 2191 | continue; |
| 2192 | } |
| 2193 | } |
| 2194 | |
| 2195 | { |
| 2196 | IkReal j3array[1], cj3array[1], sj3array[1]; |
| 2197 | bool j3valid[1]={false}; |
| 2198 | _nj3 = 1; |
| 2199 | if( IKabs(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj5*new_r11))+((new_r01*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))))+IKsqr((((cj5*new_r11))+((new_r01*sj5))))-1) <= IKFAST_SINCOS_THRESH ) |
| 2200 | continue; |
| 2201 | j3array[0]=IKatan2(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))), (((cj5*new_r11))+((new_r01*sj5)))); |
| 2202 | sj3array[0]=IKsin(j3array[0]); |
| 2203 | cj3array[0]=IKcos(j3array[0]); |
| 2204 | if( j3array[0] > IKPI ) |
| 2205 | { |
| 2206 | j3array[0]-=IK2PI; |
| 2207 | } |
| 2208 | else if( j3array[0] < -IKPI ) |
| 2209 | { j3array[0]+=IK2PI; |
| 2210 | } |
| 2211 | j3valid[0] = true; |
| 2212 | for(int ij3 = 0; ij3 < 1; ++ij3) |
| 2213 | { |
| 2214 | if( !j3valid[ij3] ) |
| 2215 | { |
| 2216 | continue; |
| 2217 | } |
| 2218 | _ij3[0] = ij3; _ij3[1] = -1; |
| 2219 | for(int iij3 = ij3+1; iij3 < 1; ++iij3) |
| 2220 | { |
| 2221 | if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH ) |
| 2222 | { |
| 2223 | j3valid[iij3]=false; _ij3[1] = iij3; break; |
| 2224 | } |
| 2225 | } |
| 2226 | j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3]; |
| 2227 | { |
| 2228 | IkReal evalcond[12]; |
| 2229 | IkReal x258=IKsin(j3); |
| 2230 | IkReal x259=IKcos(j3); |
| 2231 | IkReal x260=(cj5*new_r01); |
| 2232 | IkReal x261=((25000.00002)*sj4); |
| 2233 | IkReal x262=((3.9999999968e-5)*cj4); |
| 2234 | IkReal x263=((0.9999999992)*sj4); |
| 2235 | IkReal x264=(cj5*new_r00); |
| 2236 | IkReal x265=((1.0)*sj5); |
| 2237 | IkReal x266=((1.0)*x259); |
| 2238 | IkReal x267=(sj5*x258); |
| 2239 | IkReal x268=(cj5*x259); |
| 2240 | IkReal x269=(cj5*x258); |
| 2241 | evalcond[0]=(((cj5*new_r10))+((new_r00*sj5))+x258); |
| 2242 | evalcond[1]=(((cj5*new_r11))+((new_r01*sj5))+(((-1.0)*x266))); |
| 2243 | evalcond[2]=(x269+new_r10+((sj5*x259*x261))); |
| 2244 | evalcond[3]=((((-1.0)*x259*x261))+x264+(((-1.0)*new_r10*x265))); |
| 2245 | evalcond[4]=((((-1.0)*x258*x261))+x260+(((-1.0)*new_r11*x265))); |
| 2246 | evalcond[5]=(x267+(((-1.0)*x261*x268))+new_r00); |
| 2247 | evalcond[6]=((((-1.0)*cj5*x266))+((x261*x267))+new_r11); |
| 2248 | evalcond[7]=((((-1.0)*x259*x265))+(((-1.0)*x261*x269))+new_r01); |
| 2249 | evalcond[8]=(((x259*x262))+(((-1.0)*x259*x263))); |
| 2250 | evalcond[9]=(((x258*x262))+(((-1.0)*x258*x263))); |
| 2251 | evalcond[10]=((((-1.0)*new_r10*sj5*x261))+((x261*x264))+(((-1.0)*x266))); |
| 2252 | evalcond[11]=(((x260*x261))+(((-1.0)*new_r11*sj5*x261))+(((-1.0)*x258))); |
| 2253 | if( 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 ) |
| 2254 | { |
| 2255 | continue; |
| 2256 | } |
| 2257 | } |
| 2258 | |
| 2259 | { |
| 2260 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 2261 | vinfos[0].jointtype = 1; |
| 2262 | vinfos[0].foffset = j0; |
| 2263 | vinfos[0].indices[0] = _ij0[0]; |
| 2264 | vinfos[0].indices[1] = _ij0[1]; |
| 2265 | vinfos[0].maxsolutions = _nj0; |
| 2266 | vinfos[1].jointtype = 1; |
| 2267 | vinfos[1].foffset = j1; |
| 2268 | vinfos[1].indices[0] = _ij1[0]; |
| 2269 | vinfos[1].indices[1] = _ij1[1]; |
| 2270 | vinfos[1].maxsolutions = _nj1; |
| 2271 | vinfos[2].jointtype = 1; |
| 2272 | vinfos[2].foffset = j2; |
| 2273 | vinfos[2].indices[0] = _ij2[0]; |
| 2274 | vinfos[2].indices[1] = _ij2[1]; |
| 2275 | vinfos[2].maxsolutions = _nj2; |
| 2276 | vinfos[3].jointtype = 1; |
| 2277 | vinfos[3].foffset = j3; |
| 2278 | vinfos[3].indices[0] = _ij3[0]; |
| 2279 | vinfos[3].indices[1] = _ij3[1]; |
| 2280 | vinfos[3].maxsolutions = _nj3; |
| 2281 | vinfos[4].jointtype = 1; |
| 2282 | vinfos[4].foffset = j4; |
| 2283 | vinfos[4].indices[0] = _ij4[0]; |
| 2284 | vinfos[4].indices[1] = _ij4[1]; |
| 2285 | vinfos[4].maxsolutions = _nj4; |
| 2286 | vinfos[5].jointtype = 1; |
| 2287 | vinfos[5].foffset = j5; |
| 2288 | vinfos[5].indices[0] = _ij5[0]; |
| 2289 | vinfos[5].indices[1] = _ij5[1]; |
| 2290 | vinfos[5].maxsolutions = _nj5; |
| 2291 | std::vector<int> vfree(0); |
| 2292 | solutions.AddSolution(vinfos,vfree); |
| 2293 | } |
| 2294 | } |
| 2295 | } |
| 2296 | } |
| 2297 | } |
| 2298 | |
| 2299 | } |
| 2300 | |
| 2301 | } |
| 2302 | |
| 2303 | } else |
| 2304 | { |
| 2305 | { |
| 2306 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 2307 | bool j5valid[2]={false}; |
| 2308 | _nj5 = 2; |
| 2309 | IkReal x270=((3.9999999968e-5)*cj4); |
| 2310 | IkReal x271=((0.9999999992)*sj4); |
| 2311 | CheckValue<IkReal> x273 = IKatan2WithCheck(IkReal(((((-1.0)*new_r00*x271))+((new_r00*x270)))),IkReal(((((-1.0)*new_r10*x270))+((new_r10*x271)))),IKFAST_ATAN2_MAGTHRESH); |
| 2312 | if(!x273.valid){ |
| 2313 | continue; |
| 2314 | } |
| 2315 | IkReal x272=x273.value; |
| 2316 | j5array[0]=((-1.0)*x272); |
| 2317 | sj5array[0]=IKsin(j5array[0]); |
| 2318 | cj5array[0]=IKcos(j5array[0]); |
| 2319 | j5array[1]=((3.14159265358979)+(((-1.0)*x272))); |
| 2320 | sj5array[1]=IKsin(j5array[1]); |
| 2321 | cj5array[1]=IKcos(j5array[1]); |
| 2322 | if( j5array[0] > IKPI ) |
| 2323 | { |
| 2324 | j5array[0]-=IK2PI; |
| 2325 | } |
| 2326 | else if( j5array[0] < -IKPI ) |
| 2327 | { j5array[0]+=IK2PI; |
| 2328 | } |
| 2329 | j5valid[0] = true; |
| 2330 | if( j5array[1] > IKPI ) |
| 2331 | { |
| 2332 | j5array[1]-=IK2PI; |
| 2333 | } |
| 2334 | else if( j5array[1] < -IKPI ) |
| 2335 | { j5array[1]+=IK2PI; |
| 2336 | } |
| 2337 | j5valid[1] = true; |
| 2338 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 2339 | { |
| 2340 | if( !j5valid[ij5] ) |
| 2341 | { |
| 2342 | continue; |
| 2343 | } |
| 2344 | _ij5[0] = ij5; _ij5[1] = -1; |
| 2345 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 2346 | { |
| 2347 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 2348 | { |
| 2349 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 2350 | } |
| 2351 | } |
| 2352 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 2353 | { |
| 2354 | IkReal evalcond[3]; |
| 2355 | IkReal x274=IKcos(j5); |
| 2356 | IkReal x275=IKsin(j5); |
| 2357 | IkReal x276=((0.9999999992)*sj4); |
| 2358 | IkReal x277=((3.9999999968e-5)*cj4); |
| 2359 | IkReal x278=(new_r11*x275); |
| 2360 | IkReal x279=(new_r01*x274); |
| 2361 | evalcond[0]=((((-1.0)*x274*x277))+((x274*x276))); |
| 2362 | evalcond[1]=(((x275*x277))+(((-1.0)*x275*x276))); |
| 2363 | evalcond[2]=((((-1.0)*x277*x278))+((x277*x279))+((x276*x278))+(((-1.0)*x276*x279))); |
| 2364 | if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[2]) > IKFAST_EVALCOND_THRESH ) |
| 2365 | { |
| 2366 | continue; |
| 2367 | } |
| 2368 | } |
| 2369 | |
| 2370 | { |
| 2371 | IkReal j3array[1], cj3array[1], sj3array[1]; |
| 2372 | bool j3valid[1]={false}; |
| 2373 | _nj3 = 1; |
| 2374 | if( IKabs(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj5*new_r11))+((new_r01*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))))+IKsqr((((cj5*new_r11))+((new_r01*sj5))))-1) <= IKFAST_SINCOS_THRESH ) |
| 2375 | continue; |
| 2376 | j3array[0]=IKatan2(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))), (((cj5*new_r11))+((new_r01*sj5)))); |
| 2377 | sj3array[0]=IKsin(j3array[0]); |
| 2378 | cj3array[0]=IKcos(j3array[0]); |
| 2379 | if( j3array[0] > IKPI ) |
| 2380 | { |
| 2381 | j3array[0]-=IK2PI; |
| 2382 | } |
| 2383 | else if( j3array[0] < -IKPI ) |
| 2384 | { j3array[0]+=IK2PI; |
| 2385 | } |
| 2386 | j3valid[0] = true; |
| 2387 | for(int ij3 = 0; ij3 < 1; ++ij3) |
| 2388 | { |
| 2389 | if( !j3valid[ij3] ) |
| 2390 | { |
| 2391 | continue; |
| 2392 | } |
| 2393 | _ij3[0] = ij3; _ij3[1] = -1; |
| 2394 | for(int iij3 = ij3+1; iij3 < 1; ++iij3) |
| 2395 | { |
| 2396 | if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH ) |
| 2397 | { |
| 2398 | j3valid[iij3]=false; _ij3[1] = iij3; break; |
| 2399 | } |
| 2400 | } |
| 2401 | j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3]; |
| 2402 | { |
| 2403 | IkReal evalcond[12]; |
| 2404 | IkReal x280=IKsin(j3); |
| 2405 | IkReal x281=IKcos(j3); |
| 2406 | IkReal x282=(cj5*new_r01); |
| 2407 | IkReal x283=((25000.00002)*sj4); |
| 2408 | IkReal x284=((3.9999999968e-5)*cj4); |
| 2409 | IkReal x285=((0.9999999992)*sj4); |
| 2410 | IkReal x286=(cj5*new_r00); |
| 2411 | IkReal x287=((1.0)*sj5); |
| 2412 | IkReal x288=((1.0)*x281); |
| 2413 | IkReal x289=(sj5*x280); |
| 2414 | IkReal x290=(cj5*x281); |
| 2415 | IkReal x291=(cj5*x280); |
| 2416 | evalcond[0]=(((cj5*new_r10))+((new_r00*sj5))+x280); |
| 2417 | evalcond[1]=(((cj5*new_r11))+((new_r01*sj5))+(((-1.0)*x288))); |
| 2418 | evalcond[2]=(x291+((sj5*x281*x283))+new_r10); |
| 2419 | evalcond[3]=((((-1.0)*x281*x283))+x286+(((-1.0)*new_r10*x287))); |
| 2420 | evalcond[4]=((((-1.0)*x280*x283))+x282+(((-1.0)*new_r11*x287))); |
| 2421 | evalcond[5]=(x289+(((-1.0)*x283*x290))+new_r00); |
| 2422 | evalcond[6]=((((-1.0)*cj5*x288))+new_r11+((x283*x289))); |
| 2423 | evalcond[7]=((((-1.0)*x281*x287))+(((-1.0)*x283*x291))+new_r01); |
| 2424 | evalcond[8]=((((-1.0)*x281*x285))+((x281*x284))); |
| 2425 | evalcond[9]=((((-1.0)*x280*x285))+((x280*x284))); |
| 2426 | evalcond[10]=((((-1.0)*new_r10*sj5*x283))+(((-1.0)*x288))+((x283*x286))); |
| 2427 | evalcond[11]=((((-1.0)*x280))+(((-1.0)*new_r11*sj5*x283))+((x282*x283))); |
| 2428 | if( 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 ) |
| 2429 | { |
| 2430 | continue; |
| 2431 | } |
| 2432 | } |
| 2433 | |
| 2434 | { |
| 2435 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 2436 | vinfos[0].jointtype = 1; |
| 2437 | vinfos[0].foffset = j0; |
| 2438 | vinfos[0].indices[0] = _ij0[0]; |
| 2439 | vinfos[0].indices[1] = _ij0[1]; |
| 2440 | vinfos[0].maxsolutions = _nj0; |
| 2441 | vinfos[1].jointtype = 1; |
| 2442 | vinfos[1].foffset = j1; |
| 2443 | vinfos[1].indices[0] = _ij1[0]; |
| 2444 | vinfos[1].indices[1] = _ij1[1]; |
| 2445 | vinfos[1].maxsolutions = _nj1; |
| 2446 | vinfos[2].jointtype = 1; |
| 2447 | vinfos[2].foffset = j2; |
| 2448 | vinfos[2].indices[0] = _ij2[0]; |
| 2449 | vinfos[2].indices[1] = _ij2[1]; |
| 2450 | vinfos[2].maxsolutions = _nj2; |
| 2451 | vinfos[3].jointtype = 1; |
| 2452 | vinfos[3].foffset = j3; |
| 2453 | vinfos[3].indices[0] = _ij3[0]; |
| 2454 | vinfos[3].indices[1] = _ij3[1]; |
| 2455 | vinfos[3].maxsolutions = _nj3; |
| 2456 | vinfos[4].jointtype = 1; |
| 2457 | vinfos[4].foffset = j4; |
| 2458 | vinfos[4].indices[0] = _ij4[0]; |
| 2459 | vinfos[4].indices[1] = _ij4[1]; |
| 2460 | vinfos[4].maxsolutions = _nj4; |
| 2461 | vinfos[5].jointtype = 1; |
| 2462 | vinfos[5].foffset = j5; |
| 2463 | vinfos[5].indices[0] = _ij5[0]; |
| 2464 | vinfos[5].indices[1] = _ij5[1]; |
| 2465 | vinfos[5].maxsolutions = _nj5; |
| 2466 | std::vector<int> vfree(0); |
| 2467 | solutions.AddSolution(vinfos,vfree); |
| 2468 | } |
| 2469 | } |
| 2470 | } |
| 2471 | } |
| 2472 | } |
| 2473 | |
| 2474 | } |
| 2475 | |
| 2476 | } |
| 2477 | |
| 2478 | } else |
| 2479 | { |
| 2480 | IkReal op[2+1], zeror[2]; |
| 2481 | int numroots; |
| 2482 | IkReal x292=((3.9999999968e-5)*cj4); |
| 2483 | IkReal x293=((0.9999999992)*sj4); |
| 2484 | op[0]=((((-1.0)*x292))+x293); |
| 2485 | op[1]=0; |
| 2486 | op[2]=((((-1.0)*x293))+x292); |
| 2487 | polyroots2(op,zeror,numroots); |
| 2488 | IkReal j3array[2], cj3array[2], sj3array[2], tempj3array[1]; |
| 2489 | int numsolutions = 0; |
| 2490 | for(int ij3 = 0; ij3 < numroots; ++ij3) |
| 2491 | { |
| 2492 | IkReal htj3 = zeror[ij3]; |
| 2493 | tempj3array[0]=((2.0)*(atan(htj3))); |
| 2494 | for(int kj3 = 0; kj3 < 1; ++kj3) |
| 2495 | { |
| 2496 | j3array[numsolutions] = tempj3array[kj3]; |
| 2497 | if( j3array[numsolutions] > IKPI ) |
| 2498 | { |
| 2499 | j3array[numsolutions]-=IK2PI; |
| 2500 | } |
| 2501 | else if( j3array[numsolutions] < -IKPI ) |
| 2502 | { |
| 2503 | j3array[numsolutions]+=IK2PI; |
| 2504 | } |
| 2505 | sj3array[numsolutions] = IKsin(j3array[numsolutions]); |
| 2506 | cj3array[numsolutions] = IKcos(j3array[numsolutions]); |
| 2507 | numsolutions++; |
| 2508 | } |
| 2509 | } |
| 2510 | bool j3valid[2]={true,true}; |
| 2511 | _nj3 = 2; |
| 2512 | for(int ij3 = 0; ij3 < numsolutions; ++ij3) |
| 2513 | { |
| 2514 | if( !j3valid[ij3] ) |
| 2515 | { |
| 2516 | continue; |
| 2517 | } |
| 2518 | j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3]; |
| 2519 | htj3 = IKtan(j3/2); |
| 2520 | |
| 2521 | _ij3[0] = ij3; _ij3[1] = -1; |
| 2522 | for(int iij3 = ij3+1; iij3 < numsolutions; ++iij3) |
| 2523 | { |
| 2524 | if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH ) |
| 2525 | { |
| 2526 | j3valid[iij3]=false; _ij3[1] = iij3; break; |
| 2527 | } |
| 2528 | } |
| 2529 | { |
| 2530 | IkReal j5eval[3]; |
| 2531 | new_r02=0; |
| 2532 | new_r12=0; |
| 2533 | new_r20=0; |
| 2534 | new_r21=0; |
| 2535 | IkReal x294=((1.0)*new_r00); |
| 2536 | IkReal x295=((((-1.0)*new_r11*x294))+((new_r01*new_r10))); |
| 2537 | j5eval[0]=x295; |
| 2538 | j5eval[1]=IKsign(x295); |
| 2539 | j5eval[2]=((IKabs((((new_r11*sj3))+((cj3*new_r10)))))+(IKabs(((((-1.0)*new_r01*sj3))+(((-1.0)*cj3*x294)))))); |
| 2540 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 2541 | { |
| 2542 | { |
| 2543 | IkReal j5eval[2]; |
| 2544 | new_r02=0; |
| 2545 | new_r12=0; |
| 2546 | new_r20=0; |
| 2547 | new_r21=0; |
| 2548 | IkReal x296=cj3*cj3; |
| 2549 | IkReal x297=new_r00*new_r00; |
| 2550 | IkReal x298=cj4*cj4; |
| 2551 | IkReal x299=((625000001.0)*x296*x298); |
| 2552 | j5eval[0]=((((-1.0)*x297*x299))+x299+x297+(((-625000001.0)*x296))+(((625000000.0)*x296*x297))); |
| 2553 | j5eval[1]=((((-25000.00002)*cj3*new_r10*sj4))+((new_r00*sj3))); |
| 2554 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 2555 | { |
| 2556 | { |
| 2557 | IkReal j5eval[2]; |
| 2558 | new_r02=0; |
| 2559 | new_r12=0; |
| 2560 | new_r20=0; |
| 2561 | new_r21=0; |
| 2562 | j5eval[0]=(((new_r10*sj3))+(((25000.00002)*cj3*new_r00*sj4))); |
| 2563 | j5eval[1]=new_r00; |
| 2564 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 2565 | { |
| 2566 | { |
| 2567 | IkReal evalcond[3]; |
| 2568 | bool bgotonextstatement = true; |
| 2569 | do |
| 2570 | { |
| 2571 | evalcond[0]=((IKabs(((-3.14159265358979)+(IKfmod(((3.14159265358979)+j4), 6.28318530717959)))))+(IKabs(((-3.14159265358979)+(IKfmod(((3.14159265358979)+j3), 6.28318530717959)))))); |
| 2572 | evalcond[1]=new_r00; |
| 2573 | evalcond[2]=new_r10; |
| 2574 | if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 ) |
| 2575 | { |
| 2576 | bgotonextstatement=false; |
| 2577 | { |
| 2578 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 2579 | bool j5valid[1]={false}; |
| 2580 | _nj5 = 1; |
| 2581 | if( IKabs(new_r01) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r11) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r01)+IKsqr(new_r11)-1) <= IKFAST_SINCOS_THRESH ) |
| 2582 | continue; |
| 2583 | j5array[0]=IKatan2(new_r01, new_r11); |
| 2584 | sj5array[0]=IKsin(j5array[0]); |
| 2585 | cj5array[0]=IKcos(j5array[0]); |
| 2586 | if( j5array[0] > IKPI ) |
| 2587 | { |
| 2588 | j5array[0]-=IK2PI; |
| 2589 | } |
| 2590 | else if( j5array[0] < -IKPI ) |
| 2591 | { j5array[0]+=IK2PI; |
| 2592 | } |
| 2593 | j5valid[0] = true; |
| 2594 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 2595 | { |
| 2596 | if( !j5valid[ij5] ) |
| 2597 | { |
| 2598 | continue; |
| 2599 | } |
| 2600 | _ij5[0] = ij5; _ij5[1] = -1; |
| 2601 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 2602 | { |
| 2603 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 2604 | { |
| 2605 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 2606 | } |
| 2607 | } |
| 2608 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 2609 | { |
| 2610 | IkReal evalcond[7]; |
| 2611 | IkReal x300=IKcos(j5); |
| 2612 | IkReal x301=IKsin(j5); |
| 2613 | IkReal x302=(new_r01*x300); |
| 2614 | IkReal x303=((3.9999999968e-5)*x301); |
| 2615 | IkReal x304=((1.0)*x301); |
| 2616 | evalcond[0]=(new_r01+(((-1.0)*x304))); |
| 2617 | evalcond[1]=((((-1.0)*x300))+new_r11); |
| 2618 | evalcond[2]=((-3.9999999968e-5)*x300); |
| 2619 | evalcond[3]=x303; |
| 2620 | evalcond[4]=((-1.0)+((new_r01*x301))+((new_r11*x300))); |
| 2621 | evalcond[5]=(x302+(((-1.0)*new_r11*x304))); |
| 2622 | evalcond[6]=((((3.9999999968e-5)*x302))+(((-1.0)*new_r11*x303))); |
| 2623 | if( 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 ) |
| 2624 | { |
| 2625 | continue; |
| 2626 | } |
| 2627 | } |
| 2628 | |
| 2629 | { |
| 2630 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 2631 | vinfos[0].jointtype = 1; |
| 2632 | vinfos[0].foffset = j0; |
| 2633 | vinfos[0].indices[0] = _ij0[0]; |
| 2634 | vinfos[0].indices[1] = _ij0[1]; |
| 2635 | vinfos[0].maxsolutions = _nj0; |
| 2636 | vinfos[1].jointtype = 1; |
| 2637 | vinfos[1].foffset = j1; |
| 2638 | vinfos[1].indices[0] = _ij1[0]; |
| 2639 | vinfos[1].indices[1] = _ij1[1]; |
| 2640 | vinfos[1].maxsolutions = _nj1; |
| 2641 | vinfos[2].jointtype = 1; |
| 2642 | vinfos[2].foffset = j2; |
| 2643 | vinfos[2].indices[0] = _ij2[0]; |
| 2644 | vinfos[2].indices[1] = _ij2[1]; |
| 2645 | vinfos[2].maxsolutions = _nj2; |
| 2646 | vinfos[3].jointtype = 1; |
| 2647 | vinfos[3].foffset = j3; |
| 2648 | vinfos[3].indices[0] = _ij3[0]; |
| 2649 | vinfos[3].indices[1] = _ij3[1]; |
| 2650 | vinfos[3].maxsolutions = _nj3; |
| 2651 | vinfos[4].jointtype = 1; |
| 2652 | vinfos[4].foffset = j4; |
| 2653 | vinfos[4].indices[0] = _ij4[0]; |
| 2654 | vinfos[4].indices[1] = _ij4[1]; |
| 2655 | vinfos[4].maxsolutions = _nj4; |
| 2656 | vinfos[5].jointtype = 1; |
| 2657 | vinfos[5].foffset = j5; |
| 2658 | vinfos[5].indices[0] = _ij5[0]; |
| 2659 | vinfos[5].indices[1] = _ij5[1]; |
| 2660 | vinfos[5].maxsolutions = _nj5; |
| 2661 | std::vector<int> vfree(0); |
| 2662 | solutions.AddSolution(vinfos,vfree); |
| 2663 | } |
| 2664 | } |
| 2665 | } |
| 2666 | |
| 2667 | } |
| 2668 | } while(0); |
| 2669 | if( bgotonextstatement ) |
| 2670 | { |
| 2671 | bool bgotonextstatement = true; |
| 2672 | do |
| 2673 | { |
| 2674 | evalcond[0]=((IKabs(((-3.14159265358979)+(IKfmod(j3, 6.28318530717959)))))+(IKabs(((-3.14159265358979)+(IKfmod(((3.14159265358979)+j4), 6.28318530717959)))))); |
| 2675 | evalcond[1]=new_r00; |
| 2676 | evalcond[2]=new_r10; |
| 2677 | if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 ) |
| 2678 | { |
| 2679 | bgotonextstatement=false; |
| 2680 | { |
| 2681 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 2682 | bool j5valid[1]={false}; |
| 2683 | _nj5 = 1; |
| 2684 | if( IKabs(((-1.0)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r01))+IKsqr(((-1.0)*new_r11))-1) <= IKFAST_SINCOS_THRESH ) |
| 2685 | continue; |
| 2686 | j5array[0]=IKatan2(((-1.0)*new_r01), ((-1.0)*new_r11)); |
| 2687 | sj5array[0]=IKsin(j5array[0]); |
| 2688 | cj5array[0]=IKcos(j5array[0]); |
| 2689 | if( j5array[0] > IKPI ) |
| 2690 | { |
| 2691 | j5array[0]-=IK2PI; |
| 2692 | } |
| 2693 | else if( j5array[0] < -IKPI ) |
| 2694 | { j5array[0]+=IK2PI; |
| 2695 | } |
| 2696 | j5valid[0] = true; |
| 2697 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 2698 | { |
| 2699 | if( !j5valid[ij5] ) |
| 2700 | { |
| 2701 | continue; |
| 2702 | } |
| 2703 | _ij5[0] = ij5; _ij5[1] = -1; |
| 2704 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 2705 | { |
| 2706 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 2707 | { |
| 2708 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 2709 | } |
| 2710 | } |
| 2711 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 2712 | { |
| 2713 | IkReal evalcond[7]; |
| 2714 | IkReal x305=IKcos(j5); |
| 2715 | IkReal x306=IKsin(j5); |
| 2716 | IkReal x307=(new_r01*x305); |
| 2717 | IkReal x308=((3.9999999968e-5)*x306); |
| 2718 | evalcond[0]=(x306+new_r01); |
| 2719 | evalcond[1]=(x305+new_r11); |
| 2720 | evalcond[2]=((-3.9999999968e-5)*x305); |
| 2721 | evalcond[3]=x308; |
| 2722 | evalcond[4]=((1.0)+((new_r01*x306))+((new_r11*x305))); |
| 2723 | evalcond[5]=(x307+(((-1.0)*new_r11*x306))); |
| 2724 | evalcond[6]=((((3.9999999968e-5)*x307))+(((-1.0)*new_r11*x308))); |
| 2725 | if( 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 ) |
| 2726 | { |
| 2727 | continue; |
| 2728 | } |
| 2729 | } |
| 2730 | |
| 2731 | { |
| 2732 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 2733 | vinfos[0].jointtype = 1; |
| 2734 | vinfos[0].foffset = j0; |
| 2735 | vinfos[0].indices[0] = _ij0[0]; |
| 2736 | vinfos[0].indices[1] = _ij0[1]; |
| 2737 | vinfos[0].maxsolutions = _nj0; |
| 2738 | vinfos[1].jointtype = 1; |
| 2739 | vinfos[1].foffset = j1; |
| 2740 | vinfos[1].indices[0] = _ij1[0]; |
| 2741 | vinfos[1].indices[1] = _ij1[1]; |
| 2742 | vinfos[1].maxsolutions = _nj1; |
| 2743 | vinfos[2].jointtype = 1; |
| 2744 | vinfos[2].foffset = j2; |
| 2745 | vinfos[2].indices[0] = _ij2[0]; |
| 2746 | vinfos[2].indices[1] = _ij2[1]; |
| 2747 | vinfos[2].maxsolutions = _nj2; |
| 2748 | vinfos[3].jointtype = 1; |
| 2749 | vinfos[3].foffset = j3; |
| 2750 | vinfos[3].indices[0] = _ij3[0]; |
| 2751 | vinfos[3].indices[1] = _ij3[1]; |
| 2752 | vinfos[3].maxsolutions = _nj3; |
| 2753 | vinfos[4].jointtype = 1; |
| 2754 | vinfos[4].foffset = j4; |
| 2755 | vinfos[4].indices[0] = _ij4[0]; |
| 2756 | vinfos[4].indices[1] = _ij4[1]; |
| 2757 | vinfos[4].maxsolutions = _nj4; |
| 2758 | vinfos[5].jointtype = 1; |
| 2759 | vinfos[5].foffset = j5; |
| 2760 | vinfos[5].indices[0] = _ij5[0]; |
| 2761 | vinfos[5].indices[1] = _ij5[1]; |
| 2762 | vinfos[5].maxsolutions = _nj5; |
| 2763 | std::vector<int> vfree(0); |
| 2764 | solutions.AddSolution(vinfos,vfree); |
| 2765 | } |
| 2766 | } |
| 2767 | } |
| 2768 | |
| 2769 | } |
| 2770 | } while(0); |
| 2771 | if( bgotonextstatement ) |
| 2772 | { |
| 2773 | bool bgotonextstatement = true; |
| 2774 | do |
| 2775 | { |
| 2776 | evalcond[0]=((IKabs(((-3.14159265358979)+(IKfmod(j4, 6.28318530717959)))))+(IKabs(((-3.14159265358979)+(IKfmod(((3.14159265358979)+j3), 6.28318530717959)))))); |
| 2777 | evalcond[1]=new_r00; |
| 2778 | evalcond[2]=new_r10; |
| 2779 | if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 ) |
| 2780 | { |
| 2781 | bgotonextstatement=false; |
| 2782 | { |
| 2783 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 2784 | bool j5valid[1]={false}; |
| 2785 | _nj5 = 1; |
| 2786 | if( IKabs(new_r01) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r11) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r01)+IKsqr(new_r11)-1) <= IKFAST_SINCOS_THRESH ) |
| 2787 | continue; |
| 2788 | j5array[0]=IKatan2(new_r01, new_r11); |
| 2789 | sj5array[0]=IKsin(j5array[0]); |
| 2790 | cj5array[0]=IKcos(j5array[0]); |
| 2791 | if( j5array[0] > IKPI ) |
| 2792 | { |
| 2793 | j5array[0]-=IK2PI; |
| 2794 | } |
| 2795 | else if( j5array[0] < -IKPI ) |
| 2796 | { j5array[0]+=IK2PI; |
| 2797 | } |
| 2798 | j5valid[0] = true; |
| 2799 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 2800 | { |
| 2801 | if( !j5valid[ij5] ) |
| 2802 | { |
| 2803 | continue; |
| 2804 | } |
| 2805 | _ij5[0] = ij5; _ij5[1] = -1; |
| 2806 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 2807 | { |
| 2808 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 2809 | { |
| 2810 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 2811 | } |
| 2812 | } |
| 2813 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 2814 | { |
| 2815 | IkReal evalcond[7]; |
| 2816 | IkReal x309=IKcos(j5); |
| 2817 | IkReal x310=IKsin(j5); |
| 2818 | IkReal x311=((3.9999999968e-5)*x309); |
| 2819 | IkReal x312=(new_r11*x310); |
| 2820 | evalcond[0]=((((-1.0)*x310))+new_r01); |
| 2821 | evalcond[1]=((((-1.0)*x309))+new_r11); |
| 2822 | evalcond[2]=x311; |
| 2823 | evalcond[3]=((-3.9999999968e-5)*x310); |
| 2824 | evalcond[4]=((-1.0)+((new_r11*x309))+((new_r01*x310))); |
| 2825 | evalcond[5]=(((new_r01*x309))+(((-1.0)*x312))); |
| 2826 | evalcond[6]=((((3.9999999968e-5)*x312))+(((-1.0)*new_r01*x311))); |
| 2827 | if( 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 ) |
| 2828 | { |
| 2829 | continue; |
| 2830 | } |
| 2831 | } |
| 2832 | |
| 2833 | { |
| 2834 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 2835 | vinfos[0].jointtype = 1; |
| 2836 | vinfos[0].foffset = j0; |
| 2837 | vinfos[0].indices[0] = _ij0[0]; |
| 2838 | vinfos[0].indices[1] = _ij0[1]; |
| 2839 | vinfos[0].maxsolutions = _nj0; |
| 2840 | vinfos[1].jointtype = 1; |
| 2841 | vinfos[1].foffset = j1; |
| 2842 | vinfos[1].indices[0] = _ij1[0]; |
| 2843 | vinfos[1].indices[1] = _ij1[1]; |
| 2844 | vinfos[1].maxsolutions = _nj1; |
| 2845 | vinfos[2].jointtype = 1; |
| 2846 | vinfos[2].foffset = j2; |
| 2847 | vinfos[2].indices[0] = _ij2[0]; |
| 2848 | vinfos[2].indices[1] = _ij2[1]; |
| 2849 | vinfos[2].maxsolutions = _nj2; |
| 2850 | vinfos[3].jointtype = 1; |
| 2851 | vinfos[3].foffset = j3; |
| 2852 | vinfos[3].indices[0] = _ij3[0]; |
| 2853 | vinfos[3].indices[1] = _ij3[1]; |
| 2854 | vinfos[3].maxsolutions = _nj3; |
| 2855 | vinfos[4].jointtype = 1; |
| 2856 | vinfos[4].foffset = j4; |
| 2857 | vinfos[4].indices[0] = _ij4[0]; |
| 2858 | vinfos[4].indices[1] = _ij4[1]; |
| 2859 | vinfos[4].maxsolutions = _nj4; |
| 2860 | vinfos[5].jointtype = 1; |
| 2861 | vinfos[5].foffset = j5; |
| 2862 | vinfos[5].indices[0] = _ij5[0]; |
| 2863 | vinfos[5].indices[1] = _ij5[1]; |
| 2864 | vinfos[5].maxsolutions = _nj5; |
| 2865 | std::vector<int> vfree(0); |
| 2866 | solutions.AddSolution(vinfos,vfree); |
| 2867 | } |
| 2868 | } |
| 2869 | } |
| 2870 | |
| 2871 | } |
| 2872 | } while(0); |
| 2873 | if( bgotonextstatement ) |
| 2874 | { |
| 2875 | bool bgotonextstatement = true; |
| 2876 | do |
| 2877 | { |
| 2878 | evalcond[0]=((IKabs(((-3.14159265358979)+(IKfmod(j3, 6.28318530717959)))))+(IKabs(((-3.14159265358979)+(IKfmod(j4, 6.28318530717959)))))); |
| 2879 | evalcond[1]=new_r00; |
| 2880 | evalcond[2]=new_r10; |
| 2881 | if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 && IKabs(evalcond[2]) < 0.0000050000000000 ) |
| 2882 | { |
| 2883 | bgotonextstatement=false; |
| 2884 | { |
| 2885 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 2886 | bool j5valid[1]={false}; |
| 2887 | _nj5 = 1; |
| 2888 | if( IKabs(((-1.0)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r01))+IKsqr(((-1.0)*new_r11))-1) <= IKFAST_SINCOS_THRESH ) |
| 2889 | continue; |
| 2890 | j5array[0]=IKatan2(((-1.0)*new_r01), ((-1.0)*new_r11)); |
| 2891 | sj5array[0]=IKsin(j5array[0]); |
| 2892 | cj5array[0]=IKcos(j5array[0]); |
| 2893 | if( j5array[0] > IKPI ) |
| 2894 | { |
| 2895 | j5array[0]-=IK2PI; |
| 2896 | } |
| 2897 | else if( j5array[0] < -IKPI ) |
| 2898 | { j5array[0]+=IK2PI; |
| 2899 | } |
| 2900 | j5valid[0] = true; |
| 2901 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 2902 | { |
| 2903 | if( !j5valid[ij5] ) |
| 2904 | { |
| 2905 | continue; |
| 2906 | } |
| 2907 | _ij5[0] = ij5; _ij5[1] = -1; |
| 2908 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 2909 | { |
| 2910 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 2911 | { |
| 2912 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 2913 | } |
| 2914 | } |
| 2915 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 2916 | { |
| 2917 | IkReal evalcond[7]; |
| 2918 | IkReal x313=IKcos(j5); |
| 2919 | IkReal x314=IKsin(j5); |
| 2920 | IkReal x315=((3.9999999968e-5)*x313); |
| 2921 | IkReal x316=(new_r11*x314); |
| 2922 | evalcond[0]=(x314+new_r01); |
| 2923 | evalcond[1]=(x313+new_r11); |
| 2924 | evalcond[2]=x315; |
| 2925 | evalcond[3]=((-3.9999999968e-5)*x314); |
| 2926 | evalcond[4]=((1.0)+((new_r01*x314))+((new_r11*x313))); |
| 2927 | evalcond[5]=(((new_r01*x313))+(((-1.0)*x316))); |
| 2928 | evalcond[6]=((((3.9999999968e-5)*x316))+(((-1.0)*new_r01*x315))); |
| 2929 | if( 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 ) |
| 2930 | { |
| 2931 | continue; |
| 2932 | } |
| 2933 | } |
| 2934 | |
| 2935 | { |
| 2936 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 2937 | vinfos[0].jointtype = 1; |
| 2938 | vinfos[0].foffset = j0; |
| 2939 | vinfos[0].indices[0] = _ij0[0]; |
| 2940 | vinfos[0].indices[1] = _ij0[1]; |
| 2941 | vinfos[0].maxsolutions = _nj0; |
| 2942 | vinfos[1].jointtype = 1; |
| 2943 | vinfos[1].foffset = j1; |
| 2944 | vinfos[1].indices[0] = _ij1[0]; |
| 2945 | vinfos[1].indices[1] = _ij1[1]; |
| 2946 | vinfos[1].maxsolutions = _nj1; |
| 2947 | vinfos[2].jointtype = 1; |
| 2948 | vinfos[2].foffset = j2; |
| 2949 | vinfos[2].indices[0] = _ij2[0]; |
| 2950 | vinfos[2].indices[1] = _ij2[1]; |
| 2951 | vinfos[2].maxsolutions = _nj2; |
| 2952 | vinfos[3].jointtype = 1; |
| 2953 | vinfos[3].foffset = j3; |
| 2954 | vinfos[3].indices[0] = _ij3[0]; |
| 2955 | vinfos[3].indices[1] = _ij3[1]; |
| 2956 | vinfos[3].maxsolutions = _nj3; |
| 2957 | vinfos[4].jointtype = 1; |
| 2958 | vinfos[4].foffset = j4; |
| 2959 | vinfos[4].indices[0] = _ij4[0]; |
| 2960 | vinfos[4].indices[1] = _ij4[1]; |
| 2961 | vinfos[4].maxsolutions = _nj4; |
| 2962 | vinfos[5].jointtype = 1; |
| 2963 | vinfos[5].foffset = j5; |
| 2964 | vinfos[5].indices[0] = _ij5[0]; |
| 2965 | vinfos[5].indices[1] = _ij5[1]; |
| 2966 | vinfos[5].maxsolutions = _nj5; |
| 2967 | std::vector<int> vfree(0); |
| 2968 | solutions.AddSolution(vinfos,vfree); |
| 2969 | } |
| 2970 | } |
| 2971 | } |
| 2972 | |
| 2973 | } |
| 2974 | } while(0); |
| 2975 | if( bgotonextstatement ) |
| 2976 | { |
| 2977 | bool bgotonextstatement = true; |
| 2978 | do |
| 2979 | { |
| 2980 | if( 1 ) |
| 2981 | { |
| 2982 | bgotonextstatement=false; |
| 2983 | continue; // branch miss [j5] |
| 2984 | |
| 2985 | } |
| 2986 | } while(0); |
| 2987 | if( bgotonextstatement ) |
| 2988 | { |
| 2989 | } |
| 2990 | } |
| 2991 | } |
| 2992 | } |
| 2993 | } |
| 2994 | } |
| 2995 | |
| 2996 | } else |
| 2997 | { |
| 2998 | { |
| 2999 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 3000 | bool j5valid[1]={false}; |
| 3001 | _nj5 = 1; |
| 3002 | CheckValue<IkReal> x321=IKPowWithIntegerCheck(new_r00,-1); |
| 3003 | if(!x321.valid){ |
| 3004 | continue; |
| 3005 | } |
| 3006 | IkReal x317=x321.value; |
| 3007 | IkReal x318=cj3*cj3; |
| 3008 | CheckValue<IkReal> x322=IKPowWithIntegerCheck((((new_r10*sj3))+(((25000.00002)*cj3*new_r00*sj4))),-1); |
| 3009 | if(!x322.valid){ |
| 3010 | continue; |
| 3011 | } |
| 3012 | IkReal x319=x322.value; |
| 3013 | IkReal x320=((1.0)*new_r10*x319); |
| 3014 | CheckValue<IkReal> x323=IKPowWithIntegerCheck(x317,-2); |
| 3015 | if(!x323.valid){ |
| 3016 | continue; |
| 3017 | } |
| 3018 | if( IKabs(((((-1.0)*x317*x318*x320))+(((-1.0)*new_r00*x320))+(((-1.0)*sj3*x317))+((new_r10*x317*x319)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x319*(((-1.0)+x318+(x323.value))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*x317*x318*x320))+(((-1.0)*new_r00*x320))+(((-1.0)*sj3*x317))+((new_r10*x317*x319))))+IKsqr((x319*(((-1.0)+x318+(x323.value)))))-1) <= IKFAST_SINCOS_THRESH ) |
| 3019 | continue; |
| 3020 | j5array[0]=IKatan2(((((-1.0)*x317*x318*x320))+(((-1.0)*new_r00*x320))+(((-1.0)*sj3*x317))+((new_r10*x317*x319))), (x319*(((-1.0)+x318+(x323.value))))); |
| 3021 | sj5array[0]=IKsin(j5array[0]); |
| 3022 | cj5array[0]=IKcos(j5array[0]); |
| 3023 | if( j5array[0] > IKPI ) |
| 3024 | { |
| 3025 | j5array[0]-=IK2PI; |
| 3026 | } |
| 3027 | else if( j5array[0] < -IKPI ) |
| 3028 | { j5array[0]+=IK2PI; |
| 3029 | } |
| 3030 | j5valid[0] = true; |
| 3031 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 3032 | { |
| 3033 | if( !j5valid[ij5] ) |
| 3034 | { |
| 3035 | continue; |
| 3036 | } |
| 3037 | _ij5[0] = ij5; _ij5[1] = -1; |
| 3038 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 3039 | { |
| 3040 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 3041 | { |
| 3042 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 3043 | } |
| 3044 | } |
| 3045 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 3046 | { |
| 3047 | IkReal evalcond[14]; |
| 3048 | IkReal x324=IKcos(j5); |
| 3049 | IkReal x325=IKsin(j5); |
| 3050 | IkReal x326=((1.0)*cj3); |
| 3051 | IkReal x327=((25000.00002)*sj4); |
| 3052 | IkReal x328=((3.9999999968e-5)*cj4); |
| 3053 | IkReal x329=((0.9999999992)*sj4); |
| 3054 | IkReal x330=(new_r11*x325); |
| 3055 | IkReal x331=(new_r01*x324); |
| 3056 | IkReal x332=(new_r00*x324); |
| 3057 | IkReal x333=(sj3*x325); |
| 3058 | IkReal x334=(new_r10*x325); |
| 3059 | IkReal x335=(sj3*x324); |
| 3060 | evalcond[0]=(((new_r00*x325))+sj3+((new_r10*x324))); |
| 3061 | evalcond[1]=(((new_r01*x325))+(((-1.0)*x326))+((new_r11*x324))); |
| 3062 | evalcond[2]=(((cj3*x325*x327))+x335+new_r10); |
| 3063 | evalcond[3]=((((-1.0)*cj3*x324*x327))+x333+new_r00); |
| 3064 | evalcond[4]=(((x327*x333))+new_r11+(((-1.0)*x324*x326))); |
| 3065 | evalcond[5]=((((-1.0)*x325*x326))+new_r01+(((-1.0)*x327*x335))); |
| 3066 | evalcond[6]=(((x324*x329))+(((-1.0)*x324*x328))); |
| 3067 | evalcond[7]=(((x325*x328))+(((-1.0)*x325*x329))); |
| 3068 | evalcond[8]=((((-1.0)*cj3*x327))+x332+(((-1.0)*x334))); |
| 3069 | evalcond[9]=(x331+(((-1.0)*x330))+(((-1.0)*sj3*x327))); |
| 3070 | evalcond[10]=((((-1.0)*x326))+((x327*x332))+(((-1.0)*x327*x334))); |
| 3071 | evalcond[11]=((((-1.0)*sj3))+((x327*x331))+(((-1.0)*x327*x330))); |
| 3072 | evalcond[12]=((((-1.0)*x329*x332))+(((-1.0)*x328*x334))+((x329*x334))+((x328*x332))); |
| 3073 | evalcond[13]=((((-1.0)*x329*x331))+(((-1.0)*x328*x330))+((x329*x330))+((x328*x331))); |
| 3074 | if( 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 ) |
| 3075 | { |
| 3076 | continue; |
| 3077 | } |
| 3078 | } |
| 3079 | |
| 3080 | { |
| 3081 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 3082 | vinfos[0].jointtype = 1; |
| 3083 | vinfos[0].foffset = j0; |
| 3084 | vinfos[0].indices[0] = _ij0[0]; |
| 3085 | vinfos[0].indices[1] = _ij0[1]; |
| 3086 | vinfos[0].maxsolutions = _nj0; |
| 3087 | vinfos[1].jointtype = 1; |
| 3088 | vinfos[1].foffset = j1; |
| 3089 | vinfos[1].indices[0] = _ij1[0]; |
| 3090 | vinfos[1].indices[1] = _ij1[1]; |
| 3091 | vinfos[1].maxsolutions = _nj1; |
| 3092 | vinfos[2].jointtype = 1; |
| 3093 | vinfos[2].foffset = j2; |
| 3094 | vinfos[2].indices[0] = _ij2[0]; |
| 3095 | vinfos[2].indices[1] = _ij2[1]; |
| 3096 | vinfos[2].maxsolutions = _nj2; |
| 3097 | vinfos[3].jointtype = 1; |
| 3098 | vinfos[3].foffset = j3; |
| 3099 | vinfos[3].indices[0] = _ij3[0]; |
| 3100 | vinfos[3].indices[1] = _ij3[1]; |
| 3101 | vinfos[3].maxsolutions = _nj3; |
| 3102 | vinfos[4].jointtype = 1; |
| 3103 | vinfos[4].foffset = j4; |
| 3104 | vinfos[4].indices[0] = _ij4[0]; |
| 3105 | vinfos[4].indices[1] = _ij4[1]; |
| 3106 | vinfos[4].maxsolutions = _nj4; |
| 3107 | vinfos[5].jointtype = 1; |
| 3108 | vinfos[5].foffset = j5; |
| 3109 | vinfos[5].indices[0] = _ij5[0]; |
| 3110 | vinfos[5].indices[1] = _ij5[1]; |
| 3111 | vinfos[5].maxsolutions = _nj5; |
| 3112 | std::vector<int> vfree(0); |
| 3113 | solutions.AddSolution(vinfos,vfree); |
| 3114 | } |
| 3115 | } |
| 3116 | } |
| 3117 | |
| 3118 | } |
| 3119 | |
| 3120 | } |
| 3121 | |
| 3122 | } else |
| 3123 | { |
| 3124 | { |
| 3125 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 3126 | bool j5valid[1]={false}; |
| 3127 | _nj5 = 1; |
| 3128 | IkReal x336=new_r10*new_r10; |
| 3129 | IkReal x337=cj3*cj3; |
| 3130 | IkReal x338=new_r00*new_r00; |
| 3131 | IkReal x339=(new_r00*sj3); |
| 3132 | IkReal x340=((1.0)*new_r00); |
| 3133 | IkReal x341=((25000.00002)*cj3*sj4); |
| 3134 | IkReal x342=(new_r10*x341); |
| 3135 | IkReal x343=((625000001.0)*x336*x337); |
| 3136 | CheckValue<IkReal> x344=IKPowWithIntegerCheck((x338+(((-1.0)*x337*x338))+(((-1.0)*x343))+((x343*(cj4*cj4)))),-1); |
| 3137 | if(!x344.valid){ |
| 3138 | continue; |
| 3139 | } |
| 3140 | CheckValue<IkReal> x345=IKPowWithIntegerCheck((x339+(((-1.0)*x342))),-1); |
| 3141 | if(!x345.valid){ |
| 3142 | continue; |
| 3143 | } |
| 3144 | if( IKabs(((x344.value)*((((x342*(new_r10*new_r10)))+(((-1.0)*x339*(sj3*sj3)))+((x336*x339))+(((-1.0)*x342))+((x342*(cj3*cj3))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((x345.value)*(((((-1.0)*new_r10*x340))+((sj3*x341)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x344.value)*((((x342*(new_r10*new_r10)))+(((-1.0)*x339*(sj3*sj3)))+((x336*x339))+(((-1.0)*x342))+((x342*(cj3*cj3)))))))+IKsqr(((x345.value)*(((((-1.0)*new_r10*x340))+((sj3*x341))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 3145 | continue; |
| 3146 | j5array[0]=IKatan2(((x344.value)*((((x342*(new_r10*new_r10)))+(((-1.0)*x339*(sj3*sj3)))+((x336*x339))+(((-1.0)*x342))+((x342*(cj3*cj3)))))), ((x345.value)*(((((-1.0)*new_r10*x340))+((sj3*x341)))))); |
| 3147 | sj5array[0]=IKsin(j5array[0]); |
| 3148 | cj5array[0]=IKcos(j5array[0]); |
| 3149 | if( j5array[0] > IKPI ) |
| 3150 | { |
| 3151 | j5array[0]-=IK2PI; |
| 3152 | } |
| 3153 | else if( j5array[0] < -IKPI ) |
| 3154 | { j5array[0]+=IK2PI; |
| 3155 | } |
| 3156 | j5valid[0] = true; |
| 3157 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 3158 | { |
| 3159 | if( !j5valid[ij5] ) |
| 3160 | { |
| 3161 | continue; |
| 3162 | } |
| 3163 | _ij5[0] = ij5; _ij5[1] = -1; |
| 3164 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 3165 | { |
| 3166 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 3167 | { |
| 3168 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 3169 | } |
| 3170 | } |
| 3171 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 3172 | { |
| 3173 | IkReal evalcond[14]; |
| 3174 | IkReal x346=IKcos(j5); |
| 3175 | IkReal x347=IKsin(j5); |
| 3176 | IkReal x348=((1.0)*cj3); |
| 3177 | IkReal x349=((25000.00002)*sj4); |
| 3178 | IkReal x350=((3.9999999968e-5)*cj4); |
| 3179 | IkReal x351=((0.9999999992)*sj4); |
| 3180 | IkReal x352=(new_r11*x347); |
| 3181 | IkReal x353=(new_r01*x346); |
| 3182 | IkReal x354=(new_r00*x346); |
| 3183 | IkReal x355=(sj3*x347); |
| 3184 | IkReal x356=(new_r10*x347); |
| 3185 | IkReal x357=(sj3*x346); |
| 3186 | evalcond[0]=(sj3+((new_r00*x347))+((new_r10*x346))); |
| 3187 | evalcond[1]=(((new_r11*x346))+((new_r01*x347))+(((-1.0)*x348))); |
| 3188 | evalcond[2]=(x357+new_r10+((cj3*x347*x349))); |
| 3189 | evalcond[3]=((((-1.0)*cj3*x346*x349))+x355+new_r00); |
| 3190 | evalcond[4]=(((x349*x355))+(((-1.0)*x346*x348))+new_r11); |
| 3191 | evalcond[5]=((((-1.0)*x349*x357))+(((-1.0)*x347*x348))+new_r01); |
| 3192 | evalcond[6]=(((x346*x351))+(((-1.0)*x346*x350))); |
| 3193 | evalcond[7]=(((x347*x350))+(((-1.0)*x347*x351))); |
| 3194 | evalcond[8]=((((-1.0)*cj3*x349))+(((-1.0)*x356))+x354); |
| 3195 | evalcond[9]=((((-1.0)*x352))+x353+(((-1.0)*sj3*x349))); |
| 3196 | evalcond[10]=((((-1.0)*x349*x356))+((x349*x354))+(((-1.0)*x348))); |
| 3197 | evalcond[11]=((((-1.0)*sj3))+(((-1.0)*x349*x352))+((x349*x353))); |
| 3198 | evalcond[12]=(((x351*x356))+((x350*x354))+(((-1.0)*x351*x354))+(((-1.0)*x350*x356))); |
| 3199 | evalcond[13]=(((x351*x352))+((x350*x353))+(((-1.0)*x351*x353))+(((-1.0)*x350*x352))); |
| 3200 | if( 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 ) |
| 3201 | { |
| 3202 | continue; |
| 3203 | } |
| 3204 | } |
| 3205 | |
| 3206 | { |
| 3207 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 3208 | vinfos[0].jointtype = 1; |
| 3209 | vinfos[0].foffset = j0; |
| 3210 | vinfos[0].indices[0] = _ij0[0]; |
| 3211 | vinfos[0].indices[1] = _ij0[1]; |
| 3212 | vinfos[0].maxsolutions = _nj0; |
| 3213 | vinfos[1].jointtype = 1; |
| 3214 | vinfos[1].foffset = j1; |
| 3215 | vinfos[1].indices[0] = _ij1[0]; |
| 3216 | vinfos[1].indices[1] = _ij1[1]; |
| 3217 | vinfos[1].maxsolutions = _nj1; |
| 3218 | vinfos[2].jointtype = 1; |
| 3219 | vinfos[2].foffset = j2; |
| 3220 | vinfos[2].indices[0] = _ij2[0]; |
| 3221 | vinfos[2].indices[1] = _ij2[1]; |
| 3222 | vinfos[2].maxsolutions = _nj2; |
| 3223 | vinfos[3].jointtype = 1; |
| 3224 | vinfos[3].foffset = j3; |
| 3225 | vinfos[3].indices[0] = _ij3[0]; |
| 3226 | vinfos[3].indices[1] = _ij3[1]; |
| 3227 | vinfos[3].maxsolutions = _nj3; |
| 3228 | vinfos[4].jointtype = 1; |
| 3229 | vinfos[4].foffset = j4; |
| 3230 | vinfos[4].indices[0] = _ij4[0]; |
| 3231 | vinfos[4].indices[1] = _ij4[1]; |
| 3232 | vinfos[4].maxsolutions = _nj4; |
| 3233 | vinfos[5].jointtype = 1; |
| 3234 | vinfos[5].foffset = j5; |
| 3235 | vinfos[5].indices[0] = _ij5[0]; |
| 3236 | vinfos[5].indices[1] = _ij5[1]; |
| 3237 | vinfos[5].maxsolutions = _nj5; |
| 3238 | std::vector<int> vfree(0); |
| 3239 | solutions.AddSolution(vinfos,vfree); |
| 3240 | } |
| 3241 | } |
| 3242 | } |
| 3243 | |
| 3244 | } |
| 3245 | |
| 3246 | } |
| 3247 | |
| 3248 | } else |
| 3249 | { |
| 3250 | { |
| 3251 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 3252 | bool j5valid[1]={false}; |
| 3253 | _nj5 = 1; |
| 3254 | IkReal x358=((1.0)*new_r00); |
| 3255 | CheckValue<IkReal> x359 = IKatan2WithCheck(IkReal((((new_r11*sj3))+((cj3*new_r10)))),IkReal(((((-1.0)*new_r01*sj3))+(((-1.0)*cj3*x358)))),IKFAST_ATAN2_MAGTHRESH); |
| 3256 | if(!x359.valid){ |
| 3257 | continue; |
| 3258 | } |
| 3259 | CheckValue<IkReal> x360=IKPowWithIntegerCheck(IKsign((((new_r01*new_r10))+(((-1.0)*new_r11*x358)))),-1); |
| 3260 | if(!x360.valid){ |
| 3261 | continue; |
| 3262 | } |
| 3263 | j5array[0]=((-1.5707963267949)+(x359.value)+(((1.5707963267949)*(x360.value)))); |
| 3264 | sj5array[0]=IKsin(j5array[0]); |
| 3265 | cj5array[0]=IKcos(j5array[0]); |
| 3266 | if( j5array[0] > IKPI ) |
| 3267 | { |
| 3268 | j5array[0]-=IK2PI; |
| 3269 | } |
| 3270 | else if( j5array[0] < -IKPI ) |
| 3271 | { j5array[0]+=IK2PI; |
| 3272 | } |
| 3273 | j5valid[0] = true; |
| 3274 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 3275 | { |
| 3276 | if( !j5valid[ij5] ) |
| 3277 | { |
| 3278 | continue; |
| 3279 | } |
| 3280 | _ij5[0] = ij5; _ij5[1] = -1; |
| 3281 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 3282 | { |
| 3283 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 3284 | { |
| 3285 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 3286 | } |
| 3287 | } |
| 3288 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 3289 | { |
| 3290 | IkReal evalcond[14]; |
| 3291 | IkReal x361=IKcos(j5); |
| 3292 | IkReal x362=IKsin(j5); |
| 3293 | IkReal x363=((1.0)*cj3); |
| 3294 | IkReal x364=((25000.00002)*sj4); |
| 3295 | IkReal x365=((3.9999999968e-5)*cj4); |
| 3296 | IkReal x366=((0.9999999992)*sj4); |
| 3297 | IkReal x367=(new_r11*x362); |
| 3298 | IkReal x368=(new_r01*x361); |
| 3299 | IkReal x369=(new_r00*x361); |
| 3300 | IkReal x370=(sj3*x362); |
| 3301 | IkReal x371=(new_r10*x362); |
| 3302 | IkReal x372=(sj3*x361); |
| 3303 | evalcond[0]=(sj3+((new_r00*x362))+((new_r10*x361))); |
| 3304 | evalcond[1]=((((-1.0)*x363))+((new_r01*x362))+((new_r11*x361))); |
| 3305 | evalcond[2]=(((cj3*x362*x364))+x372+new_r10); |
| 3306 | evalcond[3]=(x370+(((-1.0)*cj3*x361*x364))+new_r00); |
| 3307 | evalcond[4]=((((-1.0)*x361*x363))+((x364*x370))+new_r11); |
| 3308 | evalcond[5]=((((-1.0)*x362*x363))+new_r01+(((-1.0)*x364*x372))); |
| 3309 | evalcond[6]=(((x361*x366))+(((-1.0)*x361*x365))); |
| 3310 | evalcond[7]=((((-1.0)*x362*x366))+((x362*x365))); |
| 3311 | evalcond[8]=((((-1.0)*x371))+x369+(((-1.0)*cj3*x364))); |
| 3312 | evalcond[9]=((((-1.0)*x367))+(((-1.0)*sj3*x364))+x368); |
| 3313 | evalcond[10]=(((x364*x369))+(((-1.0)*x363))+(((-1.0)*x364*x371))); |
| 3314 | evalcond[11]=((((-1.0)*sj3))+((x364*x368))+(((-1.0)*x364*x367))); |
| 3315 | evalcond[12]=(((x365*x369))+((x366*x371))+(((-1.0)*x366*x369))+(((-1.0)*x365*x371))); |
| 3316 | evalcond[13]=(((x366*x367))+((x365*x368))+(((-1.0)*x366*x368))+(((-1.0)*x365*x367))); |
| 3317 | if( 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 ) |
| 3318 | { |
| 3319 | continue; |
| 3320 | } |
| 3321 | } |
| 3322 | |
| 3323 | { |
| 3324 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 3325 | vinfos[0].jointtype = 1; |
| 3326 | vinfos[0].foffset = j0; |
| 3327 | vinfos[0].indices[0] = _ij0[0]; |
| 3328 | vinfos[0].indices[1] = _ij0[1]; |
| 3329 | vinfos[0].maxsolutions = _nj0; |
| 3330 | vinfos[1].jointtype = 1; |
| 3331 | vinfos[1].foffset = j1; |
| 3332 | vinfos[1].indices[0] = _ij1[0]; |
| 3333 | vinfos[1].indices[1] = _ij1[1]; |
| 3334 | vinfos[1].maxsolutions = _nj1; |
| 3335 | vinfos[2].jointtype = 1; |
| 3336 | vinfos[2].foffset = j2; |
| 3337 | vinfos[2].indices[0] = _ij2[0]; |
| 3338 | vinfos[2].indices[1] = _ij2[1]; |
| 3339 | vinfos[2].maxsolutions = _nj2; |
| 3340 | vinfos[3].jointtype = 1; |
| 3341 | vinfos[3].foffset = j3; |
| 3342 | vinfos[3].indices[0] = _ij3[0]; |
| 3343 | vinfos[3].indices[1] = _ij3[1]; |
| 3344 | vinfos[3].maxsolutions = _nj3; |
| 3345 | vinfos[4].jointtype = 1; |
| 3346 | vinfos[4].foffset = j4; |
| 3347 | vinfos[4].indices[0] = _ij4[0]; |
| 3348 | vinfos[4].indices[1] = _ij4[1]; |
| 3349 | vinfos[4].maxsolutions = _nj4; |
| 3350 | vinfos[5].jointtype = 1; |
| 3351 | vinfos[5].foffset = j5; |
| 3352 | vinfos[5].indices[0] = _ij5[0]; |
| 3353 | vinfos[5].indices[1] = _ij5[1]; |
| 3354 | vinfos[5].maxsolutions = _nj5; |
| 3355 | std::vector<int> vfree(0); |
| 3356 | solutions.AddSolution(vinfos,vfree); |
| 3357 | } |
| 3358 | } |
| 3359 | } |
| 3360 | |
| 3361 | } |
| 3362 | |
| 3363 | } |
| 3364 | } |
| 3365 | |
| 3366 | } |
| 3367 | |
| 3368 | } |
| 3369 | |
| 3370 | } |
| 3371 | } while(0); |
| 3372 | if( bgotonextstatement ) |
| 3373 | { |
| 3374 | bool bgotonextstatement = true; |
| 3375 | do |
| 3376 | { |
| 3377 | if( 1 ) |
| 3378 | { |
| 3379 | bgotonextstatement=false; |
| 3380 | continue; // branch miss [j3, j5] |
| 3381 | |
| 3382 | } |
| 3383 | } while(0); |
| 3384 | if( bgotonextstatement ) |
| 3385 | { |
| 3386 | } |
| 3387 | } |
| 3388 | } |
| 3389 | } |
| 3390 | } |
| 3391 | } |
| 3392 | } |
| 3393 | } |
| 3394 | |
| 3395 | } else |
| 3396 | { |
| 3397 | { |
| 3398 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 3399 | bool j5valid[1]={false}; |
| 3400 | _nj5 = 1; |
| 3401 | IkReal x373=((0.9999999992)*sj4); |
| 3402 | IkReal x374=((3.9999999968e-5)*cj4); |
| 3403 | CheckValue<IkReal> x375=IKPowWithIntegerCheck(IKsign(((new_r12*new_r12)+(new_r02*new_r02))),-1); |
| 3404 | if(!x375.valid){ |
| 3405 | continue; |
| 3406 | } |
| 3407 | CheckValue<IkReal> x376 = IKatan2WithCheck(IkReal((((new_r12*x373))+(((-1.0)*new_r12*x374)))),IkReal((((new_r02*x374))+(((-1.0)*new_r02*x373)))),IKFAST_ATAN2_MAGTHRESH); |
| 3408 | if(!x376.valid){ |
| 3409 | continue; |
| 3410 | } |
| 3411 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x375.value)))+(x376.value)); |
| 3412 | sj5array[0]=IKsin(j5array[0]); |
| 3413 | cj5array[0]=IKcos(j5array[0]); |
| 3414 | if( j5array[0] > IKPI ) |
| 3415 | { |
| 3416 | j5array[0]-=IK2PI; |
| 3417 | } |
| 3418 | else if( j5array[0] < -IKPI ) |
| 3419 | { j5array[0]+=IK2PI; |
| 3420 | } |
| 3421 | j5valid[0] = true; |
| 3422 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 3423 | { |
| 3424 | if( !j5valid[ij5] ) |
| 3425 | { |
| 3426 | continue; |
| 3427 | } |
| 3428 | _ij5[0] = ij5; _ij5[1] = -1; |
| 3429 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 3430 | { |
| 3431 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 3432 | { |
| 3433 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 3434 | } |
| 3435 | } |
| 3436 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 3437 | { |
| 3438 | IkReal evalcond[8]; |
| 3439 | IkReal x377=IKcos(j5); |
| 3440 | IkReal x378=IKsin(j5); |
| 3441 | IkReal x379=((0.9999999992)*cj4); |
| 3442 | IkReal x380=((3.9999999968e-5)*cj4); |
| 3443 | IkReal x381=((0.9999999992)*sj4); |
| 3444 | IkReal x382=((3.9999999968e-5)*sj4); |
| 3445 | IkReal x383=(new_r12*x378); |
| 3446 | IkReal x384=(new_r02*x377); |
| 3447 | IkReal x385=(new_r01*x377); |
| 3448 | IkReal x386=(new_r11*x378); |
| 3449 | IkReal x387=(new_r00*x377); |
| 3450 | IkReal x388=(new_r10*x378); |
| 3451 | evalcond[0]=(((new_r12*x377))+((new_r02*x378))); |
| 3452 | evalcond[1]=(((x377*x381))+new_r02+(((-1.0)*x377*x380))); |
| 3453 | evalcond[2]=(((x378*x380))+(((-1.0)*x378*x381))+new_r12); |
| 3454 | evalcond[3]=(x384+x381+(((-1.0)*x383))+(((-1.0)*x380))); |
| 3455 | evalcond[4]=((((-1.0)*x380*x388))+((new_r20*x379))+(((-1.0)*x381*x387))+((new_r20*x382))+((x380*x387))+((x381*x388))); |
| 3456 | evalcond[5]=((((-1.0)*x380*x386))+(((-1.0)*x381*x385))+((new_r21*x379))+((x380*x385))+((x381*x386))+((new_r21*x382))); |
| 3457 | evalcond[6]=((((-1.0)*x379*x383))+((new_r22*x381))+((x382*x384))+((x379*x384))+(((-1.0)*new_r22*x380))+(((-1.0)*x382*x383))); |
| 3458 | evalcond[7]=((-1.0)+(((-1.0)*x380*x383))+(((-1.0)*x381*x384))+((new_r22*x382))+((x380*x384))+((x381*x383))+((new_r22*x379))); |
| 3459 | if( 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 ) |
| 3460 | { |
| 3461 | continue; |
| 3462 | } |
| 3463 | } |
| 3464 | |
| 3465 | { |
| 3466 | IkReal j3array[1], cj3array[1], sj3array[1]; |
| 3467 | bool j3valid[1]={false}; |
| 3468 | _nj3 = 1; |
| 3469 | if( IKabs(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj5*new_r11))+((new_r01*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))))+IKsqr((((cj5*new_r11))+((new_r01*sj5))))-1) <= IKFAST_SINCOS_THRESH ) |
| 3470 | continue; |
| 3471 | j3array[0]=IKatan2(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))), (((cj5*new_r11))+((new_r01*sj5)))); |
| 3472 | sj3array[0]=IKsin(j3array[0]); |
| 3473 | cj3array[0]=IKcos(j3array[0]); |
| 3474 | if( j3array[0] > IKPI ) |
| 3475 | { |
| 3476 | j3array[0]-=IK2PI; |
| 3477 | } |
| 3478 | else if( j3array[0] < -IKPI ) |
| 3479 | { j3array[0]+=IK2PI; |
| 3480 | } |
| 3481 | j3valid[0] = true; |
| 3482 | for(int ij3 = 0; ij3 < 1; ++ij3) |
| 3483 | { |
| 3484 | if( !j3valid[ij3] ) |
| 3485 | { |
| 3486 | continue; |
| 3487 | } |
| 3488 | _ij3[0] = ij3; _ij3[1] = -1; |
| 3489 | for(int iij3 = ij3+1; iij3 < 1; ++iij3) |
| 3490 | { |
| 3491 | if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH ) |
| 3492 | { |
| 3493 | j3valid[iij3]=false; _ij3[1] = iij3; break; |
| 3494 | } |
| 3495 | } |
| 3496 | j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3]; |
| 3497 | { |
| 3498 | IkReal evalcond[12]; |
| 3499 | IkReal x389=IKcos(j3); |
| 3500 | IkReal x390=IKsin(j3); |
| 3501 | IkReal x391=((0.9999999992)*cj4); |
| 3502 | IkReal x392=((3.9999999968e-5)*cj4); |
| 3503 | IkReal x393=(cj5*new_r01); |
| 3504 | IkReal x394=((0.9999999992)*sj4); |
| 3505 | IkReal x395=(cj5*new_r00); |
| 3506 | IkReal x396=((3.9999999968e-5)*sj4); |
| 3507 | IkReal x397=(new_r10*sj5); |
| 3508 | IkReal x398=(new_r11*sj5); |
| 3509 | IkReal x399=((1.0)*x389); |
| 3510 | IkReal x400=(cj5*x390); |
| 3511 | IkReal x401=(sj5*x389); |
| 3512 | IkReal x402=(sj5*x390); |
| 3513 | IkReal x403=(cj5*x389); |
| 3514 | IkReal x404=(x389*x396); |
| 3515 | evalcond[0]=(((cj5*new_r10))+((new_r00*sj5))+x390); |
| 3516 | evalcond[1]=((((-1.0)*x399))+((cj5*new_r11))+((new_r01*sj5))); |
| 3517 | evalcond[2]=((((-1.0)*x389*x394))+new_r20+((x389*x392))); |
| 3518 | evalcond[3]=((((-1.0)*x390*x394))+new_r21+((x390*x392))); |
| 3519 | evalcond[4]=((((-1.0)*x397))+(((-1.0)*x389*x391))+x395+(((-1.0)*x404))); |
| 3520 | evalcond[5]=((((-1.0)*x398))+x393+(((-1.0)*x390*x396))+(((-1.0)*x390*x391))); |
| 3521 | evalcond[6]=((((-1.0)*x391*x403))+x402+new_r00+(((-1.0)*x396*x403))); |
| 3522 | evalcond[7]=(x400+new_r10+((x396*x401))+((x391*x401))); |
| 3523 | evalcond[8]=((((-1.0)*sj5*x399))+(((-1.0)*x391*x400))+new_r01+(((-1.0)*x396*x400))); |
| 3524 | evalcond[9]=((((-1.0)*cj5*x399))+new_r11+((x396*x402))+((x391*x402))); |
| 3525 | evalcond[10]=((((-1.0)*x399))+((x395*x396))+((new_r20*x394))+(((-1.0)*x391*x397))+((x391*x395))+(((-1.0)*x396*x397))+(((-1.0)*new_r20*x392))); |
| 3526 | evalcond[11]=((((-1.0)*x390))+(((-1.0)*new_r21*x392))+(((-1.0)*x391*x398))+((x391*x393))+((new_r21*x394))+(((-1.0)*x396*x398))+((x393*x396))); |
| 3527 | if( 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 ) |
| 3528 | { |
| 3529 | continue; |
| 3530 | } |
| 3531 | } |
| 3532 | |
| 3533 | { |
| 3534 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 3535 | vinfos[0].jointtype = 1; |
| 3536 | vinfos[0].foffset = j0; |
| 3537 | vinfos[0].indices[0] = _ij0[0]; |
| 3538 | vinfos[0].indices[1] = _ij0[1]; |
| 3539 | vinfos[0].maxsolutions = _nj0; |
| 3540 | vinfos[1].jointtype = 1; |
| 3541 | vinfos[1].foffset = j1; |
| 3542 | vinfos[1].indices[0] = _ij1[0]; |
| 3543 | vinfos[1].indices[1] = _ij1[1]; |
| 3544 | vinfos[1].maxsolutions = _nj1; |
| 3545 | vinfos[2].jointtype = 1; |
| 3546 | vinfos[2].foffset = j2; |
| 3547 | vinfos[2].indices[0] = _ij2[0]; |
| 3548 | vinfos[2].indices[1] = _ij2[1]; |
| 3549 | vinfos[2].maxsolutions = _nj2; |
| 3550 | vinfos[3].jointtype = 1; |
| 3551 | vinfos[3].foffset = j3; |
| 3552 | vinfos[3].indices[0] = _ij3[0]; |
| 3553 | vinfos[3].indices[1] = _ij3[1]; |
| 3554 | vinfos[3].maxsolutions = _nj3; |
| 3555 | vinfos[4].jointtype = 1; |
| 3556 | vinfos[4].foffset = j4; |
| 3557 | vinfos[4].indices[0] = _ij4[0]; |
| 3558 | vinfos[4].indices[1] = _ij4[1]; |
| 3559 | vinfos[4].maxsolutions = _nj4; |
| 3560 | vinfos[5].jointtype = 1; |
| 3561 | vinfos[5].foffset = j5; |
| 3562 | vinfos[5].indices[0] = _ij5[0]; |
| 3563 | vinfos[5].indices[1] = _ij5[1]; |
| 3564 | vinfos[5].maxsolutions = _nj5; |
| 3565 | std::vector<int> vfree(0); |
| 3566 | solutions.AddSolution(vinfos,vfree); |
| 3567 | } |
| 3568 | } |
| 3569 | } |
| 3570 | } |
| 3571 | } |
| 3572 | |
| 3573 | } |
| 3574 | |
| 3575 | } |
| 3576 | |
| 3577 | } else |
| 3578 | { |
| 3579 | { |
| 3580 | IkReal j3array[1], cj3array[1], sj3array[1]; |
| 3581 | bool j3valid[1]={false}; |
| 3582 | _nj3 = 1; |
| 3583 | CheckValue<IkReal> x405 = IKatan2WithCheck(IkReal(((-1.0)*new_r21)),IkReal(((-1.0)*new_r20)),IKFAST_ATAN2_MAGTHRESH); |
| 3584 | if(!x405.valid){ |
| 3585 | continue; |
| 3586 | } |
| 3587 | CheckValue<IkReal> x406=IKPowWithIntegerCheck(IKsign(((((-0.9999999992)*sj4))+(((3.9999999968e-5)*cj4)))),-1); |
| 3588 | if(!x406.valid){ |
| 3589 | continue; |
| 3590 | } |
| 3591 | j3array[0]=((-1.5707963267949)+(x405.value)+(((1.5707963267949)*(x406.value)))); |
| 3592 | sj3array[0]=IKsin(j3array[0]); |
| 3593 | cj3array[0]=IKcos(j3array[0]); |
| 3594 | if( j3array[0] > IKPI ) |
| 3595 | { |
| 3596 | j3array[0]-=IK2PI; |
| 3597 | } |
| 3598 | else if( j3array[0] < -IKPI ) |
| 3599 | { j3array[0]+=IK2PI; |
| 3600 | } |
| 3601 | j3valid[0] = true; |
| 3602 | for(int ij3 = 0; ij3 < 1; ++ij3) |
| 3603 | { |
| 3604 | if( !j3valid[ij3] ) |
| 3605 | { |
| 3606 | continue; |
| 3607 | } |
| 3608 | _ij3[0] = ij3; _ij3[1] = -1; |
| 3609 | for(int iij3 = ij3+1; iij3 < 1; ++iij3) |
| 3610 | { |
| 3611 | if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH ) |
| 3612 | { |
| 3613 | j3valid[iij3]=false; _ij3[1] = iij3; break; |
| 3614 | } |
| 3615 | } |
| 3616 | j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3]; |
| 3617 | { |
| 3618 | IkReal evalcond[2]; |
| 3619 | IkReal x407=IKcos(j3); |
| 3620 | IkReal x408=IKsin(j3); |
| 3621 | IkReal x409=((0.9999999992)*sj4); |
| 3622 | IkReal x410=((3.9999999968e-5)*cj4); |
| 3623 | evalcond[0]=(((x407*x410))+(((-1.0)*x407*x409))+new_r20); |
| 3624 | evalcond[1]=(((x408*x410))+new_r21+(((-1.0)*x408*x409))); |
| 3625 | if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH ) |
| 3626 | { |
| 3627 | continue; |
| 3628 | } |
| 3629 | } |
| 3630 | |
| 3631 | { |
| 3632 | IkReal j5eval[3]; |
| 3633 | IkReal x411=((((-1.0)*new_r00*new_r12))+((new_r02*new_r10))); |
| 3634 | j5eval[0]=x411; |
| 3635 | j5eval[1]=((IKabs((new_r12*sj3)))+(IKabs((new_r02*sj3)))); |
| 3636 | j5eval[2]=IKsign(x411); |
| 3637 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 3638 | { |
| 3639 | { |
| 3640 | IkReal j5eval[3]; |
| 3641 | IkReal x412=(((new_r01*new_r12))+(((-1.0)*new_r02*new_r11))); |
| 3642 | j5eval[0]=x412; |
| 3643 | j5eval[1]=IKsign(x412); |
| 3644 | j5eval[2]=((IKabs((cj3*new_r02)))+(IKabs((cj3*new_r12)))); |
| 3645 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 3646 | { |
| 3647 | { |
| 3648 | IkReal j5eval[3]; |
| 3649 | j5eval[0]=((((25000.0)*sj4))+(((-1.0)*cj4))); |
| 3650 | j5eval[1]=((IKabs(new_r12))+(IKabs(new_r02))); |
| 3651 | j5eval[2]=IKsign(((((-3.9999999968e-5)*cj4))+(((0.9999999992)*sj4)))); |
| 3652 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 3653 | { |
| 3654 | { |
| 3655 | IkReal evalcond[5]; |
| 3656 | bool bgotonextstatement = true; |
| 3657 | do |
| 3658 | { |
| 3659 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.99999999786667e-5)+j4)))), 6.28318530717959))); |
| 3660 | evalcond[1]=new_r02; |
| 3661 | evalcond[2]=new_r12; |
| 3662 | evalcond[3]=new_r20; |
| 3663 | evalcond[4]=new_r21; |
| 3664 | if( 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 ) |
| 3665 | { |
| 3666 | bgotonextstatement=false; |
| 3667 | { |
| 3668 | IkReal j5eval[3]; |
| 3669 | sj4=4.0e-5; |
| 3670 | cj4=1.0; |
| 3671 | j4=4.0e-5; |
| 3672 | IkReal x413=((1.0)*new_r00); |
| 3673 | IkReal x414=(((new_r01*new_r10))+(((-1.0)*new_r11*x413))); |
| 3674 | j5eval[0]=x414; |
| 3675 | j5eval[1]=IKsign(x414); |
| 3676 | j5eval[2]=((IKabs((((new_r11*sj3))+((cj3*new_r10)))))+(IKabs(((((-1.0)*new_r01*sj3))+(((-1.0)*cj3*x413)))))); |
| 3677 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 3678 | { |
| 3679 | { |
| 3680 | IkReal j5eval[2]; |
| 3681 | sj4=4.0e-5; |
| 3682 | cj4=1.0; |
| 3683 | j4=4.0e-5; |
| 3684 | IkReal x415=new_r00*new_r00; |
| 3685 | IkReal x416=cj3*cj3; |
| 3686 | j5eval[0]=((((-1.0)*x415*x416))+x415+(((-1.0000000016)*x416*(new_r10*new_r10)))); |
| 3687 | j5eval[1]=((((-1.0000000008)*cj3*new_r10))+((new_r00*sj3))); |
| 3688 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 3689 | { |
| 3690 | { |
| 3691 | IkReal j5eval[2]; |
| 3692 | sj4=4.0e-5; |
| 3693 | cj4=1.0; |
| 3694 | j4=4.0e-5; |
| 3695 | j5eval[0]=new_r00; |
| 3696 | j5eval[1]=((((-1.0000000008)*new_r00*sj3))+((cj3*new_r10))); |
| 3697 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 3698 | { |
| 3699 | { |
| 3700 | IkReal evalcond[1]; |
| 3701 | bool bgotonextstatement = true; |
| 3702 | do |
| 3703 | { |
| 3704 | IkReal x417=((-1.0000000008)*new_r00); |
| 3705 | IkReal x419 = ((((1.0000000016)*(new_r00*new_r00)))+(new_r10*new_r10)); |
| 3706 | if(IKabs(x419)==0){ |
| 3707 | continue; |
| 3708 | } |
| 3709 | IkReal x418=pow(x419,-0.5); |
| 3710 | CheckValue<IkReal> x420 = IKatan2WithCheck(IkReal(new_r10),IkReal(x417),IKFAST_ATAN2_MAGTHRESH); |
| 3711 | if(!x420.valid){ |
| 3712 | continue; |
| 3713 | } |
| 3714 | IkReal gconst6=((-1.0)*(x420.value)); |
| 3715 | IkReal gconst7=((-1.0)*new_r10*x418); |
| 3716 | IkReal gconst8=(x417*x418); |
| 3717 | CheckValue<IkReal> x421 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 3718 | if(!x421.valid){ |
| 3719 | continue; |
| 3720 | } |
| 3721 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((x421.value)+j3)))), 6.28318530717959))); |
| 3722 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 3723 | { |
| 3724 | bgotonextstatement=false; |
| 3725 | { |
| 3726 | IkReal j5eval[3]; |
| 3727 | IkReal x422=((-1.0000000008)*new_r00); |
| 3728 | IkReal x423=x418; |
| 3729 | sj4=4.0e-5; |
| 3730 | cj4=1.0; |
| 3731 | j4=4.0e-5; |
| 3732 | sj3=gconst7; |
| 3733 | cj3=gconst8; |
| 3734 | CheckValue<IkReal> x424 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 3735 | if(!x424.valid){ |
| 3736 | continue; |
| 3737 | } |
| 3738 | j3=((-1.0)*(x424.value)); |
| 3739 | CheckValue<IkReal> x425 = IKatan2WithCheck(IkReal(new_r10),IkReal(x422),IKFAST_ATAN2_MAGTHRESH); |
| 3740 | if(!x425.valid){ |
| 3741 | continue; |
| 3742 | } |
| 3743 | IkReal gconst6=((-1.0)*(x425.value)); |
| 3744 | IkReal gconst7=((-1.0)*new_r10*x423); |
| 3745 | IkReal gconst8=(x422*x423); |
| 3746 | IkReal x426=new_r00*new_r00; |
| 3747 | IkReal x427=(new_r01*new_r10); |
| 3748 | IkReal x428=(x427+(((-1.0)*new_r00*new_r11))); |
| 3749 | IkReal x431 = ((((625000000.0)*(new_r10*new_r10)))+(((625000001.0)*x426))); |
| 3750 | if(IKabs(x431)==0){ |
| 3751 | continue; |
| 3752 | } |
| 3753 | IkReal x429=pow(x431,-0.5); |
| 3754 | IkReal x430=(new_r10*x429); |
| 3755 | j5eval[0]=x428; |
| 3756 | j5eval[1]=IKsign(x428); |
| 3757 | j5eval[2]=((IKabs(((((-25000.00002)*new_r00*x430))+(((-25000.0)*new_r11*x430)))))+(IKabs(((((25000.00002)*x426*x429))+(((25000.0)*x427*x429)))))); |
| 3758 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 3759 | { |
| 3760 | { |
| 3761 | IkReal j5eval[2]; |
| 3762 | IkReal x432=((-1.0000000008)*new_r00); |
| 3763 | IkReal x433=x418; |
| 3764 | sj4=4.0e-5; |
| 3765 | cj4=1.0; |
| 3766 | j4=4.0e-5; |
| 3767 | sj3=gconst7; |
| 3768 | cj3=gconst8; |
| 3769 | CheckValue<IkReal> x434 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 3770 | if(!x434.valid){ |
| 3771 | continue; |
| 3772 | } |
| 3773 | j3=((-1.0)*(x434.value)); |
| 3774 | CheckValue<IkReal> x435 = IKatan2WithCheck(IkReal(new_r10),IkReal(x432),IKFAST_ATAN2_MAGTHRESH); |
| 3775 | if(!x435.valid){ |
| 3776 | continue; |
| 3777 | } |
| 3778 | IkReal gconst6=((-1.0)*(x435.value)); |
| 3779 | IkReal gconst7=((-1.0)*new_r10*x433); |
| 3780 | IkReal gconst8=(x432*x433); |
| 3781 | IkReal x436=new_r00*new_r00; |
| 3782 | IkReal x437=new_r10*new_r10; |
| 3783 | IkReal x438=((((1.0000000016)*x436))+x437); |
| 3784 | CheckValue<IkReal> x439=IKPowWithIntegerCheck(x438,-1); |
| 3785 | if(!x439.valid){ |
| 3786 | continue; |
| 3787 | } |
| 3788 | j5eval[0]=((-3.20000000256e-9)*x436*x437*(x439.value)); |
| 3789 | IkReal x440 = x438; |
| 3790 | if(IKabs(x440)==0){ |
| 3791 | continue; |
| 3792 | } |
| 3793 | j5eval[1]=((1.6e-9)*new_r00*new_r10*(pow(x440,-0.5))); |
| 3794 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 3795 | { |
| 3796 | { |
| 3797 | IkReal j5eval[1]; |
| 3798 | IkReal x441=((-1.0000000008)*new_r00); |
| 3799 | IkReal x442=x418; |
| 3800 | sj4=4.0e-5; |
| 3801 | cj4=1.0; |
| 3802 | j4=4.0e-5; |
| 3803 | sj3=gconst7; |
| 3804 | cj3=gconst8; |
| 3805 | CheckValue<IkReal> x443 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 3806 | if(!x443.valid){ |
| 3807 | continue; |
| 3808 | } |
| 3809 | j3=((-1.0)*(x443.value)); |
| 3810 | CheckValue<IkReal> x444 = IKatan2WithCheck(IkReal(new_r10),IkReal(x441),IKFAST_ATAN2_MAGTHRESH); |
| 3811 | if(!x444.valid){ |
| 3812 | continue; |
| 3813 | } |
| 3814 | IkReal gconst6=((-1.0)*(x444.value)); |
| 3815 | IkReal gconst7=((-1.0)*new_r10*x442); |
| 3816 | IkReal gconst8=(x441*x442); |
| 3817 | j5eval[0]=new_r00; |
| 3818 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 3819 | { |
| 3820 | { |
| 3821 | IkReal evalcond[1]; |
| 3822 | bool bgotonextstatement = true; |
| 3823 | do |
| 3824 | { |
| 3825 | evalcond[0]=IKabs(new_r00); |
| 3826 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 3827 | { |
| 3828 | bgotonextstatement=false; |
| 3829 | { |
| 3830 | IkReal j5eval[1]; |
| 3831 | CheckValue<IkReal> x446 = IKatan2WithCheck(IkReal(new_r10),IkReal(0),IKFAST_ATAN2_MAGTHRESH); |
| 3832 | if(!x446.valid){ |
| 3833 | continue; |
| 3834 | } |
| 3835 | IkReal x445=((-1.0)*(x446.value)); |
| 3836 | sj4=4.0e-5; |
| 3837 | cj4=1.0; |
| 3838 | j4=4.0e-5; |
| 3839 | sj3=gconst7; |
| 3840 | cj3=gconst8; |
| 3841 | j3=x445; |
| 3842 | new_r00=0; |
| 3843 | IkReal gconst6=x445; |
| 3844 | IkReal x447 = new_r10*new_r10; |
| 3845 | if(IKabs(x447)==0){ |
| 3846 | continue; |
| 3847 | } |
| 3848 | IkReal gconst7=((-1.0)*new_r10*(pow(x447,-0.5))); |
| 3849 | IkReal gconst8=0; |
| 3850 | j5eval[0]=new_r10; |
| 3851 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 3852 | { |
| 3853 | { |
| 3854 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 3855 | bool j5valid[1]={false}; |
| 3856 | _nj5 = 1; |
| 3857 | CheckValue<IkReal> x449=IKPowWithIntegerCheck(gconst7,-1); |
| 3858 | if(!x449.valid){ |
| 3859 | continue; |
| 3860 | } |
| 3861 | IkReal x448=x449.value; |
| 3862 | if( IKabs(((-0.9999999992)*new_r11*x448)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r10*x448)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-0.9999999992)*new_r11*x448))+IKsqr(((-1.0)*new_r10*x448))-1) <= IKFAST_SINCOS_THRESH ) |
| 3863 | continue; |
| 3864 | j5array[0]=IKatan2(((-0.9999999992)*new_r11*x448), ((-1.0)*new_r10*x448)); |
| 3865 | sj5array[0]=IKsin(j5array[0]); |
| 3866 | cj5array[0]=IKcos(j5array[0]); |
| 3867 | if( j5array[0] > IKPI ) |
| 3868 | { |
| 3869 | j5array[0]-=IK2PI; |
| 3870 | } |
| 3871 | else if( j5array[0] < -IKPI ) |
| 3872 | { j5array[0]+=IK2PI; |
| 3873 | } |
| 3874 | j5valid[0] = true; |
| 3875 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 3876 | { |
| 3877 | if( !j5valid[ij5] ) |
| 3878 | { |
| 3879 | continue; |
| 3880 | } |
| 3881 | _ij5[0] = ij5; _ij5[1] = -1; |
| 3882 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 3883 | { |
| 3884 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 3885 | { |
| 3886 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 3887 | } |
| 3888 | } |
| 3889 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 3890 | { |
| 3891 | IkReal evalcond[10]; |
| 3892 | IkReal x450=IKsin(j5); |
| 3893 | IkReal x451=IKcos(j5); |
| 3894 | IkReal x452=((1.0000000008)*gconst7); |
| 3895 | IkReal x453=(new_r11*x450); |
| 3896 | IkReal x454=(new_r10*x450); |
| 3897 | IkReal x455=(new_r01*x451); |
| 3898 | evalcond[0]=(gconst7*x450); |
| 3899 | evalcond[1]=((-1.0)*x454); |
| 3900 | evalcond[2]=(((new_r10*x451))+gconst7); |
| 3901 | evalcond[3]=(((gconst7*x451))+new_r10); |
| 3902 | evalcond[4]=((-1.0000000008)*x454); |
| 3903 | evalcond[5]=(((new_r11*x451))+((new_r01*x450))); |
| 3904 | evalcond[6]=((((-1.0)*x451*x452))+new_r01); |
| 3905 | evalcond[7]=(((x450*x452))+new_r11); |
| 3906 | evalcond[8]=((((-1.0)*x453))+(((-1.0)*x452))+x455); |
| 3907 | evalcond[9]=((((-1.0)*gconst7))+(((1.0000000008)*x455))+(((-1.0000000008)*x453))); |
| 3908 | if( 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 ) |
| 3909 | { |
| 3910 | continue; |
| 3911 | } |
| 3912 | } |
| 3913 | |
| 3914 | { |
| 3915 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 3916 | vinfos[0].jointtype = 1; |
| 3917 | vinfos[0].foffset = j0; |
| 3918 | vinfos[0].indices[0] = _ij0[0]; |
| 3919 | vinfos[0].indices[1] = _ij0[1]; |
| 3920 | vinfos[0].maxsolutions = _nj0; |
| 3921 | vinfos[1].jointtype = 1; |
| 3922 | vinfos[1].foffset = j1; |
| 3923 | vinfos[1].indices[0] = _ij1[0]; |
| 3924 | vinfos[1].indices[1] = _ij1[1]; |
| 3925 | vinfos[1].maxsolutions = _nj1; |
| 3926 | vinfos[2].jointtype = 1; |
| 3927 | vinfos[2].foffset = j2; |
| 3928 | vinfos[2].indices[0] = _ij2[0]; |
| 3929 | vinfos[2].indices[1] = _ij2[1]; |
| 3930 | vinfos[2].maxsolutions = _nj2; |
| 3931 | vinfos[3].jointtype = 1; |
| 3932 | vinfos[3].foffset = j3; |
| 3933 | vinfos[3].indices[0] = _ij3[0]; |
| 3934 | vinfos[3].indices[1] = _ij3[1]; |
| 3935 | vinfos[3].maxsolutions = _nj3; |
| 3936 | vinfos[4].jointtype = 1; |
| 3937 | vinfos[4].foffset = j4; |
| 3938 | vinfos[4].indices[0] = _ij4[0]; |
| 3939 | vinfos[4].indices[1] = _ij4[1]; |
| 3940 | vinfos[4].maxsolutions = _nj4; |
| 3941 | vinfos[5].jointtype = 1; |
| 3942 | vinfos[5].foffset = j5; |
| 3943 | vinfos[5].indices[0] = _ij5[0]; |
| 3944 | vinfos[5].indices[1] = _ij5[1]; |
| 3945 | vinfos[5].maxsolutions = _nj5; |
| 3946 | std::vector<int> vfree(0); |
| 3947 | solutions.AddSolution(vinfos,vfree); |
| 3948 | } |
| 3949 | } |
| 3950 | } |
| 3951 | |
| 3952 | } else |
| 3953 | { |
| 3954 | { |
| 3955 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 3956 | bool j5valid[1]={false}; |
| 3957 | _nj5 = 1; |
| 3958 | CheckValue<IkReal> x456=IKPowWithIntegerCheck(gconst7,-1); |
| 3959 | if(!x456.valid){ |
| 3960 | continue; |
| 3961 | } |
| 3962 | CheckValue<IkReal> x457=IKPowWithIntegerCheck(new_r10,-1); |
| 3963 | if(!x457.valid){ |
| 3964 | continue; |
| 3965 | } |
| 3966 | if( IKabs(((-0.9999999992)*new_r11*(x456.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*gconst7*(x457.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-0.9999999992)*new_r11*(x456.value)))+IKsqr(((-1.0)*gconst7*(x457.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 3967 | continue; |
| 3968 | j5array[0]=IKatan2(((-0.9999999992)*new_r11*(x456.value)), ((-1.0)*gconst7*(x457.value))); |
| 3969 | sj5array[0]=IKsin(j5array[0]); |
| 3970 | cj5array[0]=IKcos(j5array[0]); |
| 3971 | if( j5array[0] > IKPI ) |
| 3972 | { |
| 3973 | j5array[0]-=IK2PI; |
| 3974 | } |
| 3975 | else if( j5array[0] < -IKPI ) |
| 3976 | { j5array[0]+=IK2PI; |
| 3977 | } |
| 3978 | j5valid[0] = true; |
| 3979 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 3980 | { |
| 3981 | if( !j5valid[ij5] ) |
| 3982 | { |
| 3983 | continue; |
| 3984 | } |
| 3985 | _ij5[0] = ij5; _ij5[1] = -1; |
| 3986 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 3987 | { |
| 3988 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 3989 | { |
| 3990 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 3991 | } |
| 3992 | } |
| 3993 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 3994 | { |
| 3995 | IkReal evalcond[10]; |
| 3996 | IkReal x458=IKsin(j5); |
| 3997 | IkReal x459=IKcos(j5); |
| 3998 | IkReal x460=((1.0000000008)*gconst7); |
| 3999 | IkReal x461=(new_r11*x458); |
| 4000 | IkReal x462=(new_r10*x458); |
| 4001 | IkReal x463=(new_r01*x459); |
| 4002 | evalcond[0]=(gconst7*x458); |
| 4003 | evalcond[1]=((-1.0)*x462); |
| 4004 | evalcond[2]=(((new_r10*x459))+gconst7); |
| 4005 | evalcond[3]=(((gconst7*x459))+new_r10); |
| 4006 | evalcond[4]=((-1.0000000008)*x462); |
| 4007 | evalcond[5]=(((new_r11*x459))+((new_r01*x458))); |
| 4008 | evalcond[6]=((((-1.0)*x459*x460))+new_r01); |
| 4009 | evalcond[7]=(new_r11+((x458*x460))); |
| 4010 | evalcond[8]=((((-1.0)*x461))+(((-1.0)*x460))+x463); |
| 4011 | evalcond[9]=((((-1.0)*gconst7))+(((1.0000000008)*x463))+(((-1.0000000008)*x461))); |
| 4012 | if( 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 ) |
| 4013 | { |
| 4014 | continue; |
| 4015 | } |
| 4016 | } |
| 4017 | |
| 4018 | { |
| 4019 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 4020 | vinfos[0].jointtype = 1; |
| 4021 | vinfos[0].foffset = j0; |
| 4022 | vinfos[0].indices[0] = _ij0[0]; |
| 4023 | vinfos[0].indices[1] = _ij0[1]; |
| 4024 | vinfos[0].maxsolutions = _nj0; |
| 4025 | vinfos[1].jointtype = 1; |
| 4026 | vinfos[1].foffset = j1; |
| 4027 | vinfos[1].indices[0] = _ij1[0]; |
| 4028 | vinfos[1].indices[1] = _ij1[1]; |
| 4029 | vinfos[1].maxsolutions = _nj1; |
| 4030 | vinfos[2].jointtype = 1; |
| 4031 | vinfos[2].foffset = j2; |
| 4032 | vinfos[2].indices[0] = _ij2[0]; |
| 4033 | vinfos[2].indices[1] = _ij2[1]; |
| 4034 | vinfos[2].maxsolutions = _nj2; |
| 4035 | vinfos[3].jointtype = 1; |
| 4036 | vinfos[3].foffset = j3; |
| 4037 | vinfos[3].indices[0] = _ij3[0]; |
| 4038 | vinfos[3].indices[1] = _ij3[1]; |
| 4039 | vinfos[3].maxsolutions = _nj3; |
| 4040 | vinfos[4].jointtype = 1; |
| 4041 | vinfos[4].foffset = j4; |
| 4042 | vinfos[4].indices[0] = _ij4[0]; |
| 4043 | vinfos[4].indices[1] = _ij4[1]; |
| 4044 | vinfos[4].maxsolutions = _nj4; |
| 4045 | vinfos[5].jointtype = 1; |
| 4046 | vinfos[5].foffset = j5; |
| 4047 | vinfos[5].indices[0] = _ij5[0]; |
| 4048 | vinfos[5].indices[1] = _ij5[1]; |
| 4049 | vinfos[5].maxsolutions = _nj5; |
| 4050 | std::vector<int> vfree(0); |
| 4051 | solutions.AddSolution(vinfos,vfree); |
| 4052 | } |
| 4053 | } |
| 4054 | } |
| 4055 | |
| 4056 | } |
| 4057 | |
| 4058 | } |
| 4059 | |
| 4060 | } |
| 4061 | } while(0); |
| 4062 | if( bgotonextstatement ) |
| 4063 | { |
| 4064 | bool bgotonextstatement = true; |
| 4065 | do |
| 4066 | { |
| 4067 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 4068 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 4069 | { |
| 4070 | bgotonextstatement=false; |
| 4071 | { |
| 4072 | IkReal j5eval[3]; |
| 4073 | IkReal x464=((-1.0000000008)*new_r00); |
| 4074 | IkReal x466 = ((1.0000000016)+(((-1.6e-9)*(new_r10*new_r10)))); |
| 4075 | if(IKabs(x466)==0){ |
| 4076 | continue; |
| 4077 | } |
| 4078 | IkReal x465=pow(x466,-0.5); |
| 4079 | sj4=4.0e-5; |
| 4080 | cj4=1.0; |
| 4081 | j4=4.0e-5; |
| 4082 | sj3=gconst7; |
| 4083 | cj3=gconst8; |
| 4084 | CheckValue<IkReal> x467 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 4085 | if(!x467.valid){ |
| 4086 | continue; |
| 4087 | } |
| 4088 | j3=((-1.0)*(x467.value)); |
| 4089 | new_r11=0; |
| 4090 | new_r01=0; |
| 4091 | new_r22=0; |
| 4092 | new_r20=0; |
| 4093 | CheckValue<IkReal> x468 = IKatan2WithCheck(IkReal(new_r10),IkReal(x464),IKFAST_ATAN2_MAGTHRESH); |
| 4094 | if(!x468.valid){ |
| 4095 | continue; |
| 4096 | } |
| 4097 | IkReal gconst6=((-1.0)*(x468.value)); |
| 4098 | IkReal gconst7=((-1.0)*new_r10*x465); |
| 4099 | IkReal gconst8=(x464*x465); |
| 4100 | IkReal x469=new_r10*new_r10; |
| 4101 | CheckValue<IkReal> x473=IKPowWithIntegerCheck(((-625000001.0)+x469),-1); |
| 4102 | if(!x473.valid){ |
| 4103 | continue; |
| 4104 | } |
| 4105 | IkReal x470=x473.value; |
| 4106 | if((((625000001.0)+(((-1.0)*x469)))) < -0.00001) |
| 4107 | continue; |
| 4108 | IkReal x471=IKsqrt(((625000001.0)+(((-1.0)*x469)))); |
| 4109 | IkReal x472=(x470*x471); |
| 4110 | j5eval[0]=-1.0; |
| 4111 | j5eval[1]=-1.0; |
| 4112 | IkReal x474 = ((1.0000000016)+(((-1.6e-9)*x469))); |
| 4113 | if(IKabs(x474)==0){ |
| 4114 | continue; |
| 4115 | } |
| 4116 | j5eval[2]=((IKabs(((((-625000001.0)*x472))+(((1250000001.0)*x469*x472)))))+(((50000.00004)*(IKabs((new_r00*new_r10*(pow(x474,-0.5)))))))); |
| 4117 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 4118 | { |
| 4119 | { |
| 4120 | IkReal j5eval[1]; |
| 4121 | IkReal x475=((-1.0000000008)*new_r00); |
| 4122 | IkReal x477 = ((1.0000000016)+(((-1.6e-9)*(new_r10*new_r10)))); |
| 4123 | if(IKabs(x477)==0){ |
| 4124 | continue; |
| 4125 | } |
| 4126 | IkReal x476=pow(x477,-0.5); |
| 4127 | sj4=4.0e-5; |
| 4128 | cj4=1.0; |
| 4129 | j4=4.0e-5; |
| 4130 | sj3=gconst7; |
| 4131 | cj3=gconst8; |
| 4132 | CheckValue<IkReal> x478 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 4133 | if(!x478.valid){ |
| 4134 | continue; |
| 4135 | } |
| 4136 | j3=((-1.0)*(x478.value)); |
| 4137 | new_r11=0; |
| 4138 | new_r01=0; |
| 4139 | new_r22=0; |
| 4140 | new_r20=0; |
| 4141 | CheckValue<IkReal> x479 = IKatan2WithCheck(IkReal(new_r10),IkReal(x475),IKFAST_ATAN2_MAGTHRESH); |
| 4142 | if(!x479.valid){ |
| 4143 | continue; |
| 4144 | } |
| 4145 | IkReal gconst6=((-1.0)*(x479.value)); |
| 4146 | IkReal gconst7=((-1.0)*new_r10*x476); |
| 4147 | IkReal gconst8=(x475*x476); |
| 4148 | IkReal x480=new_r10*new_r10; |
| 4149 | CheckValue<IkReal> x483=IKPowWithIntegerCheck(((1.0000000016)+(((-1.6e-9)*x480))),-1); |
| 4150 | if(!x483.valid){ |
| 4151 | continue; |
| 4152 | } |
| 4153 | IkReal x481=x483.value; |
| 4154 | IkReal x482=((625000001.0)*x481); |
| 4155 | IkReal x484=((1.0)+(((-1.0)*x480))); |
| 4156 | j5eval[0]=IKsign((((x482*(x480*x480)))+(((-1.0)*x482*(x484*x484))))); |
| 4157 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 4158 | { |
| 4159 | { |
| 4160 | IkReal j5eval[2]; |
| 4161 | IkReal x485=((-1.0000000008)*new_r00); |
| 4162 | IkReal x487 = ((1.0000000016)+(((-1.6e-9)*(new_r10*new_r10)))); |
| 4163 | if(IKabs(x487)==0){ |
| 4164 | continue; |
| 4165 | } |
| 4166 | IkReal x486=pow(x487,-0.5); |
| 4167 | sj4=4.0e-5; |
| 4168 | cj4=1.0; |
| 4169 | j4=4.0e-5; |
| 4170 | sj3=gconst7; |
| 4171 | cj3=gconst8; |
| 4172 | CheckValue<IkReal> x488 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 4173 | if(!x488.valid){ |
| 4174 | continue; |
| 4175 | } |
| 4176 | j3=((-1.0)*(x488.value)); |
| 4177 | new_r11=0; |
| 4178 | new_r01=0; |
| 4179 | new_r22=0; |
| 4180 | new_r20=0; |
| 4181 | CheckValue<IkReal> x489 = IKatan2WithCheck(IkReal(new_r10),IkReal(x485),IKFAST_ATAN2_MAGTHRESH); |
| 4182 | if(!x489.valid){ |
| 4183 | continue; |
| 4184 | } |
| 4185 | IkReal gconst6=((-1.0)*(x489.value)); |
| 4186 | IkReal gconst7=((-1.0)*new_r10*x486); |
| 4187 | IkReal gconst8=(x485*x486); |
| 4188 | IkReal x490=new_r10*new_r10; |
| 4189 | IkReal x491=((1.0000000016)+(((-1.6e-9)*x490))); |
| 4190 | CheckValue<IkReal> x492=IKPowWithIntegerCheck(x491,-1); |
| 4191 | if(!x492.valid){ |
| 4192 | continue; |
| 4193 | } |
| 4194 | j5eval[0]=((-3.20000000256e-9)*x490*(x492.value)*(((1.0)+(((-1.0)*x490))))); |
| 4195 | IkReal x493 = x491; |
| 4196 | if(IKabs(x493)==0){ |
| 4197 | continue; |
| 4198 | } |
| 4199 | j5eval[1]=((1.6e-9)*new_r00*new_r10*(pow(x493,-0.5))); |
| 4200 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 4201 | { |
| 4202 | continue; // 3 cases reached |
| 4203 | |
| 4204 | } else |
| 4205 | { |
| 4206 | { |
| 4207 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 4208 | bool j5valid[1]={false}; |
| 4209 | _nj5 = 1; |
| 4210 | IkReal x494=gconst7*gconst7; |
| 4211 | IkReal x495=new_r10*new_r10; |
| 4212 | IkReal x496=((625000000.0)*new_r00); |
| 4213 | IkReal x497=((625000000.5)*gconst8); |
| 4214 | IkReal x498=((25000.00002)*gconst8); |
| 4215 | IkReal x499=((25000.0)*new_r00); |
| 4216 | CheckValue<IkReal> x500=IKPowWithIntegerCheck(((((-625000001.0)*x495*(gconst8*gconst8)))+((new_r00*x494*x496))),-1); |
| 4217 | if(!x500.valid){ |
| 4218 | continue; |
| 4219 | } |
| 4220 | CheckValue<IkReal> x501=IKPowWithIntegerCheck(((((-1.0)*new_r10*x498))+((gconst7*x499))),-1); |
| 4221 | if(!x501.valid){ |
| 4222 | continue; |
| 4223 | } |
| 4224 | if( IKabs(((x500.value)*(((((-1.0)*x496*(gconst7*gconst7*gconst7)))+(((-1.0)*new_r10*x494*x497))+((x497*(new_r10*new_r10*new_r10)))+((gconst7*x495*x496)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((x501.value)*(((((-1.0)*new_r10*x499))+((gconst7*x498)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x500.value)*(((((-1.0)*x496*(gconst7*gconst7*gconst7)))+(((-1.0)*new_r10*x494*x497))+((x497*(new_r10*new_r10*new_r10)))+((gconst7*x495*x496))))))+IKsqr(((x501.value)*(((((-1.0)*new_r10*x499))+((gconst7*x498))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 4225 | continue; |
| 4226 | j5array[0]=IKatan2(((x500.value)*(((((-1.0)*x496*(gconst7*gconst7*gconst7)))+(((-1.0)*new_r10*x494*x497))+((x497*(new_r10*new_r10*new_r10)))+((gconst7*x495*x496))))), ((x501.value)*(((((-1.0)*new_r10*x499))+((gconst7*x498)))))); |
| 4227 | sj5array[0]=IKsin(j5array[0]); |
| 4228 | cj5array[0]=IKcos(j5array[0]); |
| 4229 | if( j5array[0] > IKPI ) |
| 4230 | { |
| 4231 | j5array[0]-=IK2PI; |
| 4232 | } |
| 4233 | else if( j5array[0] < -IKPI ) |
| 4234 | { j5array[0]+=IK2PI; |
| 4235 | } |
| 4236 | j5valid[0] = true; |
| 4237 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 4238 | { |
| 4239 | if( !j5valid[ij5] ) |
| 4240 | { |
| 4241 | continue; |
| 4242 | } |
| 4243 | _ij5[0] = ij5; _ij5[1] = -1; |
| 4244 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 4245 | { |
| 4246 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 4247 | { |
| 4248 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 4249 | } |
| 4250 | } |
| 4251 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 4252 | { |
| 4253 | IkReal evalcond[7]; |
| 4254 | IkReal x502=IKsin(j5); |
| 4255 | IkReal x503=IKcos(j5); |
| 4256 | IkReal x504=((1.0)*gconst8); |
| 4257 | IkReal x505=((1.0000000008)*gconst8); |
| 4258 | IkReal x506=(gconst7*x503); |
| 4259 | IkReal x507=(new_r00*x503); |
| 4260 | IkReal x508=((1.0000000008)*x502); |
| 4261 | evalcond[0]=(gconst7+((new_r10*x503))+((new_r00*x502))); |
| 4262 | evalcond[1]=(((gconst7*x502))+(((-1.0)*x503*x505))+new_r00); |
| 4263 | evalcond[2]=(x506+((x502*x505))+new_r10); |
| 4264 | evalcond[3]=((((-1.0)*x502*x504))+(((-1.0000000008)*x506))); |
| 4265 | evalcond[4]=(((gconst7*x508))+(((-1.0)*x503*x504))); |
| 4266 | evalcond[5]=((((-1.0)*new_r10*x502))+(((-1.0)*x505))+x507); |
| 4267 | evalcond[6]=((((-1.0)*x504))+(((1.0000000008)*x507))+(((-1.0)*new_r10*x508))); |
| 4268 | if( 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 ) |
| 4269 | { |
| 4270 | continue; |
| 4271 | } |
| 4272 | } |
| 4273 | |
| 4274 | { |
| 4275 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 4276 | vinfos[0].jointtype = 1; |
| 4277 | vinfos[0].foffset = j0; |
| 4278 | vinfos[0].indices[0] = _ij0[0]; |
| 4279 | vinfos[0].indices[1] = _ij0[1]; |
| 4280 | vinfos[0].maxsolutions = _nj0; |
| 4281 | vinfos[1].jointtype = 1; |
| 4282 | vinfos[1].foffset = j1; |
| 4283 | vinfos[1].indices[0] = _ij1[0]; |
| 4284 | vinfos[1].indices[1] = _ij1[1]; |
| 4285 | vinfos[1].maxsolutions = _nj1; |
| 4286 | vinfos[2].jointtype = 1; |
| 4287 | vinfos[2].foffset = j2; |
| 4288 | vinfos[2].indices[0] = _ij2[0]; |
| 4289 | vinfos[2].indices[1] = _ij2[1]; |
| 4290 | vinfos[2].maxsolutions = _nj2; |
| 4291 | vinfos[3].jointtype = 1; |
| 4292 | vinfos[3].foffset = j3; |
| 4293 | vinfos[3].indices[0] = _ij3[0]; |
| 4294 | vinfos[3].indices[1] = _ij3[1]; |
| 4295 | vinfos[3].maxsolutions = _nj3; |
| 4296 | vinfos[4].jointtype = 1; |
| 4297 | vinfos[4].foffset = j4; |
| 4298 | vinfos[4].indices[0] = _ij4[0]; |
| 4299 | vinfos[4].indices[1] = _ij4[1]; |
| 4300 | vinfos[4].maxsolutions = _nj4; |
| 4301 | vinfos[5].jointtype = 1; |
| 4302 | vinfos[5].foffset = j5; |
| 4303 | vinfos[5].indices[0] = _ij5[0]; |
| 4304 | vinfos[5].indices[1] = _ij5[1]; |
| 4305 | vinfos[5].maxsolutions = _nj5; |
| 4306 | std::vector<int> vfree(0); |
| 4307 | solutions.AddSolution(vinfos,vfree); |
| 4308 | } |
| 4309 | } |
| 4310 | } |
| 4311 | |
| 4312 | } |
| 4313 | |
| 4314 | } |
| 4315 | |
| 4316 | } else |
| 4317 | { |
| 4318 | { |
| 4319 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 4320 | bool j5valid[1]={false}; |
| 4321 | _nj5 = 1; |
| 4322 | IkReal x509=gconst8*gconst8; |
| 4323 | IkReal x510=gconst7*gconst7; |
| 4324 | IkReal x511=((625000000.0)*x509); |
| 4325 | IkReal x512=((625000000.5)*gconst8*x510); |
| 4326 | CheckValue<IkReal> x513 = IKatan2WithCheck(IkReal((((gconst7*new_r00*x511))+(((-1.0)*new_r10*x512)))),IkReal((((new_r00*x512))+(((-625000001.0)*new_r10*(gconst7*gconst7*gconst7))))),IKFAST_ATAN2_MAGTHRESH); |
| 4327 | if(!x513.valid){ |
| 4328 | continue; |
| 4329 | } |
| 4330 | CheckValue<IkReal> x514=IKPowWithIntegerCheck(IKsign(((((625000001.0)*x510*(new_r10*new_r10)))+(((-1.0)*x511*(new_r00*new_r00))))),-1); |
| 4331 | if(!x514.valid){ |
| 4332 | continue; |
| 4333 | } |
| 4334 | j5array[0]=((-1.5707963267949)+(x513.value)+(((1.5707963267949)*(x514.value)))); |
| 4335 | sj5array[0]=IKsin(j5array[0]); |
| 4336 | cj5array[0]=IKcos(j5array[0]); |
| 4337 | if( j5array[0] > IKPI ) |
| 4338 | { |
| 4339 | j5array[0]-=IK2PI; |
| 4340 | } |
| 4341 | else if( j5array[0] < -IKPI ) |
| 4342 | { j5array[0]+=IK2PI; |
| 4343 | } |
| 4344 | j5valid[0] = true; |
| 4345 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 4346 | { |
| 4347 | if( !j5valid[ij5] ) |
| 4348 | { |
| 4349 | continue; |
| 4350 | } |
| 4351 | _ij5[0] = ij5; _ij5[1] = -1; |
| 4352 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 4353 | { |
| 4354 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 4355 | { |
| 4356 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 4357 | } |
| 4358 | } |
| 4359 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 4360 | { |
| 4361 | IkReal evalcond[7]; |
| 4362 | IkReal x515=IKsin(j5); |
| 4363 | IkReal x516=IKcos(j5); |
| 4364 | IkReal x517=((1.0)*gconst8); |
| 4365 | IkReal x518=((1.0000000008)*gconst8); |
| 4366 | IkReal x519=(gconst7*x516); |
| 4367 | IkReal x520=(new_r00*x516); |
| 4368 | IkReal x521=((1.0000000008)*x515); |
| 4369 | evalcond[0]=(((new_r00*x515))+((new_r10*x516))+gconst7); |
| 4370 | evalcond[1]=((((-1.0)*x516*x518))+((gconst7*x515))+new_r00); |
| 4371 | evalcond[2]=(x519+((x515*x518))+new_r10); |
| 4372 | evalcond[3]=((((-1.0000000008)*x519))+(((-1.0)*x515*x517))); |
| 4373 | evalcond[4]=(((gconst7*x521))+(((-1.0)*x516*x517))); |
| 4374 | evalcond[5]=((((-1.0)*new_r10*x515))+x520+(((-1.0)*x518))); |
| 4375 | evalcond[6]=((((1.0000000008)*x520))+(((-1.0)*new_r10*x521))+(((-1.0)*x517))); |
| 4376 | if( 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 ) |
| 4377 | { |
| 4378 | continue; |
| 4379 | } |
| 4380 | } |
| 4381 | |
| 4382 | { |
| 4383 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 4384 | vinfos[0].jointtype = 1; |
| 4385 | vinfos[0].foffset = j0; |
| 4386 | vinfos[0].indices[0] = _ij0[0]; |
| 4387 | vinfos[0].indices[1] = _ij0[1]; |
| 4388 | vinfos[0].maxsolutions = _nj0; |
| 4389 | vinfos[1].jointtype = 1; |
| 4390 | vinfos[1].foffset = j1; |
| 4391 | vinfos[1].indices[0] = _ij1[0]; |
| 4392 | vinfos[1].indices[1] = _ij1[1]; |
| 4393 | vinfos[1].maxsolutions = _nj1; |
| 4394 | vinfos[2].jointtype = 1; |
| 4395 | vinfos[2].foffset = j2; |
| 4396 | vinfos[2].indices[0] = _ij2[0]; |
| 4397 | vinfos[2].indices[1] = _ij2[1]; |
| 4398 | vinfos[2].maxsolutions = _nj2; |
| 4399 | vinfos[3].jointtype = 1; |
| 4400 | vinfos[3].foffset = j3; |
| 4401 | vinfos[3].indices[0] = _ij3[0]; |
| 4402 | vinfos[3].indices[1] = _ij3[1]; |
| 4403 | vinfos[3].maxsolutions = _nj3; |
| 4404 | vinfos[4].jointtype = 1; |
| 4405 | vinfos[4].foffset = j4; |
| 4406 | vinfos[4].indices[0] = _ij4[0]; |
| 4407 | vinfos[4].indices[1] = _ij4[1]; |
| 4408 | vinfos[4].maxsolutions = _nj4; |
| 4409 | vinfos[5].jointtype = 1; |
| 4410 | vinfos[5].foffset = j5; |
| 4411 | vinfos[5].indices[0] = _ij5[0]; |
| 4412 | vinfos[5].indices[1] = _ij5[1]; |
| 4413 | vinfos[5].maxsolutions = _nj5; |
| 4414 | std::vector<int> vfree(0); |
| 4415 | solutions.AddSolution(vinfos,vfree); |
| 4416 | } |
| 4417 | } |
| 4418 | } |
| 4419 | |
| 4420 | } |
| 4421 | |
| 4422 | } |
| 4423 | |
| 4424 | } else |
| 4425 | { |
| 4426 | { |
| 4427 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 4428 | bool j5valid[1]={false}; |
| 4429 | _nj5 = 1; |
| 4430 | IkReal x522=((25000.00002)*gconst8); |
| 4431 | IkReal x523=((25000.0)*gconst7); |
| 4432 | CheckValue<IkReal> x524=IKPowWithIntegerCheck(IKsign(((((-25000.0)*(new_r10*new_r10)))+(((-25000.0)*(new_r00*new_r00))))),-1); |
| 4433 | if(!x524.valid){ |
| 4434 | continue; |
| 4435 | } |
| 4436 | CheckValue<IkReal> x525 = IKatan2WithCheck(IkReal((((new_r10*x522))+((new_r00*x523)))),IkReal(((((-1.0)*new_r00*x522))+((new_r10*x523)))),IKFAST_ATAN2_MAGTHRESH); |
| 4437 | if(!x525.valid){ |
| 4438 | continue; |
| 4439 | } |
| 4440 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x524.value)))+(x525.value)); |
| 4441 | sj5array[0]=IKsin(j5array[0]); |
| 4442 | cj5array[0]=IKcos(j5array[0]); |
| 4443 | if( j5array[0] > IKPI ) |
| 4444 | { |
| 4445 | j5array[0]-=IK2PI; |
| 4446 | } |
| 4447 | else if( j5array[0] < -IKPI ) |
| 4448 | { j5array[0]+=IK2PI; |
| 4449 | } |
| 4450 | j5valid[0] = true; |
| 4451 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 4452 | { |
| 4453 | if( !j5valid[ij5] ) |
| 4454 | { |
| 4455 | continue; |
| 4456 | } |
| 4457 | _ij5[0] = ij5; _ij5[1] = -1; |
| 4458 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 4459 | { |
| 4460 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 4461 | { |
| 4462 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 4463 | } |
| 4464 | } |
| 4465 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 4466 | { |
| 4467 | IkReal evalcond[7]; |
| 4468 | IkReal x526=IKsin(j5); |
| 4469 | IkReal x527=IKcos(j5); |
| 4470 | IkReal x528=((1.0)*gconst8); |
| 4471 | IkReal x529=((1.0000000008)*gconst8); |
| 4472 | IkReal x530=(gconst7*x527); |
| 4473 | IkReal x531=(new_r00*x527); |
| 4474 | IkReal x532=((1.0000000008)*x526); |
| 4475 | evalcond[0]=(gconst7+((new_r10*x527))+((new_r00*x526))); |
| 4476 | evalcond[1]=((((-1.0)*x527*x529))+((gconst7*x526))+new_r00); |
| 4477 | evalcond[2]=(((x526*x529))+x530+new_r10); |
| 4478 | evalcond[3]=((((-1.0)*x526*x528))+(((-1.0000000008)*x530))); |
| 4479 | evalcond[4]=((((-1.0)*x527*x528))+((gconst7*x532))); |
| 4480 | evalcond[5]=((((-1.0)*x529))+x531+(((-1.0)*new_r10*x526))); |
| 4481 | evalcond[6]=((((1.0000000008)*x531))+(((-1.0)*x528))+(((-1.0)*new_r10*x532))); |
| 4482 | if( 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 ) |
| 4483 | { |
| 4484 | continue; |
| 4485 | } |
| 4486 | } |
| 4487 | |
| 4488 | { |
| 4489 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 4490 | vinfos[0].jointtype = 1; |
| 4491 | vinfos[0].foffset = j0; |
| 4492 | vinfos[0].indices[0] = _ij0[0]; |
| 4493 | vinfos[0].indices[1] = _ij0[1]; |
| 4494 | vinfos[0].maxsolutions = _nj0; |
| 4495 | vinfos[1].jointtype = 1; |
| 4496 | vinfos[1].foffset = j1; |
| 4497 | vinfos[1].indices[0] = _ij1[0]; |
| 4498 | vinfos[1].indices[1] = _ij1[1]; |
| 4499 | vinfos[1].maxsolutions = _nj1; |
| 4500 | vinfos[2].jointtype = 1; |
| 4501 | vinfos[2].foffset = j2; |
| 4502 | vinfos[2].indices[0] = _ij2[0]; |
| 4503 | vinfos[2].indices[1] = _ij2[1]; |
| 4504 | vinfos[2].maxsolutions = _nj2; |
| 4505 | vinfos[3].jointtype = 1; |
| 4506 | vinfos[3].foffset = j3; |
| 4507 | vinfos[3].indices[0] = _ij3[0]; |
| 4508 | vinfos[3].indices[1] = _ij3[1]; |
| 4509 | vinfos[3].maxsolutions = _nj3; |
| 4510 | vinfos[4].jointtype = 1; |
| 4511 | vinfos[4].foffset = j4; |
| 4512 | vinfos[4].indices[0] = _ij4[0]; |
| 4513 | vinfos[4].indices[1] = _ij4[1]; |
| 4514 | vinfos[4].maxsolutions = _nj4; |
| 4515 | vinfos[5].jointtype = 1; |
| 4516 | vinfos[5].foffset = j5; |
| 4517 | vinfos[5].indices[0] = _ij5[0]; |
| 4518 | vinfos[5].indices[1] = _ij5[1]; |
| 4519 | vinfos[5].maxsolutions = _nj5; |
| 4520 | std::vector<int> vfree(0); |
| 4521 | solutions.AddSolution(vinfos,vfree); |
| 4522 | } |
| 4523 | } |
| 4524 | } |
| 4525 | |
| 4526 | } |
| 4527 | |
| 4528 | } |
| 4529 | |
| 4530 | } |
| 4531 | } while(0); |
| 4532 | if( bgotonextstatement ) |
| 4533 | { |
| 4534 | bool bgotonextstatement = true; |
| 4535 | do |
| 4536 | { |
| 4537 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r10))); |
| 4538 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 4539 | { |
| 4540 | bgotonextstatement=false; |
| 4541 | { |
| 4542 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 4543 | bool j5valid[1]={false}; |
| 4544 | _nj5 = 1; |
| 4545 | CheckValue<IkReal> x534=IKPowWithIntegerCheck(gconst8,-1); |
| 4546 | if(!x534.valid){ |
| 4547 | continue; |
| 4548 | } |
| 4549 | IkReal x533=x534.value; |
| 4550 | if( IKabs((new_r01*x533)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((0.9999999992)*new_r00*x533)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((new_r01*x533))+IKsqr(((0.9999999992)*new_r00*x533))-1) <= IKFAST_SINCOS_THRESH ) |
| 4551 | continue; |
| 4552 | j5array[0]=IKatan2((new_r01*x533), ((0.9999999992)*new_r00*x533)); |
| 4553 | sj5array[0]=IKsin(j5array[0]); |
| 4554 | cj5array[0]=IKcos(j5array[0]); |
| 4555 | if( j5array[0] > IKPI ) |
| 4556 | { |
| 4557 | j5array[0]-=IK2PI; |
| 4558 | } |
| 4559 | else if( j5array[0] < -IKPI ) |
| 4560 | { j5array[0]+=IK2PI; |
| 4561 | } |
| 4562 | j5valid[0] = true; |
| 4563 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 4564 | { |
| 4565 | if( !j5valid[ij5] ) |
| 4566 | { |
| 4567 | continue; |
| 4568 | } |
| 4569 | _ij5[0] = ij5; _ij5[1] = -1; |
| 4570 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 4571 | { |
| 4572 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 4573 | { |
| 4574 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 4575 | } |
| 4576 | } |
| 4577 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 4578 | { |
| 4579 | IkReal evalcond[10]; |
| 4580 | IkReal x535=IKcos(j5); |
| 4581 | IkReal x536=IKsin(j5); |
| 4582 | IkReal x537=((1.0)*gconst8); |
| 4583 | IkReal x538=((1.0000000008)*gconst8); |
| 4584 | IkReal x539=(new_r00*x535); |
| 4585 | IkReal x540=(gconst8*x535); |
| 4586 | IkReal x541=(new_r01*x535); |
| 4587 | evalcond[0]=(new_r00*x536); |
| 4588 | evalcond[1]=x541; |
| 4589 | evalcond[2]=((-1.0)*x540); |
| 4590 | evalcond[3]=(new_r01+(((-1.0)*x536*x537))); |
| 4591 | evalcond[4]=(((new_r01*x536))+(((-1.0)*x537))); |
| 4592 | evalcond[5]=(x536*x538); |
| 4593 | evalcond[6]=((1.0000000008)*x541); |
| 4594 | evalcond[7]=((((-1.0)*x535*x538))+new_r00); |
| 4595 | evalcond[8]=((((-1.0)*x538))+x539); |
| 4596 | evalcond[9]=((((1.0000000008)*x539))+(((-1.0)*x537))); |
| 4597 | if( 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 ) |
| 4598 | { |
| 4599 | continue; |
| 4600 | } |
| 4601 | } |
| 4602 | |
| 4603 | { |
| 4604 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 4605 | vinfos[0].jointtype = 1; |
| 4606 | vinfos[0].foffset = j0; |
| 4607 | vinfos[0].indices[0] = _ij0[0]; |
| 4608 | vinfos[0].indices[1] = _ij0[1]; |
| 4609 | vinfos[0].maxsolutions = _nj0; |
| 4610 | vinfos[1].jointtype = 1; |
| 4611 | vinfos[1].foffset = j1; |
| 4612 | vinfos[1].indices[0] = _ij1[0]; |
| 4613 | vinfos[1].indices[1] = _ij1[1]; |
| 4614 | vinfos[1].maxsolutions = _nj1; |
| 4615 | vinfos[2].jointtype = 1; |
| 4616 | vinfos[2].foffset = j2; |
| 4617 | vinfos[2].indices[0] = _ij2[0]; |
| 4618 | vinfos[2].indices[1] = _ij2[1]; |
| 4619 | vinfos[2].maxsolutions = _nj2; |
| 4620 | vinfos[3].jointtype = 1; |
| 4621 | vinfos[3].foffset = j3; |
| 4622 | vinfos[3].indices[0] = _ij3[0]; |
| 4623 | vinfos[3].indices[1] = _ij3[1]; |
| 4624 | vinfos[3].maxsolutions = _nj3; |
| 4625 | vinfos[4].jointtype = 1; |
| 4626 | vinfos[4].foffset = j4; |
| 4627 | vinfos[4].indices[0] = _ij4[0]; |
| 4628 | vinfos[4].indices[1] = _ij4[1]; |
| 4629 | vinfos[4].maxsolutions = _nj4; |
| 4630 | vinfos[5].jointtype = 1; |
| 4631 | vinfos[5].foffset = j5; |
| 4632 | vinfos[5].indices[0] = _ij5[0]; |
| 4633 | vinfos[5].indices[1] = _ij5[1]; |
| 4634 | vinfos[5].maxsolutions = _nj5; |
| 4635 | std::vector<int> vfree(0); |
| 4636 | solutions.AddSolution(vinfos,vfree); |
| 4637 | } |
| 4638 | } |
| 4639 | } |
| 4640 | |
| 4641 | } |
| 4642 | } while(0); |
| 4643 | if( bgotonextstatement ) |
| 4644 | { |
| 4645 | bool bgotonextstatement = true; |
| 4646 | do |
| 4647 | { |
| 4648 | if( 1 ) |
| 4649 | { |
| 4650 | bgotonextstatement=false; |
| 4651 | continue; // branch miss [j5] |
| 4652 | |
| 4653 | } |
| 4654 | } while(0); |
| 4655 | if( bgotonextstatement ) |
| 4656 | { |
| 4657 | } |
| 4658 | } |
| 4659 | } |
| 4660 | } |
| 4661 | } |
| 4662 | |
| 4663 | } else |
| 4664 | { |
| 4665 | { |
| 4666 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 4667 | bool j5valid[1]={false}; |
| 4668 | _nj5 = 1; |
| 4669 | CheckValue<IkReal> x546=IKPowWithIntegerCheck(new_r00,-1); |
| 4670 | if(!x546.valid){ |
| 4671 | continue; |
| 4672 | } |
| 4673 | IkReal x542=x546.value; |
| 4674 | IkReal x543=gconst7*gconst7; |
| 4675 | IkReal x544=((25000.0)*new_r10); |
| 4676 | CheckValue<IkReal> x547=IKPowWithIntegerCheck(((((25000.00002)*gconst8*new_r00))+((gconst7*x544))),-1); |
| 4677 | if(!x547.valid){ |
| 4678 | continue; |
| 4679 | } |
| 4680 | IkReal x545=x547.value; |
| 4681 | CheckValue<IkReal> x548=IKPowWithIntegerCheck(x542,-2); |
| 4682 | if(!x548.valid){ |
| 4683 | continue; |
| 4684 | } |
| 4685 | if( IKabs((((x542*x543*x544*x545))+(((-1.0)*gconst7*x542))+(((-1.0)*new_r00*x544*x545)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x545*(((((25000.0)*(x548.value)))+(((-25000.0)*x543)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((x542*x543*x544*x545))+(((-1.0)*gconst7*x542))+(((-1.0)*new_r00*x544*x545))))+IKsqr((x545*(((((25000.0)*(x548.value)))+(((-25000.0)*x543))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 4686 | continue; |
| 4687 | j5array[0]=IKatan2((((x542*x543*x544*x545))+(((-1.0)*gconst7*x542))+(((-1.0)*new_r00*x544*x545))), (x545*(((((25000.0)*(x548.value)))+(((-25000.0)*x543)))))); |
| 4688 | sj5array[0]=IKsin(j5array[0]); |
| 4689 | cj5array[0]=IKcos(j5array[0]); |
| 4690 | if( j5array[0] > IKPI ) |
| 4691 | { |
| 4692 | j5array[0]-=IK2PI; |
| 4693 | } |
| 4694 | else if( j5array[0] < -IKPI ) |
| 4695 | { j5array[0]+=IK2PI; |
| 4696 | } |
| 4697 | j5valid[0] = true; |
| 4698 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 4699 | { |
| 4700 | if( !j5valid[ij5] ) |
| 4701 | { |
| 4702 | continue; |
| 4703 | } |
| 4704 | _ij5[0] = ij5; _ij5[1] = -1; |
| 4705 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 4706 | { |
| 4707 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 4708 | { |
| 4709 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 4710 | } |
| 4711 | } |
| 4712 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 4713 | { |
| 4714 | IkReal evalcond[10]; |
| 4715 | IkReal x549=IKcos(j5); |
| 4716 | IkReal x550=IKsin(j5); |
| 4717 | IkReal x551=((1.0)*gconst8); |
| 4718 | IkReal x552=((1.0000000008)*gconst7); |
| 4719 | IkReal x553=((1.0000000008)*gconst8); |
| 4720 | IkReal x554=(new_r11*x550); |
| 4721 | IkReal x555=(new_r01*x549); |
| 4722 | IkReal x556=(new_r00*x549); |
| 4723 | IkReal x557=(new_r10*x550); |
| 4724 | evalcond[0]=(gconst7+((new_r10*x549))+((new_r00*x550))); |
| 4725 | evalcond[1]=(((new_r11*x549))+(((-1.0)*x551))+((new_r01*x550))); |
| 4726 | evalcond[2]=(((gconst7*x550))+(((-1.0)*x549*x553))+new_r00); |
| 4727 | evalcond[3]=(((gconst7*x549))+((x550*x553))+new_r10); |
| 4728 | evalcond[4]=((((-1.0)*x550*x551))+(((-1.0)*x549*x552))+new_r01); |
| 4729 | evalcond[5]=(((x550*x552))+(((-1.0)*x549*x551))+new_r11); |
| 4730 | evalcond[6]=((((-1.0)*x557))+(((-1.0)*x553))+x556); |
| 4731 | evalcond[7]=((((-1.0)*x554))+(((-1.0)*x552))+x555); |
| 4732 | evalcond[8]=((((-1.0000000008)*x557))+(((-1.0)*x551))+(((1.0000000008)*x556))); |
| 4733 | evalcond[9]=((((-1.0)*gconst7))+(((-1.0000000008)*x554))+(((1.0000000008)*x555))); |
| 4734 | if( 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 ) |
| 4735 | { |
| 4736 | continue; |
| 4737 | } |
| 4738 | } |
| 4739 | |
| 4740 | { |
| 4741 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 4742 | vinfos[0].jointtype = 1; |
| 4743 | vinfos[0].foffset = j0; |
| 4744 | vinfos[0].indices[0] = _ij0[0]; |
| 4745 | vinfos[0].indices[1] = _ij0[1]; |
| 4746 | vinfos[0].maxsolutions = _nj0; |
| 4747 | vinfos[1].jointtype = 1; |
| 4748 | vinfos[1].foffset = j1; |
| 4749 | vinfos[1].indices[0] = _ij1[0]; |
| 4750 | vinfos[1].indices[1] = _ij1[1]; |
| 4751 | vinfos[1].maxsolutions = _nj1; |
| 4752 | vinfos[2].jointtype = 1; |
| 4753 | vinfos[2].foffset = j2; |
| 4754 | vinfos[2].indices[0] = _ij2[0]; |
| 4755 | vinfos[2].indices[1] = _ij2[1]; |
| 4756 | vinfos[2].maxsolutions = _nj2; |
| 4757 | vinfos[3].jointtype = 1; |
| 4758 | vinfos[3].foffset = j3; |
| 4759 | vinfos[3].indices[0] = _ij3[0]; |
| 4760 | vinfos[3].indices[1] = _ij3[1]; |
| 4761 | vinfos[3].maxsolutions = _nj3; |
| 4762 | vinfos[4].jointtype = 1; |
| 4763 | vinfos[4].foffset = j4; |
| 4764 | vinfos[4].indices[0] = _ij4[0]; |
| 4765 | vinfos[4].indices[1] = _ij4[1]; |
| 4766 | vinfos[4].maxsolutions = _nj4; |
| 4767 | vinfos[5].jointtype = 1; |
| 4768 | vinfos[5].foffset = j5; |
| 4769 | vinfos[5].indices[0] = _ij5[0]; |
| 4770 | vinfos[5].indices[1] = _ij5[1]; |
| 4771 | vinfos[5].maxsolutions = _nj5; |
| 4772 | std::vector<int> vfree(0); |
| 4773 | solutions.AddSolution(vinfos,vfree); |
| 4774 | } |
| 4775 | } |
| 4776 | } |
| 4777 | |
| 4778 | } |
| 4779 | |
| 4780 | } |
| 4781 | |
| 4782 | } else |
| 4783 | { |
| 4784 | { |
| 4785 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 4786 | bool j5valid[1]={false}; |
| 4787 | _nj5 = 1; |
| 4788 | IkReal x558=gconst7*gconst7; |
| 4789 | IkReal x559=new_r10*new_r10; |
| 4790 | IkReal x560=((625000000.0)*new_r00); |
| 4791 | IkReal x561=((625000000.5)*gconst8); |
| 4792 | IkReal x562=((25000.00002)*gconst8); |
| 4793 | IkReal x563=((25000.0)*new_r00); |
| 4794 | CheckValue<IkReal> x564=IKPowWithIntegerCheck(((((-625000001.0)*x559*(gconst8*gconst8)))+((new_r00*x558*x560))),-1); |
| 4795 | if(!x564.valid){ |
| 4796 | continue; |
| 4797 | } |
| 4798 | CheckValue<IkReal> x565=IKPowWithIntegerCheck((((gconst7*x563))+(((-1.0)*new_r10*x562))),-1); |
| 4799 | if(!x565.valid){ |
| 4800 | continue; |
| 4801 | } |
| 4802 | if( IKabs(((x564.value)*((((x561*(new_r10*new_r10*new_r10)))+(((-1.0)*new_r10*x558*x561))+((gconst7*x559*x560))+(((-1.0)*x560*(gconst7*gconst7*gconst7))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((x565.value)*((((gconst7*x562))+(((-1.0)*new_r10*x563)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x564.value)*((((x561*(new_r10*new_r10*new_r10)))+(((-1.0)*new_r10*x558*x561))+((gconst7*x559*x560))+(((-1.0)*x560*(gconst7*gconst7*gconst7)))))))+IKsqr(((x565.value)*((((gconst7*x562))+(((-1.0)*new_r10*x563))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 4803 | continue; |
| 4804 | j5array[0]=IKatan2(((x564.value)*((((x561*(new_r10*new_r10*new_r10)))+(((-1.0)*new_r10*x558*x561))+((gconst7*x559*x560))+(((-1.0)*x560*(gconst7*gconst7*gconst7)))))), ((x565.value)*((((gconst7*x562))+(((-1.0)*new_r10*x563)))))); |
| 4805 | sj5array[0]=IKsin(j5array[0]); |
| 4806 | cj5array[0]=IKcos(j5array[0]); |
| 4807 | if( j5array[0] > IKPI ) |
| 4808 | { |
| 4809 | j5array[0]-=IK2PI; |
| 4810 | } |
| 4811 | else if( j5array[0] < -IKPI ) |
| 4812 | { j5array[0]+=IK2PI; |
| 4813 | } |
| 4814 | j5valid[0] = true; |
| 4815 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 4816 | { |
| 4817 | if( !j5valid[ij5] ) |
| 4818 | { |
| 4819 | continue; |
| 4820 | } |
| 4821 | _ij5[0] = ij5; _ij5[1] = -1; |
| 4822 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 4823 | { |
| 4824 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 4825 | { |
| 4826 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 4827 | } |
| 4828 | } |
| 4829 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 4830 | { |
| 4831 | IkReal evalcond[10]; |
| 4832 | IkReal x566=IKcos(j5); |
| 4833 | IkReal x567=IKsin(j5); |
| 4834 | IkReal x568=((1.0)*gconst8); |
| 4835 | IkReal x569=((1.0000000008)*gconst7); |
| 4836 | IkReal x570=((1.0000000008)*gconst8); |
| 4837 | IkReal x571=(new_r11*x567); |
| 4838 | IkReal x572=(new_r01*x566); |
| 4839 | IkReal x573=(new_r00*x566); |
| 4840 | IkReal x574=(new_r10*x567); |
| 4841 | evalcond[0]=(gconst7+((new_r00*x567))+((new_r10*x566))); |
| 4842 | evalcond[1]=(((new_r01*x567))+((new_r11*x566))+(((-1.0)*x568))); |
| 4843 | evalcond[2]=((((-1.0)*x566*x570))+new_r00+((gconst7*x567))); |
| 4844 | evalcond[3]=(((x567*x570))+new_r10+((gconst7*x566))); |
| 4845 | evalcond[4]=((((-1.0)*x566*x569))+(((-1.0)*x567*x568))+new_r01); |
| 4846 | evalcond[5]=((((-1.0)*x566*x568))+((x567*x569))+new_r11); |
| 4847 | evalcond[6]=((((-1.0)*x574))+(((-1.0)*x570))+x573); |
| 4848 | evalcond[7]=((((-1.0)*x571))+x572+(((-1.0)*x569))); |
| 4849 | evalcond[8]=((((-1.0000000008)*x574))+(((1.0000000008)*x573))+(((-1.0)*x568))); |
| 4850 | evalcond[9]=((((-1.0000000008)*x571))+(((1.0000000008)*x572))+(((-1.0)*gconst7))); |
| 4851 | if( 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 ) |
| 4852 | { |
| 4853 | continue; |
| 4854 | } |
| 4855 | } |
| 4856 | |
| 4857 | { |
| 4858 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 4859 | vinfos[0].jointtype = 1; |
| 4860 | vinfos[0].foffset = j0; |
| 4861 | vinfos[0].indices[0] = _ij0[0]; |
| 4862 | vinfos[0].indices[1] = _ij0[1]; |
| 4863 | vinfos[0].maxsolutions = _nj0; |
| 4864 | vinfos[1].jointtype = 1; |
| 4865 | vinfos[1].foffset = j1; |
| 4866 | vinfos[1].indices[0] = _ij1[0]; |
| 4867 | vinfos[1].indices[1] = _ij1[1]; |
| 4868 | vinfos[1].maxsolutions = _nj1; |
| 4869 | vinfos[2].jointtype = 1; |
| 4870 | vinfos[2].foffset = j2; |
| 4871 | vinfos[2].indices[0] = _ij2[0]; |
| 4872 | vinfos[2].indices[1] = _ij2[1]; |
| 4873 | vinfos[2].maxsolutions = _nj2; |
| 4874 | vinfos[3].jointtype = 1; |
| 4875 | vinfos[3].foffset = j3; |
| 4876 | vinfos[3].indices[0] = _ij3[0]; |
| 4877 | vinfos[3].indices[1] = _ij3[1]; |
| 4878 | vinfos[3].maxsolutions = _nj3; |
| 4879 | vinfos[4].jointtype = 1; |
| 4880 | vinfos[4].foffset = j4; |
| 4881 | vinfos[4].indices[0] = _ij4[0]; |
| 4882 | vinfos[4].indices[1] = _ij4[1]; |
| 4883 | vinfos[4].maxsolutions = _nj4; |
| 4884 | vinfos[5].jointtype = 1; |
| 4885 | vinfos[5].foffset = j5; |
| 4886 | vinfos[5].indices[0] = _ij5[0]; |
| 4887 | vinfos[5].indices[1] = _ij5[1]; |
| 4888 | vinfos[5].maxsolutions = _nj5; |
| 4889 | std::vector<int> vfree(0); |
| 4890 | solutions.AddSolution(vinfos,vfree); |
| 4891 | } |
| 4892 | } |
| 4893 | } |
| 4894 | |
| 4895 | } |
| 4896 | |
| 4897 | } |
| 4898 | |
| 4899 | } else |
| 4900 | { |
| 4901 | { |
| 4902 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 4903 | bool j5valid[1]={false}; |
| 4904 | _nj5 = 1; |
| 4905 | IkReal x575=((1.0)*new_r00); |
| 4906 | CheckValue<IkReal> x576 = IKatan2WithCheck(IkReal((((gconst8*new_r10))+((gconst7*new_r11)))),IkReal(((((-1.0)*gconst7*new_r01))+(((-1.0)*gconst8*x575)))),IKFAST_ATAN2_MAGTHRESH); |
| 4907 | if(!x576.valid){ |
| 4908 | continue; |
| 4909 | } |
| 4910 | CheckValue<IkReal> x577=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r11*x575))+((new_r01*new_r10)))),-1); |
| 4911 | if(!x577.valid){ |
| 4912 | continue; |
| 4913 | } |
| 4914 | j5array[0]=((-1.5707963267949)+(x576.value)+(((1.5707963267949)*(x577.value)))); |
| 4915 | sj5array[0]=IKsin(j5array[0]); |
| 4916 | cj5array[0]=IKcos(j5array[0]); |
| 4917 | if( j5array[0] > IKPI ) |
| 4918 | { |
| 4919 | j5array[0]-=IK2PI; |
| 4920 | } |
| 4921 | else if( j5array[0] < -IKPI ) |
| 4922 | { j5array[0]+=IK2PI; |
| 4923 | } |
| 4924 | j5valid[0] = true; |
| 4925 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 4926 | { |
| 4927 | if( !j5valid[ij5] ) |
| 4928 | { |
| 4929 | continue; |
| 4930 | } |
| 4931 | _ij5[0] = ij5; _ij5[1] = -1; |
| 4932 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 4933 | { |
| 4934 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 4935 | { |
| 4936 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 4937 | } |
| 4938 | } |
| 4939 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 4940 | { |
| 4941 | IkReal evalcond[10]; |
| 4942 | IkReal x578=IKcos(j5); |
| 4943 | IkReal x579=IKsin(j5); |
| 4944 | IkReal x580=((1.0)*gconst8); |
| 4945 | IkReal x581=((1.0000000008)*gconst7); |
| 4946 | IkReal x582=((1.0000000008)*gconst8); |
| 4947 | IkReal x583=(new_r11*x579); |
| 4948 | IkReal x584=(new_r01*x578); |
| 4949 | IkReal x585=(new_r00*x578); |
| 4950 | IkReal x586=(new_r10*x579); |
| 4951 | evalcond[0]=(((new_r00*x579))+((new_r10*x578))+gconst7); |
| 4952 | evalcond[1]=(((new_r11*x578))+((new_r01*x579))+(((-1.0)*x580))); |
| 4953 | evalcond[2]=((((-1.0)*x578*x582))+((gconst7*x579))+new_r00); |
| 4954 | evalcond[3]=(((x579*x582))+((gconst7*x578))+new_r10); |
| 4955 | evalcond[4]=((((-1.0)*x578*x581))+(((-1.0)*x579*x580))+new_r01); |
| 4956 | evalcond[5]=(((x579*x581))+(((-1.0)*x578*x580))+new_r11); |
| 4957 | evalcond[6]=((((-1.0)*x586))+x585+(((-1.0)*x582))); |
| 4958 | evalcond[7]=((((-1.0)*x583))+x584+(((-1.0)*x581))); |
| 4959 | evalcond[8]=((((1.0000000008)*x585))+(((-1.0)*x580))+(((-1.0000000008)*x586))); |
| 4960 | evalcond[9]=((((1.0000000008)*x584))+(((-1.0)*gconst7))+(((-1.0000000008)*x583))); |
| 4961 | if( 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 ) |
| 4962 | { |
| 4963 | continue; |
| 4964 | } |
| 4965 | } |
| 4966 | |
| 4967 | { |
| 4968 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 4969 | vinfos[0].jointtype = 1; |
| 4970 | vinfos[0].foffset = j0; |
| 4971 | vinfos[0].indices[0] = _ij0[0]; |
| 4972 | vinfos[0].indices[1] = _ij0[1]; |
| 4973 | vinfos[0].maxsolutions = _nj0; |
| 4974 | vinfos[1].jointtype = 1; |
| 4975 | vinfos[1].foffset = j1; |
| 4976 | vinfos[1].indices[0] = _ij1[0]; |
| 4977 | vinfos[1].indices[1] = _ij1[1]; |
| 4978 | vinfos[1].maxsolutions = _nj1; |
| 4979 | vinfos[2].jointtype = 1; |
| 4980 | vinfos[2].foffset = j2; |
| 4981 | vinfos[2].indices[0] = _ij2[0]; |
| 4982 | vinfos[2].indices[1] = _ij2[1]; |
| 4983 | vinfos[2].maxsolutions = _nj2; |
| 4984 | vinfos[3].jointtype = 1; |
| 4985 | vinfos[3].foffset = j3; |
| 4986 | vinfos[3].indices[0] = _ij3[0]; |
| 4987 | vinfos[3].indices[1] = _ij3[1]; |
| 4988 | vinfos[3].maxsolutions = _nj3; |
| 4989 | vinfos[4].jointtype = 1; |
| 4990 | vinfos[4].foffset = j4; |
| 4991 | vinfos[4].indices[0] = _ij4[0]; |
| 4992 | vinfos[4].indices[1] = _ij4[1]; |
| 4993 | vinfos[4].maxsolutions = _nj4; |
| 4994 | vinfos[5].jointtype = 1; |
| 4995 | vinfos[5].foffset = j5; |
| 4996 | vinfos[5].indices[0] = _ij5[0]; |
| 4997 | vinfos[5].indices[1] = _ij5[1]; |
| 4998 | vinfos[5].maxsolutions = _nj5; |
| 4999 | std::vector<int> vfree(0); |
| 5000 | solutions.AddSolution(vinfos,vfree); |
| 5001 | } |
| 5002 | } |
| 5003 | } |
| 5004 | |
| 5005 | } |
| 5006 | |
| 5007 | } |
| 5008 | |
| 5009 | } |
| 5010 | } while(0); |
| 5011 | if( bgotonextstatement ) |
| 5012 | { |
| 5013 | bool bgotonextstatement = true; |
| 5014 | do |
| 5015 | { |
| 5016 | IkReal x588 = ((((1.0000000016)*(new_r00*new_r00)))+(new_r10*new_r10)); |
| 5017 | if(IKabs(x588)==0){ |
| 5018 | continue; |
| 5019 | } |
| 5020 | IkReal x587=pow(x588,-0.5); |
| 5021 | CheckValue<IkReal> x589 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5022 | if(!x589.valid){ |
| 5023 | continue; |
| 5024 | } |
| 5025 | IkReal gconst9=((3.14159265358979)+(((-1.0)*(x589.value)))); |
| 5026 | IkReal gconst10=((1.0)*new_r10*x587); |
| 5027 | IkReal gconst11=((1.0000000008)*new_r00*x587); |
| 5028 | CheckValue<IkReal> x590 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5029 | if(!x590.valid){ |
| 5030 | continue; |
| 5031 | } |
| 5032 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+(x590.value)+j3)))), 6.28318530717959))); |
| 5033 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 5034 | { |
| 5035 | bgotonextstatement=false; |
| 5036 | { |
| 5037 | IkReal j5eval[2]; |
| 5038 | IkReal x591=x587; |
| 5039 | sj4=4.0e-5; |
| 5040 | cj4=1.0; |
| 5041 | j4=4.0e-5; |
| 5042 | sj3=gconst10; |
| 5043 | cj3=gconst11; |
| 5044 | CheckValue<IkReal> x592 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5045 | if(!x592.valid){ |
| 5046 | continue; |
| 5047 | } |
| 5048 | j3=((3.14159265)+(((-1.0)*(x592.value)))); |
| 5049 | CheckValue<IkReal> x593 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5050 | if(!x593.valid){ |
| 5051 | continue; |
| 5052 | } |
| 5053 | IkReal gconst9=((3.14159265358979)+(((-1.0)*(x593.value)))); |
| 5054 | IkReal gconst10=((1.0)*new_r10*x591); |
| 5055 | IkReal gconst11=((1.0000000008)*new_r00*x591); |
| 5056 | IkReal x594=(((new_r01*new_r10))+(((-1.0)*new_r00*new_r11))); |
| 5057 | j5eval[0]=x594; |
| 5058 | j5eval[1]=IKsign(x594); |
| 5059 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 5060 | { |
| 5061 | { |
| 5062 | IkReal j5eval[2]; |
| 5063 | IkReal x595=x587; |
| 5064 | sj4=4.0e-5; |
| 5065 | cj4=1.0; |
| 5066 | j4=4.0e-5; |
| 5067 | sj3=gconst10; |
| 5068 | cj3=gconst11; |
| 5069 | CheckValue<IkReal> x596 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5070 | if(!x596.valid){ |
| 5071 | continue; |
| 5072 | } |
| 5073 | j3=((3.14159265)+(((-1.0)*(x596.value)))); |
| 5074 | CheckValue<IkReal> x597 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5075 | if(!x597.valid){ |
| 5076 | continue; |
| 5077 | } |
| 5078 | IkReal gconst9=((3.14159265358979)+(((-1.0)*(x597.value)))); |
| 5079 | IkReal gconst10=((1.0)*new_r10*x595); |
| 5080 | IkReal gconst11=((1.0000000008)*new_r00*x595); |
| 5081 | IkReal x598=new_r00*new_r00; |
| 5082 | IkReal x599=new_r10*new_r10; |
| 5083 | IkReal x600=((((1.0000000016)*x598))+x599); |
| 5084 | CheckValue<IkReal> x601=IKPowWithIntegerCheck(x600,-1); |
| 5085 | if(!x601.valid){ |
| 5086 | continue; |
| 5087 | } |
| 5088 | j5eval[0]=((-3.20000004272458e-9)*x598*x599*(x601.value)); |
| 5089 | IkReal x602 = x600; |
| 5090 | if(IKabs(x602)==0){ |
| 5091 | continue; |
| 5092 | } |
| 5093 | j5eval[1]=((-1.60000013238459e-9)*new_r00*new_r10*(pow(x602,-0.5))); |
| 5094 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 5095 | { |
| 5096 | { |
| 5097 | IkReal j5eval[1]; |
| 5098 | IkReal x603=x587; |
| 5099 | sj4=4.0e-5; |
| 5100 | cj4=1.0; |
| 5101 | j4=4.0e-5; |
| 5102 | sj3=gconst10; |
| 5103 | cj3=gconst11; |
| 5104 | CheckValue<IkReal> x604 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5105 | if(!x604.valid){ |
| 5106 | continue; |
| 5107 | } |
| 5108 | j3=((3.14159265)+(((-1.0)*(x604.value)))); |
| 5109 | CheckValue<IkReal> x605 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5110 | if(!x605.valid){ |
| 5111 | continue; |
| 5112 | } |
| 5113 | IkReal gconst9=((3.14159265358979)+(((-1.0)*(x605.value)))); |
| 5114 | IkReal gconst10=((1.0)*new_r10*x603); |
| 5115 | IkReal gconst11=((1.0000000008)*new_r00*x603); |
| 5116 | j5eval[0]=new_r00; |
| 5117 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 5118 | { |
| 5119 | { |
| 5120 | IkReal evalcond[1]; |
| 5121 | bool bgotonextstatement = true; |
| 5122 | do |
| 5123 | { |
| 5124 | evalcond[0]=IKabs(new_r00); |
| 5125 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 5126 | { |
| 5127 | bgotonextstatement=false; |
| 5128 | { |
| 5129 | IkReal j5eval[1]; |
| 5130 | CheckValue<IkReal> x607 = IKatan2WithCheck(IkReal(new_r10),IkReal(0),IKFAST_ATAN2_MAGTHRESH); |
| 5131 | if(!x607.valid){ |
| 5132 | continue; |
| 5133 | } |
| 5134 | IkReal x606=((1.0)*(x607.value)); |
| 5135 | sj4=4.0e-5; |
| 5136 | cj4=1.0; |
| 5137 | j4=4.0e-5; |
| 5138 | sj3=gconst10; |
| 5139 | cj3=gconst11; |
| 5140 | j3=((3.14159265)+(((-1.0)*x606))); |
| 5141 | new_r00=0; |
| 5142 | IkReal gconst9=((3.14159265358979)+(((-1.0)*x606))); |
| 5143 | IkReal x608 = new_r10*new_r10; |
| 5144 | if(IKabs(x608)==0){ |
| 5145 | continue; |
| 5146 | } |
| 5147 | IkReal gconst10=((1.0)*new_r10*(pow(x608,-0.5))); |
| 5148 | IkReal gconst11=0; |
| 5149 | j5eval[0]=new_r10; |
| 5150 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 5151 | { |
| 5152 | { |
| 5153 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 5154 | bool j5valid[1]={false}; |
| 5155 | _nj5 = 1; |
| 5156 | CheckValue<IkReal> x610=IKPowWithIntegerCheck(gconst10,-1); |
| 5157 | if(!x610.valid){ |
| 5158 | continue; |
| 5159 | } |
| 5160 | IkReal x609=x610.value; |
| 5161 | if( IKabs(((-0.9999999992)*new_r11*x609)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r10*x609)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-0.9999999992)*new_r11*x609))+IKsqr(((-1.0)*new_r10*x609))-1) <= IKFAST_SINCOS_THRESH ) |
| 5162 | continue; |
| 5163 | j5array[0]=IKatan2(((-0.9999999992)*new_r11*x609), ((-1.0)*new_r10*x609)); |
| 5164 | sj5array[0]=IKsin(j5array[0]); |
| 5165 | cj5array[0]=IKcos(j5array[0]); |
| 5166 | if( j5array[0] > IKPI ) |
| 5167 | { |
| 5168 | j5array[0]-=IK2PI; |
| 5169 | } |
| 5170 | else if( j5array[0] < -IKPI ) |
| 5171 | { j5array[0]+=IK2PI; |
| 5172 | } |
| 5173 | j5valid[0] = true; |
| 5174 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 5175 | { |
| 5176 | if( !j5valid[ij5] ) |
| 5177 | { |
| 5178 | continue; |
| 5179 | } |
| 5180 | _ij5[0] = ij5; _ij5[1] = -1; |
| 5181 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 5182 | { |
| 5183 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 5184 | { |
| 5185 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 5186 | } |
| 5187 | } |
| 5188 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 5189 | { |
| 5190 | IkReal evalcond[10]; |
| 5191 | IkReal x611=IKsin(j5); |
| 5192 | IkReal x612=IKcos(j5); |
| 5193 | IkReal x613=(gconst10*x612); |
| 5194 | IkReal x614=(gconst10*x611); |
| 5195 | IkReal x615=(new_r01*x612); |
| 5196 | IkReal x616=(new_r11*x611); |
| 5197 | IkReal x617=(new_r10*x611); |
| 5198 | evalcond[0]=x614; |
| 5199 | evalcond[1]=((-1.0)*x617); |
| 5200 | evalcond[2]=(gconst10+((new_r10*x612))); |
| 5201 | evalcond[3]=(x613+new_r10); |
| 5202 | evalcond[4]=((-1.0000000008)*x617); |
| 5203 | evalcond[5]=(((new_r11*x612))+((new_r01*x611))); |
| 5204 | evalcond[6]=((((-1.0000000008)*x613))+new_r01); |
| 5205 | evalcond[7]=(new_r11+(((1.0000000008)*x614))); |
| 5206 | evalcond[8]=((((-1.0000000008)*gconst10))+(((-1.0)*x616))+x615); |
| 5207 | evalcond[9]=((((-1.0000000008)*x616))+(((-1.0)*gconst10))+(((1.0000000008)*x615))); |
| 5208 | if( 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 ) |
| 5209 | { |
| 5210 | continue; |
| 5211 | } |
| 5212 | } |
| 5213 | |
| 5214 | { |
| 5215 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 5216 | vinfos[0].jointtype = 1; |
| 5217 | vinfos[0].foffset = j0; |
| 5218 | vinfos[0].indices[0] = _ij0[0]; |
| 5219 | vinfos[0].indices[1] = _ij0[1]; |
| 5220 | vinfos[0].maxsolutions = _nj0; |
| 5221 | vinfos[1].jointtype = 1; |
| 5222 | vinfos[1].foffset = j1; |
| 5223 | vinfos[1].indices[0] = _ij1[0]; |
| 5224 | vinfos[1].indices[1] = _ij1[1]; |
| 5225 | vinfos[1].maxsolutions = _nj1; |
| 5226 | vinfos[2].jointtype = 1; |
| 5227 | vinfos[2].foffset = j2; |
| 5228 | vinfos[2].indices[0] = _ij2[0]; |
| 5229 | vinfos[2].indices[1] = _ij2[1]; |
| 5230 | vinfos[2].maxsolutions = _nj2; |
| 5231 | vinfos[3].jointtype = 1; |
| 5232 | vinfos[3].foffset = j3; |
| 5233 | vinfos[3].indices[0] = _ij3[0]; |
| 5234 | vinfos[3].indices[1] = _ij3[1]; |
| 5235 | vinfos[3].maxsolutions = _nj3; |
| 5236 | vinfos[4].jointtype = 1; |
| 5237 | vinfos[4].foffset = j4; |
| 5238 | vinfos[4].indices[0] = _ij4[0]; |
| 5239 | vinfos[4].indices[1] = _ij4[1]; |
| 5240 | vinfos[4].maxsolutions = _nj4; |
| 5241 | vinfos[5].jointtype = 1; |
| 5242 | vinfos[5].foffset = j5; |
| 5243 | vinfos[5].indices[0] = _ij5[0]; |
| 5244 | vinfos[5].indices[1] = _ij5[1]; |
| 5245 | vinfos[5].maxsolutions = _nj5; |
| 5246 | std::vector<int> vfree(0); |
| 5247 | solutions.AddSolution(vinfos,vfree); |
| 5248 | } |
| 5249 | } |
| 5250 | } |
| 5251 | |
| 5252 | } else |
| 5253 | { |
| 5254 | { |
| 5255 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 5256 | bool j5valid[1]={false}; |
| 5257 | _nj5 = 1; |
| 5258 | CheckValue<IkReal> x618=IKPowWithIntegerCheck(gconst10,-1); |
| 5259 | if(!x618.valid){ |
| 5260 | continue; |
| 5261 | } |
| 5262 | CheckValue<IkReal> x619=IKPowWithIntegerCheck(new_r10,-1); |
| 5263 | if(!x619.valid){ |
| 5264 | continue; |
| 5265 | } |
| 5266 | if( IKabs(((-0.9999999992)*new_r11*(x618.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*gconst10*(x619.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-0.9999999992)*new_r11*(x618.value)))+IKsqr(((-1.0)*gconst10*(x619.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 5267 | continue; |
| 5268 | j5array[0]=IKatan2(((-0.9999999992)*new_r11*(x618.value)), ((-1.0)*gconst10*(x619.value))); |
| 5269 | sj5array[0]=IKsin(j5array[0]); |
| 5270 | cj5array[0]=IKcos(j5array[0]); |
| 5271 | if( j5array[0] > IKPI ) |
| 5272 | { |
| 5273 | j5array[0]-=IK2PI; |
| 5274 | } |
| 5275 | else if( j5array[0] < -IKPI ) |
| 5276 | { j5array[0]+=IK2PI; |
| 5277 | } |
| 5278 | j5valid[0] = true; |
| 5279 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 5280 | { |
| 5281 | if( !j5valid[ij5] ) |
| 5282 | { |
| 5283 | continue; |
| 5284 | } |
| 5285 | _ij5[0] = ij5; _ij5[1] = -1; |
| 5286 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 5287 | { |
| 5288 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 5289 | { |
| 5290 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 5291 | } |
| 5292 | } |
| 5293 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 5294 | { |
| 5295 | IkReal evalcond[10]; |
| 5296 | IkReal x620=IKsin(j5); |
| 5297 | IkReal x621=IKcos(j5); |
| 5298 | IkReal x622=(gconst10*x621); |
| 5299 | IkReal x623=(gconst10*x620); |
| 5300 | IkReal x624=(new_r01*x621); |
| 5301 | IkReal x625=(new_r11*x620); |
| 5302 | IkReal x626=(new_r10*x620); |
| 5303 | evalcond[0]=x623; |
| 5304 | evalcond[1]=((-1.0)*x626); |
| 5305 | evalcond[2]=(gconst10+((new_r10*x621))); |
| 5306 | evalcond[3]=(x622+new_r10); |
| 5307 | evalcond[4]=((-1.0000000008)*x626); |
| 5308 | evalcond[5]=(((new_r01*x620))+((new_r11*x621))); |
| 5309 | evalcond[6]=((((-1.0000000008)*x622))+new_r01); |
| 5310 | evalcond[7]=((((1.0000000008)*x623))+new_r11); |
| 5311 | evalcond[8]=((((-1.0000000008)*gconst10))+x624+(((-1.0)*x625))); |
| 5312 | evalcond[9]=((((1.0000000008)*x624))+(((-1.0000000008)*x625))+(((-1.0)*gconst10))); |
| 5313 | if( 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 ) |
| 5314 | { |
| 5315 | continue; |
| 5316 | } |
| 5317 | } |
| 5318 | |
| 5319 | { |
| 5320 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 5321 | vinfos[0].jointtype = 1; |
| 5322 | vinfos[0].foffset = j0; |
| 5323 | vinfos[0].indices[0] = _ij0[0]; |
| 5324 | vinfos[0].indices[1] = _ij0[1]; |
| 5325 | vinfos[0].maxsolutions = _nj0; |
| 5326 | vinfos[1].jointtype = 1; |
| 5327 | vinfos[1].foffset = j1; |
| 5328 | vinfos[1].indices[0] = _ij1[0]; |
| 5329 | vinfos[1].indices[1] = _ij1[1]; |
| 5330 | vinfos[1].maxsolutions = _nj1; |
| 5331 | vinfos[2].jointtype = 1; |
| 5332 | vinfos[2].foffset = j2; |
| 5333 | vinfos[2].indices[0] = _ij2[0]; |
| 5334 | vinfos[2].indices[1] = _ij2[1]; |
| 5335 | vinfos[2].maxsolutions = _nj2; |
| 5336 | vinfos[3].jointtype = 1; |
| 5337 | vinfos[3].foffset = j3; |
| 5338 | vinfos[3].indices[0] = _ij3[0]; |
| 5339 | vinfos[3].indices[1] = _ij3[1]; |
| 5340 | vinfos[3].maxsolutions = _nj3; |
| 5341 | vinfos[4].jointtype = 1; |
| 5342 | vinfos[4].foffset = j4; |
| 5343 | vinfos[4].indices[0] = _ij4[0]; |
| 5344 | vinfos[4].indices[1] = _ij4[1]; |
| 5345 | vinfos[4].maxsolutions = _nj4; |
| 5346 | vinfos[5].jointtype = 1; |
| 5347 | vinfos[5].foffset = j5; |
| 5348 | vinfos[5].indices[0] = _ij5[0]; |
| 5349 | vinfos[5].indices[1] = _ij5[1]; |
| 5350 | vinfos[5].maxsolutions = _nj5; |
| 5351 | std::vector<int> vfree(0); |
| 5352 | solutions.AddSolution(vinfos,vfree); |
| 5353 | } |
| 5354 | } |
| 5355 | } |
| 5356 | |
| 5357 | } |
| 5358 | |
| 5359 | } |
| 5360 | |
| 5361 | } |
| 5362 | } while(0); |
| 5363 | if( bgotonextstatement ) |
| 5364 | { |
| 5365 | bool bgotonextstatement = true; |
| 5366 | do |
| 5367 | { |
| 5368 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 5369 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 5370 | { |
| 5371 | bgotonextstatement=false; |
| 5372 | { |
| 5373 | IkReal j5eval[3]; |
| 5374 | IkReal x628 = ((1.0000000016)+(((-1.6e-9)*(new_r10*new_r10)))); |
| 5375 | if(IKabs(x628)==0){ |
| 5376 | continue; |
| 5377 | } |
| 5378 | IkReal x627=pow(x628,-0.5); |
| 5379 | sj4=4.0e-5; |
| 5380 | cj4=1.0; |
| 5381 | j4=4.0e-5; |
| 5382 | sj3=gconst10; |
| 5383 | cj3=gconst11; |
| 5384 | CheckValue<IkReal> x629 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5385 | if(!x629.valid){ |
| 5386 | continue; |
| 5387 | } |
| 5388 | j3=((3.14159265)+(((-1.0)*(x629.value)))); |
| 5389 | new_r11=0; |
| 5390 | new_r01=0; |
| 5391 | new_r22=0; |
| 5392 | new_r20=0; |
| 5393 | CheckValue<IkReal> x630 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5394 | if(!x630.valid){ |
| 5395 | continue; |
| 5396 | } |
| 5397 | IkReal gconst9=((3.14159265358979)+(((-1.0)*(x630.value)))); |
| 5398 | IkReal gconst10=((1.0)*new_r10*x627); |
| 5399 | IkReal gconst11=((1.0000000008)*new_r00*x627); |
| 5400 | IkReal x631=new_r10*new_r10; |
| 5401 | CheckValue<IkReal> x635=IKPowWithIntegerCheck(((-3.90625000625e+17)+(((625000000.0)*x631))),-1); |
| 5402 | if(!x635.valid){ |
| 5403 | continue; |
| 5404 | } |
| 5405 | IkReal x632=x635.value; |
| 5406 | if((((625000001.0)+(((-1.0)*x631)))) < -0.00001) |
| 5407 | continue; |
| 5408 | IkReal x633=IKsqrt(((625000001.0)+(((-1.0)*x631)))); |
| 5409 | IkReal x634=(x632*x633); |
| 5410 | j5eval[0]=-1.0; |
| 5411 | j5eval[1]=-1.0; |
| 5412 | IkReal x636 = ((1.0000000016)+(((-1.6e-9)*x631))); |
| 5413 | if(IKabs(x636)==0){ |
| 5414 | continue; |
| 5415 | } |
| 5416 | j5eval[2]=((IKabs(((((-7.81250000625e+17)*x631*x634))+(((3.90625000625e+17)*x634)))))+(IKabs(((50000.00004)*new_r00*new_r10*(pow(x636,-0.5)))))); |
| 5417 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 5418 | { |
| 5419 | { |
| 5420 | IkReal j5eval[1]; |
| 5421 | IkReal x638 = ((1.0000000016)+(((-1.6e-9)*(new_r10*new_r10)))); |
| 5422 | if(IKabs(x638)==0){ |
| 5423 | continue; |
| 5424 | } |
| 5425 | IkReal x637=pow(x638,-0.5); |
| 5426 | sj4=4.0e-5; |
| 5427 | cj4=1.0; |
| 5428 | j4=4.0e-5; |
| 5429 | sj3=gconst10; |
| 5430 | cj3=gconst11; |
| 5431 | CheckValue<IkReal> x639 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5432 | if(!x639.valid){ |
| 5433 | continue; |
| 5434 | } |
| 5435 | j3=((3.14159265)+(((-1.0)*(x639.value)))); |
| 5436 | new_r11=0; |
| 5437 | new_r01=0; |
| 5438 | new_r22=0; |
| 5439 | new_r20=0; |
| 5440 | CheckValue<IkReal> x640 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5441 | if(!x640.valid){ |
| 5442 | continue; |
| 5443 | } |
| 5444 | IkReal gconst9=((3.14159265358979)+(((-1.0)*(x640.value)))); |
| 5445 | IkReal gconst10=((1.0)*new_r10*x637); |
| 5446 | IkReal gconst11=((1.0000000008)*new_r00*x637); |
| 5447 | IkReal x641=new_r10*new_r10; |
| 5448 | CheckValue<IkReal> x643=IKPowWithIntegerCheck(((1.0000000016)+(((-1.6e-9)*x641))),-1); |
| 5449 | if(!x643.valid){ |
| 5450 | continue; |
| 5451 | } |
| 5452 | IkReal x642=x643.value; |
| 5453 | IkReal x644=((1.0)+(((-1.0)*x641))); |
| 5454 | j5eval[0]=IKsign(((((625000001.0)*x642*(x641*x641)))+(((-625000001.0)*x642*(x644*x644))))); |
| 5455 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 5456 | { |
| 5457 | { |
| 5458 | IkReal j5eval[2]; |
| 5459 | IkReal x646 = ((1.0000000016)+(((-1.6e-9)*(new_r10*new_r10)))); |
| 5460 | if(IKabs(x646)==0){ |
| 5461 | continue; |
| 5462 | } |
| 5463 | IkReal x645=pow(x646,-0.5); |
| 5464 | sj4=4.0e-5; |
| 5465 | cj4=1.0; |
| 5466 | j4=4.0e-5; |
| 5467 | sj3=gconst10; |
| 5468 | cj3=gconst11; |
| 5469 | CheckValue<IkReal> x647 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5470 | if(!x647.valid){ |
| 5471 | continue; |
| 5472 | } |
| 5473 | j3=((3.14159265)+(((-1.0)*(x647.value)))); |
| 5474 | new_r11=0; |
| 5475 | new_r01=0; |
| 5476 | new_r22=0; |
| 5477 | new_r20=0; |
| 5478 | CheckValue<IkReal> x648 = IKatan2WithCheck(IkReal(new_r10),IkReal(((-1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 5479 | if(!x648.valid){ |
| 5480 | continue; |
| 5481 | } |
| 5482 | IkReal gconst9=((3.14159265358979)+(((-1.0)*(x648.value)))); |
| 5483 | IkReal gconst10=((1.0)*new_r10*x645); |
| 5484 | IkReal gconst11=((1.0000000008)*new_r00*x645); |
| 5485 | IkReal x649=new_r10*new_r10; |
| 5486 | IkReal x650=((1.0000000016)+(((-1.6e-9)*x649))); |
| 5487 | CheckValue<IkReal> x651=IKPowWithIntegerCheck(x650,-1); |
| 5488 | if(!x651.valid){ |
| 5489 | continue; |
| 5490 | } |
| 5491 | j5eval[0]=((-3.20000004272458e-9)*x649*(x651.value)*(((1.0)+(((-1.0)*x649))))); |
| 5492 | IkReal x652 = x650; |
| 5493 | if(IKabs(x652)==0){ |
| 5494 | continue; |
| 5495 | } |
| 5496 | j5eval[1]=((-1.60000013238459e-9)*new_r00*new_r10*(pow(x652,-0.5))); |
| 5497 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 5498 | { |
| 5499 | continue; // 3 cases reached |
| 5500 | |
| 5501 | } else |
| 5502 | { |
| 5503 | { |
| 5504 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 5505 | bool j5valid[1]={false}; |
| 5506 | _nj5 = 1; |
| 5507 | IkReal x653=gconst10*gconst10; |
| 5508 | IkReal x654=new_r10*new_r10; |
| 5509 | IkReal x655=((25000.00002)*gconst11); |
| 5510 | IkReal x656=(gconst10*new_r00); |
| 5511 | IkReal x657=((625000000.5)*gconst11); |
| 5512 | CheckValue<IkReal> x658=IKPowWithIntegerCheck(((((625000000.0)*x653*(new_r00*new_r00)))+(((-625000001.0)*x654*(gconst11*gconst11)))),-1); |
| 5513 | if(!x658.valid){ |
| 5514 | continue; |
| 5515 | } |
| 5516 | CheckValue<IkReal> x659=IKPowWithIntegerCheck(((((-1.0)*new_r10*x655))+(((25000.0)*x656))),-1); |
| 5517 | if(!x659.valid){ |
| 5518 | continue; |
| 5519 | } |
| 5520 | if( IKabs(((x658.value)*((((x657*(new_r10*new_r10*new_r10)))+(((625000000.0)*x654*x656))+(((-625000000.0)*x656*(gconst10*gconst10)))+(((-1.0)*new_r10*x653*x657)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((x659.value)*(((((-25000.0)*new_r00*new_r10))+((gconst10*x655)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x658.value)*((((x657*(new_r10*new_r10*new_r10)))+(((625000000.0)*x654*x656))+(((-625000000.0)*x656*(gconst10*gconst10)))+(((-1.0)*new_r10*x653*x657))))))+IKsqr(((x659.value)*(((((-25000.0)*new_r00*new_r10))+((gconst10*x655))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 5521 | continue; |
| 5522 | j5array[0]=IKatan2(((x658.value)*((((x657*(new_r10*new_r10*new_r10)))+(((625000000.0)*x654*x656))+(((-625000000.0)*x656*(gconst10*gconst10)))+(((-1.0)*new_r10*x653*x657))))), ((x659.value)*(((((-25000.0)*new_r00*new_r10))+((gconst10*x655)))))); |
| 5523 | sj5array[0]=IKsin(j5array[0]); |
| 5524 | cj5array[0]=IKcos(j5array[0]); |
| 5525 | if( j5array[0] > IKPI ) |
| 5526 | { |
| 5527 | j5array[0]-=IK2PI; |
| 5528 | } |
| 5529 | else if( j5array[0] < -IKPI ) |
| 5530 | { j5array[0]+=IK2PI; |
| 5531 | } |
| 5532 | j5valid[0] = true; |
| 5533 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 5534 | { |
| 5535 | if( !j5valid[ij5] ) |
| 5536 | { |
| 5537 | continue; |
| 5538 | } |
| 5539 | _ij5[0] = ij5; _ij5[1] = -1; |
| 5540 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 5541 | { |
| 5542 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 5543 | { |
| 5544 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 5545 | } |
| 5546 | } |
| 5547 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 5548 | { |
| 5549 | IkReal evalcond[7]; |
| 5550 | IkReal x660=IKsin(j5); |
| 5551 | IkReal x661=IKcos(j5); |
| 5552 | IkReal x662=(gconst11*x661); |
| 5553 | IkReal x663=((1.0000000008)*x660); |
| 5554 | IkReal x664=(gconst10*x661); |
| 5555 | IkReal x665=((1.0)*x660); |
| 5556 | IkReal x666=(new_r00*x661); |
| 5557 | evalcond[0]=(gconst10+((new_r10*x661))+((new_r00*x660))); |
| 5558 | evalcond[1]=((((-1.0000000008)*x662))+new_r00+((gconst10*x660))); |
| 5559 | evalcond[2]=(x664+new_r10+((gconst11*x663))); |
| 5560 | evalcond[3]=((((-1.0000000008)*x664))+(((-1.0)*gconst11*x665))); |
| 5561 | evalcond[4]=((((-1.0)*x662))+((gconst10*x663))); |
| 5562 | evalcond[5]=((((-1.0)*new_r10*x665))+(((-1.0000000008)*gconst11))+x666); |
| 5563 | evalcond[6]=((((1.0000000008)*x666))+(((-1.0)*new_r10*x663))+(((-1.0)*gconst11))); |
| 5564 | if( 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 ) |
| 5565 | { |
| 5566 | continue; |
| 5567 | } |
| 5568 | } |
| 5569 | |
| 5570 | { |
| 5571 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 5572 | vinfos[0].jointtype = 1; |
| 5573 | vinfos[0].foffset = j0; |
| 5574 | vinfos[0].indices[0] = _ij0[0]; |
| 5575 | vinfos[0].indices[1] = _ij0[1]; |
| 5576 | vinfos[0].maxsolutions = _nj0; |
| 5577 | vinfos[1].jointtype = 1; |
| 5578 | vinfos[1].foffset = j1; |
| 5579 | vinfos[1].indices[0] = _ij1[0]; |
| 5580 | vinfos[1].indices[1] = _ij1[1]; |
| 5581 | vinfos[1].maxsolutions = _nj1; |
| 5582 | vinfos[2].jointtype = 1; |
| 5583 | vinfos[2].foffset = j2; |
| 5584 | vinfos[2].indices[0] = _ij2[0]; |
| 5585 | vinfos[2].indices[1] = _ij2[1]; |
| 5586 | vinfos[2].maxsolutions = _nj2; |
| 5587 | vinfos[3].jointtype = 1; |
| 5588 | vinfos[3].foffset = j3; |
| 5589 | vinfos[3].indices[0] = _ij3[0]; |
| 5590 | vinfos[3].indices[1] = _ij3[1]; |
| 5591 | vinfos[3].maxsolutions = _nj3; |
| 5592 | vinfos[4].jointtype = 1; |
| 5593 | vinfos[4].foffset = j4; |
| 5594 | vinfos[4].indices[0] = _ij4[0]; |
| 5595 | vinfos[4].indices[1] = _ij4[1]; |
| 5596 | vinfos[4].maxsolutions = _nj4; |
| 5597 | vinfos[5].jointtype = 1; |
| 5598 | vinfos[5].foffset = j5; |
| 5599 | vinfos[5].indices[0] = _ij5[0]; |
| 5600 | vinfos[5].indices[1] = _ij5[1]; |
| 5601 | vinfos[5].maxsolutions = _nj5; |
| 5602 | std::vector<int> vfree(0); |
| 5603 | solutions.AddSolution(vinfos,vfree); |
| 5604 | } |
| 5605 | } |
| 5606 | } |
| 5607 | |
| 5608 | } |
| 5609 | |
| 5610 | } |
| 5611 | |
| 5612 | } else |
| 5613 | { |
| 5614 | { |
| 5615 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 5616 | bool j5valid[1]={false}; |
| 5617 | _nj5 = 1; |
| 5618 | IkReal x667=gconst10*gconst10; |
| 5619 | IkReal x668=gconst11*gconst11; |
| 5620 | IkReal x669=((625000000.0)*x668); |
| 5621 | IkReal x670=((625000000.5)*gconst11*x667); |
| 5622 | CheckValue<IkReal> x671 = IKatan2WithCheck(IkReal((((gconst10*new_r00*x669))+(((-1.0)*new_r10*x670)))),IkReal((((new_r00*x670))+(((-625000001.0)*new_r10*(gconst10*gconst10*gconst10))))),IKFAST_ATAN2_MAGTHRESH); |
| 5623 | if(!x671.valid){ |
| 5624 | continue; |
| 5625 | } |
| 5626 | CheckValue<IkReal> x672=IKPowWithIntegerCheck(IKsign(((((625000001.0)*x667*(new_r10*new_r10)))+(((-1.0)*x669*(new_r00*new_r00))))),-1); |
| 5627 | if(!x672.valid){ |
| 5628 | continue; |
| 5629 | } |
| 5630 | j5array[0]=((-1.5707963267949)+(x671.value)+(((1.5707963267949)*(x672.value)))); |
| 5631 | sj5array[0]=IKsin(j5array[0]); |
| 5632 | cj5array[0]=IKcos(j5array[0]); |
| 5633 | if( j5array[0] > IKPI ) |
| 5634 | { |
| 5635 | j5array[0]-=IK2PI; |
| 5636 | } |
| 5637 | else if( j5array[0] < -IKPI ) |
| 5638 | { j5array[0]+=IK2PI; |
| 5639 | } |
| 5640 | j5valid[0] = true; |
| 5641 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 5642 | { |
| 5643 | if( !j5valid[ij5] ) |
| 5644 | { |
| 5645 | continue; |
| 5646 | } |
| 5647 | _ij5[0] = ij5; _ij5[1] = -1; |
| 5648 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 5649 | { |
| 5650 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 5651 | { |
| 5652 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 5653 | } |
| 5654 | } |
| 5655 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 5656 | { |
| 5657 | IkReal evalcond[7]; |
| 5658 | IkReal x673=IKsin(j5); |
| 5659 | IkReal x674=IKcos(j5); |
| 5660 | IkReal x675=(gconst11*x674); |
| 5661 | IkReal x676=((1.0000000008)*x673); |
| 5662 | IkReal x677=(gconst10*x674); |
| 5663 | IkReal x678=((1.0)*x673); |
| 5664 | IkReal x679=(new_r00*x674); |
| 5665 | evalcond[0]=(((new_r00*x673))+((new_r10*x674))+gconst10); |
| 5666 | evalcond[1]=(((gconst10*x673))+new_r00+(((-1.0000000008)*x675))); |
| 5667 | evalcond[2]=(((gconst11*x676))+x677+new_r10); |
| 5668 | evalcond[3]=((((-1.0)*gconst11*x678))+(((-1.0000000008)*x677))); |
| 5669 | evalcond[4]=(((gconst10*x676))+(((-1.0)*x675))); |
| 5670 | evalcond[5]=((((-1.0000000008)*gconst11))+x679+(((-1.0)*new_r10*x678))); |
| 5671 | evalcond[6]=((((1.0000000008)*x679))+(((-1.0)*gconst11))+(((-1.0)*new_r10*x676))); |
| 5672 | if( 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 ) |
| 5673 | { |
| 5674 | continue; |
| 5675 | } |
| 5676 | } |
| 5677 | |
| 5678 | { |
| 5679 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 5680 | vinfos[0].jointtype = 1; |
| 5681 | vinfos[0].foffset = j0; |
| 5682 | vinfos[0].indices[0] = _ij0[0]; |
| 5683 | vinfos[0].indices[1] = _ij0[1]; |
| 5684 | vinfos[0].maxsolutions = _nj0; |
| 5685 | vinfos[1].jointtype = 1; |
| 5686 | vinfos[1].foffset = j1; |
| 5687 | vinfos[1].indices[0] = _ij1[0]; |
| 5688 | vinfos[1].indices[1] = _ij1[1]; |
| 5689 | vinfos[1].maxsolutions = _nj1; |
| 5690 | vinfos[2].jointtype = 1; |
| 5691 | vinfos[2].foffset = j2; |
| 5692 | vinfos[2].indices[0] = _ij2[0]; |
| 5693 | vinfos[2].indices[1] = _ij2[1]; |
| 5694 | vinfos[2].maxsolutions = _nj2; |
| 5695 | vinfos[3].jointtype = 1; |
| 5696 | vinfos[3].foffset = j3; |
| 5697 | vinfos[3].indices[0] = _ij3[0]; |
| 5698 | vinfos[3].indices[1] = _ij3[1]; |
| 5699 | vinfos[3].maxsolutions = _nj3; |
| 5700 | vinfos[4].jointtype = 1; |
| 5701 | vinfos[4].foffset = j4; |
| 5702 | vinfos[4].indices[0] = _ij4[0]; |
| 5703 | vinfos[4].indices[1] = _ij4[1]; |
| 5704 | vinfos[4].maxsolutions = _nj4; |
| 5705 | vinfos[5].jointtype = 1; |
| 5706 | vinfos[5].foffset = j5; |
| 5707 | vinfos[5].indices[0] = _ij5[0]; |
| 5708 | vinfos[5].indices[1] = _ij5[1]; |
| 5709 | vinfos[5].maxsolutions = _nj5; |
| 5710 | std::vector<int> vfree(0); |
| 5711 | solutions.AddSolution(vinfos,vfree); |
| 5712 | } |
| 5713 | } |
| 5714 | } |
| 5715 | |
| 5716 | } |
| 5717 | |
| 5718 | } |
| 5719 | |
| 5720 | } else |
| 5721 | { |
| 5722 | { |
| 5723 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 5724 | bool j5valid[1]={false}; |
| 5725 | _nj5 = 1; |
| 5726 | IkReal x680=((25000.00002)*gconst11); |
| 5727 | IkReal x681=((25000.0)*gconst10); |
| 5728 | CheckValue<IkReal> x682=IKPowWithIntegerCheck(IKsign(((((-25000.0)*(new_r10*new_r10)))+(((-25000.0)*(new_r00*new_r00))))),-1); |
| 5729 | if(!x682.valid){ |
| 5730 | continue; |
| 5731 | } |
| 5732 | CheckValue<IkReal> x683 = IKatan2WithCheck(IkReal((((new_r00*x681))+((new_r10*x680)))),IkReal((((new_r10*x681))+(((-1.0)*new_r00*x680)))),IKFAST_ATAN2_MAGTHRESH); |
| 5733 | if(!x683.valid){ |
| 5734 | continue; |
| 5735 | } |
| 5736 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x682.value)))+(x683.value)); |
| 5737 | sj5array[0]=IKsin(j5array[0]); |
| 5738 | cj5array[0]=IKcos(j5array[0]); |
| 5739 | if( j5array[0] > IKPI ) |
| 5740 | { |
| 5741 | j5array[0]-=IK2PI; |
| 5742 | } |
| 5743 | else if( j5array[0] < -IKPI ) |
| 5744 | { j5array[0]+=IK2PI; |
| 5745 | } |
| 5746 | j5valid[0] = true; |
| 5747 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 5748 | { |
| 5749 | if( !j5valid[ij5] ) |
| 5750 | { |
| 5751 | continue; |
| 5752 | } |
| 5753 | _ij5[0] = ij5; _ij5[1] = -1; |
| 5754 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 5755 | { |
| 5756 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 5757 | { |
| 5758 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 5759 | } |
| 5760 | } |
| 5761 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 5762 | { |
| 5763 | IkReal evalcond[7]; |
| 5764 | IkReal x684=IKsin(j5); |
| 5765 | IkReal x685=IKcos(j5); |
| 5766 | IkReal x686=(gconst11*x685); |
| 5767 | IkReal x687=((1.0000000008)*x684); |
| 5768 | IkReal x688=(gconst10*x685); |
| 5769 | IkReal x689=((1.0)*x684); |
| 5770 | IkReal x690=(new_r00*x685); |
| 5771 | evalcond[0]=(gconst10+((new_r00*x684))+((new_r10*x685))); |
| 5772 | evalcond[1]=(((gconst10*x684))+(((-1.0000000008)*x686))+new_r00); |
| 5773 | evalcond[2]=(((gconst11*x687))+x688+new_r10); |
| 5774 | evalcond[3]=((((-1.0)*gconst11*x689))+(((-1.0000000008)*x688))); |
| 5775 | evalcond[4]=(((gconst10*x687))+(((-1.0)*x686))); |
| 5776 | evalcond[5]=((((-1.0)*new_r10*x689))+(((-1.0000000008)*gconst11))+x690); |
| 5777 | evalcond[6]=((((-1.0)*new_r10*x687))+(((1.0000000008)*x690))+(((-1.0)*gconst11))); |
| 5778 | if( 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 ) |
| 5779 | { |
| 5780 | continue; |
| 5781 | } |
| 5782 | } |
| 5783 | |
| 5784 | { |
| 5785 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 5786 | vinfos[0].jointtype = 1; |
| 5787 | vinfos[0].foffset = j0; |
| 5788 | vinfos[0].indices[0] = _ij0[0]; |
| 5789 | vinfos[0].indices[1] = _ij0[1]; |
| 5790 | vinfos[0].maxsolutions = _nj0; |
| 5791 | vinfos[1].jointtype = 1; |
| 5792 | vinfos[1].foffset = j1; |
| 5793 | vinfos[1].indices[0] = _ij1[0]; |
| 5794 | vinfos[1].indices[1] = _ij1[1]; |
| 5795 | vinfos[1].maxsolutions = _nj1; |
| 5796 | vinfos[2].jointtype = 1; |
| 5797 | vinfos[2].foffset = j2; |
| 5798 | vinfos[2].indices[0] = _ij2[0]; |
| 5799 | vinfos[2].indices[1] = _ij2[1]; |
| 5800 | vinfos[2].maxsolutions = _nj2; |
| 5801 | vinfos[3].jointtype = 1; |
| 5802 | vinfos[3].foffset = j3; |
| 5803 | vinfos[3].indices[0] = _ij3[0]; |
| 5804 | vinfos[3].indices[1] = _ij3[1]; |
| 5805 | vinfos[3].maxsolutions = _nj3; |
| 5806 | vinfos[4].jointtype = 1; |
| 5807 | vinfos[4].foffset = j4; |
| 5808 | vinfos[4].indices[0] = _ij4[0]; |
| 5809 | vinfos[4].indices[1] = _ij4[1]; |
| 5810 | vinfos[4].maxsolutions = _nj4; |
| 5811 | vinfos[5].jointtype = 1; |
| 5812 | vinfos[5].foffset = j5; |
| 5813 | vinfos[5].indices[0] = _ij5[0]; |
| 5814 | vinfos[5].indices[1] = _ij5[1]; |
| 5815 | vinfos[5].maxsolutions = _nj5; |
| 5816 | std::vector<int> vfree(0); |
| 5817 | solutions.AddSolution(vinfos,vfree); |
| 5818 | } |
| 5819 | } |
| 5820 | } |
| 5821 | |
| 5822 | } |
| 5823 | |
| 5824 | } |
| 5825 | |
| 5826 | } |
| 5827 | } while(0); |
| 5828 | if( bgotonextstatement ) |
| 5829 | { |
| 5830 | bool bgotonextstatement = true; |
| 5831 | do |
| 5832 | { |
| 5833 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r10))); |
| 5834 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 5835 | { |
| 5836 | bgotonextstatement=false; |
| 5837 | { |
| 5838 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 5839 | bool j5valid[1]={false}; |
| 5840 | _nj5 = 1; |
| 5841 | CheckValue<IkReal> x692=IKPowWithIntegerCheck(gconst11,-1); |
| 5842 | if(!x692.valid){ |
| 5843 | continue; |
| 5844 | } |
| 5845 | IkReal x691=x692.value; |
| 5846 | if( IKabs((new_r01*x691)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((0.9999999992)*new_r00*x691)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((new_r01*x691))+IKsqr(((0.9999999992)*new_r00*x691))-1) <= IKFAST_SINCOS_THRESH ) |
| 5847 | continue; |
| 5848 | j5array[0]=IKatan2((new_r01*x691), ((0.9999999992)*new_r00*x691)); |
| 5849 | sj5array[0]=IKsin(j5array[0]); |
| 5850 | cj5array[0]=IKcos(j5array[0]); |
| 5851 | if( j5array[0] > IKPI ) |
| 5852 | { |
| 5853 | j5array[0]-=IK2PI; |
| 5854 | } |
| 5855 | else if( j5array[0] < -IKPI ) |
| 5856 | { j5array[0]+=IK2PI; |
| 5857 | } |
| 5858 | j5valid[0] = true; |
| 5859 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 5860 | { |
| 5861 | if( !j5valid[ij5] ) |
| 5862 | { |
| 5863 | continue; |
| 5864 | } |
| 5865 | _ij5[0] = ij5; _ij5[1] = -1; |
| 5866 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 5867 | { |
| 5868 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 5869 | { |
| 5870 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 5871 | } |
| 5872 | } |
| 5873 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 5874 | { |
| 5875 | IkReal evalcond[10]; |
| 5876 | IkReal x693=IKcos(j5); |
| 5877 | IkReal x694=IKsin(j5); |
| 5878 | IkReal x695=((1.0)*gconst11); |
| 5879 | IkReal x696=((1.0000000008)*gconst11); |
| 5880 | IkReal x697=(new_r00*x693); |
| 5881 | IkReal x698=(new_r01*x693); |
| 5882 | evalcond[0]=(new_r00*x694); |
| 5883 | evalcond[1]=x698; |
| 5884 | evalcond[2]=((-1.0)*gconst11*x693); |
| 5885 | evalcond[3]=((((-1.0)*x694*x695))+new_r01); |
| 5886 | evalcond[4]=((((-1.0)*x695))+((new_r01*x694))); |
| 5887 | evalcond[5]=(x694*x696); |
| 5888 | evalcond[6]=((1.0000000008)*x698); |
| 5889 | evalcond[7]=((((-1.0)*x693*x696))+new_r00); |
| 5890 | evalcond[8]=(x697+(((-1.0)*x696))); |
| 5891 | evalcond[9]=((((-1.0)*x695))+(((1.0000000008)*x697))); |
| 5892 | if( 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 ) |
| 5893 | { |
| 5894 | continue; |
| 5895 | } |
| 5896 | } |
| 5897 | |
| 5898 | { |
| 5899 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 5900 | vinfos[0].jointtype = 1; |
| 5901 | vinfos[0].foffset = j0; |
| 5902 | vinfos[0].indices[0] = _ij0[0]; |
| 5903 | vinfos[0].indices[1] = _ij0[1]; |
| 5904 | vinfos[0].maxsolutions = _nj0; |
| 5905 | vinfos[1].jointtype = 1; |
| 5906 | vinfos[1].foffset = j1; |
| 5907 | vinfos[1].indices[0] = _ij1[0]; |
| 5908 | vinfos[1].indices[1] = _ij1[1]; |
| 5909 | vinfos[1].maxsolutions = _nj1; |
| 5910 | vinfos[2].jointtype = 1; |
| 5911 | vinfos[2].foffset = j2; |
| 5912 | vinfos[2].indices[0] = _ij2[0]; |
| 5913 | vinfos[2].indices[1] = _ij2[1]; |
| 5914 | vinfos[2].maxsolutions = _nj2; |
| 5915 | vinfos[3].jointtype = 1; |
| 5916 | vinfos[3].foffset = j3; |
| 5917 | vinfos[3].indices[0] = _ij3[0]; |
| 5918 | vinfos[3].indices[1] = _ij3[1]; |
| 5919 | vinfos[3].maxsolutions = _nj3; |
| 5920 | vinfos[4].jointtype = 1; |
| 5921 | vinfos[4].foffset = j4; |
| 5922 | vinfos[4].indices[0] = _ij4[0]; |
| 5923 | vinfos[4].indices[1] = _ij4[1]; |
| 5924 | vinfos[4].maxsolutions = _nj4; |
| 5925 | vinfos[5].jointtype = 1; |
| 5926 | vinfos[5].foffset = j5; |
| 5927 | vinfos[5].indices[0] = _ij5[0]; |
| 5928 | vinfos[5].indices[1] = _ij5[1]; |
| 5929 | vinfos[5].maxsolutions = _nj5; |
| 5930 | std::vector<int> vfree(0); |
| 5931 | solutions.AddSolution(vinfos,vfree); |
| 5932 | } |
| 5933 | } |
| 5934 | } |
| 5935 | |
| 5936 | } |
| 5937 | } while(0); |
| 5938 | if( bgotonextstatement ) |
| 5939 | { |
| 5940 | bool bgotonextstatement = true; |
| 5941 | do |
| 5942 | { |
| 5943 | if( 1 ) |
| 5944 | { |
| 5945 | bgotonextstatement=false; |
| 5946 | continue; // branch miss [j5] |
| 5947 | |
| 5948 | } |
| 5949 | } while(0); |
| 5950 | if( bgotonextstatement ) |
| 5951 | { |
| 5952 | } |
| 5953 | } |
| 5954 | } |
| 5955 | } |
| 5956 | } |
| 5957 | |
| 5958 | } else |
| 5959 | { |
| 5960 | { |
| 5961 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 5962 | bool j5valid[1]={false}; |
| 5963 | _nj5 = 1; |
| 5964 | CheckValue<IkReal> x704=IKPowWithIntegerCheck(new_r00,-1); |
| 5965 | if(!x704.valid){ |
| 5966 | continue; |
| 5967 | } |
| 5968 | IkReal x699=x704.value; |
| 5969 | IkReal x700=gconst10*gconst10; |
| 5970 | IkReal x701=((25000.0)*new_r10); |
| 5971 | IkReal x702=((25000.0)*x700); |
| 5972 | CheckValue<IkReal> x705=IKPowWithIntegerCheck((((gconst10*x701))+(((25000.00002)*gconst11*new_r00))),-1); |
| 5973 | if(!x705.valid){ |
| 5974 | continue; |
| 5975 | } |
| 5976 | IkReal x703=x705.value; |
| 5977 | CheckValue<IkReal> x706=IKPowWithIntegerCheck(x699,-2); |
| 5978 | if(!x706.valid){ |
| 5979 | continue; |
| 5980 | } |
| 5981 | if( IKabs((((x699*x700*x701*x703))+(((-1.0)*new_r00*x701*x703))+(((-1.0)*gconst10*x699)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x703*(((((25000.0)*(x706.value)))+(((-1.0)*x702)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((x699*x700*x701*x703))+(((-1.0)*new_r00*x701*x703))+(((-1.0)*gconst10*x699))))+IKsqr((x703*(((((25000.0)*(x706.value)))+(((-1.0)*x702))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 5982 | continue; |
| 5983 | j5array[0]=IKatan2((((x699*x700*x701*x703))+(((-1.0)*new_r00*x701*x703))+(((-1.0)*gconst10*x699))), (x703*(((((25000.0)*(x706.value)))+(((-1.0)*x702)))))); |
| 5984 | sj5array[0]=IKsin(j5array[0]); |
| 5985 | cj5array[0]=IKcos(j5array[0]); |
| 5986 | if( j5array[0] > IKPI ) |
| 5987 | { |
| 5988 | j5array[0]-=IK2PI; |
| 5989 | } |
| 5990 | else if( j5array[0] < -IKPI ) |
| 5991 | { j5array[0]+=IK2PI; |
| 5992 | } |
| 5993 | j5valid[0] = true; |
| 5994 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 5995 | { |
| 5996 | if( !j5valid[ij5] ) |
| 5997 | { |
| 5998 | continue; |
| 5999 | } |
| 6000 | _ij5[0] = ij5; _ij5[1] = -1; |
| 6001 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 6002 | { |
| 6003 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 6004 | { |
| 6005 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 6006 | } |
| 6007 | } |
| 6008 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 6009 | { |
| 6010 | IkReal evalcond[10]; |
| 6011 | IkReal x707=IKcos(j5); |
| 6012 | IkReal x708=IKsin(j5); |
| 6013 | IkReal x709=((1.0)*gconst11); |
| 6014 | IkReal x710=((1.0000000008)*gconst11); |
| 6015 | IkReal x711=((1.0000000008)*gconst10); |
| 6016 | IkReal x712=(new_r11*x708); |
| 6017 | IkReal x713=(new_r01*x707); |
| 6018 | IkReal x714=(new_r00*x707); |
| 6019 | IkReal x715=(gconst10*x707); |
| 6020 | IkReal x716=(new_r10*x708); |
| 6021 | evalcond[0]=(((new_r00*x708))+gconst10+((new_r10*x707))); |
| 6022 | evalcond[1]=(((new_r01*x708))+(((-1.0)*x709))+((new_r11*x707))); |
| 6023 | evalcond[2]=((((-1.0)*x707*x710))+((gconst10*x708))+new_r00); |
| 6024 | evalcond[3]=(x715+new_r10+((x708*x710))); |
| 6025 | evalcond[4]=((((-1.0)*x707*x711))+new_r01+(((-1.0)*x708*x709))); |
| 6026 | evalcond[5]=((((-1.0)*x707*x709))+new_r11+((x708*x711))); |
| 6027 | evalcond[6]=((((-1.0)*x716))+(((-1.0)*x710))+x714); |
| 6028 | evalcond[7]=((((-1.0)*x712))+(((-1.0)*x711))+x713); |
| 6029 | evalcond[8]=((((1.0000000008)*x714))+(((-1.0)*x709))+(((-1.0000000008)*x716))); |
| 6030 | evalcond[9]=((((1.0000000008)*x713))+(((-1.0000000008)*x712))+(((-1.0)*gconst10))); |
| 6031 | if( 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 ) |
| 6032 | { |
| 6033 | continue; |
| 6034 | } |
| 6035 | } |
| 6036 | |
| 6037 | { |
| 6038 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 6039 | vinfos[0].jointtype = 1; |
| 6040 | vinfos[0].foffset = j0; |
| 6041 | vinfos[0].indices[0] = _ij0[0]; |
| 6042 | vinfos[0].indices[1] = _ij0[1]; |
| 6043 | vinfos[0].maxsolutions = _nj0; |
| 6044 | vinfos[1].jointtype = 1; |
| 6045 | vinfos[1].foffset = j1; |
| 6046 | vinfos[1].indices[0] = _ij1[0]; |
| 6047 | vinfos[1].indices[1] = _ij1[1]; |
| 6048 | vinfos[1].maxsolutions = _nj1; |
| 6049 | vinfos[2].jointtype = 1; |
| 6050 | vinfos[2].foffset = j2; |
| 6051 | vinfos[2].indices[0] = _ij2[0]; |
| 6052 | vinfos[2].indices[1] = _ij2[1]; |
| 6053 | vinfos[2].maxsolutions = _nj2; |
| 6054 | vinfos[3].jointtype = 1; |
| 6055 | vinfos[3].foffset = j3; |
| 6056 | vinfos[3].indices[0] = _ij3[0]; |
| 6057 | vinfos[3].indices[1] = _ij3[1]; |
| 6058 | vinfos[3].maxsolutions = _nj3; |
| 6059 | vinfos[4].jointtype = 1; |
| 6060 | vinfos[4].foffset = j4; |
| 6061 | vinfos[4].indices[0] = _ij4[0]; |
| 6062 | vinfos[4].indices[1] = _ij4[1]; |
| 6063 | vinfos[4].maxsolutions = _nj4; |
| 6064 | vinfos[5].jointtype = 1; |
| 6065 | vinfos[5].foffset = j5; |
| 6066 | vinfos[5].indices[0] = _ij5[0]; |
| 6067 | vinfos[5].indices[1] = _ij5[1]; |
| 6068 | vinfos[5].maxsolutions = _nj5; |
| 6069 | std::vector<int> vfree(0); |
| 6070 | solutions.AddSolution(vinfos,vfree); |
| 6071 | } |
| 6072 | } |
| 6073 | } |
| 6074 | |
| 6075 | } |
| 6076 | |
| 6077 | } |
| 6078 | |
| 6079 | } else |
| 6080 | { |
| 6081 | { |
| 6082 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 6083 | bool j5valid[1]={false}; |
| 6084 | _nj5 = 1; |
| 6085 | IkReal x717=gconst10*gconst10; |
| 6086 | IkReal x718=new_r10*new_r10; |
| 6087 | IkReal x719=((25000.00002)*gconst11); |
| 6088 | IkReal x720=(gconst10*new_r00); |
| 6089 | IkReal x721=((625000000.5)*gconst11); |
| 6090 | CheckValue<IkReal> x722=IKPowWithIntegerCheck(((((625000000.0)*x717*(new_r00*new_r00)))+(((-625000001.0)*x718*(gconst11*gconst11)))),-1); |
| 6091 | if(!x722.valid){ |
| 6092 | continue; |
| 6093 | } |
| 6094 | CheckValue<IkReal> x723=IKPowWithIntegerCheck(((((25000.0)*x720))+(((-1.0)*new_r10*x719))),-1); |
| 6095 | if(!x723.valid){ |
| 6096 | continue; |
| 6097 | } |
| 6098 | if( IKabs(((x722.value)*(((((625000000.0)*x718*x720))+((x721*(new_r10*new_r10*new_r10)))+(((-1.0)*new_r10*x717*x721))+(((-625000000.0)*x720*(gconst10*gconst10))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((x723.value)*(((((-25000.0)*new_r00*new_r10))+((gconst10*x719)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x722.value)*(((((625000000.0)*x718*x720))+((x721*(new_r10*new_r10*new_r10)))+(((-1.0)*new_r10*x717*x721))+(((-625000000.0)*x720*(gconst10*gconst10)))))))+IKsqr(((x723.value)*(((((-25000.0)*new_r00*new_r10))+((gconst10*x719))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 6099 | continue; |
| 6100 | j5array[0]=IKatan2(((x722.value)*(((((625000000.0)*x718*x720))+((x721*(new_r10*new_r10*new_r10)))+(((-1.0)*new_r10*x717*x721))+(((-625000000.0)*x720*(gconst10*gconst10)))))), ((x723.value)*(((((-25000.0)*new_r00*new_r10))+((gconst10*x719)))))); |
| 6101 | sj5array[0]=IKsin(j5array[0]); |
| 6102 | cj5array[0]=IKcos(j5array[0]); |
| 6103 | if( j5array[0] > IKPI ) |
| 6104 | { |
| 6105 | j5array[0]-=IK2PI; |
| 6106 | } |
| 6107 | else if( j5array[0] < -IKPI ) |
| 6108 | { j5array[0]+=IK2PI; |
| 6109 | } |
| 6110 | j5valid[0] = true; |
| 6111 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 6112 | { |
| 6113 | if( !j5valid[ij5] ) |
| 6114 | { |
| 6115 | continue; |
| 6116 | } |
| 6117 | _ij5[0] = ij5; _ij5[1] = -1; |
| 6118 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 6119 | { |
| 6120 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 6121 | { |
| 6122 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 6123 | } |
| 6124 | } |
| 6125 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 6126 | { |
| 6127 | IkReal evalcond[10]; |
| 6128 | IkReal x724=IKcos(j5); |
| 6129 | IkReal x725=IKsin(j5); |
| 6130 | IkReal x726=((1.0)*gconst11); |
| 6131 | IkReal x727=((1.0000000008)*gconst11); |
| 6132 | IkReal x728=((1.0000000008)*gconst10); |
| 6133 | IkReal x729=(new_r11*x725); |
| 6134 | IkReal x730=(new_r01*x724); |
| 6135 | IkReal x731=(new_r00*x724); |
| 6136 | IkReal x732=(gconst10*x724); |
| 6137 | IkReal x733=(new_r10*x725); |
| 6138 | evalcond[0]=(((new_r00*x725))+gconst10+((new_r10*x724))); |
| 6139 | evalcond[1]=(((new_r01*x725))+(((-1.0)*x726))+((new_r11*x724))); |
| 6140 | evalcond[2]=((((-1.0)*x724*x727))+((gconst10*x725))+new_r00); |
| 6141 | evalcond[3]=(((x725*x727))+x732+new_r10); |
| 6142 | evalcond[4]=((((-1.0)*x724*x728))+(((-1.0)*x725*x726))+new_r01); |
| 6143 | evalcond[5]=((((-1.0)*x724*x726))+((x725*x728))+new_r11); |
| 6144 | evalcond[6]=((((-1.0)*x733))+(((-1.0)*x727))+x731); |
| 6145 | evalcond[7]=((((-1.0)*x728))+(((-1.0)*x729))+x730); |
| 6146 | evalcond[8]=((((1.0000000008)*x731))+(((-1.0)*x726))+(((-1.0000000008)*x733))); |
| 6147 | evalcond[9]=((((1.0000000008)*x730))+(((-1.0000000008)*x729))+(((-1.0)*gconst10))); |
| 6148 | if( 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 ) |
| 6149 | { |
| 6150 | continue; |
| 6151 | } |
| 6152 | } |
| 6153 | |
| 6154 | { |
| 6155 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 6156 | vinfos[0].jointtype = 1; |
| 6157 | vinfos[0].foffset = j0; |
| 6158 | vinfos[0].indices[0] = _ij0[0]; |
| 6159 | vinfos[0].indices[1] = _ij0[1]; |
| 6160 | vinfos[0].maxsolutions = _nj0; |
| 6161 | vinfos[1].jointtype = 1; |
| 6162 | vinfos[1].foffset = j1; |
| 6163 | vinfos[1].indices[0] = _ij1[0]; |
| 6164 | vinfos[1].indices[1] = _ij1[1]; |
| 6165 | vinfos[1].maxsolutions = _nj1; |
| 6166 | vinfos[2].jointtype = 1; |
| 6167 | vinfos[2].foffset = j2; |
| 6168 | vinfos[2].indices[0] = _ij2[0]; |
| 6169 | vinfos[2].indices[1] = _ij2[1]; |
| 6170 | vinfos[2].maxsolutions = _nj2; |
| 6171 | vinfos[3].jointtype = 1; |
| 6172 | vinfos[3].foffset = j3; |
| 6173 | vinfos[3].indices[0] = _ij3[0]; |
| 6174 | vinfos[3].indices[1] = _ij3[1]; |
| 6175 | vinfos[3].maxsolutions = _nj3; |
| 6176 | vinfos[4].jointtype = 1; |
| 6177 | vinfos[4].foffset = j4; |
| 6178 | vinfos[4].indices[0] = _ij4[0]; |
| 6179 | vinfos[4].indices[1] = _ij4[1]; |
| 6180 | vinfos[4].maxsolutions = _nj4; |
| 6181 | vinfos[5].jointtype = 1; |
| 6182 | vinfos[5].foffset = j5; |
| 6183 | vinfos[5].indices[0] = _ij5[0]; |
| 6184 | vinfos[5].indices[1] = _ij5[1]; |
| 6185 | vinfos[5].maxsolutions = _nj5; |
| 6186 | std::vector<int> vfree(0); |
| 6187 | solutions.AddSolution(vinfos,vfree); |
| 6188 | } |
| 6189 | } |
| 6190 | } |
| 6191 | |
| 6192 | } |
| 6193 | |
| 6194 | } |
| 6195 | |
| 6196 | } else |
| 6197 | { |
| 6198 | { |
| 6199 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 6200 | bool j5valid[1]={false}; |
| 6201 | _nj5 = 1; |
| 6202 | IkReal x734=((1.0)*new_r00); |
| 6203 | CheckValue<IkReal> x735=IKPowWithIntegerCheck(IKsign((((new_r01*new_r10))+(((-1.0)*new_r11*x734)))),-1); |
| 6204 | if(!x735.valid){ |
| 6205 | continue; |
| 6206 | } |
| 6207 | CheckValue<IkReal> x736 = IKatan2WithCheck(IkReal((((gconst10*new_r11))+((gconst11*new_r10)))),IkReal(((((-1.0)*gconst11*x734))+(((-1.0)*gconst10*new_r01)))),IKFAST_ATAN2_MAGTHRESH); |
| 6208 | if(!x736.valid){ |
| 6209 | continue; |
| 6210 | } |
| 6211 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x735.value)))+(x736.value)); |
| 6212 | sj5array[0]=IKsin(j5array[0]); |
| 6213 | cj5array[0]=IKcos(j5array[0]); |
| 6214 | if( j5array[0] > IKPI ) |
| 6215 | { |
| 6216 | j5array[0]-=IK2PI; |
| 6217 | } |
| 6218 | else if( j5array[0] < -IKPI ) |
| 6219 | { j5array[0]+=IK2PI; |
| 6220 | } |
| 6221 | j5valid[0] = true; |
| 6222 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 6223 | { |
| 6224 | if( !j5valid[ij5] ) |
| 6225 | { |
| 6226 | continue; |
| 6227 | } |
| 6228 | _ij5[0] = ij5; _ij5[1] = -1; |
| 6229 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 6230 | { |
| 6231 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 6232 | { |
| 6233 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 6234 | } |
| 6235 | } |
| 6236 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 6237 | { |
| 6238 | IkReal evalcond[10]; |
| 6239 | IkReal x737=IKcos(j5); |
| 6240 | IkReal x738=IKsin(j5); |
| 6241 | IkReal x739=((1.0)*gconst11); |
| 6242 | IkReal x740=((1.0000000008)*gconst11); |
| 6243 | IkReal x741=((1.0000000008)*gconst10); |
| 6244 | IkReal x742=(new_r11*x738); |
| 6245 | IkReal x743=(new_r01*x737); |
| 6246 | IkReal x744=(new_r00*x737); |
| 6247 | IkReal x745=(gconst10*x737); |
| 6248 | IkReal x746=(new_r10*x738); |
| 6249 | evalcond[0]=(gconst10+((new_r00*x738))+((new_r10*x737))); |
| 6250 | evalcond[1]=(((new_r01*x738))+(((-1.0)*x739))+((new_r11*x737))); |
| 6251 | evalcond[2]=((((-1.0)*x737*x740))+((gconst10*x738))+new_r00); |
| 6252 | evalcond[3]=(((x738*x740))+x745+new_r10); |
| 6253 | evalcond[4]=((((-1.0)*x737*x741))+new_r01+(((-1.0)*x738*x739))); |
| 6254 | evalcond[5]=(((x738*x741))+(((-1.0)*x737*x739))+new_r11); |
| 6255 | evalcond[6]=((((-1.0)*x746))+x744+(((-1.0)*x740))); |
| 6256 | evalcond[7]=((((-1.0)*x742))+x743+(((-1.0)*x741))); |
| 6257 | evalcond[8]=((((-1.0000000008)*x746))+(((-1.0)*x739))+(((1.0000000008)*x744))); |
| 6258 | evalcond[9]=((((-1.0000000008)*x742))+(((1.0000000008)*x743))+(((-1.0)*gconst10))); |
| 6259 | if( 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 ) |
| 6260 | { |
| 6261 | continue; |
| 6262 | } |
| 6263 | } |
| 6264 | |
| 6265 | { |
| 6266 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 6267 | vinfos[0].jointtype = 1; |
| 6268 | vinfos[0].foffset = j0; |
| 6269 | vinfos[0].indices[0] = _ij0[0]; |
| 6270 | vinfos[0].indices[1] = _ij0[1]; |
| 6271 | vinfos[0].maxsolutions = _nj0; |
| 6272 | vinfos[1].jointtype = 1; |
| 6273 | vinfos[1].foffset = j1; |
| 6274 | vinfos[1].indices[0] = _ij1[0]; |
| 6275 | vinfos[1].indices[1] = _ij1[1]; |
| 6276 | vinfos[1].maxsolutions = _nj1; |
| 6277 | vinfos[2].jointtype = 1; |
| 6278 | vinfos[2].foffset = j2; |
| 6279 | vinfos[2].indices[0] = _ij2[0]; |
| 6280 | vinfos[2].indices[1] = _ij2[1]; |
| 6281 | vinfos[2].maxsolutions = _nj2; |
| 6282 | vinfos[3].jointtype = 1; |
| 6283 | vinfos[3].foffset = j3; |
| 6284 | vinfos[3].indices[0] = _ij3[0]; |
| 6285 | vinfos[3].indices[1] = _ij3[1]; |
| 6286 | vinfos[3].maxsolutions = _nj3; |
| 6287 | vinfos[4].jointtype = 1; |
| 6288 | vinfos[4].foffset = j4; |
| 6289 | vinfos[4].indices[0] = _ij4[0]; |
| 6290 | vinfos[4].indices[1] = _ij4[1]; |
| 6291 | vinfos[4].maxsolutions = _nj4; |
| 6292 | vinfos[5].jointtype = 1; |
| 6293 | vinfos[5].foffset = j5; |
| 6294 | vinfos[5].indices[0] = _ij5[0]; |
| 6295 | vinfos[5].indices[1] = _ij5[1]; |
| 6296 | vinfos[5].maxsolutions = _nj5; |
| 6297 | std::vector<int> vfree(0); |
| 6298 | solutions.AddSolution(vinfos,vfree); |
| 6299 | } |
| 6300 | } |
| 6301 | } |
| 6302 | |
| 6303 | } |
| 6304 | |
| 6305 | } |
| 6306 | |
| 6307 | } |
| 6308 | } while(0); |
| 6309 | if( bgotonextstatement ) |
| 6310 | { |
| 6311 | bool bgotonextstatement = true; |
| 6312 | do |
| 6313 | { |
| 6314 | IkReal x747=new_r00*new_r00; |
| 6315 | CheckValue<IkReal> x748=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x747))),-1); |
| 6316 | if(!x748.valid){ |
| 6317 | continue; |
| 6318 | } |
| 6319 | if((((-1.0)*x747*(x748.value))) < -0.00001) |
| 6320 | continue; |
| 6321 | IkReal gconst12=IKsqrt(((-1.0)*x747*(x748.value))); |
| 6322 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.0)+(IKsign(sj3)))))+(IKabs((cj3+(((-1.0)*gconst12)))))), 6.28318530717959))); |
| 6323 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 6324 | { |
| 6325 | bgotonextstatement=false; |
| 6326 | { |
| 6327 | IkReal j5eval[2]; |
| 6328 | IkReal x749=new_r00*new_r00; |
| 6329 | sj4=4.0e-5; |
| 6330 | cj4=1.0; |
| 6331 | j4=4.0e-5; |
| 6332 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 6333 | continue; |
| 6334 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))); |
| 6335 | cj3=gconst12; |
| 6336 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 6337 | continue; |
| 6338 | j3=IKacos(gconst12); |
| 6339 | CheckValue<IkReal> x750=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x749))),-1); |
| 6340 | if(!x750.valid){ |
| 6341 | continue; |
| 6342 | } |
| 6343 | if((((-1.0)*x749*(x750.value))) < -0.00001) |
| 6344 | continue; |
| 6345 | IkReal gconst12=IKsqrt(((-1.0)*x749*(x750.value))); |
| 6346 | IkReal x751=(new_r00*new_r01); |
| 6347 | IkReal x752=(new_r10*new_r11); |
| 6348 | j5eval[0]=(x751+x752); |
| 6349 | j5eval[1]=IKsign(((((25000.0)*x752))+(((25000.0)*x751)))); |
| 6350 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 6351 | { |
| 6352 | { |
| 6353 | IkReal j5eval[2]; |
| 6354 | IkReal x753=new_r00*new_r00; |
| 6355 | sj4=4.0e-5; |
| 6356 | cj4=1.0; |
| 6357 | j4=4.0e-5; |
| 6358 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 6359 | continue; |
| 6360 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))); |
| 6361 | cj3=gconst12; |
| 6362 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 6363 | continue; |
| 6364 | j3=IKacos(gconst12); |
| 6365 | CheckValue<IkReal> x754=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x753))),-1); |
| 6366 | if(!x754.valid){ |
| 6367 | continue; |
| 6368 | } |
| 6369 | if((((-1.0)*x753*(x754.value))) < -0.00001) |
| 6370 | continue; |
| 6371 | IkReal gconst12=IKsqrt(((-1.0)*x753*(x754.value))); |
| 6372 | IkReal x755=(((new_r01*new_r10))+(((-1.0)*new_r00*new_r11))); |
| 6373 | j5eval[0]=x755; |
| 6374 | j5eval[1]=IKsign(x755); |
| 6375 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 6376 | { |
| 6377 | { |
| 6378 | IkReal j5eval[1]; |
| 6379 | IkReal x756=new_r00*new_r00; |
| 6380 | sj4=4.0e-5; |
| 6381 | cj4=1.0; |
| 6382 | j4=4.0e-5; |
| 6383 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 6384 | continue; |
| 6385 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))); |
| 6386 | cj3=gconst12; |
| 6387 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 6388 | continue; |
| 6389 | j3=IKacos(gconst12); |
| 6390 | CheckValue<IkReal> x757=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x756))),-1); |
| 6391 | if(!x757.valid){ |
| 6392 | continue; |
| 6393 | } |
| 6394 | if((((-1.0)*x756*(x757.value))) < -0.00001) |
| 6395 | continue; |
| 6396 | IkReal gconst12=IKsqrt(((-1.0)*x756*(x757.value))); |
| 6397 | j5eval[0]=new_r01; |
| 6398 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 6399 | { |
| 6400 | { |
| 6401 | IkReal evalcond[1]; |
| 6402 | bool bgotonextstatement = true; |
| 6403 | do |
| 6404 | { |
| 6405 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 6406 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 6407 | { |
| 6408 | bgotonextstatement=false; |
| 6409 | { |
| 6410 | IkReal j5eval[2]; |
| 6411 | IkReal x758=new_r10*new_r10; |
| 6412 | sj4=4.0e-5; |
| 6413 | cj4=1.0; |
| 6414 | j4=4.0e-5; |
| 6415 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 6416 | continue; |
| 6417 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))); |
| 6418 | cj3=gconst12; |
| 6419 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 6420 | continue; |
| 6421 | j3=IKacos(gconst12); |
| 6422 | new_r11=0; |
| 6423 | new_r01=0; |
| 6424 | new_r22=0; |
| 6425 | new_r20=0; |
| 6426 | CheckValue<IkReal> x759=IKPowWithIntegerCheck(((-1.0)+(((-1.6e-9)*x758))),-1); |
| 6427 | if(!x759.valid){ |
| 6428 | continue; |
| 6429 | } |
| 6430 | if((((x759.value)*(((-1.0)+(((1.0)*x758)))))) < -0.00001) |
| 6431 | continue; |
| 6432 | IkReal gconst12=IKsqrt(((x759.value)*(((-1.0)+(((1.0)*x758)))))); |
| 6433 | j5eval[0]=-1.0; |
| 6434 | j5eval[1]=-1.0; |
| 6435 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 6436 | { |
| 6437 | { |
| 6438 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 6439 | bool j5valid[1]={false}; |
| 6440 | _nj5 = 1; |
| 6441 | IkReal x760=gconst12*gconst12; |
| 6442 | IkReal x761=new_r00*new_r00; |
| 6443 | IkReal x762=(gconst12*new_r10); |
| 6444 | IkReal x763=((1.0)+(((-1.0)*x760))); |
| 6445 | IkReal x764=((3.90625000625e+17)*x760); |
| 6446 | if((x763) < -0.00001) |
| 6447 | continue; |
| 6448 | IkReal x765=IKsqrt(x763); |
| 6449 | IkReal x766=(new_r00*x765); |
| 6450 | CheckValue<IkReal> x767=IKPowWithIntegerCheck(((((-1.0)*x764*(new_r10*new_r10)))+(((3.90625e+17)*x761*(pow(x763,1.0))))),-1); |
| 6451 | if(!x767.valid){ |
| 6452 | continue; |
| 6453 | } |
| 6454 | CheckValue<IkReal> x768=IKPowWithIntegerCheck(((((-25000.00002)*x762))+(((25000.0)*x766))),-1); |
| 6455 | if(!x768.valid){ |
| 6456 | continue; |
| 6457 | } |
| 6458 | if( IKabs(((x767.value)*(((((-3.906250003125e+17)*x761*x762))+(((3.906250009375e+17)*x762*(gconst12*gconst12)))+(((-3.90625e+17)*x766*(new_r00*new_r00)))+((x764*x766)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((x768.value)*(((((-25000.0)*new_r00*new_r10))+(((25000.00002)*gconst12*x765)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x767.value)*(((((-3.906250003125e+17)*x761*x762))+(((3.906250009375e+17)*x762*(gconst12*gconst12)))+(((-3.90625e+17)*x766*(new_r00*new_r00)))+((x764*x766))))))+IKsqr(((x768.value)*(((((-25000.0)*new_r00*new_r10))+(((25000.00002)*gconst12*x765))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 6459 | continue; |
| 6460 | j5array[0]=IKatan2(((x767.value)*(((((-3.906250003125e+17)*x761*x762))+(((3.906250009375e+17)*x762*(gconst12*gconst12)))+(((-3.90625e+17)*x766*(new_r00*new_r00)))+((x764*x766))))), ((x768.value)*(((((-25000.0)*new_r00*new_r10))+(((25000.00002)*gconst12*x765)))))); |
| 6461 | sj5array[0]=IKsin(j5array[0]); |
| 6462 | cj5array[0]=IKcos(j5array[0]); |
| 6463 | if( j5array[0] > IKPI ) |
| 6464 | { |
| 6465 | j5array[0]-=IK2PI; |
| 6466 | } |
| 6467 | else if( j5array[0] < -IKPI ) |
| 6468 | { j5array[0]+=IK2PI; |
| 6469 | } |
| 6470 | j5valid[0] = true; |
| 6471 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 6472 | { |
| 6473 | if( !j5valid[ij5] ) |
| 6474 | { |
| 6475 | continue; |
| 6476 | } |
| 6477 | _ij5[0] = ij5; _ij5[1] = -1; |
| 6478 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 6479 | { |
| 6480 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 6481 | { |
| 6482 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 6483 | } |
| 6484 | } |
| 6485 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 6486 | { |
| 6487 | IkReal evalcond[7]; |
| 6488 | IkReal x769=IKcos(j5); |
| 6489 | IkReal x770=IKsin(j5); |
| 6490 | IkReal x771=((1.0)*gconst12); |
| 6491 | IkReal x772=((1.0000000008)*gconst12); |
| 6492 | IkReal x773=((1.0000000008)*x770); |
| 6493 | IkReal x774=(new_r00*x769); |
| 6494 | if((((1.0)+(((-1.0)*gconst12*x771)))) < -0.00001) |
| 6495 | continue; |
| 6496 | IkReal x775=IKsqrt(((1.0)+(((-1.0)*gconst12*x771)))); |
| 6497 | IkReal x776=(x769*x775); |
| 6498 | evalcond[0]=((((-1.0)*new_r10*x770))+x774+(((-1.0)*x772))); |
| 6499 | evalcond[1]=(((new_r10*x769))+((new_r00*x770))+x775); |
| 6500 | evalcond[2]=((((-1.0)*new_r10*x773))+(((1.0000000008)*x774))+(((-1.0)*x771))); |
| 6501 | evalcond[3]=(((x770*x775))+(((-1.0)*x769*x772))+new_r00); |
| 6502 | evalcond[4]=(((x770*x772))+x776+new_r10); |
| 6503 | evalcond[5]=((((-1.0000000008)*x776))+(((-1.0)*x770*x771))); |
| 6504 | evalcond[6]=(((x773*x775))+(((-1.0)*x769*x771))); |
| 6505 | if( 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 ) |
| 6506 | { |
| 6507 | continue; |
| 6508 | } |
| 6509 | } |
| 6510 | |
| 6511 | { |
| 6512 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 6513 | vinfos[0].jointtype = 1; |
| 6514 | vinfos[0].foffset = j0; |
| 6515 | vinfos[0].indices[0] = _ij0[0]; |
| 6516 | vinfos[0].indices[1] = _ij0[1]; |
| 6517 | vinfos[0].maxsolutions = _nj0; |
| 6518 | vinfos[1].jointtype = 1; |
| 6519 | vinfos[1].foffset = j1; |
| 6520 | vinfos[1].indices[0] = _ij1[0]; |
| 6521 | vinfos[1].indices[1] = _ij1[1]; |
| 6522 | vinfos[1].maxsolutions = _nj1; |
| 6523 | vinfos[2].jointtype = 1; |
| 6524 | vinfos[2].foffset = j2; |
| 6525 | vinfos[2].indices[0] = _ij2[0]; |
| 6526 | vinfos[2].indices[1] = _ij2[1]; |
| 6527 | vinfos[2].maxsolutions = _nj2; |
| 6528 | vinfos[3].jointtype = 1; |
| 6529 | vinfos[3].foffset = j3; |
| 6530 | vinfos[3].indices[0] = _ij3[0]; |
| 6531 | vinfos[3].indices[1] = _ij3[1]; |
| 6532 | vinfos[3].maxsolutions = _nj3; |
| 6533 | vinfos[4].jointtype = 1; |
| 6534 | vinfos[4].foffset = j4; |
| 6535 | vinfos[4].indices[0] = _ij4[0]; |
| 6536 | vinfos[4].indices[1] = _ij4[1]; |
| 6537 | vinfos[4].maxsolutions = _nj4; |
| 6538 | vinfos[5].jointtype = 1; |
| 6539 | vinfos[5].foffset = j5; |
| 6540 | vinfos[5].indices[0] = _ij5[0]; |
| 6541 | vinfos[5].indices[1] = _ij5[1]; |
| 6542 | vinfos[5].maxsolutions = _nj5; |
| 6543 | std::vector<int> vfree(0); |
| 6544 | solutions.AddSolution(vinfos,vfree); |
| 6545 | } |
| 6546 | } |
| 6547 | } |
| 6548 | |
| 6549 | } else |
| 6550 | { |
| 6551 | { |
| 6552 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 6553 | bool j5valid[1]={false}; |
| 6554 | _nj5 = 1; |
| 6555 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 6556 | continue; |
| 6557 | IkReal x777=IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))); |
| 6558 | IkReal x778=((25000.0)*x777); |
| 6559 | CheckValue<IkReal> x779=IKPowWithIntegerCheck(IKsign(((((-25000.0)*(new_r10*new_r10)))+(((-25000.0)*(new_r00*new_r00))))),-1); |
| 6560 | if(!x779.valid){ |
| 6561 | continue; |
| 6562 | } |
| 6563 | CheckValue<IkReal> x780 = IKatan2WithCheck(IkReal(((((25000.00002)*gconst12*new_r10))+((new_r00*x778)))),IkReal(((((-25000.00002)*gconst12*new_r00))+((new_r10*x778)))),IKFAST_ATAN2_MAGTHRESH); |
| 6564 | if(!x780.valid){ |
| 6565 | continue; |
| 6566 | } |
| 6567 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x779.value)))+(x780.value)); |
| 6568 | sj5array[0]=IKsin(j5array[0]); |
| 6569 | cj5array[0]=IKcos(j5array[0]); |
| 6570 | if( j5array[0] > IKPI ) |
| 6571 | { |
| 6572 | j5array[0]-=IK2PI; |
| 6573 | } |
| 6574 | else if( j5array[0] < -IKPI ) |
| 6575 | { j5array[0]+=IK2PI; |
| 6576 | } |
| 6577 | j5valid[0] = true; |
| 6578 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 6579 | { |
| 6580 | if( !j5valid[ij5] ) |
| 6581 | { |
| 6582 | continue; |
| 6583 | } |
| 6584 | _ij5[0] = ij5; _ij5[1] = -1; |
| 6585 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 6586 | { |
| 6587 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 6588 | { |
| 6589 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 6590 | } |
| 6591 | } |
| 6592 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 6593 | { |
| 6594 | IkReal evalcond[7]; |
| 6595 | IkReal x781=IKcos(j5); |
| 6596 | IkReal x782=IKsin(j5); |
| 6597 | IkReal x783=((1.0)*gconst12); |
| 6598 | IkReal x784=((1.0000000008)*gconst12); |
| 6599 | IkReal x785=((1.0000000008)*x782); |
| 6600 | IkReal x786=(new_r00*x781); |
| 6601 | IkReal x787=x777; |
| 6602 | IkReal x788=(x781*x787); |
| 6603 | evalcond[0]=((((-1.0)*x784))+x786+(((-1.0)*new_r10*x782))); |
| 6604 | evalcond[1]=(((new_r10*x781))+((new_r00*x782))+x787); |
| 6605 | evalcond[2]=((((-1.0)*x783))+(((-1.0)*new_r10*x785))+(((1.0000000008)*x786))); |
| 6606 | evalcond[3]=(((x782*x787))+(((-1.0)*x781*x784))+new_r00); |
| 6607 | evalcond[4]=(((x782*x784))+x788+new_r10); |
| 6608 | evalcond[5]=((((-1.0)*x782*x783))+(((-1.0000000008)*x788))); |
| 6609 | evalcond[6]=(((x785*x787))+(((-1.0)*x781*x783))); |
| 6610 | if( 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 ) |
| 6611 | { |
| 6612 | continue; |
| 6613 | } |
| 6614 | } |
| 6615 | |
| 6616 | { |
| 6617 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 6618 | vinfos[0].jointtype = 1; |
| 6619 | vinfos[0].foffset = j0; |
| 6620 | vinfos[0].indices[0] = _ij0[0]; |
| 6621 | vinfos[0].indices[1] = _ij0[1]; |
| 6622 | vinfos[0].maxsolutions = _nj0; |
| 6623 | vinfos[1].jointtype = 1; |
| 6624 | vinfos[1].foffset = j1; |
| 6625 | vinfos[1].indices[0] = _ij1[0]; |
| 6626 | vinfos[1].indices[1] = _ij1[1]; |
| 6627 | vinfos[1].maxsolutions = _nj1; |
| 6628 | vinfos[2].jointtype = 1; |
| 6629 | vinfos[2].foffset = j2; |
| 6630 | vinfos[2].indices[0] = _ij2[0]; |
| 6631 | vinfos[2].indices[1] = _ij2[1]; |
| 6632 | vinfos[2].maxsolutions = _nj2; |
| 6633 | vinfos[3].jointtype = 1; |
| 6634 | vinfos[3].foffset = j3; |
| 6635 | vinfos[3].indices[0] = _ij3[0]; |
| 6636 | vinfos[3].indices[1] = _ij3[1]; |
| 6637 | vinfos[3].maxsolutions = _nj3; |
| 6638 | vinfos[4].jointtype = 1; |
| 6639 | vinfos[4].foffset = j4; |
| 6640 | vinfos[4].indices[0] = _ij4[0]; |
| 6641 | vinfos[4].indices[1] = _ij4[1]; |
| 6642 | vinfos[4].maxsolutions = _nj4; |
| 6643 | vinfos[5].jointtype = 1; |
| 6644 | vinfos[5].foffset = j5; |
| 6645 | vinfos[5].indices[0] = _ij5[0]; |
| 6646 | vinfos[5].indices[1] = _ij5[1]; |
| 6647 | vinfos[5].maxsolutions = _nj5; |
| 6648 | std::vector<int> vfree(0); |
| 6649 | solutions.AddSolution(vinfos,vfree); |
| 6650 | } |
| 6651 | } |
| 6652 | } |
| 6653 | |
| 6654 | } |
| 6655 | |
| 6656 | } |
| 6657 | |
| 6658 | } |
| 6659 | } while(0); |
| 6660 | if( bgotonextstatement ) |
| 6661 | { |
| 6662 | bool bgotonextstatement = true; |
| 6663 | do |
| 6664 | { |
| 6665 | evalcond[0]=IKabs(new_r01); |
| 6666 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 6667 | { |
| 6668 | bgotonextstatement=false; |
| 6669 | { |
| 6670 | IkReal j5eval[3]; |
| 6671 | IkReal x789=new_r00*new_r00; |
| 6672 | sj4=4.0e-5; |
| 6673 | cj4=1.0; |
| 6674 | j4=4.0e-5; |
| 6675 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 6676 | continue; |
| 6677 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))); |
| 6678 | cj3=gconst12; |
| 6679 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 6680 | continue; |
| 6681 | j3=IKacos(gconst12); |
| 6682 | new_r01=0; |
| 6683 | CheckValue<IkReal> x790=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x789))),-1); |
| 6684 | if(!x790.valid){ |
| 6685 | continue; |
| 6686 | } |
| 6687 | if((((-1.0)*x789*(x790.value))) < -0.00001) |
| 6688 | continue; |
| 6689 | IkReal gconst12=IKsqrt(((-1.0)*x789*(x790.value))); |
| 6690 | IkReal x791=new_r10*new_r10; |
| 6691 | IkReal x792=new_r00*new_r00; |
| 6692 | IkReal x793=((1.0)*x792); |
| 6693 | j5eval[0]=new_r11; |
| 6694 | j5eval[1]=IKsign(new_r11); |
| 6695 | CheckValue<IkReal> x794=IKPowWithIntegerCheck(((((625000000.0)*x792))+(((625000001.0)*x791))),-1); |
| 6696 | if(!x794.valid){ |
| 6697 | continue; |
| 6698 | } |
| 6699 | CheckValue<IkReal> x795=IKPowWithIntegerCheck(((((-1.0000000016)*x791))+(((-1.0)*x792))),-1); |
| 6700 | if(!x795.valid){ |
| 6701 | continue; |
| 6702 | } |
| 6703 | j5eval[2]=((((625000002.0)*(pow(x791,1.0))*(pow(x794.value,1.0))))+(((-1.0)*x793*(x795.value)))); |
| 6704 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 6705 | { |
| 6706 | { |
| 6707 | IkReal j5eval[2]; |
| 6708 | IkReal x796=new_r00*new_r00; |
| 6709 | sj4=4.0e-5; |
| 6710 | cj4=1.0; |
| 6711 | j4=4.0e-5; |
| 6712 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 6713 | continue; |
| 6714 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))); |
| 6715 | cj3=gconst12; |
| 6716 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 6717 | continue; |
| 6718 | j3=IKacos(gconst12); |
| 6719 | new_r01=0; |
| 6720 | CheckValue<IkReal> x797=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x796))),-1); |
| 6721 | if(!x797.valid){ |
| 6722 | continue; |
| 6723 | } |
| 6724 | if((((-1.0)*x796*(x797.value))) < -0.00001) |
| 6725 | continue; |
| 6726 | IkReal gconst12=IKsqrt(((-1.0)*x796*(x797.value))); |
| 6727 | j5eval[0]=new_r10; |
| 6728 | j5eval[1]=new_r11; |
| 6729 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 6730 | { |
| 6731 | { |
| 6732 | IkReal j5eval[2]; |
| 6733 | IkReal x798=new_r00*new_r00; |
| 6734 | sj4=4.0e-5; |
| 6735 | cj4=1.0; |
| 6736 | j4=4.0e-5; |
| 6737 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 6738 | continue; |
| 6739 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))); |
| 6740 | cj3=gconst12; |
| 6741 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 6742 | continue; |
| 6743 | j3=IKacos(gconst12); |
| 6744 | new_r01=0; |
| 6745 | CheckValue<IkReal> x799=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x798))),-1); |
| 6746 | if(!x799.valid){ |
| 6747 | continue; |
| 6748 | } |
| 6749 | if((((-1.0)*x798*(x799.value))) < -0.00001) |
| 6750 | continue; |
| 6751 | IkReal gconst12=IKsqrt(((-1.0)*x798*(x799.value))); |
| 6752 | j5eval[0]=new_r00; |
| 6753 | j5eval[1]=new_r11; |
| 6754 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 6755 | { |
| 6756 | continue; // 3 cases reached |
| 6757 | |
| 6758 | } else |
| 6759 | { |
| 6760 | { |
| 6761 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 6762 | bool j5valid[1]={false}; |
| 6763 | _nj5 = 1; |
| 6764 | CheckValue<IkReal> x801=IKPowWithIntegerCheck(new_r11,-1); |
| 6765 | if(!x801.valid){ |
| 6766 | continue; |
| 6767 | } |
| 6768 | IkReal x800=x801.value; |
| 6769 | CheckValue<IkReal> x802=IKPowWithIntegerCheck(new_r00,-1); |
| 6770 | if(!x802.valid){ |
| 6771 | continue; |
| 6772 | } |
| 6773 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 6774 | continue; |
| 6775 | if( IKabs((x800*(x802.value)*(((((-1.0)*new_r11*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))))+(((-1.0)*gconst12*new_r10)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst12*x800)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x800*(x802.value)*(((((-1.0)*new_r11*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))))+(((-1.0)*gconst12*new_r10))))))+IKsqr((gconst12*x800))-1) <= IKFAST_SINCOS_THRESH ) |
| 6776 | continue; |
| 6777 | j5array[0]=IKatan2((x800*(x802.value)*(((((-1.0)*new_r11*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))))+(((-1.0)*gconst12*new_r10))))), (gconst12*x800)); |
| 6778 | sj5array[0]=IKsin(j5array[0]); |
| 6779 | cj5array[0]=IKcos(j5array[0]); |
| 6780 | if( j5array[0] > IKPI ) |
| 6781 | { |
| 6782 | j5array[0]-=IK2PI; |
| 6783 | } |
| 6784 | else if( j5array[0] < -IKPI ) |
| 6785 | { j5array[0]+=IK2PI; |
| 6786 | } |
| 6787 | j5valid[0] = true; |
| 6788 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 6789 | { |
| 6790 | if( !j5valid[ij5] ) |
| 6791 | { |
| 6792 | continue; |
| 6793 | } |
| 6794 | _ij5[0] = ij5; _ij5[1] = -1; |
| 6795 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 6796 | { |
| 6797 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 6798 | { |
| 6799 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 6800 | } |
| 6801 | } |
| 6802 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 6803 | { |
| 6804 | IkReal evalcond[10]; |
| 6805 | IkReal x803=IKcos(j5); |
| 6806 | IkReal x804=IKsin(j5); |
| 6807 | IkReal x805=((1.0)*gconst12); |
| 6808 | IkReal x806=(gconst12*x803); |
| 6809 | IkReal x807=(new_r11*x804); |
| 6810 | IkReal x808=(new_r00*x803); |
| 6811 | IkReal x809=(gconst12*x804); |
| 6812 | IkReal x810=(new_r10*x804); |
| 6813 | if((((1.0)+(((-1.0)*gconst12*x805)))) < -0.00001) |
| 6814 | continue; |
| 6815 | IkReal x811=IKsqrt(((1.0)+(((-1.0)*gconst12*x805)))); |
| 6816 | IkReal x812=(x804*x811); |
| 6817 | IkReal x813=(x803*x811); |
| 6818 | evalcond[0]=(((new_r11*x803))+(((-1.0)*x805))); |
| 6819 | evalcond[1]=((((-1.0000000008)*gconst12))+(((-1.0)*x810))+x808); |
| 6820 | evalcond[2]=(((new_r00*x804))+((new_r10*x803))+x811); |
| 6821 | evalcond[3]=((((-1.0)*x807))+(((-1.0000000008)*x811))); |
| 6822 | evalcond[4]=((((-1.0000000008)*x807))+(((-1.0)*x811))); |
| 6823 | evalcond[5]=((((1.0000000008)*x808))+(((-1.0)*x805))+(((-1.0000000008)*x810))); |
| 6824 | evalcond[6]=((((-1.0000000008)*x806))+new_r00+x812); |
| 6825 | evalcond[7]=((((1.0000000008)*x809))+new_r10+x813); |
| 6826 | evalcond[8]=((((-1.0)*x804*x805))+(((-1.0000000008)*x813))); |
| 6827 | evalcond[9]=((((1.0000000008)*x812))+(((-1.0)*x803*x805))+new_r11); |
| 6828 | if( 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 ) |
| 6829 | { |
| 6830 | continue; |
| 6831 | } |
| 6832 | } |
| 6833 | |
| 6834 | { |
| 6835 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 6836 | vinfos[0].jointtype = 1; |
| 6837 | vinfos[0].foffset = j0; |
| 6838 | vinfos[0].indices[0] = _ij0[0]; |
| 6839 | vinfos[0].indices[1] = _ij0[1]; |
| 6840 | vinfos[0].maxsolutions = _nj0; |
| 6841 | vinfos[1].jointtype = 1; |
| 6842 | vinfos[1].foffset = j1; |
| 6843 | vinfos[1].indices[0] = _ij1[0]; |
| 6844 | vinfos[1].indices[1] = _ij1[1]; |
| 6845 | vinfos[1].maxsolutions = _nj1; |
| 6846 | vinfos[2].jointtype = 1; |
| 6847 | vinfos[2].foffset = j2; |
| 6848 | vinfos[2].indices[0] = _ij2[0]; |
| 6849 | vinfos[2].indices[1] = _ij2[1]; |
| 6850 | vinfos[2].maxsolutions = _nj2; |
| 6851 | vinfos[3].jointtype = 1; |
| 6852 | vinfos[3].foffset = j3; |
| 6853 | vinfos[3].indices[0] = _ij3[0]; |
| 6854 | vinfos[3].indices[1] = _ij3[1]; |
| 6855 | vinfos[3].maxsolutions = _nj3; |
| 6856 | vinfos[4].jointtype = 1; |
| 6857 | vinfos[4].foffset = j4; |
| 6858 | vinfos[4].indices[0] = _ij4[0]; |
| 6859 | vinfos[4].indices[1] = _ij4[1]; |
| 6860 | vinfos[4].maxsolutions = _nj4; |
| 6861 | vinfos[5].jointtype = 1; |
| 6862 | vinfos[5].foffset = j5; |
| 6863 | vinfos[5].indices[0] = _ij5[0]; |
| 6864 | vinfos[5].indices[1] = _ij5[1]; |
| 6865 | vinfos[5].maxsolutions = _nj5; |
| 6866 | std::vector<int> vfree(0); |
| 6867 | solutions.AddSolution(vinfos,vfree); |
| 6868 | } |
| 6869 | } |
| 6870 | } |
| 6871 | |
| 6872 | } |
| 6873 | |
| 6874 | } |
| 6875 | |
| 6876 | } else |
| 6877 | { |
| 6878 | { |
| 6879 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 6880 | bool j5valid[1]={false}; |
| 6881 | _nj5 = 1; |
| 6882 | CheckValue<IkReal> x815=IKPowWithIntegerCheck(new_r11,-1); |
| 6883 | if(!x815.valid){ |
| 6884 | continue; |
| 6885 | } |
| 6886 | IkReal x814=x815.value; |
| 6887 | CheckValue<IkReal> x816=IKPowWithIntegerCheck(new_r10,-1); |
| 6888 | if(!x816.valid){ |
| 6889 | continue; |
| 6890 | } |
| 6891 | if( IKabs(((4.0e-5)*x814*(x816.value)*(((((25000.0)*gconst12*new_r00))+(((-25000.00002)*gconst12*new_r11)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst12*x814)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((4.0e-5)*x814*(x816.value)*(((((25000.0)*gconst12*new_r00))+(((-25000.00002)*gconst12*new_r11))))))+IKsqr((gconst12*x814))-1) <= IKFAST_SINCOS_THRESH ) |
| 6892 | continue; |
| 6893 | j5array[0]=IKatan2(((4.0e-5)*x814*(x816.value)*(((((25000.0)*gconst12*new_r00))+(((-25000.00002)*gconst12*new_r11))))), (gconst12*x814)); |
| 6894 | sj5array[0]=IKsin(j5array[0]); |
| 6895 | cj5array[0]=IKcos(j5array[0]); |
| 6896 | if( j5array[0] > IKPI ) |
| 6897 | { |
| 6898 | j5array[0]-=IK2PI; |
| 6899 | } |
| 6900 | else if( j5array[0] < -IKPI ) |
| 6901 | { j5array[0]+=IK2PI; |
| 6902 | } |
| 6903 | j5valid[0] = true; |
| 6904 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 6905 | { |
| 6906 | if( !j5valid[ij5] ) |
| 6907 | { |
| 6908 | continue; |
| 6909 | } |
| 6910 | _ij5[0] = ij5; _ij5[1] = -1; |
| 6911 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 6912 | { |
| 6913 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 6914 | { |
| 6915 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 6916 | } |
| 6917 | } |
| 6918 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 6919 | { |
| 6920 | IkReal evalcond[10]; |
| 6921 | IkReal x817=IKcos(j5); |
| 6922 | IkReal x818=IKsin(j5); |
| 6923 | IkReal x819=((1.0)*gconst12); |
| 6924 | IkReal x820=(gconst12*x817); |
| 6925 | IkReal x821=(new_r11*x818); |
| 6926 | IkReal x822=(new_r00*x817); |
| 6927 | IkReal x823=(gconst12*x818); |
| 6928 | IkReal x824=(new_r10*x818); |
| 6929 | if((((1.0)+(((-1.0)*gconst12*x819)))) < -0.00001) |
| 6930 | continue; |
| 6931 | IkReal x825=IKsqrt(((1.0)+(((-1.0)*gconst12*x819)))); |
| 6932 | IkReal x826=(x818*x825); |
| 6933 | IkReal x827=(x817*x825); |
| 6934 | evalcond[0]=(((new_r11*x817))+(((-1.0)*x819))); |
| 6935 | evalcond[1]=((((-1.0000000008)*gconst12))+(((-1.0)*x824))+x822); |
| 6936 | evalcond[2]=(((new_r00*x818))+((new_r10*x817))+x825); |
| 6937 | evalcond[3]=((((-1.0)*x821))+(((-1.0000000008)*x825))); |
| 6938 | evalcond[4]=((((-1.0)*x825))+(((-1.0000000008)*x821))); |
| 6939 | evalcond[5]=((((1.0000000008)*x822))+(((-1.0)*x819))+(((-1.0000000008)*x824))); |
| 6940 | evalcond[6]=(new_r00+x826+(((-1.0000000008)*x820))); |
| 6941 | evalcond[7]=((((1.0000000008)*x823))+new_r10+x827); |
| 6942 | evalcond[8]=((((-1.0)*x818*x819))+(((-1.0000000008)*x827))); |
| 6943 | evalcond[9]=((((-1.0)*x817*x819))+(((1.0000000008)*x826))+new_r11); |
| 6944 | if( 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 ) |
| 6945 | { |
| 6946 | continue; |
| 6947 | } |
| 6948 | } |
| 6949 | |
| 6950 | { |
| 6951 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 6952 | vinfos[0].jointtype = 1; |
| 6953 | vinfos[0].foffset = j0; |
| 6954 | vinfos[0].indices[0] = _ij0[0]; |
| 6955 | vinfos[0].indices[1] = _ij0[1]; |
| 6956 | vinfos[0].maxsolutions = _nj0; |
| 6957 | vinfos[1].jointtype = 1; |
| 6958 | vinfos[1].foffset = j1; |
| 6959 | vinfos[1].indices[0] = _ij1[0]; |
| 6960 | vinfos[1].indices[1] = _ij1[1]; |
| 6961 | vinfos[1].maxsolutions = _nj1; |
| 6962 | vinfos[2].jointtype = 1; |
| 6963 | vinfos[2].foffset = j2; |
| 6964 | vinfos[2].indices[0] = _ij2[0]; |
| 6965 | vinfos[2].indices[1] = _ij2[1]; |
| 6966 | vinfos[2].maxsolutions = _nj2; |
| 6967 | vinfos[3].jointtype = 1; |
| 6968 | vinfos[3].foffset = j3; |
| 6969 | vinfos[3].indices[0] = _ij3[0]; |
| 6970 | vinfos[3].indices[1] = _ij3[1]; |
| 6971 | vinfos[3].maxsolutions = _nj3; |
| 6972 | vinfos[4].jointtype = 1; |
| 6973 | vinfos[4].foffset = j4; |
| 6974 | vinfos[4].indices[0] = _ij4[0]; |
| 6975 | vinfos[4].indices[1] = _ij4[1]; |
| 6976 | vinfos[4].maxsolutions = _nj4; |
| 6977 | vinfos[5].jointtype = 1; |
| 6978 | vinfos[5].foffset = j5; |
| 6979 | vinfos[5].indices[0] = _ij5[0]; |
| 6980 | vinfos[5].indices[1] = _ij5[1]; |
| 6981 | vinfos[5].maxsolutions = _nj5; |
| 6982 | std::vector<int> vfree(0); |
| 6983 | solutions.AddSolution(vinfos,vfree); |
| 6984 | } |
| 6985 | } |
| 6986 | } |
| 6987 | |
| 6988 | } |
| 6989 | |
| 6990 | } |
| 6991 | |
| 6992 | } else |
| 6993 | { |
| 6994 | { |
| 6995 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 6996 | bool j5valid[1]={false}; |
| 6997 | _nj5 = 1; |
| 6998 | CheckValue<IkReal> x828=IKPowWithIntegerCheck(IKsign(new_r11),-1); |
| 6999 | if(!x828.valid){ |
| 7000 | continue; |
| 7001 | } |
| 7002 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 7003 | continue; |
| 7004 | CheckValue<IkReal> x829 = IKatan2WithCheck(IkReal(((-1.0000000008)*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12)))))))),IkReal(gconst12),IKFAST_ATAN2_MAGTHRESH); |
| 7005 | if(!x829.valid){ |
| 7006 | continue; |
| 7007 | } |
| 7008 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x828.value)))+(x829.value)); |
| 7009 | sj5array[0]=IKsin(j5array[0]); |
| 7010 | cj5array[0]=IKcos(j5array[0]); |
| 7011 | if( j5array[0] > IKPI ) |
| 7012 | { |
| 7013 | j5array[0]-=IK2PI; |
| 7014 | } |
| 7015 | else if( j5array[0] < -IKPI ) |
| 7016 | { j5array[0]+=IK2PI; |
| 7017 | } |
| 7018 | j5valid[0] = true; |
| 7019 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 7020 | { |
| 7021 | if( !j5valid[ij5] ) |
| 7022 | { |
| 7023 | continue; |
| 7024 | } |
| 7025 | _ij5[0] = ij5; _ij5[1] = -1; |
| 7026 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 7027 | { |
| 7028 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 7029 | { |
| 7030 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 7031 | } |
| 7032 | } |
| 7033 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 7034 | { |
| 7035 | IkReal evalcond[10]; |
| 7036 | IkReal x830=IKcos(j5); |
| 7037 | IkReal x831=IKsin(j5); |
| 7038 | IkReal x832=((1.0)*gconst12); |
| 7039 | IkReal x833=(gconst12*x830); |
| 7040 | IkReal x834=(new_r11*x831); |
| 7041 | IkReal x835=(new_r00*x830); |
| 7042 | IkReal x836=(gconst12*x831); |
| 7043 | IkReal x837=(new_r10*x831); |
| 7044 | if((((1.0)+(((-1.0)*gconst12*x832)))) < -0.00001) |
| 7045 | continue; |
| 7046 | IkReal x838=IKsqrt(((1.0)+(((-1.0)*gconst12*x832)))); |
| 7047 | IkReal x839=(x831*x838); |
| 7048 | IkReal x840=(x830*x838); |
| 7049 | evalcond[0]=(((new_r11*x830))+(((-1.0)*x832))); |
| 7050 | evalcond[1]=((((-1.0000000008)*gconst12))+(((-1.0)*x837))+x835); |
| 7051 | evalcond[2]=(((new_r00*x831))+x838+((new_r10*x830))); |
| 7052 | evalcond[3]=((((-1.0)*x834))+(((-1.0000000008)*x838))); |
| 7053 | evalcond[4]=((((-1.0)*x838))+(((-1.0000000008)*x834))); |
| 7054 | evalcond[5]=((((1.0000000008)*x835))+(((-1.0)*x832))+(((-1.0000000008)*x837))); |
| 7055 | evalcond[6]=((((-1.0000000008)*x833))+new_r00+x839); |
| 7056 | evalcond[7]=((((1.0000000008)*x836))+new_r10+x840); |
| 7057 | evalcond[8]=((((-1.0000000008)*x840))+(((-1.0)*x831*x832))); |
| 7058 | evalcond[9]=((((1.0000000008)*x839))+(((-1.0)*x830*x832))+new_r11); |
| 7059 | if( 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 ) |
| 7060 | { |
| 7061 | continue; |
| 7062 | } |
| 7063 | } |
| 7064 | |
| 7065 | { |
| 7066 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 7067 | vinfos[0].jointtype = 1; |
| 7068 | vinfos[0].foffset = j0; |
| 7069 | vinfos[0].indices[0] = _ij0[0]; |
| 7070 | vinfos[0].indices[1] = _ij0[1]; |
| 7071 | vinfos[0].maxsolutions = _nj0; |
| 7072 | vinfos[1].jointtype = 1; |
| 7073 | vinfos[1].foffset = j1; |
| 7074 | vinfos[1].indices[0] = _ij1[0]; |
| 7075 | vinfos[1].indices[1] = _ij1[1]; |
| 7076 | vinfos[1].maxsolutions = _nj1; |
| 7077 | vinfos[2].jointtype = 1; |
| 7078 | vinfos[2].foffset = j2; |
| 7079 | vinfos[2].indices[0] = _ij2[0]; |
| 7080 | vinfos[2].indices[1] = _ij2[1]; |
| 7081 | vinfos[2].maxsolutions = _nj2; |
| 7082 | vinfos[3].jointtype = 1; |
| 7083 | vinfos[3].foffset = j3; |
| 7084 | vinfos[3].indices[0] = _ij3[0]; |
| 7085 | vinfos[3].indices[1] = _ij3[1]; |
| 7086 | vinfos[3].maxsolutions = _nj3; |
| 7087 | vinfos[4].jointtype = 1; |
| 7088 | vinfos[4].foffset = j4; |
| 7089 | vinfos[4].indices[0] = _ij4[0]; |
| 7090 | vinfos[4].indices[1] = _ij4[1]; |
| 7091 | vinfos[4].maxsolutions = _nj4; |
| 7092 | vinfos[5].jointtype = 1; |
| 7093 | vinfos[5].foffset = j5; |
| 7094 | vinfos[5].indices[0] = _ij5[0]; |
| 7095 | vinfos[5].indices[1] = _ij5[1]; |
| 7096 | vinfos[5].maxsolutions = _nj5; |
| 7097 | std::vector<int> vfree(0); |
| 7098 | solutions.AddSolution(vinfos,vfree); |
| 7099 | } |
| 7100 | } |
| 7101 | } |
| 7102 | |
| 7103 | } |
| 7104 | |
| 7105 | } |
| 7106 | |
| 7107 | } |
| 7108 | } while(0); |
| 7109 | if( bgotonextstatement ) |
| 7110 | { |
| 7111 | bool bgotonextstatement = true; |
| 7112 | do |
| 7113 | { |
| 7114 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r00))); |
| 7115 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 7116 | { |
| 7117 | bgotonextstatement=false; |
| 7118 | { |
| 7119 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 7120 | bool j5valid[2]={false}; |
| 7121 | _nj5 = 2; |
| 7122 | cj5array[0]=((-1.0)*new_r10); |
| 7123 | if( cj5array[0] >= -1-IKFAST_SINCOS_THRESH && cj5array[0] <= 1+IKFAST_SINCOS_THRESH ) |
| 7124 | { |
| 7125 | j5valid[0] = j5valid[1] = true; |
| 7126 | j5array[0] = IKacos(cj5array[0]); |
| 7127 | sj5array[0] = IKsin(j5array[0]); |
| 7128 | cj5array[1] = cj5array[0]; |
| 7129 | j5array[1] = -j5array[0]; |
| 7130 | sj5array[1] = -sj5array[0]; |
| 7131 | } |
| 7132 | else if( isnan(cj5array[0]) ) |
| 7133 | { |
| 7134 | // probably any value will work |
| 7135 | j5valid[0] = true; |
| 7136 | cj5array[0] = 1; sj5array[0] = 0; j5array[0] = 0; |
| 7137 | } |
| 7138 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 7139 | { |
| 7140 | if( !j5valid[ij5] ) |
| 7141 | { |
| 7142 | continue; |
| 7143 | } |
| 7144 | _ij5[0] = ij5; _ij5[1] = -1; |
| 7145 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 7146 | { |
| 7147 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 7148 | { |
| 7149 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 7150 | } |
| 7151 | } |
| 7152 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 7153 | { |
| 7154 | IkReal evalcond[9]; |
| 7155 | IkReal x841=IKsin(j5); |
| 7156 | IkReal x842=IKcos(j5); |
| 7157 | IkReal x843=(new_r10*x841); |
| 7158 | IkReal x844=((1.0000000008)*x842); |
| 7159 | evalcond[0]=x841; |
| 7160 | evalcond[1]=(new_r01*x841); |
| 7161 | evalcond[2]=((-1.0)*x843); |
| 7162 | evalcond[3]=((1.0)+((new_r10*x842))); |
| 7163 | evalcond[4]=((1.0000000008)*x841); |
| 7164 | evalcond[5]=((-1.0000000008)*x843); |
| 7165 | evalcond[6]=((((-1.0)*x844))+new_r01); |
| 7166 | evalcond[7]=((-1.0000000008)+((new_r01*x842))); |
| 7167 | evalcond[8]=((-1.0)+((new_r01*x844))); |
| 7168 | if( 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 ) |
| 7169 | { |
| 7170 | continue; |
| 7171 | } |
| 7172 | } |
| 7173 | |
| 7174 | { |
| 7175 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 7176 | vinfos[0].jointtype = 1; |
| 7177 | vinfos[0].foffset = j0; |
| 7178 | vinfos[0].indices[0] = _ij0[0]; |
| 7179 | vinfos[0].indices[1] = _ij0[1]; |
| 7180 | vinfos[0].maxsolutions = _nj0; |
| 7181 | vinfos[1].jointtype = 1; |
| 7182 | vinfos[1].foffset = j1; |
| 7183 | vinfos[1].indices[0] = _ij1[0]; |
| 7184 | vinfos[1].indices[1] = _ij1[1]; |
| 7185 | vinfos[1].maxsolutions = _nj1; |
| 7186 | vinfos[2].jointtype = 1; |
| 7187 | vinfos[2].foffset = j2; |
| 7188 | vinfos[2].indices[0] = _ij2[0]; |
| 7189 | vinfos[2].indices[1] = _ij2[1]; |
| 7190 | vinfos[2].maxsolutions = _nj2; |
| 7191 | vinfos[3].jointtype = 1; |
| 7192 | vinfos[3].foffset = j3; |
| 7193 | vinfos[3].indices[0] = _ij3[0]; |
| 7194 | vinfos[3].indices[1] = _ij3[1]; |
| 7195 | vinfos[3].maxsolutions = _nj3; |
| 7196 | vinfos[4].jointtype = 1; |
| 7197 | vinfos[4].foffset = j4; |
| 7198 | vinfos[4].indices[0] = _ij4[0]; |
| 7199 | vinfos[4].indices[1] = _ij4[1]; |
| 7200 | vinfos[4].maxsolutions = _nj4; |
| 7201 | vinfos[5].jointtype = 1; |
| 7202 | vinfos[5].foffset = j5; |
| 7203 | vinfos[5].indices[0] = _ij5[0]; |
| 7204 | vinfos[5].indices[1] = _ij5[1]; |
| 7205 | vinfos[5].maxsolutions = _nj5; |
| 7206 | std::vector<int> vfree(0); |
| 7207 | solutions.AddSolution(vinfos,vfree); |
| 7208 | } |
| 7209 | } |
| 7210 | } |
| 7211 | |
| 7212 | } |
| 7213 | } while(0); |
| 7214 | if( bgotonextstatement ) |
| 7215 | { |
| 7216 | bool bgotonextstatement = true; |
| 7217 | do |
| 7218 | { |
| 7219 | evalcond[0]=((IKabs(new_r10))+(IKabs(new_r00))); |
| 7220 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 7221 | { |
| 7222 | bgotonextstatement=false; |
| 7223 | { |
| 7224 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 7225 | bool j5valid[1]={false}; |
| 7226 | _nj5 = 1; |
| 7227 | if( IKabs(((-0.9999999992)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((0.9999999992)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-0.9999999992)*new_r11))+IKsqr(((0.9999999992)*new_r01))-1) <= IKFAST_SINCOS_THRESH ) |
| 7228 | continue; |
| 7229 | j5array[0]=IKatan2(((-0.9999999992)*new_r11), ((0.9999999992)*new_r01)); |
| 7230 | sj5array[0]=IKsin(j5array[0]); |
| 7231 | cj5array[0]=IKcos(j5array[0]); |
| 7232 | if( j5array[0] > IKPI ) |
| 7233 | { |
| 7234 | j5array[0]-=IK2PI; |
| 7235 | } |
| 7236 | else if( j5array[0] < -IKPI ) |
| 7237 | { j5array[0]+=IK2PI; |
| 7238 | } |
| 7239 | j5valid[0] = true; |
| 7240 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 7241 | { |
| 7242 | if( !j5valid[ij5] ) |
| 7243 | { |
| 7244 | continue; |
| 7245 | } |
| 7246 | _ij5[0] = ij5; _ij5[1] = -1; |
| 7247 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 7248 | { |
| 7249 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 7250 | { |
| 7251 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 7252 | } |
| 7253 | } |
| 7254 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 7255 | { |
| 7256 | IkReal evalcond[7]; |
| 7257 | IkReal x845=IKcos(j5); |
| 7258 | IkReal x846=IKsin(j5); |
| 7259 | IkReal x847=((1.0000000008)*x846); |
| 7260 | IkReal x848=((1.0000000008)*x845); |
| 7261 | evalcond[0]=x846; |
| 7262 | evalcond[1]=x845; |
| 7263 | evalcond[2]=((((-1.0)*x848))+new_r01); |
| 7264 | evalcond[3]=(new_r11+x847); |
| 7265 | evalcond[4]=(((new_r01*x846))+((new_r11*x845))); |
| 7266 | evalcond[5]=((-1.0000000008)+((new_r01*x845))+(((-1.0)*new_r11*x846))); |
| 7267 | evalcond[6]=((-1.0)+(((-1.0)*new_r11*x847))+((new_r01*x848))); |
| 7268 | if( 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 ) |
| 7269 | { |
| 7270 | continue; |
| 7271 | } |
| 7272 | } |
| 7273 | |
| 7274 | { |
| 7275 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 7276 | vinfos[0].jointtype = 1; |
| 7277 | vinfos[0].foffset = j0; |
| 7278 | vinfos[0].indices[0] = _ij0[0]; |
| 7279 | vinfos[0].indices[1] = _ij0[1]; |
| 7280 | vinfos[0].maxsolutions = _nj0; |
| 7281 | vinfos[1].jointtype = 1; |
| 7282 | vinfos[1].foffset = j1; |
| 7283 | vinfos[1].indices[0] = _ij1[0]; |
| 7284 | vinfos[1].indices[1] = _ij1[1]; |
| 7285 | vinfos[1].maxsolutions = _nj1; |
| 7286 | vinfos[2].jointtype = 1; |
| 7287 | vinfos[2].foffset = j2; |
| 7288 | vinfos[2].indices[0] = _ij2[0]; |
| 7289 | vinfos[2].indices[1] = _ij2[1]; |
| 7290 | vinfos[2].maxsolutions = _nj2; |
| 7291 | vinfos[3].jointtype = 1; |
| 7292 | vinfos[3].foffset = j3; |
| 7293 | vinfos[3].indices[0] = _ij3[0]; |
| 7294 | vinfos[3].indices[1] = _ij3[1]; |
| 7295 | vinfos[3].maxsolutions = _nj3; |
| 7296 | vinfos[4].jointtype = 1; |
| 7297 | vinfos[4].foffset = j4; |
| 7298 | vinfos[4].indices[0] = _ij4[0]; |
| 7299 | vinfos[4].indices[1] = _ij4[1]; |
| 7300 | vinfos[4].maxsolutions = _nj4; |
| 7301 | vinfos[5].jointtype = 1; |
| 7302 | vinfos[5].foffset = j5; |
| 7303 | vinfos[5].indices[0] = _ij5[0]; |
| 7304 | vinfos[5].indices[1] = _ij5[1]; |
| 7305 | vinfos[5].maxsolutions = _nj5; |
| 7306 | std::vector<int> vfree(0); |
| 7307 | solutions.AddSolution(vinfos,vfree); |
| 7308 | } |
| 7309 | } |
| 7310 | } |
| 7311 | |
| 7312 | } |
| 7313 | } while(0); |
| 7314 | if( bgotonextstatement ) |
| 7315 | { |
| 7316 | bool bgotonextstatement = true; |
| 7317 | do |
| 7318 | { |
| 7319 | if( 1 ) |
| 7320 | { |
| 7321 | bgotonextstatement=false; |
| 7322 | continue; // branch miss [j5] |
| 7323 | |
| 7324 | } |
| 7325 | } while(0); |
| 7326 | if( bgotonextstatement ) |
| 7327 | { |
| 7328 | } |
| 7329 | } |
| 7330 | } |
| 7331 | } |
| 7332 | } |
| 7333 | } |
| 7334 | |
| 7335 | } else |
| 7336 | { |
| 7337 | { |
| 7338 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 7339 | bool j5valid[1]={false}; |
| 7340 | _nj5 = 1; |
| 7341 | CheckValue<IkReal> x855=IKPowWithIntegerCheck(new_r01,-1); |
| 7342 | if(!x855.valid){ |
| 7343 | continue; |
| 7344 | } |
| 7345 | IkReal x849=x855.value; |
| 7346 | IkReal x850=(gconst12*x849); |
| 7347 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 7348 | continue; |
| 7349 | IkReal x851=IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))); |
| 7350 | IkReal x852=((25000.0)*x851); |
| 7351 | CheckValue<IkReal> x856=IKPowWithIntegerCheck(((((25000.00002)*gconst12*new_r01))+((new_r11*x852))),-1); |
| 7352 | if(!x856.valid){ |
| 7353 | continue; |
| 7354 | } |
| 7355 | IkReal x853=x856.value; |
| 7356 | IkReal x854=((25000.0)*new_r11*x853); |
| 7357 | if( IKabs(((((-1.0)*new_r00*x854))+x850+(((-1.0)*new_r11*x850*x852*x853)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x853*((((gconst12*x852))+(((25000.0)*new_r00*new_r01)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*x854))+x850+(((-1.0)*new_r11*x850*x852*x853))))+IKsqr((x853*((((gconst12*x852))+(((25000.0)*new_r00*new_r01))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 7358 | continue; |
| 7359 | j5array[0]=IKatan2(((((-1.0)*new_r00*x854))+x850+(((-1.0)*new_r11*x850*x852*x853))), (x853*((((gconst12*x852))+(((25000.0)*new_r00*new_r01)))))); |
| 7360 | sj5array[0]=IKsin(j5array[0]); |
| 7361 | cj5array[0]=IKcos(j5array[0]); |
| 7362 | if( j5array[0] > IKPI ) |
| 7363 | { |
| 7364 | j5array[0]-=IK2PI; |
| 7365 | } |
| 7366 | else if( j5array[0] < -IKPI ) |
| 7367 | { j5array[0]+=IK2PI; |
| 7368 | } |
| 7369 | j5valid[0] = true; |
| 7370 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 7371 | { |
| 7372 | if( !j5valid[ij5] ) |
| 7373 | { |
| 7374 | continue; |
| 7375 | } |
| 7376 | _ij5[0] = ij5; _ij5[1] = -1; |
| 7377 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 7378 | { |
| 7379 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 7380 | { |
| 7381 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 7382 | } |
| 7383 | } |
| 7384 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 7385 | { |
| 7386 | IkReal evalcond[10]; |
| 7387 | IkReal x857=IKcos(j5); |
| 7388 | IkReal x858=IKsin(j5); |
| 7389 | IkReal x859=((1.0)*gconst12); |
| 7390 | IkReal x860=(gconst12*x857); |
| 7391 | IkReal x861=(new_r11*x858); |
| 7392 | IkReal x862=(new_r01*x857); |
| 7393 | IkReal x863=(new_r00*x857); |
| 7394 | IkReal x864=(gconst12*x858); |
| 7395 | IkReal x865=(new_r10*x858); |
| 7396 | IkReal x866=x851; |
| 7397 | IkReal x867=(x858*x866); |
| 7398 | IkReal x868=(x857*x866); |
| 7399 | evalcond[0]=((((-1.0)*x859))+((new_r11*x857))+((new_r01*x858))); |
| 7400 | evalcond[1]=((((-1.0)*x865))+(((-1.0000000008)*gconst12))+x863); |
| 7401 | evalcond[2]=(((new_r10*x857))+x866+((new_r00*x858))); |
| 7402 | evalcond[3]=((((-1.0000000008)*x865))+(((1.0000000008)*x863))+(((-1.0)*x859))); |
| 7403 | evalcond[4]=((((-1.0000000008)*x860))+new_r00+x867); |
| 7404 | evalcond[5]=((((1.0000000008)*x864))+new_r10+x868); |
| 7405 | evalcond[6]=((((-1.0000000008)*x868))+(((-1.0)*x858*x859))+new_r01); |
| 7406 | evalcond[7]=((((1.0000000008)*x867))+new_r11+(((-1.0)*x857*x859))); |
| 7407 | evalcond[8]=((((-1.0000000008)*x866))+(((-1.0)*x861))+x862); |
| 7408 | evalcond[9]=((((-1.0000000008)*x861))+(((1.0000000008)*x862))+(((-1.0)*x866))); |
| 7409 | if( 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 ) |
| 7410 | { |
| 7411 | continue; |
| 7412 | } |
| 7413 | } |
| 7414 | |
| 7415 | { |
| 7416 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 7417 | vinfos[0].jointtype = 1; |
| 7418 | vinfos[0].foffset = j0; |
| 7419 | vinfos[0].indices[0] = _ij0[0]; |
| 7420 | vinfos[0].indices[1] = _ij0[1]; |
| 7421 | vinfos[0].maxsolutions = _nj0; |
| 7422 | vinfos[1].jointtype = 1; |
| 7423 | vinfos[1].foffset = j1; |
| 7424 | vinfos[1].indices[0] = _ij1[0]; |
| 7425 | vinfos[1].indices[1] = _ij1[1]; |
| 7426 | vinfos[1].maxsolutions = _nj1; |
| 7427 | vinfos[2].jointtype = 1; |
| 7428 | vinfos[2].foffset = j2; |
| 7429 | vinfos[2].indices[0] = _ij2[0]; |
| 7430 | vinfos[2].indices[1] = _ij2[1]; |
| 7431 | vinfos[2].maxsolutions = _nj2; |
| 7432 | vinfos[3].jointtype = 1; |
| 7433 | vinfos[3].foffset = j3; |
| 7434 | vinfos[3].indices[0] = _ij3[0]; |
| 7435 | vinfos[3].indices[1] = _ij3[1]; |
| 7436 | vinfos[3].maxsolutions = _nj3; |
| 7437 | vinfos[4].jointtype = 1; |
| 7438 | vinfos[4].foffset = j4; |
| 7439 | vinfos[4].indices[0] = _ij4[0]; |
| 7440 | vinfos[4].indices[1] = _ij4[1]; |
| 7441 | vinfos[4].maxsolutions = _nj4; |
| 7442 | vinfos[5].jointtype = 1; |
| 7443 | vinfos[5].foffset = j5; |
| 7444 | vinfos[5].indices[0] = _ij5[0]; |
| 7445 | vinfos[5].indices[1] = _ij5[1]; |
| 7446 | vinfos[5].maxsolutions = _nj5; |
| 7447 | std::vector<int> vfree(0); |
| 7448 | solutions.AddSolution(vinfos,vfree); |
| 7449 | } |
| 7450 | } |
| 7451 | } |
| 7452 | |
| 7453 | } |
| 7454 | |
| 7455 | } |
| 7456 | |
| 7457 | } else |
| 7458 | { |
| 7459 | { |
| 7460 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 7461 | bool j5valid[1]={false}; |
| 7462 | _nj5 = 1; |
| 7463 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 7464 | continue; |
| 7465 | IkReal x869=IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))); |
| 7466 | CheckValue<IkReal> x870 = IKatan2WithCheck(IkReal((((new_r11*x869))+((gconst12*new_r10)))),IkReal(((((-1.0)*gconst12*new_r00))+(((-1.0)*new_r01*x869)))),IKFAST_ATAN2_MAGTHRESH); |
| 7467 | if(!x870.valid){ |
| 7468 | continue; |
| 7469 | } |
| 7470 | CheckValue<IkReal> x871=IKPowWithIntegerCheck(IKsign((((new_r01*new_r10))+(((-1.0)*new_r00*new_r11)))),-1); |
| 7471 | if(!x871.valid){ |
| 7472 | continue; |
| 7473 | } |
| 7474 | j5array[0]=((-1.5707963267949)+(x870.value)+(((1.5707963267949)*(x871.value)))); |
| 7475 | sj5array[0]=IKsin(j5array[0]); |
| 7476 | cj5array[0]=IKcos(j5array[0]); |
| 7477 | if( j5array[0] > IKPI ) |
| 7478 | { |
| 7479 | j5array[0]-=IK2PI; |
| 7480 | } |
| 7481 | else if( j5array[0] < -IKPI ) |
| 7482 | { j5array[0]+=IK2PI; |
| 7483 | } |
| 7484 | j5valid[0] = true; |
| 7485 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 7486 | { |
| 7487 | if( !j5valid[ij5] ) |
| 7488 | { |
| 7489 | continue; |
| 7490 | } |
| 7491 | _ij5[0] = ij5; _ij5[1] = -1; |
| 7492 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 7493 | { |
| 7494 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 7495 | { |
| 7496 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 7497 | } |
| 7498 | } |
| 7499 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 7500 | { |
| 7501 | IkReal evalcond[10]; |
| 7502 | IkReal x872=IKcos(j5); |
| 7503 | IkReal x873=IKsin(j5); |
| 7504 | IkReal x874=((1.0)*gconst12); |
| 7505 | IkReal x875=(gconst12*x872); |
| 7506 | IkReal x876=(new_r11*x873); |
| 7507 | IkReal x877=(new_r01*x872); |
| 7508 | IkReal x878=(new_r00*x872); |
| 7509 | IkReal x879=(gconst12*x873); |
| 7510 | IkReal x880=(new_r10*x873); |
| 7511 | IkReal x881=x869; |
| 7512 | IkReal x882=(x873*x881); |
| 7513 | IkReal x883=(x872*x881); |
| 7514 | evalcond[0]=(((new_r01*x873))+((new_r11*x872))+(((-1.0)*x874))); |
| 7515 | evalcond[1]=((((-1.0)*x880))+(((-1.0000000008)*gconst12))+x878); |
| 7516 | evalcond[2]=(((new_r00*x873))+((new_r10*x872))+x881); |
| 7517 | evalcond[3]=((((1.0000000008)*x878))+(((-1.0000000008)*x880))+(((-1.0)*x874))); |
| 7518 | evalcond[4]=((((-1.0000000008)*x875))+new_r00+x882); |
| 7519 | evalcond[5]=((((1.0000000008)*x879))+new_r10+x883); |
| 7520 | evalcond[6]=((((-1.0)*x873*x874))+new_r01+(((-1.0000000008)*x883))); |
| 7521 | evalcond[7]=((((-1.0)*x872*x874))+(((1.0000000008)*x882))+new_r11); |
| 7522 | evalcond[8]=((((-1.0)*x876))+x877+(((-1.0000000008)*x881))); |
| 7523 | evalcond[9]=((((-1.0000000008)*x876))+(((1.0000000008)*x877))+(((-1.0)*x881))); |
| 7524 | if( 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 ) |
| 7525 | { |
| 7526 | continue; |
| 7527 | } |
| 7528 | } |
| 7529 | |
| 7530 | { |
| 7531 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 7532 | vinfos[0].jointtype = 1; |
| 7533 | vinfos[0].foffset = j0; |
| 7534 | vinfos[0].indices[0] = _ij0[0]; |
| 7535 | vinfos[0].indices[1] = _ij0[1]; |
| 7536 | vinfos[0].maxsolutions = _nj0; |
| 7537 | vinfos[1].jointtype = 1; |
| 7538 | vinfos[1].foffset = j1; |
| 7539 | vinfos[1].indices[0] = _ij1[0]; |
| 7540 | vinfos[1].indices[1] = _ij1[1]; |
| 7541 | vinfos[1].maxsolutions = _nj1; |
| 7542 | vinfos[2].jointtype = 1; |
| 7543 | vinfos[2].foffset = j2; |
| 7544 | vinfos[2].indices[0] = _ij2[0]; |
| 7545 | vinfos[2].indices[1] = _ij2[1]; |
| 7546 | vinfos[2].maxsolutions = _nj2; |
| 7547 | vinfos[3].jointtype = 1; |
| 7548 | vinfos[3].foffset = j3; |
| 7549 | vinfos[3].indices[0] = _ij3[0]; |
| 7550 | vinfos[3].indices[1] = _ij3[1]; |
| 7551 | vinfos[3].maxsolutions = _nj3; |
| 7552 | vinfos[4].jointtype = 1; |
| 7553 | vinfos[4].foffset = j4; |
| 7554 | vinfos[4].indices[0] = _ij4[0]; |
| 7555 | vinfos[4].indices[1] = _ij4[1]; |
| 7556 | vinfos[4].maxsolutions = _nj4; |
| 7557 | vinfos[5].jointtype = 1; |
| 7558 | vinfos[5].foffset = j5; |
| 7559 | vinfos[5].indices[0] = _ij5[0]; |
| 7560 | vinfos[5].indices[1] = _ij5[1]; |
| 7561 | vinfos[5].maxsolutions = _nj5; |
| 7562 | std::vector<int> vfree(0); |
| 7563 | solutions.AddSolution(vinfos,vfree); |
| 7564 | } |
| 7565 | } |
| 7566 | } |
| 7567 | |
| 7568 | } |
| 7569 | |
| 7570 | } |
| 7571 | |
| 7572 | } else |
| 7573 | { |
| 7574 | { |
| 7575 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 7576 | bool j5valid[1]={false}; |
| 7577 | _nj5 = 1; |
| 7578 | IkReal x884=((25000.00002)*gconst12); |
| 7579 | IkReal x885=((25000.0)*new_r10); |
| 7580 | IkReal x886=((25000.0)*new_r00); |
| 7581 | CheckValue<IkReal> x887=IKPowWithIntegerCheck(IKsign((((new_r01*x886))+((new_r11*x885)))),-1); |
| 7582 | if(!x887.valid){ |
| 7583 | continue; |
| 7584 | } |
| 7585 | CheckValue<IkReal> x888 = IKatan2WithCheck(IkReal(((((-1.0)*new_r11*x884))+((gconst12*x886)))),IkReal((((new_r01*x884))+((gconst12*x885)))),IKFAST_ATAN2_MAGTHRESH); |
| 7586 | if(!x888.valid){ |
| 7587 | continue; |
| 7588 | } |
| 7589 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x887.value)))+(x888.value)); |
| 7590 | sj5array[0]=IKsin(j5array[0]); |
| 7591 | cj5array[0]=IKcos(j5array[0]); |
| 7592 | if( j5array[0] > IKPI ) |
| 7593 | { |
| 7594 | j5array[0]-=IK2PI; |
| 7595 | } |
| 7596 | else if( j5array[0] < -IKPI ) |
| 7597 | { j5array[0]+=IK2PI; |
| 7598 | } |
| 7599 | j5valid[0] = true; |
| 7600 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 7601 | { |
| 7602 | if( !j5valid[ij5] ) |
| 7603 | { |
| 7604 | continue; |
| 7605 | } |
| 7606 | _ij5[0] = ij5; _ij5[1] = -1; |
| 7607 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 7608 | { |
| 7609 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 7610 | { |
| 7611 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 7612 | } |
| 7613 | } |
| 7614 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 7615 | { |
| 7616 | IkReal evalcond[10]; |
| 7617 | IkReal x889=IKcos(j5); |
| 7618 | IkReal x890=IKsin(j5); |
| 7619 | IkReal x891=((1.0)*gconst12); |
| 7620 | IkReal x892=(gconst12*x889); |
| 7621 | IkReal x893=(new_r11*x890); |
| 7622 | IkReal x894=(new_r01*x889); |
| 7623 | IkReal x895=(new_r00*x889); |
| 7624 | IkReal x896=(gconst12*x890); |
| 7625 | IkReal x897=(new_r10*x890); |
| 7626 | if((((1.0)+(((-1.0)*gconst12*x891)))) < -0.00001) |
| 7627 | continue; |
| 7628 | IkReal x898=IKsqrt(((1.0)+(((-1.0)*gconst12*x891)))); |
| 7629 | IkReal x899=(x890*x898); |
| 7630 | IkReal x900=(x889*x898); |
| 7631 | evalcond[0]=(((new_r11*x889))+((new_r01*x890))+(((-1.0)*x891))); |
| 7632 | evalcond[1]=((((-1.0)*x897))+(((-1.0000000008)*gconst12))+x895); |
| 7633 | evalcond[2]=(((new_r10*x889))+((new_r00*x890))+x898); |
| 7634 | evalcond[3]=((((1.0000000008)*x895))+(((-1.0)*x891))+(((-1.0000000008)*x897))); |
| 7635 | evalcond[4]=(new_r00+x899+(((-1.0000000008)*x892))); |
| 7636 | evalcond[5]=((((1.0000000008)*x896))+new_r10+x900); |
| 7637 | evalcond[6]=(new_r01+(((-1.0000000008)*x900))+(((-1.0)*x890*x891))); |
| 7638 | evalcond[7]=((((1.0000000008)*x899))+(((-1.0)*x889*x891))+new_r11); |
| 7639 | evalcond[8]=((((-1.0)*x893))+x894+(((-1.0000000008)*x898))); |
| 7640 | evalcond[9]=((((1.0000000008)*x894))+(((-1.0)*x898))+(((-1.0000000008)*x893))); |
| 7641 | if( 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 ) |
| 7642 | { |
| 7643 | continue; |
| 7644 | } |
| 7645 | } |
| 7646 | |
| 7647 | { |
| 7648 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 7649 | vinfos[0].jointtype = 1; |
| 7650 | vinfos[0].foffset = j0; |
| 7651 | vinfos[0].indices[0] = _ij0[0]; |
| 7652 | vinfos[0].indices[1] = _ij0[1]; |
| 7653 | vinfos[0].maxsolutions = _nj0; |
| 7654 | vinfos[1].jointtype = 1; |
| 7655 | vinfos[1].foffset = j1; |
| 7656 | vinfos[1].indices[0] = _ij1[0]; |
| 7657 | vinfos[1].indices[1] = _ij1[1]; |
| 7658 | vinfos[1].maxsolutions = _nj1; |
| 7659 | vinfos[2].jointtype = 1; |
| 7660 | vinfos[2].foffset = j2; |
| 7661 | vinfos[2].indices[0] = _ij2[0]; |
| 7662 | vinfos[2].indices[1] = _ij2[1]; |
| 7663 | vinfos[2].maxsolutions = _nj2; |
| 7664 | vinfos[3].jointtype = 1; |
| 7665 | vinfos[3].foffset = j3; |
| 7666 | vinfos[3].indices[0] = _ij3[0]; |
| 7667 | vinfos[3].indices[1] = _ij3[1]; |
| 7668 | vinfos[3].maxsolutions = _nj3; |
| 7669 | vinfos[4].jointtype = 1; |
| 7670 | vinfos[4].foffset = j4; |
| 7671 | vinfos[4].indices[0] = _ij4[0]; |
| 7672 | vinfos[4].indices[1] = _ij4[1]; |
| 7673 | vinfos[4].maxsolutions = _nj4; |
| 7674 | vinfos[5].jointtype = 1; |
| 7675 | vinfos[5].foffset = j5; |
| 7676 | vinfos[5].indices[0] = _ij5[0]; |
| 7677 | vinfos[5].indices[1] = _ij5[1]; |
| 7678 | vinfos[5].maxsolutions = _nj5; |
| 7679 | std::vector<int> vfree(0); |
| 7680 | solutions.AddSolution(vinfos,vfree); |
| 7681 | } |
| 7682 | } |
| 7683 | } |
| 7684 | |
| 7685 | } |
| 7686 | |
| 7687 | } |
| 7688 | |
| 7689 | } |
| 7690 | } while(0); |
| 7691 | if( bgotonextstatement ) |
| 7692 | { |
| 7693 | bool bgotonextstatement = true; |
| 7694 | do |
| 7695 | { |
| 7696 | IkReal x901=new_r00*new_r00; |
| 7697 | CheckValue<IkReal> x902=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x901))),-1); |
| 7698 | if(!x902.valid){ |
| 7699 | continue; |
| 7700 | } |
| 7701 | if((((-1.0)*x901*(x902.value))) < -0.00001) |
| 7702 | continue; |
| 7703 | IkReal gconst12=IKsqrt(((-1.0)*x901*(x902.value))); |
| 7704 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.0)+(IKsign(sj3)))))+(IKabs((cj3+(((-1.0)*gconst12)))))), 6.28318530717959))); |
| 7705 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 7706 | { |
| 7707 | bgotonextstatement=false; |
| 7708 | { |
| 7709 | IkReal j5eval[2]; |
| 7710 | IkReal x903=new_r00*new_r00; |
| 7711 | sj4=4.0e-5; |
| 7712 | cj4=1.0; |
| 7713 | j4=4.0e-5; |
| 7714 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 7715 | continue; |
| 7716 | sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))); |
| 7717 | cj3=gconst12; |
| 7718 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 7719 | continue; |
| 7720 | j3=((-1.0)*(IKacos(gconst12))); |
| 7721 | CheckValue<IkReal> x904=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x903))),-1); |
| 7722 | if(!x904.valid){ |
| 7723 | continue; |
| 7724 | } |
| 7725 | if((((-1.0)*x903*(x904.value))) < -0.00001) |
| 7726 | continue; |
| 7727 | IkReal gconst12=IKsqrt(((-1.0)*x903*(x904.value))); |
| 7728 | IkReal x905=(new_r00*new_r01); |
| 7729 | IkReal x906=(new_r10*new_r11); |
| 7730 | j5eval[0]=(x905+x906); |
| 7731 | j5eval[1]=IKsign(((((25000.0)*x906))+(((25000.0)*x905)))); |
| 7732 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 7733 | { |
| 7734 | { |
| 7735 | IkReal j5eval[2]; |
| 7736 | IkReal x907=new_r00*new_r00; |
| 7737 | sj4=4.0e-5; |
| 7738 | cj4=1.0; |
| 7739 | j4=4.0e-5; |
| 7740 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 7741 | continue; |
| 7742 | sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))); |
| 7743 | cj3=gconst12; |
| 7744 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 7745 | continue; |
| 7746 | j3=((-1.0)*(IKacos(gconst12))); |
| 7747 | CheckValue<IkReal> x908=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x907))),-1); |
| 7748 | if(!x908.valid){ |
| 7749 | continue; |
| 7750 | } |
| 7751 | if((((-1.0)*x907*(x908.value))) < -0.00001) |
| 7752 | continue; |
| 7753 | IkReal gconst12=IKsqrt(((-1.0)*x907*(x908.value))); |
| 7754 | IkReal x909=(((new_r01*new_r10))+(((-1.0)*new_r00*new_r11))); |
| 7755 | j5eval[0]=x909; |
| 7756 | j5eval[1]=IKsign(x909); |
| 7757 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 7758 | { |
| 7759 | { |
| 7760 | IkReal j5eval[1]; |
| 7761 | IkReal x910=new_r00*new_r00; |
| 7762 | sj4=4.0e-5; |
| 7763 | cj4=1.0; |
| 7764 | j4=4.0e-5; |
| 7765 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 7766 | continue; |
| 7767 | sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))); |
| 7768 | cj3=gconst12; |
| 7769 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 7770 | continue; |
| 7771 | j3=((-1.0)*(IKacos(gconst12))); |
| 7772 | CheckValue<IkReal> x911=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x910))),-1); |
| 7773 | if(!x911.valid){ |
| 7774 | continue; |
| 7775 | } |
| 7776 | if((((-1.0)*x910*(x911.value))) < -0.00001) |
| 7777 | continue; |
| 7778 | IkReal gconst12=IKsqrt(((-1.0)*x910*(x911.value))); |
| 7779 | j5eval[0]=new_r01; |
| 7780 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 7781 | { |
| 7782 | { |
| 7783 | IkReal evalcond[1]; |
| 7784 | bool bgotonextstatement = true; |
| 7785 | do |
| 7786 | { |
| 7787 | evalcond[0]=IKabs(new_r01); |
| 7788 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 7789 | { |
| 7790 | bgotonextstatement=false; |
| 7791 | { |
| 7792 | IkReal j5eval[1]; |
| 7793 | IkReal x912=new_r00*new_r00; |
| 7794 | sj4=4.0e-5; |
| 7795 | cj4=1.0; |
| 7796 | j4=4.0e-5; |
| 7797 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 7798 | continue; |
| 7799 | sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))); |
| 7800 | cj3=gconst12; |
| 7801 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 7802 | continue; |
| 7803 | j3=((-1.0)*(IKacos(gconst12))); |
| 7804 | new_r01=0; |
| 7805 | CheckValue<IkReal> x913=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x912))),-1); |
| 7806 | if(!x913.valid){ |
| 7807 | continue; |
| 7808 | } |
| 7809 | if((((-1.0)*x912*(x913.value))) < -0.00001) |
| 7810 | continue; |
| 7811 | IkReal gconst12=IKsqrt(((-1.0)*x912*(x913.value))); |
| 7812 | j5eval[0]=new_r11; |
| 7813 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 7814 | { |
| 7815 | { |
| 7816 | IkReal j5eval[2]; |
| 7817 | IkReal x914=new_r00*new_r00; |
| 7818 | sj4=4.0e-5; |
| 7819 | cj4=1.0; |
| 7820 | j4=4.0e-5; |
| 7821 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 7822 | continue; |
| 7823 | sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))); |
| 7824 | cj3=gconst12; |
| 7825 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 7826 | continue; |
| 7827 | j3=((-1.0)*(IKacos(gconst12))); |
| 7828 | new_r01=0; |
| 7829 | CheckValue<IkReal> x915=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x914))),-1); |
| 7830 | if(!x915.valid){ |
| 7831 | continue; |
| 7832 | } |
| 7833 | if((((-1.0)*x914*(x915.value))) < -0.00001) |
| 7834 | continue; |
| 7835 | IkReal gconst12=IKsqrt(((-1.0)*x914*(x915.value))); |
| 7836 | j5eval[0]=new_r10; |
| 7837 | j5eval[1]=new_r11; |
| 7838 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 7839 | { |
| 7840 | { |
| 7841 | IkReal j5eval[2]; |
| 7842 | IkReal x916=new_r00*new_r00; |
| 7843 | sj4=4.0e-5; |
| 7844 | cj4=1.0; |
| 7845 | j4=4.0e-5; |
| 7846 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 7847 | continue; |
| 7848 | sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))); |
| 7849 | cj3=gconst12; |
| 7850 | if( (gconst12) < -1-IKFAST_SINCOS_THRESH || (gconst12) > 1+IKFAST_SINCOS_THRESH ) |
| 7851 | continue; |
| 7852 | j3=((-1.0)*(IKacos(gconst12))); |
| 7853 | new_r01=0; |
| 7854 | CheckValue<IkReal> x917=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x916))),-1); |
| 7855 | if(!x917.valid){ |
| 7856 | continue; |
| 7857 | } |
| 7858 | if((((-1.0)*x916*(x917.value))) < -0.00001) |
| 7859 | continue; |
| 7860 | IkReal gconst12=IKsqrt(((-1.0)*x916*(x917.value))); |
| 7861 | j5eval[0]=new_r00; |
| 7862 | j5eval[1]=new_r11; |
| 7863 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 7864 | { |
| 7865 | continue; // 3 cases reached |
| 7866 | |
| 7867 | } else |
| 7868 | { |
| 7869 | { |
| 7870 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 7871 | bool j5valid[1]={false}; |
| 7872 | _nj5 = 1; |
| 7873 | CheckValue<IkReal> x919=IKPowWithIntegerCheck(new_r11,-1); |
| 7874 | if(!x919.valid){ |
| 7875 | continue; |
| 7876 | } |
| 7877 | IkReal x918=x919.value; |
| 7878 | CheckValue<IkReal> x920=IKPowWithIntegerCheck(new_r00,-1); |
| 7879 | if(!x920.valid){ |
| 7880 | continue; |
| 7881 | } |
| 7882 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 7883 | continue; |
| 7884 | if( IKabs((x918*(x920.value)*(((((-1.0)*gconst12*new_r10))+((new_r11*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12)))))))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst12*x918)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x918*(x920.value)*(((((-1.0)*gconst12*new_r10))+((new_r11*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))))))))+IKsqr((gconst12*x918))-1) <= IKFAST_SINCOS_THRESH ) |
| 7885 | continue; |
| 7886 | j5array[0]=IKatan2((x918*(x920.value)*(((((-1.0)*gconst12*new_r10))+((new_r11*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))))))), (gconst12*x918)); |
| 7887 | sj5array[0]=IKsin(j5array[0]); |
| 7888 | cj5array[0]=IKcos(j5array[0]); |
| 7889 | if( j5array[0] > IKPI ) |
| 7890 | { |
| 7891 | j5array[0]-=IK2PI; |
| 7892 | } |
| 7893 | else if( j5array[0] < -IKPI ) |
| 7894 | { j5array[0]+=IK2PI; |
| 7895 | } |
| 7896 | j5valid[0] = true; |
| 7897 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 7898 | { |
| 7899 | if( !j5valid[ij5] ) |
| 7900 | { |
| 7901 | continue; |
| 7902 | } |
| 7903 | _ij5[0] = ij5; _ij5[1] = -1; |
| 7904 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 7905 | { |
| 7906 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 7907 | { |
| 7908 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 7909 | } |
| 7910 | } |
| 7911 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 7912 | { |
| 7913 | IkReal evalcond[10]; |
| 7914 | IkReal x921=IKcos(j5); |
| 7915 | IkReal x922=IKsin(j5); |
| 7916 | IkReal x923=((1.0)*gconst12); |
| 7917 | IkReal x924=(gconst12*x921); |
| 7918 | IkReal x925=(new_r11*x922); |
| 7919 | IkReal x926=(new_r00*x921); |
| 7920 | IkReal x927=(gconst12*x922); |
| 7921 | IkReal x928=(new_r10*x922); |
| 7922 | if((((1.0)+(((-1.0)*gconst12*x923)))) < -0.00001) |
| 7923 | continue; |
| 7924 | IkReal x929=IKsqrt(((1.0)+(((-1.0)*gconst12*x923)))); |
| 7925 | IkReal x930=((1.0)*x929); |
| 7926 | IkReal x931=((1.0000000008)*x929); |
| 7927 | evalcond[0]=((((-1.0)*x923))+((new_r11*x921))); |
| 7928 | evalcond[1]=((((-1.0000000008)*gconst12))+(((-1.0)*x928))+x926); |
| 7929 | evalcond[2]=((((-1.0000000008)*x925))+x929); |
| 7930 | evalcond[3]=((((-1.0)*x925))+x931); |
| 7931 | evalcond[4]=(((new_r00*x922))+((new_r10*x921))+(((-1.0)*x930))); |
| 7932 | evalcond[5]=((((-1.0)*x923))+(((-1.0000000008)*x928))+(((1.0000000008)*x926))); |
| 7933 | evalcond[6]=(((x921*x931))+(((-1.0)*x922*x923))); |
| 7934 | evalcond[7]=((((-1.0000000008)*x924))+new_r00+(((-1.0)*x922*x930))); |
| 7935 | evalcond[8]=((((1.0000000008)*x927))+(((-1.0)*x921*x930))+new_r10); |
| 7936 | evalcond[9]=((((-1.0)*x921*x923))+new_r11+(((-1.0)*x922*x931))); |
| 7937 | if( 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 ) |
| 7938 | { |
| 7939 | continue; |
| 7940 | } |
| 7941 | } |
| 7942 | |
| 7943 | { |
| 7944 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 7945 | vinfos[0].jointtype = 1; |
| 7946 | vinfos[0].foffset = j0; |
| 7947 | vinfos[0].indices[0] = _ij0[0]; |
| 7948 | vinfos[0].indices[1] = _ij0[1]; |
| 7949 | vinfos[0].maxsolutions = _nj0; |
| 7950 | vinfos[1].jointtype = 1; |
| 7951 | vinfos[1].foffset = j1; |
| 7952 | vinfos[1].indices[0] = _ij1[0]; |
| 7953 | vinfos[1].indices[1] = _ij1[1]; |
| 7954 | vinfos[1].maxsolutions = _nj1; |
| 7955 | vinfos[2].jointtype = 1; |
| 7956 | vinfos[2].foffset = j2; |
| 7957 | vinfos[2].indices[0] = _ij2[0]; |
| 7958 | vinfos[2].indices[1] = _ij2[1]; |
| 7959 | vinfos[2].maxsolutions = _nj2; |
| 7960 | vinfos[3].jointtype = 1; |
| 7961 | vinfos[3].foffset = j3; |
| 7962 | vinfos[3].indices[0] = _ij3[0]; |
| 7963 | vinfos[3].indices[1] = _ij3[1]; |
| 7964 | vinfos[3].maxsolutions = _nj3; |
| 7965 | vinfos[4].jointtype = 1; |
| 7966 | vinfos[4].foffset = j4; |
| 7967 | vinfos[4].indices[0] = _ij4[0]; |
| 7968 | vinfos[4].indices[1] = _ij4[1]; |
| 7969 | vinfos[4].maxsolutions = _nj4; |
| 7970 | vinfos[5].jointtype = 1; |
| 7971 | vinfos[5].foffset = j5; |
| 7972 | vinfos[5].indices[0] = _ij5[0]; |
| 7973 | vinfos[5].indices[1] = _ij5[1]; |
| 7974 | vinfos[5].maxsolutions = _nj5; |
| 7975 | std::vector<int> vfree(0); |
| 7976 | solutions.AddSolution(vinfos,vfree); |
| 7977 | } |
| 7978 | } |
| 7979 | } |
| 7980 | |
| 7981 | } |
| 7982 | |
| 7983 | } |
| 7984 | |
| 7985 | } else |
| 7986 | { |
| 7987 | { |
| 7988 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 7989 | bool j5valid[1]={false}; |
| 7990 | _nj5 = 1; |
| 7991 | CheckValue<IkReal> x933=IKPowWithIntegerCheck(new_r11,-1); |
| 7992 | if(!x933.valid){ |
| 7993 | continue; |
| 7994 | } |
| 7995 | IkReal x932=x933.value; |
| 7996 | CheckValue<IkReal> x934=IKPowWithIntegerCheck(new_r10,-1); |
| 7997 | if(!x934.valid){ |
| 7998 | continue; |
| 7999 | } |
| 8000 | if( IKabs(((4.0e-5)*x932*(x934.value)*(((((25000.0)*gconst12*new_r00))+(((-25000.00002)*gconst12*new_r11)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst12*x932)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((4.0e-5)*x932*(x934.value)*(((((25000.0)*gconst12*new_r00))+(((-25000.00002)*gconst12*new_r11))))))+IKsqr((gconst12*x932))-1) <= IKFAST_SINCOS_THRESH ) |
| 8001 | continue; |
| 8002 | j5array[0]=IKatan2(((4.0e-5)*x932*(x934.value)*(((((25000.0)*gconst12*new_r00))+(((-25000.00002)*gconst12*new_r11))))), (gconst12*x932)); |
| 8003 | sj5array[0]=IKsin(j5array[0]); |
| 8004 | cj5array[0]=IKcos(j5array[0]); |
| 8005 | if( j5array[0] > IKPI ) |
| 8006 | { |
| 8007 | j5array[0]-=IK2PI; |
| 8008 | } |
| 8009 | else if( j5array[0] < -IKPI ) |
| 8010 | { j5array[0]+=IK2PI; |
| 8011 | } |
| 8012 | j5valid[0] = true; |
| 8013 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 8014 | { |
| 8015 | if( !j5valid[ij5] ) |
| 8016 | { |
| 8017 | continue; |
| 8018 | } |
| 8019 | _ij5[0] = ij5; _ij5[1] = -1; |
| 8020 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 8021 | { |
| 8022 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 8023 | { |
| 8024 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 8025 | } |
| 8026 | } |
| 8027 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 8028 | { |
| 8029 | IkReal evalcond[10]; |
| 8030 | IkReal x935=IKcos(j5); |
| 8031 | IkReal x936=IKsin(j5); |
| 8032 | IkReal x937=((1.0)*gconst12); |
| 8033 | IkReal x938=(gconst12*x935); |
| 8034 | IkReal x939=(new_r11*x936); |
| 8035 | IkReal x940=(new_r00*x935); |
| 8036 | IkReal x941=(gconst12*x936); |
| 8037 | IkReal x942=(new_r10*x936); |
| 8038 | if((((1.0)+(((-1.0)*gconst12*x937)))) < -0.00001) |
| 8039 | continue; |
| 8040 | IkReal x943=IKsqrt(((1.0)+(((-1.0)*gconst12*x937)))); |
| 8041 | IkReal x944=((1.0)*x943); |
| 8042 | IkReal x945=((1.0000000008)*x943); |
| 8043 | evalcond[0]=(((new_r11*x935))+(((-1.0)*x937))); |
| 8044 | evalcond[1]=((((-1.0)*x942))+(((-1.0000000008)*gconst12))+x940); |
| 8045 | evalcond[2]=((((-1.0000000008)*x939))+x943); |
| 8046 | evalcond[3]=((((-1.0)*x939))+x945); |
| 8047 | evalcond[4]=((((-1.0)*x944))+((new_r00*x936))+((new_r10*x935))); |
| 8048 | evalcond[5]=((((1.0000000008)*x940))+(((-1.0000000008)*x942))+(((-1.0)*x937))); |
| 8049 | evalcond[6]=(((x935*x945))+(((-1.0)*x936*x937))); |
| 8050 | evalcond[7]=((((-1.0000000008)*x938))+(((-1.0)*x936*x944))+new_r00); |
| 8051 | evalcond[8]=((((1.0000000008)*x941))+new_r10+(((-1.0)*x935*x944))); |
| 8052 | evalcond[9]=((((-1.0)*x935*x937))+(((-1.0)*x936*x945))+new_r11); |
| 8053 | if( 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 ) |
| 8054 | { |
| 8055 | continue; |
| 8056 | } |
| 8057 | } |
| 8058 | |
| 8059 | { |
| 8060 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 8061 | vinfos[0].jointtype = 1; |
| 8062 | vinfos[0].foffset = j0; |
| 8063 | vinfos[0].indices[0] = _ij0[0]; |
| 8064 | vinfos[0].indices[1] = _ij0[1]; |
| 8065 | vinfos[0].maxsolutions = _nj0; |
| 8066 | vinfos[1].jointtype = 1; |
| 8067 | vinfos[1].foffset = j1; |
| 8068 | vinfos[1].indices[0] = _ij1[0]; |
| 8069 | vinfos[1].indices[1] = _ij1[1]; |
| 8070 | vinfos[1].maxsolutions = _nj1; |
| 8071 | vinfos[2].jointtype = 1; |
| 8072 | vinfos[2].foffset = j2; |
| 8073 | vinfos[2].indices[0] = _ij2[0]; |
| 8074 | vinfos[2].indices[1] = _ij2[1]; |
| 8075 | vinfos[2].maxsolutions = _nj2; |
| 8076 | vinfos[3].jointtype = 1; |
| 8077 | vinfos[3].foffset = j3; |
| 8078 | vinfos[3].indices[0] = _ij3[0]; |
| 8079 | vinfos[3].indices[1] = _ij3[1]; |
| 8080 | vinfos[3].maxsolutions = _nj3; |
| 8081 | vinfos[4].jointtype = 1; |
| 8082 | vinfos[4].foffset = j4; |
| 8083 | vinfos[4].indices[0] = _ij4[0]; |
| 8084 | vinfos[4].indices[1] = _ij4[1]; |
| 8085 | vinfos[4].maxsolutions = _nj4; |
| 8086 | vinfos[5].jointtype = 1; |
| 8087 | vinfos[5].foffset = j5; |
| 8088 | vinfos[5].indices[0] = _ij5[0]; |
| 8089 | vinfos[5].indices[1] = _ij5[1]; |
| 8090 | vinfos[5].maxsolutions = _nj5; |
| 8091 | std::vector<int> vfree(0); |
| 8092 | solutions.AddSolution(vinfos,vfree); |
| 8093 | } |
| 8094 | } |
| 8095 | } |
| 8096 | |
| 8097 | } |
| 8098 | |
| 8099 | } |
| 8100 | |
| 8101 | } else |
| 8102 | { |
| 8103 | { |
| 8104 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 8105 | bool j5valid[1]={false}; |
| 8106 | _nj5 = 1; |
| 8107 | CheckValue<IkReal> x947=IKPowWithIntegerCheck(new_r11,-1); |
| 8108 | if(!x947.valid){ |
| 8109 | continue; |
| 8110 | } |
| 8111 | IkReal x946=x947.value; |
| 8112 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 8113 | continue; |
| 8114 | if( IKabs(((0.9999999992)*x946*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12)))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst12*x946)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*x946*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))))+IKsqr((gconst12*x946))-1) <= IKFAST_SINCOS_THRESH ) |
| 8115 | continue; |
| 8116 | j5array[0]=IKatan2(((0.9999999992)*x946*(IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))))), (gconst12*x946)); |
| 8117 | sj5array[0]=IKsin(j5array[0]); |
| 8118 | cj5array[0]=IKcos(j5array[0]); |
| 8119 | if( j5array[0] > IKPI ) |
| 8120 | { |
| 8121 | j5array[0]-=IK2PI; |
| 8122 | } |
| 8123 | else if( j5array[0] < -IKPI ) |
| 8124 | { j5array[0]+=IK2PI; |
| 8125 | } |
| 8126 | j5valid[0] = true; |
| 8127 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 8128 | { |
| 8129 | if( !j5valid[ij5] ) |
| 8130 | { |
| 8131 | continue; |
| 8132 | } |
| 8133 | _ij5[0] = ij5; _ij5[1] = -1; |
| 8134 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 8135 | { |
| 8136 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 8137 | { |
| 8138 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 8139 | } |
| 8140 | } |
| 8141 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 8142 | { |
| 8143 | IkReal evalcond[10]; |
| 8144 | IkReal x948=IKcos(j5); |
| 8145 | IkReal x949=IKsin(j5); |
| 8146 | IkReal x950=((1.0)*gconst12); |
| 8147 | IkReal x951=(gconst12*x948); |
| 8148 | IkReal x952=(new_r11*x949); |
| 8149 | IkReal x953=(new_r00*x948); |
| 8150 | IkReal x954=(gconst12*x949); |
| 8151 | IkReal x955=(new_r10*x949); |
| 8152 | if((((1.0)+(((-1.0)*gconst12*x950)))) < -0.00001) |
| 8153 | continue; |
| 8154 | IkReal x956=IKsqrt(((1.0)+(((-1.0)*gconst12*x950)))); |
| 8155 | IkReal x957=((1.0)*x956); |
| 8156 | IkReal x958=((1.0000000008)*x956); |
| 8157 | evalcond[0]=(((new_r11*x948))+(((-1.0)*x950))); |
| 8158 | evalcond[1]=((((-1.0)*x955))+(((-1.0000000008)*gconst12))+x953); |
| 8159 | evalcond[2]=((((-1.0000000008)*x952))+x956); |
| 8160 | evalcond[3]=((((-1.0)*x952))+x958); |
| 8161 | evalcond[4]=(((new_r00*x949))+((new_r10*x948))+(((-1.0)*x957))); |
| 8162 | evalcond[5]=((((1.0000000008)*x953))+(((-1.0000000008)*x955))+(((-1.0)*x950))); |
| 8163 | evalcond[6]=(((x948*x958))+(((-1.0)*x949*x950))); |
| 8164 | evalcond[7]=((((-1.0000000008)*x951))+(((-1.0)*x949*x957))+new_r00); |
| 8165 | evalcond[8]=((((1.0000000008)*x954))+new_r10+(((-1.0)*x948*x957))); |
| 8166 | evalcond[9]=((((-1.0)*x949*x958))+new_r11+(((-1.0)*x948*x950))); |
| 8167 | if( 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 ) |
| 8168 | { |
| 8169 | continue; |
| 8170 | } |
| 8171 | } |
| 8172 | |
| 8173 | { |
| 8174 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 8175 | vinfos[0].jointtype = 1; |
| 8176 | vinfos[0].foffset = j0; |
| 8177 | vinfos[0].indices[0] = _ij0[0]; |
| 8178 | vinfos[0].indices[1] = _ij0[1]; |
| 8179 | vinfos[0].maxsolutions = _nj0; |
| 8180 | vinfos[1].jointtype = 1; |
| 8181 | vinfos[1].foffset = j1; |
| 8182 | vinfos[1].indices[0] = _ij1[0]; |
| 8183 | vinfos[1].indices[1] = _ij1[1]; |
| 8184 | vinfos[1].maxsolutions = _nj1; |
| 8185 | vinfos[2].jointtype = 1; |
| 8186 | vinfos[2].foffset = j2; |
| 8187 | vinfos[2].indices[0] = _ij2[0]; |
| 8188 | vinfos[2].indices[1] = _ij2[1]; |
| 8189 | vinfos[2].maxsolutions = _nj2; |
| 8190 | vinfos[3].jointtype = 1; |
| 8191 | vinfos[3].foffset = j3; |
| 8192 | vinfos[3].indices[0] = _ij3[0]; |
| 8193 | vinfos[3].indices[1] = _ij3[1]; |
| 8194 | vinfos[3].maxsolutions = _nj3; |
| 8195 | vinfos[4].jointtype = 1; |
| 8196 | vinfos[4].foffset = j4; |
| 8197 | vinfos[4].indices[0] = _ij4[0]; |
| 8198 | vinfos[4].indices[1] = _ij4[1]; |
| 8199 | vinfos[4].maxsolutions = _nj4; |
| 8200 | vinfos[5].jointtype = 1; |
| 8201 | vinfos[5].foffset = j5; |
| 8202 | vinfos[5].indices[0] = _ij5[0]; |
| 8203 | vinfos[5].indices[1] = _ij5[1]; |
| 8204 | vinfos[5].maxsolutions = _nj5; |
| 8205 | std::vector<int> vfree(0); |
| 8206 | solutions.AddSolution(vinfos,vfree); |
| 8207 | } |
| 8208 | } |
| 8209 | } |
| 8210 | |
| 8211 | } |
| 8212 | |
| 8213 | } |
| 8214 | |
| 8215 | } |
| 8216 | } while(0); |
| 8217 | if( bgotonextstatement ) |
| 8218 | { |
| 8219 | bool bgotonextstatement = true; |
| 8220 | do |
| 8221 | { |
| 8222 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r00))); |
| 8223 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 8224 | { |
| 8225 | bgotonextstatement=false; |
| 8226 | { |
| 8227 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 8228 | bool j5valid[2]={false}; |
| 8229 | _nj5 = 2; |
| 8230 | cj5array[0]=new_r10; |
| 8231 | if( cj5array[0] >= -1-IKFAST_SINCOS_THRESH && cj5array[0] <= 1+IKFAST_SINCOS_THRESH ) |
| 8232 | { |
| 8233 | j5valid[0] = j5valid[1] = true; |
| 8234 | j5array[0] = IKacos(cj5array[0]); |
| 8235 | sj5array[0] = IKsin(j5array[0]); |
| 8236 | cj5array[1] = cj5array[0]; |
| 8237 | j5array[1] = -j5array[0]; |
| 8238 | sj5array[1] = -sj5array[0]; |
| 8239 | } |
| 8240 | else if( isnan(cj5array[0]) ) |
| 8241 | { |
| 8242 | // probably any value will work |
| 8243 | j5valid[0] = true; |
| 8244 | cj5array[0] = 1; sj5array[0] = 0; j5array[0] = 0; |
| 8245 | } |
| 8246 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 8247 | { |
| 8248 | if( !j5valid[ij5] ) |
| 8249 | { |
| 8250 | continue; |
| 8251 | } |
| 8252 | _ij5[0] = ij5; _ij5[1] = -1; |
| 8253 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 8254 | { |
| 8255 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 8256 | { |
| 8257 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 8258 | } |
| 8259 | } |
| 8260 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 8261 | { |
| 8262 | IkReal evalcond[9]; |
| 8263 | IkReal x959=IKsin(j5); |
| 8264 | IkReal x960=IKcos(j5); |
| 8265 | IkReal x961=((1.0000000008)*x960); |
| 8266 | IkReal x962=((-1.0000000008)*x959); |
| 8267 | IkReal x963=((-1.0)*x959); |
| 8268 | evalcond[0]=(new_r01*x959); |
| 8269 | evalcond[1]=x963; |
| 8270 | evalcond[2]=(new_r10*x963); |
| 8271 | evalcond[3]=((-1.0)+((new_r10*x960))); |
| 8272 | evalcond[4]=x962; |
| 8273 | evalcond[5]=(new_r10*x962); |
| 8274 | evalcond[6]=(new_r01+x961); |
| 8275 | evalcond[7]=((1.0000000008)+((new_r01*x960))); |
| 8276 | evalcond[8]=((1.0)+((new_r01*x961))); |
| 8277 | if( 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 ) |
| 8278 | { |
| 8279 | continue; |
| 8280 | } |
| 8281 | } |
| 8282 | |
| 8283 | { |
| 8284 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 8285 | vinfos[0].jointtype = 1; |
| 8286 | vinfos[0].foffset = j0; |
| 8287 | vinfos[0].indices[0] = _ij0[0]; |
| 8288 | vinfos[0].indices[1] = _ij0[1]; |
| 8289 | vinfos[0].maxsolutions = _nj0; |
| 8290 | vinfos[1].jointtype = 1; |
| 8291 | vinfos[1].foffset = j1; |
| 8292 | vinfos[1].indices[0] = _ij1[0]; |
| 8293 | vinfos[1].indices[1] = _ij1[1]; |
| 8294 | vinfos[1].maxsolutions = _nj1; |
| 8295 | vinfos[2].jointtype = 1; |
| 8296 | vinfos[2].foffset = j2; |
| 8297 | vinfos[2].indices[0] = _ij2[0]; |
| 8298 | vinfos[2].indices[1] = _ij2[1]; |
| 8299 | vinfos[2].maxsolutions = _nj2; |
| 8300 | vinfos[3].jointtype = 1; |
| 8301 | vinfos[3].foffset = j3; |
| 8302 | vinfos[3].indices[0] = _ij3[0]; |
| 8303 | vinfos[3].indices[1] = _ij3[1]; |
| 8304 | vinfos[3].maxsolutions = _nj3; |
| 8305 | vinfos[4].jointtype = 1; |
| 8306 | vinfos[4].foffset = j4; |
| 8307 | vinfos[4].indices[0] = _ij4[0]; |
| 8308 | vinfos[4].indices[1] = _ij4[1]; |
| 8309 | vinfos[4].maxsolutions = _nj4; |
| 8310 | vinfos[5].jointtype = 1; |
| 8311 | vinfos[5].foffset = j5; |
| 8312 | vinfos[5].indices[0] = _ij5[0]; |
| 8313 | vinfos[5].indices[1] = _ij5[1]; |
| 8314 | vinfos[5].maxsolutions = _nj5; |
| 8315 | std::vector<int> vfree(0); |
| 8316 | solutions.AddSolution(vinfos,vfree); |
| 8317 | } |
| 8318 | } |
| 8319 | } |
| 8320 | |
| 8321 | } |
| 8322 | } while(0); |
| 8323 | if( bgotonextstatement ) |
| 8324 | { |
| 8325 | bool bgotonextstatement = true; |
| 8326 | do |
| 8327 | { |
| 8328 | evalcond[0]=((IKabs(new_r10))+(IKabs(new_r00))); |
| 8329 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 8330 | { |
| 8331 | bgotonextstatement=false; |
| 8332 | { |
| 8333 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 8334 | bool j5valid[1]={false}; |
| 8335 | _nj5 = 1; |
| 8336 | if( IKabs(((0.9999999992)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.9999999992)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*new_r11))+IKsqr(((-0.9999999992)*new_r01))-1) <= IKFAST_SINCOS_THRESH ) |
| 8337 | continue; |
| 8338 | j5array[0]=IKatan2(((0.9999999992)*new_r11), ((-0.9999999992)*new_r01)); |
| 8339 | sj5array[0]=IKsin(j5array[0]); |
| 8340 | cj5array[0]=IKcos(j5array[0]); |
| 8341 | if( j5array[0] > IKPI ) |
| 8342 | { |
| 8343 | j5array[0]-=IK2PI; |
| 8344 | } |
| 8345 | else if( j5array[0] < -IKPI ) |
| 8346 | { j5array[0]+=IK2PI; |
| 8347 | } |
| 8348 | j5valid[0] = true; |
| 8349 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 8350 | { |
| 8351 | if( !j5valid[ij5] ) |
| 8352 | { |
| 8353 | continue; |
| 8354 | } |
| 8355 | _ij5[0] = ij5; _ij5[1] = -1; |
| 8356 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 8357 | { |
| 8358 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 8359 | { |
| 8360 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 8361 | } |
| 8362 | } |
| 8363 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 8364 | { |
| 8365 | IkReal evalcond[7]; |
| 8366 | IkReal x964=IKcos(j5); |
| 8367 | IkReal x965=IKsin(j5); |
| 8368 | IkReal x966=((1.0000000008)*x965); |
| 8369 | IkReal x967=((1.0000000008)*x964); |
| 8370 | evalcond[0]=((-1.0)*x965); |
| 8371 | evalcond[1]=((-1.0)*x964); |
| 8372 | evalcond[2]=(new_r01+x967); |
| 8373 | evalcond[3]=(new_r11+(((-1.0)*x966))); |
| 8374 | evalcond[4]=(((new_r11*x964))+((new_r01*x965))); |
| 8375 | evalcond[5]=((1.0000000008)+((new_r01*x964))+(((-1.0)*new_r11*x965))); |
| 8376 | evalcond[6]=((1.0)+((new_r01*x967))+(((-1.0)*new_r11*x966))); |
| 8377 | if( 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 ) |
| 8378 | { |
| 8379 | continue; |
| 8380 | } |
| 8381 | } |
| 8382 | |
| 8383 | { |
| 8384 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 8385 | vinfos[0].jointtype = 1; |
| 8386 | vinfos[0].foffset = j0; |
| 8387 | vinfos[0].indices[0] = _ij0[0]; |
| 8388 | vinfos[0].indices[1] = _ij0[1]; |
| 8389 | vinfos[0].maxsolutions = _nj0; |
| 8390 | vinfos[1].jointtype = 1; |
| 8391 | vinfos[1].foffset = j1; |
| 8392 | vinfos[1].indices[0] = _ij1[0]; |
| 8393 | vinfos[1].indices[1] = _ij1[1]; |
| 8394 | vinfos[1].maxsolutions = _nj1; |
| 8395 | vinfos[2].jointtype = 1; |
| 8396 | vinfos[2].foffset = j2; |
| 8397 | vinfos[2].indices[0] = _ij2[0]; |
| 8398 | vinfos[2].indices[1] = _ij2[1]; |
| 8399 | vinfos[2].maxsolutions = _nj2; |
| 8400 | vinfos[3].jointtype = 1; |
| 8401 | vinfos[3].foffset = j3; |
| 8402 | vinfos[3].indices[0] = _ij3[0]; |
| 8403 | vinfos[3].indices[1] = _ij3[1]; |
| 8404 | vinfos[3].maxsolutions = _nj3; |
| 8405 | vinfos[4].jointtype = 1; |
| 8406 | vinfos[4].foffset = j4; |
| 8407 | vinfos[4].indices[0] = _ij4[0]; |
| 8408 | vinfos[4].indices[1] = _ij4[1]; |
| 8409 | vinfos[4].maxsolutions = _nj4; |
| 8410 | vinfos[5].jointtype = 1; |
| 8411 | vinfos[5].foffset = j5; |
| 8412 | vinfos[5].indices[0] = _ij5[0]; |
| 8413 | vinfos[5].indices[1] = _ij5[1]; |
| 8414 | vinfos[5].maxsolutions = _nj5; |
| 8415 | std::vector<int> vfree(0); |
| 8416 | solutions.AddSolution(vinfos,vfree); |
| 8417 | } |
| 8418 | } |
| 8419 | } |
| 8420 | |
| 8421 | } |
| 8422 | } while(0); |
| 8423 | if( bgotonextstatement ) |
| 8424 | { |
| 8425 | bool bgotonextstatement = true; |
| 8426 | do |
| 8427 | { |
| 8428 | if( 1 ) |
| 8429 | { |
| 8430 | bgotonextstatement=false; |
| 8431 | continue; // branch miss [j5] |
| 8432 | |
| 8433 | } |
| 8434 | } while(0); |
| 8435 | if( bgotonextstatement ) |
| 8436 | { |
| 8437 | } |
| 8438 | } |
| 8439 | } |
| 8440 | } |
| 8441 | } |
| 8442 | |
| 8443 | } else |
| 8444 | { |
| 8445 | { |
| 8446 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 8447 | bool j5valid[1]={false}; |
| 8448 | _nj5 = 1; |
| 8449 | CheckValue<IkReal> x975=IKPowWithIntegerCheck(new_r01,-1); |
| 8450 | if(!x975.valid){ |
| 8451 | continue; |
| 8452 | } |
| 8453 | IkReal x968=x975.value; |
| 8454 | IkReal x969=(gconst12*x968); |
| 8455 | IkReal x970=((25000.0)*new_r00); |
| 8456 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 8457 | continue; |
| 8458 | IkReal x971=IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))); |
| 8459 | IkReal x972=((25000.0)*new_r11*x971); |
| 8460 | CheckValue<IkReal> x976=IKPowWithIntegerCheck(((((25000.00002)*gconst12*new_r01))+(((-1.0)*x972))),-1); |
| 8461 | if(!x976.valid){ |
| 8462 | continue; |
| 8463 | } |
| 8464 | IkReal x973=x976.value; |
| 8465 | IkReal x974=((25000.0)*new_r11*x973); |
| 8466 | CheckValue<IkReal> x977=IKPowWithIntegerCheck(((((25000.00002)*gconst12*new_r01))+(((-25000.0)*new_r11*x971))),-1); |
| 8467 | if(!x977.valid){ |
| 8468 | continue; |
| 8469 | } |
| 8470 | if( IKabs(((((-1.0)*new_r11*x970*x973))+((x969*x972*(x977.value)))+x969)) < IKFAST_ATAN2_MAGTHRESH && IKabs((x973*((((new_r01*x970))+(((-25000.0)*gconst12*x971)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r11*x970*x973))+((x969*x972*(x977.value)))+x969))+IKsqr((x973*((((new_r01*x970))+(((-25000.0)*gconst12*x971))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 8471 | continue; |
| 8472 | j5array[0]=IKatan2(((((-1.0)*new_r11*x970*x973))+((x969*x972*(x977.value)))+x969), (x973*((((new_r01*x970))+(((-25000.0)*gconst12*x971)))))); |
| 8473 | sj5array[0]=IKsin(j5array[0]); |
| 8474 | cj5array[0]=IKcos(j5array[0]); |
| 8475 | if( j5array[0] > IKPI ) |
| 8476 | { |
| 8477 | j5array[0]-=IK2PI; |
| 8478 | } |
| 8479 | else if( j5array[0] < -IKPI ) |
| 8480 | { j5array[0]+=IK2PI; |
| 8481 | } |
| 8482 | j5valid[0] = true; |
| 8483 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 8484 | { |
| 8485 | if( !j5valid[ij5] ) |
| 8486 | { |
| 8487 | continue; |
| 8488 | } |
| 8489 | _ij5[0] = ij5; _ij5[1] = -1; |
| 8490 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 8491 | { |
| 8492 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 8493 | { |
| 8494 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 8495 | } |
| 8496 | } |
| 8497 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 8498 | { |
| 8499 | IkReal evalcond[10]; |
| 8500 | IkReal x978=IKcos(j5); |
| 8501 | IkReal x979=IKsin(j5); |
| 8502 | IkReal x980=((1.0)*gconst12); |
| 8503 | IkReal x981=(gconst12*x978); |
| 8504 | IkReal x982=(new_r11*x979); |
| 8505 | IkReal x983=(new_r01*x978); |
| 8506 | IkReal x984=(new_r00*x978); |
| 8507 | IkReal x985=(gconst12*x979); |
| 8508 | IkReal x986=(new_r10*x979); |
| 8509 | IkReal x987=x971; |
| 8510 | IkReal x988=((1.0)*x987); |
| 8511 | IkReal x989=((1.0000000008)*x987); |
| 8512 | evalcond[0]=((((-1.0)*x980))+((new_r01*x979))+((new_r11*x978))); |
| 8513 | evalcond[1]=((((-1.0)*x986))+(((-1.0000000008)*gconst12))+x984); |
| 8514 | evalcond[2]=((((-1.0)*x988))+((new_r10*x978))+((new_r00*x979))); |
| 8515 | evalcond[3]=((((-1.0)*x980))+(((-1.0000000008)*x986))+(((1.0000000008)*x984))); |
| 8516 | evalcond[4]=((((-1.0000000008)*x981))+new_r00+(((-1.0)*x979*x988))); |
| 8517 | evalcond[5]=((((-1.0)*x978*x988))+new_r10+(((1.0000000008)*x985))); |
| 8518 | evalcond[6]=(new_r01+(((-1.0)*x979*x980))+((x978*x989))); |
| 8519 | evalcond[7]=((((-1.0)*x978*x980))+new_r11+(((-1.0)*x979*x989))); |
| 8520 | evalcond[8]=((((-1.0)*x982))+x989+x983); |
| 8521 | evalcond[9]=((((-1.0000000008)*x982))+(((1.0000000008)*x983))+x987); |
| 8522 | if( 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 ) |
| 8523 | { |
| 8524 | continue; |
| 8525 | } |
| 8526 | } |
| 8527 | |
| 8528 | { |
| 8529 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 8530 | vinfos[0].jointtype = 1; |
| 8531 | vinfos[0].foffset = j0; |
| 8532 | vinfos[0].indices[0] = _ij0[0]; |
| 8533 | vinfos[0].indices[1] = _ij0[1]; |
| 8534 | vinfos[0].maxsolutions = _nj0; |
| 8535 | vinfos[1].jointtype = 1; |
| 8536 | vinfos[1].foffset = j1; |
| 8537 | vinfos[1].indices[0] = _ij1[0]; |
| 8538 | vinfos[1].indices[1] = _ij1[1]; |
| 8539 | vinfos[1].maxsolutions = _nj1; |
| 8540 | vinfos[2].jointtype = 1; |
| 8541 | vinfos[2].foffset = j2; |
| 8542 | vinfos[2].indices[0] = _ij2[0]; |
| 8543 | vinfos[2].indices[1] = _ij2[1]; |
| 8544 | vinfos[2].maxsolutions = _nj2; |
| 8545 | vinfos[3].jointtype = 1; |
| 8546 | vinfos[3].foffset = j3; |
| 8547 | vinfos[3].indices[0] = _ij3[0]; |
| 8548 | vinfos[3].indices[1] = _ij3[1]; |
| 8549 | vinfos[3].maxsolutions = _nj3; |
| 8550 | vinfos[4].jointtype = 1; |
| 8551 | vinfos[4].foffset = j4; |
| 8552 | vinfos[4].indices[0] = _ij4[0]; |
| 8553 | vinfos[4].indices[1] = _ij4[1]; |
| 8554 | vinfos[4].maxsolutions = _nj4; |
| 8555 | vinfos[5].jointtype = 1; |
| 8556 | vinfos[5].foffset = j5; |
| 8557 | vinfos[5].indices[0] = _ij5[0]; |
| 8558 | vinfos[5].indices[1] = _ij5[1]; |
| 8559 | vinfos[5].maxsolutions = _nj5; |
| 8560 | std::vector<int> vfree(0); |
| 8561 | solutions.AddSolution(vinfos,vfree); |
| 8562 | } |
| 8563 | } |
| 8564 | } |
| 8565 | |
| 8566 | } |
| 8567 | |
| 8568 | } |
| 8569 | |
| 8570 | } else |
| 8571 | { |
| 8572 | { |
| 8573 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 8574 | bool j5valid[1]={false}; |
| 8575 | _nj5 = 1; |
| 8576 | IkReal x990=((1.0)*new_r11); |
| 8577 | if((((1.0)+(((-1.0)*(gconst12*gconst12))))) < -0.00001) |
| 8578 | continue; |
| 8579 | IkReal x991=IKsqrt(((1.0)+(((-1.0)*(gconst12*gconst12))))); |
| 8580 | CheckValue<IkReal> x992=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r00*x990))+((new_r01*new_r10)))),-1); |
| 8581 | if(!x992.valid){ |
| 8582 | continue; |
| 8583 | } |
| 8584 | CheckValue<IkReal> x993 = IKatan2WithCheck(IkReal(((((-1.0)*x990*x991))+((gconst12*new_r10)))),IkReal(((((-1.0)*gconst12*new_r00))+((new_r01*x991)))),IKFAST_ATAN2_MAGTHRESH); |
| 8585 | if(!x993.valid){ |
| 8586 | continue; |
| 8587 | } |
| 8588 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x992.value)))+(x993.value)); |
| 8589 | sj5array[0]=IKsin(j5array[0]); |
| 8590 | cj5array[0]=IKcos(j5array[0]); |
| 8591 | if( j5array[0] > IKPI ) |
| 8592 | { |
| 8593 | j5array[0]-=IK2PI; |
| 8594 | } |
| 8595 | else if( j5array[0] < -IKPI ) |
| 8596 | { j5array[0]+=IK2PI; |
| 8597 | } |
| 8598 | j5valid[0] = true; |
| 8599 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 8600 | { |
| 8601 | if( !j5valid[ij5] ) |
| 8602 | { |
| 8603 | continue; |
| 8604 | } |
| 8605 | _ij5[0] = ij5; _ij5[1] = -1; |
| 8606 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 8607 | { |
| 8608 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 8609 | { |
| 8610 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 8611 | } |
| 8612 | } |
| 8613 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 8614 | { |
| 8615 | IkReal evalcond[10]; |
| 8616 | IkReal x994=IKcos(j5); |
| 8617 | IkReal x995=IKsin(j5); |
| 8618 | IkReal x996=((1.0)*gconst12); |
| 8619 | IkReal x997=(gconst12*x994); |
| 8620 | IkReal x998=(new_r11*x995); |
| 8621 | IkReal x999=(new_r01*x994); |
| 8622 | IkReal x1000=(new_r00*x994); |
| 8623 | IkReal x1001=(gconst12*x995); |
| 8624 | IkReal x1002=(new_r10*x995); |
| 8625 | IkReal x1003=x991; |
| 8626 | IkReal x1004=((1.0)*x1003); |
| 8627 | IkReal x1005=((1.0000000008)*x1003); |
| 8628 | evalcond[0]=(((new_r11*x994))+(((-1.0)*x996))+((new_r01*x995))); |
| 8629 | evalcond[1]=((((-1.0)*x1002))+x1000+(((-1.0000000008)*gconst12))); |
| 8630 | evalcond[2]=((((-1.0)*x1004))+((new_r10*x994))+((new_r00*x995))); |
| 8631 | evalcond[3]=((((-1.0000000008)*x1002))+(((1.0000000008)*x1000))+(((-1.0)*x996))); |
| 8632 | evalcond[4]=((((-1.0000000008)*x997))+(((-1.0)*x1004*x995))+new_r00); |
| 8633 | evalcond[5]=((((1.0000000008)*x1001))+(((-1.0)*x1004*x994))+new_r10); |
| 8634 | evalcond[6]=((((-1.0)*x995*x996))+new_r01+((x1005*x994))); |
| 8635 | evalcond[7]=((((-1.0)*x994*x996))+new_r11+(((-1.0)*x1005*x995))); |
| 8636 | evalcond[8]=((((-1.0)*x998))+x1005+x999); |
| 8637 | evalcond[9]=(x1003+(((-1.0000000008)*x998))+(((1.0000000008)*x999))); |
| 8638 | if( 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 ) |
| 8639 | { |
| 8640 | continue; |
| 8641 | } |
| 8642 | } |
| 8643 | |
| 8644 | { |
| 8645 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 8646 | vinfos[0].jointtype = 1; |
| 8647 | vinfos[0].foffset = j0; |
| 8648 | vinfos[0].indices[0] = _ij0[0]; |
| 8649 | vinfos[0].indices[1] = _ij0[1]; |
| 8650 | vinfos[0].maxsolutions = _nj0; |
| 8651 | vinfos[1].jointtype = 1; |
| 8652 | vinfos[1].foffset = j1; |
| 8653 | vinfos[1].indices[0] = _ij1[0]; |
| 8654 | vinfos[1].indices[1] = _ij1[1]; |
| 8655 | vinfos[1].maxsolutions = _nj1; |
| 8656 | vinfos[2].jointtype = 1; |
| 8657 | vinfos[2].foffset = j2; |
| 8658 | vinfos[2].indices[0] = _ij2[0]; |
| 8659 | vinfos[2].indices[1] = _ij2[1]; |
| 8660 | vinfos[2].maxsolutions = _nj2; |
| 8661 | vinfos[3].jointtype = 1; |
| 8662 | vinfos[3].foffset = j3; |
| 8663 | vinfos[3].indices[0] = _ij3[0]; |
| 8664 | vinfos[3].indices[1] = _ij3[1]; |
| 8665 | vinfos[3].maxsolutions = _nj3; |
| 8666 | vinfos[4].jointtype = 1; |
| 8667 | vinfos[4].foffset = j4; |
| 8668 | vinfos[4].indices[0] = _ij4[0]; |
| 8669 | vinfos[4].indices[1] = _ij4[1]; |
| 8670 | vinfos[4].maxsolutions = _nj4; |
| 8671 | vinfos[5].jointtype = 1; |
| 8672 | vinfos[5].foffset = j5; |
| 8673 | vinfos[5].indices[0] = _ij5[0]; |
| 8674 | vinfos[5].indices[1] = _ij5[1]; |
| 8675 | vinfos[5].maxsolutions = _nj5; |
| 8676 | std::vector<int> vfree(0); |
| 8677 | solutions.AddSolution(vinfos,vfree); |
| 8678 | } |
| 8679 | } |
| 8680 | } |
| 8681 | |
| 8682 | } |
| 8683 | |
| 8684 | } |
| 8685 | |
| 8686 | } else |
| 8687 | { |
| 8688 | { |
| 8689 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 8690 | bool j5valid[1]={false}; |
| 8691 | _nj5 = 1; |
| 8692 | IkReal x1006=((25000.00002)*gconst12); |
| 8693 | IkReal x1007=((25000.0)*new_r10); |
| 8694 | IkReal x1008=((25000.0)*new_r00); |
| 8695 | CheckValue<IkReal> x1009=IKPowWithIntegerCheck(IKsign((((new_r11*x1007))+((new_r01*x1008)))),-1); |
| 8696 | if(!x1009.valid){ |
| 8697 | continue; |
| 8698 | } |
| 8699 | CheckValue<IkReal> x1010 = IKatan2WithCheck(IkReal((((gconst12*x1008))+(((-1.0)*new_r11*x1006)))),IkReal((((gconst12*x1007))+((new_r01*x1006)))),IKFAST_ATAN2_MAGTHRESH); |
| 8700 | if(!x1010.valid){ |
| 8701 | continue; |
| 8702 | } |
| 8703 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1009.value)))+(x1010.value)); |
| 8704 | sj5array[0]=IKsin(j5array[0]); |
| 8705 | cj5array[0]=IKcos(j5array[0]); |
| 8706 | if( j5array[0] > IKPI ) |
| 8707 | { |
| 8708 | j5array[0]-=IK2PI; |
| 8709 | } |
| 8710 | else if( j5array[0] < -IKPI ) |
| 8711 | { j5array[0]+=IK2PI; |
| 8712 | } |
| 8713 | j5valid[0] = true; |
| 8714 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 8715 | { |
| 8716 | if( !j5valid[ij5] ) |
| 8717 | { |
| 8718 | continue; |
| 8719 | } |
| 8720 | _ij5[0] = ij5; _ij5[1] = -1; |
| 8721 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 8722 | { |
| 8723 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 8724 | { |
| 8725 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 8726 | } |
| 8727 | } |
| 8728 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 8729 | { |
| 8730 | IkReal evalcond[10]; |
| 8731 | IkReal x1011=IKcos(j5); |
| 8732 | IkReal x1012=IKsin(j5); |
| 8733 | IkReal x1013=((1.0)*gconst12); |
| 8734 | IkReal x1014=(gconst12*x1011); |
| 8735 | IkReal x1015=(new_r11*x1012); |
| 8736 | IkReal x1016=(new_r01*x1011); |
| 8737 | IkReal x1017=(new_r00*x1011); |
| 8738 | IkReal x1018=(gconst12*x1012); |
| 8739 | IkReal x1019=(new_r10*x1012); |
| 8740 | if((((1.0)+(((-1.0)*gconst12*x1013)))) < -0.00001) |
| 8741 | continue; |
| 8742 | IkReal x1020=IKsqrt(((1.0)+(((-1.0)*gconst12*x1013)))); |
| 8743 | IkReal x1021=((1.0)*x1020); |
| 8744 | IkReal x1022=((1.0000000008)*x1020); |
| 8745 | evalcond[0]=(((new_r11*x1011))+(((-1.0)*x1013))+((new_r01*x1012))); |
| 8746 | evalcond[1]=(x1017+(((-1.0000000008)*gconst12))+(((-1.0)*x1019))); |
| 8747 | evalcond[2]=(((new_r10*x1011))+(((-1.0)*x1021))+((new_r00*x1012))); |
| 8748 | evalcond[3]=((((-1.0000000008)*x1019))+(((-1.0)*x1013))+(((1.0000000008)*x1017))); |
| 8749 | evalcond[4]=((((-1.0000000008)*x1014))+new_r00+(((-1.0)*x1012*x1021))); |
| 8750 | evalcond[5]=((((1.0000000008)*x1018))+new_r10+(((-1.0)*x1011*x1021))); |
| 8751 | evalcond[6]=((((-1.0)*x1012*x1013))+((x1011*x1022))+new_r01); |
| 8752 | evalcond[7]=((((-1.0)*x1011*x1013))+new_r11+(((-1.0)*x1012*x1022))); |
| 8753 | evalcond[8]=(x1016+x1022+(((-1.0)*x1015))); |
| 8754 | evalcond[9]=((((-1.0000000008)*x1015))+x1020+(((1.0000000008)*x1016))); |
| 8755 | if( 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 ) |
| 8756 | { |
| 8757 | continue; |
| 8758 | } |
| 8759 | } |
| 8760 | |
| 8761 | { |
| 8762 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 8763 | vinfos[0].jointtype = 1; |
| 8764 | vinfos[0].foffset = j0; |
| 8765 | vinfos[0].indices[0] = _ij0[0]; |
| 8766 | vinfos[0].indices[1] = _ij0[1]; |
| 8767 | vinfos[0].maxsolutions = _nj0; |
| 8768 | vinfos[1].jointtype = 1; |
| 8769 | vinfos[1].foffset = j1; |
| 8770 | vinfos[1].indices[0] = _ij1[0]; |
| 8771 | vinfos[1].indices[1] = _ij1[1]; |
| 8772 | vinfos[1].maxsolutions = _nj1; |
| 8773 | vinfos[2].jointtype = 1; |
| 8774 | vinfos[2].foffset = j2; |
| 8775 | vinfos[2].indices[0] = _ij2[0]; |
| 8776 | vinfos[2].indices[1] = _ij2[1]; |
| 8777 | vinfos[2].maxsolutions = _nj2; |
| 8778 | vinfos[3].jointtype = 1; |
| 8779 | vinfos[3].foffset = j3; |
| 8780 | vinfos[3].indices[0] = _ij3[0]; |
| 8781 | vinfos[3].indices[1] = _ij3[1]; |
| 8782 | vinfos[3].maxsolutions = _nj3; |
| 8783 | vinfos[4].jointtype = 1; |
| 8784 | vinfos[4].foffset = j4; |
| 8785 | vinfos[4].indices[0] = _ij4[0]; |
| 8786 | vinfos[4].indices[1] = _ij4[1]; |
| 8787 | vinfos[4].maxsolutions = _nj4; |
| 8788 | vinfos[5].jointtype = 1; |
| 8789 | vinfos[5].foffset = j5; |
| 8790 | vinfos[5].indices[0] = _ij5[0]; |
| 8791 | vinfos[5].indices[1] = _ij5[1]; |
| 8792 | vinfos[5].maxsolutions = _nj5; |
| 8793 | std::vector<int> vfree(0); |
| 8794 | solutions.AddSolution(vinfos,vfree); |
| 8795 | } |
| 8796 | } |
| 8797 | } |
| 8798 | |
| 8799 | } |
| 8800 | |
| 8801 | } |
| 8802 | |
| 8803 | } |
| 8804 | } while(0); |
| 8805 | if( bgotonextstatement ) |
| 8806 | { |
| 8807 | bool bgotonextstatement = true; |
| 8808 | do |
| 8809 | { |
| 8810 | IkReal x1023=new_r00*new_r00; |
| 8811 | CheckValue<IkReal> x1024=IKPowWithIntegerCheck(((((-1.0)*x1023))+(((-1.0000000016)*(new_r10*new_r10)))),-1); |
| 8812 | if(!x1024.valid){ |
| 8813 | continue; |
| 8814 | } |
| 8815 | if((((-1.0)*x1023*(x1024.value))) < -0.00001) |
| 8816 | continue; |
| 8817 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1023*(x1024.value))))); |
| 8818 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.0)+(IKsign(sj3)))))+(IKabs((cj3+(((-1.0)*gconst13)))))), 6.28318530717959))); |
| 8819 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 8820 | { |
| 8821 | bgotonextstatement=false; |
| 8822 | { |
| 8823 | IkReal j5eval[2]; |
| 8824 | IkReal x1025=new_r00*new_r00; |
| 8825 | sj4=4.0e-5; |
| 8826 | cj4=1.0; |
| 8827 | j4=4.0e-5; |
| 8828 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 8829 | continue; |
| 8830 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))); |
| 8831 | cj3=gconst13; |
| 8832 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 8833 | continue; |
| 8834 | j3=IKacos(gconst13); |
| 8835 | CheckValue<IkReal> x1026=IKPowWithIntegerCheck(((((-1.0)*x1025))+(((-1.0000000016)*(new_r10*new_r10)))),-1); |
| 8836 | if(!x1026.valid){ |
| 8837 | continue; |
| 8838 | } |
| 8839 | if((((-1.0)*x1025*(x1026.value))) < -0.00001) |
| 8840 | continue; |
| 8841 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1025*(x1026.value))))); |
| 8842 | IkReal x1027=(new_r00*new_r01); |
| 8843 | IkReal x1028=(new_r10*new_r11); |
| 8844 | j5eval[0]=(x1027+x1028); |
| 8845 | j5eval[1]=IKsign(((((25000.0)*x1028))+(((25000.0)*x1027)))); |
| 8846 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 8847 | { |
| 8848 | { |
| 8849 | IkReal j5eval[2]; |
| 8850 | IkReal x1029=new_r00*new_r00; |
| 8851 | sj4=4.0e-5; |
| 8852 | cj4=1.0; |
| 8853 | j4=4.0e-5; |
| 8854 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 8855 | continue; |
| 8856 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))); |
| 8857 | cj3=gconst13; |
| 8858 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 8859 | continue; |
| 8860 | j3=IKacos(gconst13); |
| 8861 | CheckValue<IkReal> x1030=IKPowWithIntegerCheck(((((-1.0)*x1029))+(((-1.0000000016)*(new_r10*new_r10)))),-1); |
| 8862 | if(!x1030.valid){ |
| 8863 | continue; |
| 8864 | } |
| 8865 | if((((-1.0)*x1029*(x1030.value))) < -0.00001) |
| 8866 | continue; |
| 8867 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1029*(x1030.value))))); |
| 8868 | IkReal x1031=(((new_r01*new_r10))+(((-1.0)*new_r00*new_r11))); |
| 8869 | j5eval[0]=x1031; |
| 8870 | j5eval[1]=IKsign(x1031); |
| 8871 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 8872 | { |
| 8873 | { |
| 8874 | IkReal j5eval[1]; |
| 8875 | IkReal x1032=new_r00*new_r00; |
| 8876 | sj4=4.0e-5; |
| 8877 | cj4=1.0; |
| 8878 | j4=4.0e-5; |
| 8879 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 8880 | continue; |
| 8881 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))); |
| 8882 | cj3=gconst13; |
| 8883 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 8884 | continue; |
| 8885 | j3=IKacos(gconst13); |
| 8886 | CheckValue<IkReal> x1033=IKPowWithIntegerCheck(((((-1.0)*x1032))+(((-1.0000000016)*(new_r10*new_r10)))),-1); |
| 8887 | if(!x1033.valid){ |
| 8888 | continue; |
| 8889 | } |
| 8890 | if((((-1.0)*x1032*(x1033.value))) < -0.00001) |
| 8891 | continue; |
| 8892 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1032*(x1033.value))))); |
| 8893 | j5eval[0]=new_r01; |
| 8894 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 8895 | { |
| 8896 | { |
| 8897 | IkReal evalcond[1]; |
| 8898 | bool bgotonextstatement = true; |
| 8899 | do |
| 8900 | { |
| 8901 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 8902 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 8903 | { |
| 8904 | bgotonextstatement=false; |
| 8905 | { |
| 8906 | IkReal j5eval[2]; |
| 8907 | IkReal x1034=new_r10*new_r10; |
| 8908 | sj4=4.0e-5; |
| 8909 | cj4=1.0; |
| 8910 | j4=4.0e-5; |
| 8911 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 8912 | continue; |
| 8913 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))); |
| 8914 | cj3=gconst13; |
| 8915 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 8916 | continue; |
| 8917 | j3=IKacos(gconst13); |
| 8918 | new_r11=0; |
| 8919 | new_r01=0; |
| 8920 | new_r22=0; |
| 8921 | new_r20=0; |
| 8922 | CheckValue<IkReal> x1035=IKPowWithIntegerCheck(((-1.0)+(((-1.6e-9)*x1034))),-1); |
| 8923 | if(!x1035.valid){ |
| 8924 | continue; |
| 8925 | } |
| 8926 | if((((x1035.value)*(((-1.0)+(((1.0)*x1034)))))) < -0.00001) |
| 8927 | continue; |
| 8928 | IkReal gconst13=((-1.0)*(IKsqrt(((x1035.value)*(((-1.0)+(((1.0)*x1034)))))))); |
| 8929 | j5eval[0]=-1.0; |
| 8930 | j5eval[1]=-1.0; |
| 8931 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 8932 | { |
| 8933 | { |
| 8934 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 8935 | bool j5valid[1]={false}; |
| 8936 | _nj5 = 1; |
| 8937 | IkReal x1036=gconst13*gconst13; |
| 8938 | IkReal x1037=new_r00*new_r00; |
| 8939 | IkReal x1038=(gconst13*new_r10); |
| 8940 | IkReal x1039=((1.0)+(((-1.0)*x1036))); |
| 8941 | IkReal x1040=((3.90625000625e+17)*x1036); |
| 8942 | if((x1039) < -0.00001) |
| 8943 | continue; |
| 8944 | IkReal x1041=IKsqrt(x1039); |
| 8945 | IkReal x1042=(new_r00*x1041); |
| 8946 | CheckValue<IkReal> x1043=IKPowWithIntegerCheck(((((-1.0)*x1040*(new_r10*new_r10)))+(((3.90625e+17)*x1037*(pow(x1039,1.0))))),-1); |
| 8947 | if(!x1043.valid){ |
| 8948 | continue; |
| 8949 | } |
| 8950 | CheckValue<IkReal> x1044=IKPowWithIntegerCheck(((((25000.0)*x1042))+(((-25000.00002)*x1038))),-1); |
| 8951 | if(!x1044.valid){ |
| 8952 | continue; |
| 8953 | } |
| 8954 | if( IKabs(((x1043.value)*(((((3.906250009375e+17)*x1038*(gconst13*gconst13)))+((x1040*x1042))+(((-3.906250003125e+17)*x1037*x1038))+(((-3.90625e+17)*x1042*(new_r00*new_r00))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((x1044.value)*(((((-25000.0)*new_r00*new_r10))+(((25000.00002)*gconst13*x1041)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x1043.value)*(((((3.906250009375e+17)*x1038*(gconst13*gconst13)))+((x1040*x1042))+(((-3.906250003125e+17)*x1037*x1038))+(((-3.90625e+17)*x1042*(new_r00*new_r00)))))))+IKsqr(((x1044.value)*(((((-25000.0)*new_r00*new_r10))+(((25000.00002)*gconst13*x1041))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 8955 | continue; |
| 8956 | j5array[0]=IKatan2(((x1043.value)*(((((3.906250009375e+17)*x1038*(gconst13*gconst13)))+((x1040*x1042))+(((-3.906250003125e+17)*x1037*x1038))+(((-3.90625e+17)*x1042*(new_r00*new_r00)))))), ((x1044.value)*(((((-25000.0)*new_r00*new_r10))+(((25000.00002)*gconst13*x1041)))))); |
| 8957 | sj5array[0]=IKsin(j5array[0]); |
| 8958 | cj5array[0]=IKcos(j5array[0]); |
| 8959 | if( j5array[0] > IKPI ) |
| 8960 | { |
| 8961 | j5array[0]-=IK2PI; |
| 8962 | } |
| 8963 | else if( j5array[0] < -IKPI ) |
| 8964 | { j5array[0]+=IK2PI; |
| 8965 | } |
| 8966 | j5valid[0] = true; |
| 8967 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 8968 | { |
| 8969 | if( !j5valid[ij5] ) |
| 8970 | { |
| 8971 | continue; |
| 8972 | } |
| 8973 | _ij5[0] = ij5; _ij5[1] = -1; |
| 8974 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 8975 | { |
| 8976 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 8977 | { |
| 8978 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 8979 | } |
| 8980 | } |
| 8981 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 8982 | { |
| 8983 | IkReal evalcond[7]; |
| 8984 | IkReal x1045=IKcos(j5); |
| 8985 | IkReal x1046=IKsin(j5); |
| 8986 | IkReal x1047=((1.0000000008)*gconst13); |
| 8987 | IkReal x1048=((1.0)*gconst13); |
| 8988 | IkReal x1049=((1.0000000008)*x1046); |
| 8989 | IkReal x1050=(new_r00*x1045); |
| 8990 | if((((1.0)+(((-1.0)*gconst13*x1048)))) < -0.00001) |
| 8991 | continue; |
| 8992 | IkReal x1051=IKsqrt(((1.0)+(((-1.0)*gconst13*x1048)))); |
| 8993 | IkReal x1052=(x1045*x1051); |
| 8994 | evalcond[0]=(x1050+(((-1.0)*new_r10*x1046))+(((-1.0)*x1047))); |
| 8995 | evalcond[1]=(x1051+((new_r00*x1046))+((new_r10*x1045))); |
| 8996 | evalcond[2]=((((-1.0)*new_r10*x1049))+(((-1.0)*x1048))+(((1.0000000008)*x1050))); |
| 8997 | evalcond[3]=((((-1.0)*x1045*x1047))+new_r00+((x1046*x1051))); |
| 8998 | evalcond[4]=(x1052+new_r10+((x1046*x1047))); |
| 8999 | evalcond[5]=((((-1.0)*x1046*x1048))+(((-1.0000000008)*x1052))); |
| 9000 | evalcond[6]=((((-1.0)*x1045*x1048))+((x1049*x1051))); |
| 9001 | if( 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 ) |
| 9002 | { |
| 9003 | continue; |
| 9004 | } |
| 9005 | } |
| 9006 | |
| 9007 | { |
| 9008 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 9009 | vinfos[0].jointtype = 1; |
| 9010 | vinfos[0].foffset = j0; |
| 9011 | vinfos[0].indices[0] = _ij0[0]; |
| 9012 | vinfos[0].indices[1] = _ij0[1]; |
| 9013 | vinfos[0].maxsolutions = _nj0; |
| 9014 | vinfos[1].jointtype = 1; |
| 9015 | vinfos[1].foffset = j1; |
| 9016 | vinfos[1].indices[0] = _ij1[0]; |
| 9017 | vinfos[1].indices[1] = _ij1[1]; |
| 9018 | vinfos[1].maxsolutions = _nj1; |
| 9019 | vinfos[2].jointtype = 1; |
| 9020 | vinfos[2].foffset = j2; |
| 9021 | vinfos[2].indices[0] = _ij2[0]; |
| 9022 | vinfos[2].indices[1] = _ij2[1]; |
| 9023 | vinfos[2].maxsolutions = _nj2; |
| 9024 | vinfos[3].jointtype = 1; |
| 9025 | vinfos[3].foffset = j3; |
| 9026 | vinfos[3].indices[0] = _ij3[0]; |
| 9027 | vinfos[3].indices[1] = _ij3[1]; |
| 9028 | vinfos[3].maxsolutions = _nj3; |
| 9029 | vinfos[4].jointtype = 1; |
| 9030 | vinfos[4].foffset = j4; |
| 9031 | vinfos[4].indices[0] = _ij4[0]; |
| 9032 | vinfos[4].indices[1] = _ij4[1]; |
| 9033 | vinfos[4].maxsolutions = _nj4; |
| 9034 | vinfos[5].jointtype = 1; |
| 9035 | vinfos[5].foffset = j5; |
| 9036 | vinfos[5].indices[0] = _ij5[0]; |
| 9037 | vinfos[5].indices[1] = _ij5[1]; |
| 9038 | vinfos[5].maxsolutions = _nj5; |
| 9039 | std::vector<int> vfree(0); |
| 9040 | solutions.AddSolution(vinfos,vfree); |
| 9041 | } |
| 9042 | } |
| 9043 | } |
| 9044 | |
| 9045 | } else |
| 9046 | { |
| 9047 | { |
| 9048 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 9049 | bool j5valid[1]={false}; |
| 9050 | _nj5 = 1; |
| 9051 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 9052 | continue; |
| 9053 | IkReal x1053=IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))); |
| 9054 | IkReal x1054=((25000.0)*x1053); |
| 9055 | CheckValue<IkReal> x1055=IKPowWithIntegerCheck(IKsign(((((-25000.0)*(new_r10*new_r10)))+(((-25000.0)*(new_r00*new_r00))))),-1); |
| 9056 | if(!x1055.valid){ |
| 9057 | continue; |
| 9058 | } |
| 9059 | CheckValue<IkReal> x1056 = IKatan2WithCheck(IkReal(((((25000.00002)*gconst13*new_r10))+((new_r00*x1054)))),IkReal((((new_r10*x1054))+(((-25000.00002)*gconst13*new_r00)))),IKFAST_ATAN2_MAGTHRESH); |
| 9060 | if(!x1056.valid){ |
| 9061 | continue; |
| 9062 | } |
| 9063 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1055.value)))+(x1056.value)); |
| 9064 | sj5array[0]=IKsin(j5array[0]); |
| 9065 | cj5array[0]=IKcos(j5array[0]); |
| 9066 | if( j5array[0] > IKPI ) |
| 9067 | { |
| 9068 | j5array[0]-=IK2PI; |
| 9069 | } |
| 9070 | else if( j5array[0] < -IKPI ) |
| 9071 | { j5array[0]+=IK2PI; |
| 9072 | } |
| 9073 | j5valid[0] = true; |
| 9074 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 9075 | { |
| 9076 | if( !j5valid[ij5] ) |
| 9077 | { |
| 9078 | continue; |
| 9079 | } |
| 9080 | _ij5[0] = ij5; _ij5[1] = -1; |
| 9081 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 9082 | { |
| 9083 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 9084 | { |
| 9085 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 9086 | } |
| 9087 | } |
| 9088 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 9089 | { |
| 9090 | IkReal evalcond[7]; |
| 9091 | IkReal x1057=IKcos(j5); |
| 9092 | IkReal x1058=IKsin(j5); |
| 9093 | IkReal x1059=((1.0000000008)*gconst13); |
| 9094 | IkReal x1060=((1.0)*gconst13); |
| 9095 | IkReal x1061=((1.0000000008)*x1058); |
| 9096 | IkReal x1062=(new_r00*x1057); |
| 9097 | IkReal x1063=x1053; |
| 9098 | IkReal x1064=(x1057*x1063); |
| 9099 | evalcond[0]=((((-1.0)*x1059))+x1062+(((-1.0)*new_r10*x1058))); |
| 9100 | evalcond[1]=(x1063+((new_r00*x1058))+((new_r10*x1057))); |
| 9101 | evalcond[2]=((((-1.0)*new_r10*x1061))+(((1.0000000008)*x1062))+(((-1.0)*x1060))); |
| 9102 | evalcond[3]=((((-1.0)*x1057*x1059))+new_r00+((x1058*x1063))); |
| 9103 | evalcond[4]=(x1064+new_r10+((x1058*x1059))); |
| 9104 | evalcond[5]=((((-1.0000000008)*x1064))+(((-1.0)*x1058*x1060))); |
| 9105 | evalcond[6]=(((x1061*x1063))+(((-1.0)*x1057*x1060))); |
| 9106 | if( 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 ) |
| 9107 | { |
| 9108 | continue; |
| 9109 | } |
| 9110 | } |
| 9111 | |
| 9112 | { |
| 9113 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 9114 | vinfos[0].jointtype = 1; |
| 9115 | vinfos[0].foffset = j0; |
| 9116 | vinfos[0].indices[0] = _ij0[0]; |
| 9117 | vinfos[0].indices[1] = _ij0[1]; |
| 9118 | vinfos[0].maxsolutions = _nj0; |
| 9119 | vinfos[1].jointtype = 1; |
| 9120 | vinfos[1].foffset = j1; |
| 9121 | vinfos[1].indices[0] = _ij1[0]; |
| 9122 | vinfos[1].indices[1] = _ij1[1]; |
| 9123 | vinfos[1].maxsolutions = _nj1; |
| 9124 | vinfos[2].jointtype = 1; |
| 9125 | vinfos[2].foffset = j2; |
| 9126 | vinfos[2].indices[0] = _ij2[0]; |
| 9127 | vinfos[2].indices[1] = _ij2[1]; |
| 9128 | vinfos[2].maxsolutions = _nj2; |
| 9129 | vinfos[3].jointtype = 1; |
| 9130 | vinfos[3].foffset = j3; |
| 9131 | vinfos[3].indices[0] = _ij3[0]; |
| 9132 | vinfos[3].indices[1] = _ij3[1]; |
| 9133 | vinfos[3].maxsolutions = _nj3; |
| 9134 | vinfos[4].jointtype = 1; |
| 9135 | vinfos[4].foffset = j4; |
| 9136 | vinfos[4].indices[0] = _ij4[0]; |
| 9137 | vinfos[4].indices[1] = _ij4[1]; |
| 9138 | vinfos[4].maxsolutions = _nj4; |
| 9139 | vinfos[5].jointtype = 1; |
| 9140 | vinfos[5].foffset = j5; |
| 9141 | vinfos[5].indices[0] = _ij5[0]; |
| 9142 | vinfos[5].indices[1] = _ij5[1]; |
| 9143 | vinfos[5].maxsolutions = _nj5; |
| 9144 | std::vector<int> vfree(0); |
| 9145 | solutions.AddSolution(vinfos,vfree); |
| 9146 | } |
| 9147 | } |
| 9148 | } |
| 9149 | |
| 9150 | } |
| 9151 | |
| 9152 | } |
| 9153 | |
| 9154 | } |
| 9155 | } while(0); |
| 9156 | if( bgotonextstatement ) |
| 9157 | { |
| 9158 | bool bgotonextstatement = true; |
| 9159 | do |
| 9160 | { |
| 9161 | evalcond[0]=IKabs(new_r01); |
| 9162 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 9163 | { |
| 9164 | bgotonextstatement=false; |
| 9165 | { |
| 9166 | IkReal j5eval[3]; |
| 9167 | IkReal x1065=new_r00*new_r00; |
| 9168 | sj4=4.0e-5; |
| 9169 | cj4=1.0; |
| 9170 | j4=4.0e-5; |
| 9171 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 9172 | continue; |
| 9173 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))); |
| 9174 | cj3=gconst13; |
| 9175 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 9176 | continue; |
| 9177 | j3=IKacos(gconst13); |
| 9178 | new_r01=0; |
| 9179 | CheckValue<IkReal> x1066=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x1065))),-1); |
| 9180 | if(!x1066.valid){ |
| 9181 | continue; |
| 9182 | } |
| 9183 | if((((-1.0)*x1065*(x1066.value))) < -0.00001) |
| 9184 | continue; |
| 9185 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1065*(x1066.value))))); |
| 9186 | IkReal x1067=new_r10*new_r10; |
| 9187 | IkReal x1068=new_r00*new_r00; |
| 9188 | IkReal x1069=((1.0)*x1068); |
| 9189 | j5eval[0]=new_r11; |
| 9190 | j5eval[1]=IKsign(new_r11); |
| 9191 | CheckValue<IkReal> x1070=IKPowWithIntegerCheck(((((625000000.0)*x1068))+(((625000001.0)*x1067))),-1); |
| 9192 | if(!x1070.valid){ |
| 9193 | continue; |
| 9194 | } |
| 9195 | CheckValue<IkReal> x1071=IKPowWithIntegerCheck(((((-1.0000000016)*x1067))+(((-1.0)*x1068))),-1); |
| 9196 | if(!x1071.valid){ |
| 9197 | continue; |
| 9198 | } |
| 9199 | j5eval[2]=((((625000002.0)*(pow(x1067,1.0))*(pow(x1070.value,1.0))))+(((-1.0)*x1069*(x1071.value)))); |
| 9200 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 9201 | { |
| 9202 | { |
| 9203 | IkReal j5eval[2]; |
| 9204 | IkReal x1072=new_r00*new_r00; |
| 9205 | sj4=4.0e-5; |
| 9206 | cj4=1.0; |
| 9207 | j4=4.0e-5; |
| 9208 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 9209 | continue; |
| 9210 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))); |
| 9211 | cj3=gconst13; |
| 9212 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 9213 | continue; |
| 9214 | j3=IKacos(gconst13); |
| 9215 | new_r01=0; |
| 9216 | CheckValue<IkReal> x1073=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x1072))),-1); |
| 9217 | if(!x1073.valid){ |
| 9218 | continue; |
| 9219 | } |
| 9220 | if((((-1.0)*x1072*(x1073.value))) < -0.00001) |
| 9221 | continue; |
| 9222 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1072*(x1073.value))))); |
| 9223 | j5eval[0]=new_r10; |
| 9224 | j5eval[1]=new_r11; |
| 9225 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 9226 | { |
| 9227 | { |
| 9228 | IkReal j5eval[2]; |
| 9229 | IkReal x1074=new_r00*new_r00; |
| 9230 | sj4=4.0e-5; |
| 9231 | cj4=1.0; |
| 9232 | j4=4.0e-5; |
| 9233 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 9234 | continue; |
| 9235 | sj3=IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))); |
| 9236 | cj3=gconst13; |
| 9237 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 9238 | continue; |
| 9239 | j3=IKacos(gconst13); |
| 9240 | new_r01=0; |
| 9241 | CheckValue<IkReal> x1075=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x1074))),-1); |
| 9242 | if(!x1075.valid){ |
| 9243 | continue; |
| 9244 | } |
| 9245 | if((((-1.0)*x1074*(x1075.value))) < -0.00001) |
| 9246 | continue; |
| 9247 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1074*(x1075.value))))); |
| 9248 | j5eval[0]=new_r00; |
| 9249 | j5eval[1]=new_r11; |
| 9250 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 9251 | { |
| 9252 | continue; // 3 cases reached |
| 9253 | |
| 9254 | } else |
| 9255 | { |
| 9256 | { |
| 9257 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 9258 | bool j5valid[1]={false}; |
| 9259 | _nj5 = 1; |
| 9260 | CheckValue<IkReal> x1077=IKPowWithIntegerCheck(new_r11,-1); |
| 9261 | if(!x1077.valid){ |
| 9262 | continue; |
| 9263 | } |
| 9264 | IkReal x1076=x1077.value; |
| 9265 | CheckValue<IkReal> x1078=IKPowWithIntegerCheck(new_r00,-1); |
| 9266 | if(!x1078.valid){ |
| 9267 | continue; |
| 9268 | } |
| 9269 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 9270 | continue; |
| 9271 | if( IKabs((x1076*(x1078.value)*(((((-1.0)*gconst13*new_r10))+(((-1.0)*new_r11*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13)))))))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst13*x1076)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x1076*(x1078.value)*(((((-1.0)*gconst13*new_r10))+(((-1.0)*new_r11*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))))))))))+IKsqr((gconst13*x1076))-1) <= IKFAST_SINCOS_THRESH ) |
| 9272 | continue; |
| 9273 | j5array[0]=IKatan2((x1076*(x1078.value)*(((((-1.0)*gconst13*new_r10))+(((-1.0)*new_r11*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))))))))), (gconst13*x1076)); |
| 9274 | sj5array[0]=IKsin(j5array[0]); |
| 9275 | cj5array[0]=IKcos(j5array[0]); |
| 9276 | if( j5array[0] > IKPI ) |
| 9277 | { |
| 9278 | j5array[0]-=IK2PI; |
| 9279 | } |
| 9280 | else if( j5array[0] < -IKPI ) |
| 9281 | { j5array[0]+=IK2PI; |
| 9282 | } |
| 9283 | j5valid[0] = true; |
| 9284 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 9285 | { |
| 9286 | if( !j5valid[ij5] ) |
| 9287 | { |
| 9288 | continue; |
| 9289 | } |
| 9290 | _ij5[0] = ij5; _ij5[1] = -1; |
| 9291 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 9292 | { |
| 9293 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 9294 | { |
| 9295 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 9296 | } |
| 9297 | } |
| 9298 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 9299 | { |
| 9300 | IkReal evalcond[10]; |
| 9301 | IkReal x1079=IKcos(j5); |
| 9302 | IkReal x1080=IKsin(j5); |
| 9303 | IkReal x1081=((1.0)*gconst13); |
| 9304 | IkReal x1082=((1.0000000008)*x1080); |
| 9305 | IkReal x1083=((1.0)*x1080); |
| 9306 | IkReal x1084=((1.0000000008)*x1079); |
| 9307 | if((((1.0)+(((-1.0)*gconst13*x1081)))) < -0.00001) |
| 9308 | continue; |
| 9309 | IkReal x1085=IKsqrt(((1.0)+(((-1.0)*gconst13*x1081)))); |
| 9310 | evalcond[0]=(((new_r11*x1079))+(((-1.0)*x1081))); |
| 9311 | evalcond[1]=((((-1.0)*new_r10*x1083))+(((-1.0000000008)*gconst13))+((new_r00*x1079))); |
| 9312 | evalcond[2]=(x1085+((new_r00*x1080))+((new_r10*x1079))); |
| 9313 | evalcond[3]=((((-1.0)*new_r11*x1083))+(((-1.0000000008)*x1085))); |
| 9314 | evalcond[4]=((((-1.0)*new_r11*x1082))+(((-1.0)*x1085))); |
| 9315 | evalcond[5]=((((-1.0)*new_r10*x1082))+((new_r00*x1084))+(((-1.0)*x1081))); |
| 9316 | evalcond[6]=(((x1080*x1085))+new_r00+(((-1.0)*gconst13*x1084))); |
| 9317 | evalcond[7]=(((x1079*x1085))+((gconst13*x1082))+new_r10); |
| 9318 | evalcond[8]=((((-1.0)*x1080*x1081))+(((-1.0)*x1084*x1085))); |
| 9319 | evalcond[9]=(((x1082*x1085))+(((-1.0)*x1079*x1081))+new_r11); |
| 9320 | if( 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 ) |
| 9321 | { |
| 9322 | continue; |
| 9323 | } |
| 9324 | } |
| 9325 | |
| 9326 | { |
| 9327 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 9328 | vinfos[0].jointtype = 1; |
| 9329 | vinfos[0].foffset = j0; |
| 9330 | vinfos[0].indices[0] = _ij0[0]; |
| 9331 | vinfos[0].indices[1] = _ij0[1]; |
| 9332 | vinfos[0].maxsolutions = _nj0; |
| 9333 | vinfos[1].jointtype = 1; |
| 9334 | vinfos[1].foffset = j1; |
| 9335 | vinfos[1].indices[0] = _ij1[0]; |
| 9336 | vinfos[1].indices[1] = _ij1[1]; |
| 9337 | vinfos[1].maxsolutions = _nj1; |
| 9338 | vinfos[2].jointtype = 1; |
| 9339 | vinfos[2].foffset = j2; |
| 9340 | vinfos[2].indices[0] = _ij2[0]; |
| 9341 | vinfos[2].indices[1] = _ij2[1]; |
| 9342 | vinfos[2].maxsolutions = _nj2; |
| 9343 | vinfos[3].jointtype = 1; |
| 9344 | vinfos[3].foffset = j3; |
| 9345 | vinfos[3].indices[0] = _ij3[0]; |
| 9346 | vinfos[3].indices[1] = _ij3[1]; |
| 9347 | vinfos[3].maxsolutions = _nj3; |
| 9348 | vinfos[4].jointtype = 1; |
| 9349 | vinfos[4].foffset = j4; |
| 9350 | vinfos[4].indices[0] = _ij4[0]; |
| 9351 | vinfos[4].indices[1] = _ij4[1]; |
| 9352 | vinfos[4].maxsolutions = _nj4; |
| 9353 | vinfos[5].jointtype = 1; |
| 9354 | vinfos[5].foffset = j5; |
| 9355 | vinfos[5].indices[0] = _ij5[0]; |
| 9356 | vinfos[5].indices[1] = _ij5[1]; |
| 9357 | vinfos[5].maxsolutions = _nj5; |
| 9358 | std::vector<int> vfree(0); |
| 9359 | solutions.AddSolution(vinfos,vfree); |
| 9360 | } |
| 9361 | } |
| 9362 | } |
| 9363 | |
| 9364 | } |
| 9365 | |
| 9366 | } |
| 9367 | |
| 9368 | } else |
| 9369 | { |
| 9370 | { |
| 9371 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 9372 | bool j5valid[1]={false}; |
| 9373 | _nj5 = 1; |
| 9374 | CheckValue<IkReal> x1087=IKPowWithIntegerCheck(new_r11,-1); |
| 9375 | if(!x1087.valid){ |
| 9376 | continue; |
| 9377 | } |
| 9378 | IkReal x1086=x1087.value; |
| 9379 | CheckValue<IkReal> x1088=IKPowWithIntegerCheck(new_r10,-1); |
| 9380 | if(!x1088.valid){ |
| 9381 | continue; |
| 9382 | } |
| 9383 | if( IKabs(((4.0e-5)*x1086*(x1088.value)*(((((25000.0)*gconst13*new_r00))+(((-25000.00002)*gconst13*new_r11)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst13*x1086)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((4.0e-5)*x1086*(x1088.value)*(((((25000.0)*gconst13*new_r00))+(((-25000.00002)*gconst13*new_r11))))))+IKsqr((gconst13*x1086))-1) <= IKFAST_SINCOS_THRESH ) |
| 9384 | continue; |
| 9385 | j5array[0]=IKatan2(((4.0e-5)*x1086*(x1088.value)*(((((25000.0)*gconst13*new_r00))+(((-25000.00002)*gconst13*new_r11))))), (gconst13*x1086)); |
| 9386 | sj5array[0]=IKsin(j5array[0]); |
| 9387 | cj5array[0]=IKcos(j5array[0]); |
| 9388 | if( j5array[0] > IKPI ) |
| 9389 | { |
| 9390 | j5array[0]-=IK2PI; |
| 9391 | } |
| 9392 | else if( j5array[0] < -IKPI ) |
| 9393 | { j5array[0]+=IK2PI; |
| 9394 | } |
| 9395 | j5valid[0] = true; |
| 9396 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 9397 | { |
| 9398 | if( !j5valid[ij5] ) |
| 9399 | { |
| 9400 | continue; |
| 9401 | } |
| 9402 | _ij5[0] = ij5; _ij5[1] = -1; |
| 9403 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 9404 | { |
| 9405 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 9406 | { |
| 9407 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 9408 | } |
| 9409 | } |
| 9410 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 9411 | { |
| 9412 | IkReal evalcond[10]; |
| 9413 | IkReal x1089=IKcos(j5); |
| 9414 | IkReal x1090=IKsin(j5); |
| 9415 | IkReal x1091=((1.0)*gconst13); |
| 9416 | IkReal x1092=((1.0000000008)*x1090); |
| 9417 | IkReal x1093=((1.0)*x1090); |
| 9418 | IkReal x1094=((1.0000000008)*x1089); |
| 9419 | if((((1.0)+(((-1.0)*gconst13*x1091)))) < -0.00001) |
| 9420 | continue; |
| 9421 | IkReal x1095=IKsqrt(((1.0)+(((-1.0)*gconst13*x1091)))); |
| 9422 | evalcond[0]=((((-1.0)*x1091))+((new_r11*x1089))); |
| 9423 | evalcond[1]=(((new_r00*x1089))+(((-1.0000000008)*gconst13))+(((-1.0)*new_r10*x1093))); |
| 9424 | evalcond[2]=(((new_r00*x1090))+x1095+((new_r10*x1089))); |
| 9425 | evalcond[3]=((((-1.0000000008)*x1095))+(((-1.0)*new_r11*x1093))); |
| 9426 | evalcond[4]=((((-1.0)*x1095))+(((-1.0)*new_r11*x1092))); |
| 9427 | evalcond[5]=(((new_r00*x1094))+(((-1.0)*x1091))+(((-1.0)*new_r10*x1092))); |
| 9428 | evalcond[6]=((((-1.0)*gconst13*x1094))+new_r00+((x1090*x1095))); |
| 9429 | evalcond[7]=(((x1089*x1095))+new_r10+((gconst13*x1092))); |
| 9430 | evalcond[8]=((((-1.0)*x1090*x1091))+(((-1.0)*x1094*x1095))); |
| 9431 | evalcond[9]=((((-1.0)*x1089*x1091))+((x1092*x1095))+new_r11); |
| 9432 | if( 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 ) |
| 9433 | { |
| 9434 | continue; |
| 9435 | } |
| 9436 | } |
| 9437 | |
| 9438 | { |
| 9439 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 9440 | vinfos[0].jointtype = 1; |
| 9441 | vinfos[0].foffset = j0; |
| 9442 | vinfos[0].indices[0] = _ij0[0]; |
| 9443 | vinfos[0].indices[1] = _ij0[1]; |
| 9444 | vinfos[0].maxsolutions = _nj0; |
| 9445 | vinfos[1].jointtype = 1; |
| 9446 | vinfos[1].foffset = j1; |
| 9447 | vinfos[1].indices[0] = _ij1[0]; |
| 9448 | vinfos[1].indices[1] = _ij1[1]; |
| 9449 | vinfos[1].maxsolutions = _nj1; |
| 9450 | vinfos[2].jointtype = 1; |
| 9451 | vinfos[2].foffset = j2; |
| 9452 | vinfos[2].indices[0] = _ij2[0]; |
| 9453 | vinfos[2].indices[1] = _ij2[1]; |
| 9454 | vinfos[2].maxsolutions = _nj2; |
| 9455 | vinfos[3].jointtype = 1; |
| 9456 | vinfos[3].foffset = j3; |
| 9457 | vinfos[3].indices[0] = _ij3[0]; |
| 9458 | vinfos[3].indices[1] = _ij3[1]; |
| 9459 | vinfos[3].maxsolutions = _nj3; |
| 9460 | vinfos[4].jointtype = 1; |
| 9461 | vinfos[4].foffset = j4; |
| 9462 | vinfos[4].indices[0] = _ij4[0]; |
| 9463 | vinfos[4].indices[1] = _ij4[1]; |
| 9464 | vinfos[4].maxsolutions = _nj4; |
| 9465 | vinfos[5].jointtype = 1; |
| 9466 | vinfos[5].foffset = j5; |
| 9467 | vinfos[5].indices[0] = _ij5[0]; |
| 9468 | vinfos[5].indices[1] = _ij5[1]; |
| 9469 | vinfos[5].maxsolutions = _nj5; |
| 9470 | std::vector<int> vfree(0); |
| 9471 | solutions.AddSolution(vinfos,vfree); |
| 9472 | } |
| 9473 | } |
| 9474 | } |
| 9475 | |
| 9476 | } |
| 9477 | |
| 9478 | } |
| 9479 | |
| 9480 | } else |
| 9481 | { |
| 9482 | { |
| 9483 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 9484 | bool j5valid[1]={false}; |
| 9485 | _nj5 = 1; |
| 9486 | CheckValue<IkReal> x1096=IKPowWithIntegerCheck(IKsign(new_r11),-1); |
| 9487 | if(!x1096.valid){ |
| 9488 | continue; |
| 9489 | } |
| 9490 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 9491 | continue; |
| 9492 | CheckValue<IkReal> x1097 = IKatan2WithCheck(IkReal(((-1.0000000008)*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13)))))))),IkReal(gconst13),IKFAST_ATAN2_MAGTHRESH); |
| 9493 | if(!x1097.valid){ |
| 9494 | continue; |
| 9495 | } |
| 9496 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1096.value)))+(x1097.value)); |
| 9497 | sj5array[0]=IKsin(j5array[0]); |
| 9498 | cj5array[0]=IKcos(j5array[0]); |
| 9499 | if( j5array[0] > IKPI ) |
| 9500 | { |
| 9501 | j5array[0]-=IK2PI; |
| 9502 | } |
| 9503 | else if( j5array[0] < -IKPI ) |
| 9504 | { j5array[0]+=IK2PI; |
| 9505 | } |
| 9506 | j5valid[0] = true; |
| 9507 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 9508 | { |
| 9509 | if( !j5valid[ij5] ) |
| 9510 | { |
| 9511 | continue; |
| 9512 | } |
| 9513 | _ij5[0] = ij5; _ij5[1] = -1; |
| 9514 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 9515 | { |
| 9516 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 9517 | { |
| 9518 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 9519 | } |
| 9520 | } |
| 9521 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 9522 | { |
| 9523 | IkReal evalcond[10]; |
| 9524 | IkReal x1098=IKcos(j5); |
| 9525 | IkReal x1099=IKsin(j5); |
| 9526 | IkReal x1100=((1.0)*gconst13); |
| 9527 | IkReal x1101=((1.0000000008)*x1099); |
| 9528 | IkReal x1102=((1.0)*x1099); |
| 9529 | IkReal x1103=((1.0000000008)*x1098); |
| 9530 | if((((1.0)+(((-1.0)*gconst13*x1100)))) < -0.00001) |
| 9531 | continue; |
| 9532 | IkReal x1104=IKsqrt(((1.0)+(((-1.0)*gconst13*x1100)))); |
| 9533 | evalcond[0]=(((new_r11*x1098))+(((-1.0)*x1100))); |
| 9534 | evalcond[1]=(((new_r00*x1098))+(((-1.0000000008)*gconst13))+(((-1.0)*new_r10*x1102))); |
| 9535 | evalcond[2]=(x1104+((new_r00*x1099))+((new_r10*x1098))); |
| 9536 | evalcond[3]=((((-1.0000000008)*x1104))+(((-1.0)*new_r11*x1102))); |
| 9537 | evalcond[4]=((((-1.0)*x1104))+(((-1.0)*new_r11*x1101))); |
| 9538 | evalcond[5]=(((new_r00*x1103))+(((-1.0)*new_r10*x1101))+(((-1.0)*x1100))); |
| 9539 | evalcond[6]=(((x1099*x1104))+new_r00+(((-1.0)*gconst13*x1103))); |
| 9540 | evalcond[7]=(((x1098*x1104))+((gconst13*x1101))+new_r10); |
| 9541 | evalcond[8]=((((-1.0)*x1103*x1104))+(((-1.0)*x1099*x1100))); |
| 9542 | evalcond[9]=((((-1.0)*x1098*x1100))+((x1101*x1104))+new_r11); |
| 9543 | if( 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 ) |
| 9544 | { |
| 9545 | continue; |
| 9546 | } |
| 9547 | } |
| 9548 | |
| 9549 | { |
| 9550 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 9551 | vinfos[0].jointtype = 1; |
| 9552 | vinfos[0].foffset = j0; |
| 9553 | vinfos[0].indices[0] = _ij0[0]; |
| 9554 | vinfos[0].indices[1] = _ij0[1]; |
| 9555 | vinfos[0].maxsolutions = _nj0; |
| 9556 | vinfos[1].jointtype = 1; |
| 9557 | vinfos[1].foffset = j1; |
| 9558 | vinfos[1].indices[0] = _ij1[0]; |
| 9559 | vinfos[1].indices[1] = _ij1[1]; |
| 9560 | vinfos[1].maxsolutions = _nj1; |
| 9561 | vinfos[2].jointtype = 1; |
| 9562 | vinfos[2].foffset = j2; |
| 9563 | vinfos[2].indices[0] = _ij2[0]; |
| 9564 | vinfos[2].indices[1] = _ij2[1]; |
| 9565 | vinfos[2].maxsolutions = _nj2; |
| 9566 | vinfos[3].jointtype = 1; |
| 9567 | vinfos[3].foffset = j3; |
| 9568 | vinfos[3].indices[0] = _ij3[0]; |
| 9569 | vinfos[3].indices[1] = _ij3[1]; |
| 9570 | vinfos[3].maxsolutions = _nj3; |
| 9571 | vinfos[4].jointtype = 1; |
| 9572 | vinfos[4].foffset = j4; |
| 9573 | vinfos[4].indices[0] = _ij4[0]; |
| 9574 | vinfos[4].indices[1] = _ij4[1]; |
| 9575 | vinfos[4].maxsolutions = _nj4; |
| 9576 | vinfos[5].jointtype = 1; |
| 9577 | vinfos[5].foffset = j5; |
| 9578 | vinfos[5].indices[0] = _ij5[0]; |
| 9579 | vinfos[5].indices[1] = _ij5[1]; |
| 9580 | vinfos[5].maxsolutions = _nj5; |
| 9581 | std::vector<int> vfree(0); |
| 9582 | solutions.AddSolution(vinfos,vfree); |
| 9583 | } |
| 9584 | } |
| 9585 | } |
| 9586 | |
| 9587 | } |
| 9588 | |
| 9589 | } |
| 9590 | |
| 9591 | } |
| 9592 | } while(0); |
| 9593 | if( bgotonextstatement ) |
| 9594 | { |
| 9595 | bool bgotonextstatement = true; |
| 9596 | do |
| 9597 | { |
| 9598 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r00))); |
| 9599 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 9600 | { |
| 9601 | bgotonextstatement=false; |
| 9602 | { |
| 9603 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 9604 | bool j5valid[2]={false}; |
| 9605 | _nj5 = 2; |
| 9606 | cj5array[0]=((-1.0)*new_r10); |
| 9607 | if( cj5array[0] >= -1-IKFAST_SINCOS_THRESH && cj5array[0] <= 1+IKFAST_SINCOS_THRESH ) |
| 9608 | { |
| 9609 | j5valid[0] = j5valid[1] = true; |
| 9610 | j5array[0] = IKacos(cj5array[0]); |
| 9611 | sj5array[0] = IKsin(j5array[0]); |
| 9612 | cj5array[1] = cj5array[0]; |
| 9613 | j5array[1] = -j5array[0]; |
| 9614 | sj5array[1] = -sj5array[0]; |
| 9615 | } |
| 9616 | else if( isnan(cj5array[0]) ) |
| 9617 | { |
| 9618 | // probably any value will work |
| 9619 | j5valid[0] = true; |
| 9620 | cj5array[0] = 1; sj5array[0] = 0; j5array[0] = 0; |
| 9621 | } |
| 9622 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 9623 | { |
| 9624 | if( !j5valid[ij5] ) |
| 9625 | { |
| 9626 | continue; |
| 9627 | } |
| 9628 | _ij5[0] = ij5; _ij5[1] = -1; |
| 9629 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 9630 | { |
| 9631 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 9632 | { |
| 9633 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 9634 | } |
| 9635 | } |
| 9636 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 9637 | { |
| 9638 | IkReal evalcond[9]; |
| 9639 | IkReal x1105=IKsin(j5); |
| 9640 | IkReal x1106=IKcos(j5); |
| 9641 | IkReal x1107=(new_r10*x1105); |
| 9642 | IkReal x1108=((1.0000000008)*x1106); |
| 9643 | evalcond[0]=x1105; |
| 9644 | evalcond[1]=(new_r01*x1105); |
| 9645 | evalcond[2]=((-1.0)*x1107); |
| 9646 | evalcond[3]=((1.0)+((new_r10*x1106))); |
| 9647 | evalcond[4]=((1.0000000008)*x1105); |
| 9648 | evalcond[5]=((-1.0000000008)*x1107); |
| 9649 | evalcond[6]=(new_r01+(((-1.0)*x1108))); |
| 9650 | evalcond[7]=((-1.0000000008)+((new_r01*x1106))); |
| 9651 | evalcond[8]=((-1.0)+((new_r01*x1108))); |
| 9652 | if( 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 ) |
| 9653 | { |
| 9654 | continue; |
| 9655 | } |
| 9656 | } |
| 9657 | |
| 9658 | { |
| 9659 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 9660 | vinfos[0].jointtype = 1; |
| 9661 | vinfos[0].foffset = j0; |
| 9662 | vinfos[0].indices[0] = _ij0[0]; |
| 9663 | vinfos[0].indices[1] = _ij0[1]; |
| 9664 | vinfos[0].maxsolutions = _nj0; |
| 9665 | vinfos[1].jointtype = 1; |
| 9666 | vinfos[1].foffset = j1; |
| 9667 | vinfos[1].indices[0] = _ij1[0]; |
| 9668 | vinfos[1].indices[1] = _ij1[1]; |
| 9669 | vinfos[1].maxsolutions = _nj1; |
| 9670 | vinfos[2].jointtype = 1; |
| 9671 | vinfos[2].foffset = j2; |
| 9672 | vinfos[2].indices[0] = _ij2[0]; |
| 9673 | vinfos[2].indices[1] = _ij2[1]; |
| 9674 | vinfos[2].maxsolutions = _nj2; |
| 9675 | vinfos[3].jointtype = 1; |
| 9676 | vinfos[3].foffset = j3; |
| 9677 | vinfos[3].indices[0] = _ij3[0]; |
| 9678 | vinfos[3].indices[1] = _ij3[1]; |
| 9679 | vinfos[3].maxsolutions = _nj3; |
| 9680 | vinfos[4].jointtype = 1; |
| 9681 | vinfos[4].foffset = j4; |
| 9682 | vinfos[4].indices[0] = _ij4[0]; |
| 9683 | vinfos[4].indices[1] = _ij4[1]; |
| 9684 | vinfos[4].maxsolutions = _nj4; |
| 9685 | vinfos[5].jointtype = 1; |
| 9686 | vinfos[5].foffset = j5; |
| 9687 | vinfos[5].indices[0] = _ij5[0]; |
| 9688 | vinfos[5].indices[1] = _ij5[1]; |
| 9689 | vinfos[5].maxsolutions = _nj5; |
| 9690 | std::vector<int> vfree(0); |
| 9691 | solutions.AddSolution(vinfos,vfree); |
| 9692 | } |
| 9693 | } |
| 9694 | } |
| 9695 | |
| 9696 | } |
| 9697 | } while(0); |
| 9698 | if( bgotonextstatement ) |
| 9699 | { |
| 9700 | bool bgotonextstatement = true; |
| 9701 | do |
| 9702 | { |
| 9703 | evalcond[0]=((IKabs(new_r10))+(IKabs(new_r00))); |
| 9704 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 9705 | { |
| 9706 | bgotonextstatement=false; |
| 9707 | { |
| 9708 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 9709 | bool j5valid[1]={false}; |
| 9710 | _nj5 = 1; |
| 9711 | if( IKabs(((-0.9999999992)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((0.9999999992)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-0.9999999992)*new_r11))+IKsqr(((0.9999999992)*new_r01))-1) <= IKFAST_SINCOS_THRESH ) |
| 9712 | continue; |
| 9713 | j5array[0]=IKatan2(((-0.9999999992)*new_r11), ((0.9999999992)*new_r01)); |
| 9714 | sj5array[0]=IKsin(j5array[0]); |
| 9715 | cj5array[0]=IKcos(j5array[0]); |
| 9716 | if( j5array[0] > IKPI ) |
| 9717 | { |
| 9718 | j5array[0]-=IK2PI; |
| 9719 | } |
| 9720 | else if( j5array[0] < -IKPI ) |
| 9721 | { j5array[0]+=IK2PI; |
| 9722 | } |
| 9723 | j5valid[0] = true; |
| 9724 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 9725 | { |
| 9726 | if( !j5valid[ij5] ) |
| 9727 | { |
| 9728 | continue; |
| 9729 | } |
| 9730 | _ij5[0] = ij5; _ij5[1] = -1; |
| 9731 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 9732 | { |
| 9733 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 9734 | { |
| 9735 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 9736 | } |
| 9737 | } |
| 9738 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 9739 | { |
| 9740 | IkReal evalcond[7]; |
| 9741 | IkReal x1109=IKcos(j5); |
| 9742 | IkReal x1110=IKsin(j5); |
| 9743 | IkReal x1111=((1.0000000008)*x1110); |
| 9744 | IkReal x1112=((1.0000000008)*x1109); |
| 9745 | evalcond[0]=x1110; |
| 9746 | evalcond[1]=x1109; |
| 9747 | evalcond[2]=(new_r01+(((-1.0)*x1112))); |
| 9748 | evalcond[3]=(x1111+new_r11); |
| 9749 | evalcond[4]=(((new_r11*x1109))+((new_r01*x1110))); |
| 9750 | evalcond[5]=((-1.0000000008)+((new_r01*x1109))+(((-1.0)*new_r11*x1110))); |
| 9751 | evalcond[6]=((-1.0)+((new_r01*x1112))+(((-1.0)*new_r11*x1111))); |
| 9752 | if( 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 ) |
| 9753 | { |
| 9754 | continue; |
| 9755 | } |
| 9756 | } |
| 9757 | |
| 9758 | { |
| 9759 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 9760 | vinfos[0].jointtype = 1; |
| 9761 | vinfos[0].foffset = j0; |
| 9762 | vinfos[0].indices[0] = _ij0[0]; |
| 9763 | vinfos[0].indices[1] = _ij0[1]; |
| 9764 | vinfos[0].maxsolutions = _nj0; |
| 9765 | vinfos[1].jointtype = 1; |
| 9766 | vinfos[1].foffset = j1; |
| 9767 | vinfos[1].indices[0] = _ij1[0]; |
| 9768 | vinfos[1].indices[1] = _ij1[1]; |
| 9769 | vinfos[1].maxsolutions = _nj1; |
| 9770 | vinfos[2].jointtype = 1; |
| 9771 | vinfos[2].foffset = j2; |
| 9772 | vinfos[2].indices[0] = _ij2[0]; |
| 9773 | vinfos[2].indices[1] = _ij2[1]; |
| 9774 | vinfos[2].maxsolutions = _nj2; |
| 9775 | vinfos[3].jointtype = 1; |
| 9776 | vinfos[3].foffset = j3; |
| 9777 | vinfos[3].indices[0] = _ij3[0]; |
| 9778 | vinfos[3].indices[1] = _ij3[1]; |
| 9779 | vinfos[3].maxsolutions = _nj3; |
| 9780 | vinfos[4].jointtype = 1; |
| 9781 | vinfos[4].foffset = j4; |
| 9782 | vinfos[4].indices[0] = _ij4[0]; |
| 9783 | vinfos[4].indices[1] = _ij4[1]; |
| 9784 | vinfos[4].maxsolutions = _nj4; |
| 9785 | vinfos[5].jointtype = 1; |
| 9786 | vinfos[5].foffset = j5; |
| 9787 | vinfos[5].indices[0] = _ij5[0]; |
| 9788 | vinfos[5].indices[1] = _ij5[1]; |
| 9789 | vinfos[5].maxsolutions = _nj5; |
| 9790 | std::vector<int> vfree(0); |
| 9791 | solutions.AddSolution(vinfos,vfree); |
| 9792 | } |
| 9793 | } |
| 9794 | } |
| 9795 | |
| 9796 | } |
| 9797 | } while(0); |
| 9798 | if( bgotonextstatement ) |
| 9799 | { |
| 9800 | bool bgotonextstatement = true; |
| 9801 | do |
| 9802 | { |
| 9803 | if( 1 ) |
| 9804 | { |
| 9805 | bgotonextstatement=false; |
| 9806 | continue; // branch miss [j5] |
| 9807 | |
| 9808 | } |
| 9809 | } while(0); |
| 9810 | if( bgotonextstatement ) |
| 9811 | { |
| 9812 | } |
| 9813 | } |
| 9814 | } |
| 9815 | } |
| 9816 | } |
| 9817 | } |
| 9818 | |
| 9819 | } else |
| 9820 | { |
| 9821 | { |
| 9822 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 9823 | bool j5valid[1]={false}; |
| 9824 | _nj5 = 1; |
| 9825 | CheckValue<IkReal> x1120=IKPowWithIntegerCheck(new_r01,-1); |
| 9826 | if(!x1120.valid){ |
| 9827 | continue; |
| 9828 | } |
| 9829 | IkReal x1113=x1120.value; |
| 9830 | IkReal x1114=((25000.0)*new_r00); |
| 9831 | IkReal x1115=(gconst13*x1113); |
| 9832 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 9833 | continue; |
| 9834 | IkReal x1116=IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))); |
| 9835 | IkReal x1117=((25000.0)*x1116); |
| 9836 | CheckValue<IkReal> x1121=IKPowWithIntegerCheck(((((25000.00002)*gconst13*new_r01))+((new_r11*x1117))),-1); |
| 9837 | if(!x1121.valid){ |
| 9838 | continue; |
| 9839 | } |
| 9840 | IkReal x1118=x1121.value; |
| 9841 | IkReal x1119=(new_r11*x1118); |
| 9842 | if( IKabs((x1115+(((-1.0)*x1114*x1119))+(((-1.0)*x1115*x1117*x1119)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x1118*((((gconst13*x1117))+((new_r01*x1114)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x1115+(((-1.0)*x1114*x1119))+(((-1.0)*x1115*x1117*x1119))))+IKsqr((x1118*((((gconst13*x1117))+((new_r01*x1114))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 9843 | continue; |
| 9844 | j5array[0]=IKatan2((x1115+(((-1.0)*x1114*x1119))+(((-1.0)*x1115*x1117*x1119))), (x1118*((((gconst13*x1117))+((new_r01*x1114)))))); |
| 9845 | sj5array[0]=IKsin(j5array[0]); |
| 9846 | cj5array[0]=IKcos(j5array[0]); |
| 9847 | if( j5array[0] > IKPI ) |
| 9848 | { |
| 9849 | j5array[0]-=IK2PI; |
| 9850 | } |
| 9851 | else if( j5array[0] < -IKPI ) |
| 9852 | { j5array[0]+=IK2PI; |
| 9853 | } |
| 9854 | j5valid[0] = true; |
| 9855 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 9856 | { |
| 9857 | if( !j5valid[ij5] ) |
| 9858 | { |
| 9859 | continue; |
| 9860 | } |
| 9861 | _ij5[0] = ij5; _ij5[1] = -1; |
| 9862 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 9863 | { |
| 9864 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 9865 | { |
| 9866 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 9867 | } |
| 9868 | } |
| 9869 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 9870 | { |
| 9871 | IkReal evalcond[10]; |
| 9872 | IkReal x1122=IKcos(j5); |
| 9873 | IkReal x1123=IKsin(j5); |
| 9874 | IkReal x1124=((1.0)*gconst13); |
| 9875 | IkReal x1125=((1.0000000008)*x1123); |
| 9876 | IkReal x1126=((1.0)*x1123); |
| 9877 | IkReal x1127=((1.0000000008)*x1122); |
| 9878 | IkReal x1128=x1116; |
| 9879 | evalcond[0]=(((new_r01*x1123))+(((-1.0)*x1124))+((new_r11*x1122))); |
| 9880 | evalcond[1]=((((-1.0)*new_r10*x1126))+(((-1.0000000008)*gconst13))+((new_r00*x1122))); |
| 9881 | evalcond[2]=(x1128+((new_r10*x1122))+((new_r00*x1123))); |
| 9882 | evalcond[3]=((((-1.0)*new_r10*x1125))+(((-1.0)*x1124))+((new_r00*x1127))); |
| 9883 | evalcond[4]=((((-1.0)*gconst13*x1127))+new_r00+((x1123*x1128))); |
| 9884 | evalcond[5]=(((gconst13*x1125))+((x1122*x1128))+new_r10); |
| 9885 | evalcond[6]=((((-1.0)*x1123*x1124))+(((-1.0)*x1127*x1128))+new_r01); |
| 9886 | evalcond[7]=((((-1.0)*x1122*x1124))+((x1125*x1128))+new_r11); |
| 9887 | evalcond[8]=((((-1.0)*new_r11*x1126))+((new_r01*x1122))+(((-1.0000000008)*x1128))); |
| 9888 | evalcond[9]=((((-1.0)*new_r11*x1125))+((new_r01*x1127))+(((-1.0)*x1128))); |
| 9889 | if( 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 ) |
| 9890 | { |
| 9891 | continue; |
| 9892 | } |
| 9893 | } |
| 9894 | |
| 9895 | { |
| 9896 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 9897 | vinfos[0].jointtype = 1; |
| 9898 | vinfos[0].foffset = j0; |
| 9899 | vinfos[0].indices[0] = _ij0[0]; |
| 9900 | vinfos[0].indices[1] = _ij0[1]; |
| 9901 | vinfos[0].maxsolutions = _nj0; |
| 9902 | vinfos[1].jointtype = 1; |
| 9903 | vinfos[1].foffset = j1; |
| 9904 | vinfos[1].indices[0] = _ij1[0]; |
| 9905 | vinfos[1].indices[1] = _ij1[1]; |
| 9906 | vinfos[1].maxsolutions = _nj1; |
| 9907 | vinfos[2].jointtype = 1; |
| 9908 | vinfos[2].foffset = j2; |
| 9909 | vinfos[2].indices[0] = _ij2[0]; |
| 9910 | vinfos[2].indices[1] = _ij2[1]; |
| 9911 | vinfos[2].maxsolutions = _nj2; |
| 9912 | vinfos[3].jointtype = 1; |
| 9913 | vinfos[3].foffset = j3; |
| 9914 | vinfos[3].indices[0] = _ij3[0]; |
| 9915 | vinfos[3].indices[1] = _ij3[1]; |
| 9916 | vinfos[3].maxsolutions = _nj3; |
| 9917 | vinfos[4].jointtype = 1; |
| 9918 | vinfos[4].foffset = j4; |
| 9919 | vinfos[4].indices[0] = _ij4[0]; |
| 9920 | vinfos[4].indices[1] = _ij4[1]; |
| 9921 | vinfos[4].maxsolutions = _nj4; |
| 9922 | vinfos[5].jointtype = 1; |
| 9923 | vinfos[5].foffset = j5; |
| 9924 | vinfos[5].indices[0] = _ij5[0]; |
| 9925 | vinfos[5].indices[1] = _ij5[1]; |
| 9926 | vinfos[5].maxsolutions = _nj5; |
| 9927 | std::vector<int> vfree(0); |
| 9928 | solutions.AddSolution(vinfos,vfree); |
| 9929 | } |
| 9930 | } |
| 9931 | } |
| 9932 | |
| 9933 | } |
| 9934 | |
| 9935 | } |
| 9936 | |
| 9937 | } else |
| 9938 | { |
| 9939 | { |
| 9940 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 9941 | bool j5valid[1]={false}; |
| 9942 | _nj5 = 1; |
| 9943 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 9944 | continue; |
| 9945 | IkReal x1129=IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))); |
| 9946 | CheckValue<IkReal> x1130 = IKatan2WithCheck(IkReal((((gconst13*new_r10))+((new_r11*x1129)))),IkReal(((((-1.0)*new_r01*x1129))+(((-1.0)*gconst13*new_r00)))),IKFAST_ATAN2_MAGTHRESH); |
| 9947 | if(!x1130.valid){ |
| 9948 | continue; |
| 9949 | } |
| 9950 | CheckValue<IkReal> x1131=IKPowWithIntegerCheck(IKsign((((new_r01*new_r10))+(((-1.0)*new_r00*new_r11)))),-1); |
| 9951 | if(!x1131.valid){ |
| 9952 | continue; |
| 9953 | } |
| 9954 | j5array[0]=((-1.5707963267949)+(x1130.value)+(((1.5707963267949)*(x1131.value)))); |
| 9955 | sj5array[0]=IKsin(j5array[0]); |
| 9956 | cj5array[0]=IKcos(j5array[0]); |
| 9957 | if( j5array[0] > IKPI ) |
| 9958 | { |
| 9959 | j5array[0]-=IK2PI; |
| 9960 | } |
| 9961 | else if( j5array[0] < -IKPI ) |
| 9962 | { j5array[0]+=IK2PI; |
| 9963 | } |
| 9964 | j5valid[0] = true; |
| 9965 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 9966 | { |
| 9967 | if( !j5valid[ij5] ) |
| 9968 | { |
| 9969 | continue; |
| 9970 | } |
| 9971 | _ij5[0] = ij5; _ij5[1] = -1; |
| 9972 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 9973 | { |
| 9974 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 9975 | { |
| 9976 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 9977 | } |
| 9978 | } |
| 9979 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 9980 | { |
| 9981 | IkReal evalcond[10]; |
| 9982 | IkReal x1132=IKcos(j5); |
| 9983 | IkReal x1133=IKsin(j5); |
| 9984 | IkReal x1134=((1.0)*gconst13); |
| 9985 | IkReal x1135=((1.0000000008)*x1133); |
| 9986 | IkReal x1136=((1.0)*x1133); |
| 9987 | IkReal x1137=((1.0000000008)*x1132); |
| 9988 | IkReal x1138=x1129; |
| 9989 | evalcond[0]=((((-1.0)*x1134))+((new_r11*x1132))+((new_r01*x1133))); |
| 9990 | evalcond[1]=((((-1.0)*new_r10*x1136))+(((-1.0000000008)*gconst13))+((new_r00*x1132))); |
| 9991 | evalcond[2]=(x1138+((new_r00*x1133))+((new_r10*x1132))); |
| 9992 | evalcond[3]=((((-1.0)*new_r10*x1135))+(((-1.0)*x1134))+((new_r00*x1137))); |
| 9993 | evalcond[4]=((((-1.0)*gconst13*x1137))+new_r00+((x1133*x1138))); |
| 9994 | evalcond[5]=(((gconst13*x1135))+new_r10+((x1132*x1138))); |
| 9995 | evalcond[6]=(new_r01+(((-1.0)*x1137*x1138))+(((-1.0)*x1133*x1134))); |
| 9996 | evalcond[7]=(((x1135*x1138))+(((-1.0)*x1132*x1134))+new_r11); |
| 9997 | evalcond[8]=((((-1.0)*new_r11*x1136))+(((-1.0000000008)*x1138))+((new_r01*x1132))); |
| 9998 | evalcond[9]=((((-1.0)*new_r11*x1135))+((new_r01*x1137))+(((-1.0)*x1138))); |
| 9999 | if( 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 ) |
| 10000 | { |
| 10001 | continue; |
| 10002 | } |
| 10003 | } |
| 10004 | |
| 10005 | { |
| 10006 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 10007 | vinfos[0].jointtype = 1; |
| 10008 | vinfos[0].foffset = j0; |
| 10009 | vinfos[0].indices[0] = _ij0[0]; |
| 10010 | vinfos[0].indices[1] = _ij0[1]; |
| 10011 | vinfos[0].maxsolutions = _nj0; |
| 10012 | vinfos[1].jointtype = 1; |
| 10013 | vinfos[1].foffset = j1; |
| 10014 | vinfos[1].indices[0] = _ij1[0]; |
| 10015 | vinfos[1].indices[1] = _ij1[1]; |
| 10016 | vinfos[1].maxsolutions = _nj1; |
| 10017 | vinfos[2].jointtype = 1; |
| 10018 | vinfos[2].foffset = j2; |
| 10019 | vinfos[2].indices[0] = _ij2[0]; |
| 10020 | vinfos[2].indices[1] = _ij2[1]; |
| 10021 | vinfos[2].maxsolutions = _nj2; |
| 10022 | vinfos[3].jointtype = 1; |
| 10023 | vinfos[3].foffset = j3; |
| 10024 | vinfos[3].indices[0] = _ij3[0]; |
| 10025 | vinfos[3].indices[1] = _ij3[1]; |
| 10026 | vinfos[3].maxsolutions = _nj3; |
| 10027 | vinfos[4].jointtype = 1; |
| 10028 | vinfos[4].foffset = j4; |
| 10029 | vinfos[4].indices[0] = _ij4[0]; |
| 10030 | vinfos[4].indices[1] = _ij4[1]; |
| 10031 | vinfos[4].maxsolutions = _nj4; |
| 10032 | vinfos[5].jointtype = 1; |
| 10033 | vinfos[5].foffset = j5; |
| 10034 | vinfos[5].indices[0] = _ij5[0]; |
| 10035 | vinfos[5].indices[1] = _ij5[1]; |
| 10036 | vinfos[5].maxsolutions = _nj5; |
| 10037 | std::vector<int> vfree(0); |
| 10038 | solutions.AddSolution(vinfos,vfree); |
| 10039 | } |
| 10040 | } |
| 10041 | } |
| 10042 | |
| 10043 | } |
| 10044 | |
| 10045 | } |
| 10046 | |
| 10047 | } else |
| 10048 | { |
| 10049 | { |
| 10050 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 10051 | bool j5valid[1]={false}; |
| 10052 | _nj5 = 1; |
| 10053 | IkReal x1139=((25000.0)*gconst13); |
| 10054 | IkReal x1140=((25000.00002)*gconst13); |
| 10055 | CheckValue<IkReal> x1141=IKPowWithIntegerCheck(IKsign(((((25000.0)*new_r10*new_r11))+(((25000.0)*new_r00*new_r01)))),-1); |
| 10056 | if(!x1141.valid){ |
| 10057 | continue; |
| 10058 | } |
| 10059 | CheckValue<IkReal> x1142 = IKatan2WithCheck(IkReal(((((-1.0)*new_r11*x1140))+((new_r00*x1139)))),IkReal((((new_r01*x1140))+((new_r10*x1139)))),IKFAST_ATAN2_MAGTHRESH); |
| 10060 | if(!x1142.valid){ |
| 10061 | continue; |
| 10062 | } |
| 10063 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1141.value)))+(x1142.value)); |
| 10064 | sj5array[0]=IKsin(j5array[0]); |
| 10065 | cj5array[0]=IKcos(j5array[0]); |
| 10066 | if( j5array[0] > IKPI ) |
| 10067 | { |
| 10068 | j5array[0]-=IK2PI; |
| 10069 | } |
| 10070 | else if( j5array[0] < -IKPI ) |
| 10071 | { j5array[0]+=IK2PI; |
| 10072 | } |
| 10073 | j5valid[0] = true; |
| 10074 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 10075 | { |
| 10076 | if( !j5valid[ij5] ) |
| 10077 | { |
| 10078 | continue; |
| 10079 | } |
| 10080 | _ij5[0] = ij5; _ij5[1] = -1; |
| 10081 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 10082 | { |
| 10083 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 10084 | { |
| 10085 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 10086 | } |
| 10087 | } |
| 10088 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 10089 | { |
| 10090 | IkReal evalcond[10]; |
| 10091 | IkReal x1143=IKcos(j5); |
| 10092 | IkReal x1144=IKsin(j5); |
| 10093 | IkReal x1145=((1.0)*gconst13); |
| 10094 | IkReal x1146=((1.0000000008)*x1144); |
| 10095 | IkReal x1147=((1.0)*x1144); |
| 10096 | IkReal x1148=((1.0000000008)*x1143); |
| 10097 | if((((1.0)+(((-1.0)*gconst13*x1145)))) < -0.00001) |
| 10098 | continue; |
| 10099 | IkReal x1149=IKsqrt(((1.0)+(((-1.0)*gconst13*x1145)))); |
| 10100 | evalcond[0]=((((-1.0)*x1145))+((new_r01*x1144))+((new_r11*x1143))); |
| 10101 | evalcond[1]=(((new_r00*x1143))+(((-1.0000000008)*gconst13))+(((-1.0)*new_r10*x1147))); |
| 10102 | evalcond[2]=(x1149+((new_r00*x1144))+((new_r10*x1143))); |
| 10103 | evalcond[3]=(((new_r00*x1148))+(((-1.0)*x1145))+(((-1.0)*new_r10*x1146))); |
| 10104 | evalcond[4]=((((-1.0)*gconst13*x1148))+new_r00+((x1144*x1149))); |
| 10105 | evalcond[5]=(((x1143*x1149))+((gconst13*x1146))+new_r10); |
| 10106 | evalcond[6]=(new_r01+(((-1.0)*x1148*x1149))+(((-1.0)*x1144*x1145))); |
| 10107 | evalcond[7]=((((-1.0)*x1143*x1145))+((x1146*x1149))+new_r11); |
| 10108 | evalcond[8]=(((new_r01*x1143))+(((-1.0)*new_r11*x1147))+(((-1.0000000008)*x1149))); |
| 10109 | evalcond[9]=(((new_r01*x1148))+(((-1.0)*x1149))+(((-1.0)*new_r11*x1146))); |
| 10110 | if( 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 ) |
| 10111 | { |
| 10112 | continue; |
| 10113 | } |
| 10114 | } |
| 10115 | |
| 10116 | { |
| 10117 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 10118 | vinfos[0].jointtype = 1; |
| 10119 | vinfos[0].foffset = j0; |
| 10120 | vinfos[0].indices[0] = _ij0[0]; |
| 10121 | vinfos[0].indices[1] = _ij0[1]; |
| 10122 | vinfos[0].maxsolutions = _nj0; |
| 10123 | vinfos[1].jointtype = 1; |
| 10124 | vinfos[1].foffset = j1; |
| 10125 | vinfos[1].indices[0] = _ij1[0]; |
| 10126 | vinfos[1].indices[1] = _ij1[1]; |
| 10127 | vinfos[1].maxsolutions = _nj1; |
| 10128 | vinfos[2].jointtype = 1; |
| 10129 | vinfos[2].foffset = j2; |
| 10130 | vinfos[2].indices[0] = _ij2[0]; |
| 10131 | vinfos[2].indices[1] = _ij2[1]; |
| 10132 | vinfos[2].maxsolutions = _nj2; |
| 10133 | vinfos[3].jointtype = 1; |
| 10134 | vinfos[3].foffset = j3; |
| 10135 | vinfos[3].indices[0] = _ij3[0]; |
| 10136 | vinfos[3].indices[1] = _ij3[1]; |
| 10137 | vinfos[3].maxsolutions = _nj3; |
| 10138 | vinfos[4].jointtype = 1; |
| 10139 | vinfos[4].foffset = j4; |
| 10140 | vinfos[4].indices[0] = _ij4[0]; |
| 10141 | vinfos[4].indices[1] = _ij4[1]; |
| 10142 | vinfos[4].maxsolutions = _nj4; |
| 10143 | vinfos[5].jointtype = 1; |
| 10144 | vinfos[5].foffset = j5; |
| 10145 | vinfos[5].indices[0] = _ij5[0]; |
| 10146 | vinfos[5].indices[1] = _ij5[1]; |
| 10147 | vinfos[5].maxsolutions = _nj5; |
| 10148 | std::vector<int> vfree(0); |
| 10149 | solutions.AddSolution(vinfos,vfree); |
| 10150 | } |
| 10151 | } |
| 10152 | } |
| 10153 | |
| 10154 | } |
| 10155 | |
| 10156 | } |
| 10157 | |
| 10158 | } |
| 10159 | } while(0); |
| 10160 | if( bgotonextstatement ) |
| 10161 | { |
| 10162 | bool bgotonextstatement = true; |
| 10163 | do |
| 10164 | { |
| 10165 | IkReal x1150=new_r00*new_r00; |
| 10166 | CheckValue<IkReal> x1151=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x1150))),-1); |
| 10167 | if(!x1151.valid){ |
| 10168 | continue; |
| 10169 | } |
| 10170 | if((((-1.0)*x1150*(x1151.value))) < -0.00001) |
| 10171 | continue; |
| 10172 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1150*(x1151.value))))); |
| 10173 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs((cj3+(((-1.0)*gconst13)))))+(IKabs(((1.0)+(IKsign(sj3)))))), 6.28318530717959))); |
| 10174 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 10175 | { |
| 10176 | bgotonextstatement=false; |
| 10177 | { |
| 10178 | IkReal j5eval[2]; |
| 10179 | IkReal x1152=new_r00*new_r00; |
| 10180 | sj4=4.0e-5; |
| 10181 | cj4=1.0; |
| 10182 | j4=4.0e-5; |
| 10183 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 10184 | continue; |
| 10185 | sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))))); |
| 10186 | cj3=gconst13; |
| 10187 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 10188 | continue; |
| 10189 | j3=((-1.0)*(IKacos(gconst13))); |
| 10190 | CheckValue<IkReal> x1153=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x1152))),-1); |
| 10191 | if(!x1153.valid){ |
| 10192 | continue; |
| 10193 | } |
| 10194 | if((((-1.0)*x1152*(x1153.value))) < -0.00001) |
| 10195 | continue; |
| 10196 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1152*(x1153.value))))); |
| 10197 | IkReal x1154=(new_r00*new_r01); |
| 10198 | IkReal x1155=(new_r10*new_r11); |
| 10199 | j5eval[0]=(x1155+x1154); |
| 10200 | j5eval[1]=IKsign(((((25000.0)*x1155))+(((25000.0)*x1154)))); |
| 10201 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 10202 | { |
| 10203 | { |
| 10204 | IkReal j5eval[2]; |
| 10205 | IkReal x1156=new_r00*new_r00; |
| 10206 | sj4=4.0e-5; |
| 10207 | cj4=1.0; |
| 10208 | j4=4.0e-5; |
| 10209 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 10210 | continue; |
| 10211 | sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))))); |
| 10212 | cj3=gconst13; |
| 10213 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 10214 | continue; |
| 10215 | j3=((-1.0)*(IKacos(gconst13))); |
| 10216 | CheckValue<IkReal> x1157=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x1156))),-1); |
| 10217 | if(!x1157.valid){ |
| 10218 | continue; |
| 10219 | } |
| 10220 | if((((-1.0)*x1156*(x1157.value))) < -0.00001) |
| 10221 | continue; |
| 10222 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1156*(x1157.value))))); |
| 10223 | IkReal x1158=(((new_r01*new_r10))+(((-1.0)*new_r00*new_r11))); |
| 10224 | j5eval[0]=x1158; |
| 10225 | j5eval[1]=IKsign(x1158); |
| 10226 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 10227 | { |
| 10228 | { |
| 10229 | IkReal j5eval[1]; |
| 10230 | IkReal x1159=new_r00*new_r00; |
| 10231 | sj4=4.0e-5; |
| 10232 | cj4=1.0; |
| 10233 | j4=4.0e-5; |
| 10234 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 10235 | continue; |
| 10236 | sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))))); |
| 10237 | cj3=gconst13; |
| 10238 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 10239 | continue; |
| 10240 | j3=((-1.0)*(IKacos(gconst13))); |
| 10241 | CheckValue<IkReal> x1160=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x1159))),-1); |
| 10242 | if(!x1160.valid){ |
| 10243 | continue; |
| 10244 | } |
| 10245 | if((((-1.0)*x1159*(x1160.value))) < -0.00001) |
| 10246 | continue; |
| 10247 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1159*(x1160.value))))); |
| 10248 | j5eval[0]=new_r01; |
| 10249 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 10250 | { |
| 10251 | { |
| 10252 | IkReal evalcond[1]; |
| 10253 | bool bgotonextstatement = true; |
| 10254 | do |
| 10255 | { |
| 10256 | evalcond[0]=IKabs(new_r01); |
| 10257 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 10258 | { |
| 10259 | bgotonextstatement=false; |
| 10260 | { |
| 10261 | IkReal j5eval[1]; |
| 10262 | IkReal x1161=new_r00*new_r00; |
| 10263 | sj4=4.0e-5; |
| 10264 | cj4=1.0; |
| 10265 | j4=4.0e-5; |
| 10266 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 10267 | continue; |
| 10268 | sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))))); |
| 10269 | cj3=gconst13; |
| 10270 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 10271 | continue; |
| 10272 | j3=((-1.0)*(IKacos(gconst13))); |
| 10273 | new_r01=0; |
| 10274 | CheckValue<IkReal> x1162=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x1161))),-1); |
| 10275 | if(!x1162.valid){ |
| 10276 | continue; |
| 10277 | } |
| 10278 | if((((-1.0)*x1161*(x1162.value))) < -0.00001) |
| 10279 | continue; |
| 10280 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1161*(x1162.value))))); |
| 10281 | j5eval[0]=new_r11; |
| 10282 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 10283 | { |
| 10284 | { |
| 10285 | IkReal j5eval[2]; |
| 10286 | IkReal x1163=new_r00*new_r00; |
| 10287 | sj4=4.0e-5; |
| 10288 | cj4=1.0; |
| 10289 | j4=4.0e-5; |
| 10290 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 10291 | continue; |
| 10292 | sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))))); |
| 10293 | cj3=gconst13; |
| 10294 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 10295 | continue; |
| 10296 | j3=((-1.0)*(IKacos(gconst13))); |
| 10297 | new_r01=0; |
| 10298 | CheckValue<IkReal> x1164=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x1163))),-1); |
| 10299 | if(!x1164.valid){ |
| 10300 | continue; |
| 10301 | } |
| 10302 | if((((-1.0)*x1163*(x1164.value))) < -0.00001) |
| 10303 | continue; |
| 10304 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1163*(x1164.value))))); |
| 10305 | j5eval[0]=new_r10; |
| 10306 | j5eval[1]=new_r11; |
| 10307 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 10308 | { |
| 10309 | { |
| 10310 | IkReal j5eval[2]; |
| 10311 | IkReal x1165=new_r00*new_r00; |
| 10312 | sj4=4.0e-5; |
| 10313 | cj4=1.0; |
| 10314 | j4=4.0e-5; |
| 10315 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 10316 | continue; |
| 10317 | sj3=((-1.0)*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))))); |
| 10318 | cj3=gconst13; |
| 10319 | if( (gconst13) < -1-IKFAST_SINCOS_THRESH || (gconst13) > 1+IKFAST_SINCOS_THRESH ) |
| 10320 | continue; |
| 10321 | j3=((-1.0)*(IKacos(gconst13))); |
| 10322 | new_r01=0; |
| 10323 | CheckValue<IkReal> x1166=IKPowWithIntegerCheck(((((-1.0000000016)*(new_r10*new_r10)))+(((-1.0)*x1165))),-1); |
| 10324 | if(!x1166.valid){ |
| 10325 | continue; |
| 10326 | } |
| 10327 | if((((-1.0)*x1165*(x1166.value))) < -0.00001) |
| 10328 | continue; |
| 10329 | IkReal gconst13=((-1.0)*(IKsqrt(((-1.0)*x1165*(x1166.value))))); |
| 10330 | j5eval[0]=new_r00; |
| 10331 | j5eval[1]=new_r11; |
| 10332 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 10333 | { |
| 10334 | continue; // 3 cases reached |
| 10335 | |
| 10336 | } else |
| 10337 | { |
| 10338 | { |
| 10339 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 10340 | bool j5valid[1]={false}; |
| 10341 | _nj5 = 1; |
| 10342 | CheckValue<IkReal> x1168=IKPowWithIntegerCheck(new_r11,-1); |
| 10343 | if(!x1168.valid){ |
| 10344 | continue; |
| 10345 | } |
| 10346 | IkReal x1167=x1168.value; |
| 10347 | CheckValue<IkReal> x1169=IKPowWithIntegerCheck(new_r00,-1); |
| 10348 | if(!x1169.valid){ |
| 10349 | continue; |
| 10350 | } |
| 10351 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 10352 | continue; |
| 10353 | if( IKabs((x1167*(x1169.value)*(((((-1.0)*gconst13*new_r10))+((new_r11*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13)))))))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst13*x1167)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x1167*(x1169.value)*(((((-1.0)*gconst13*new_r10))+((new_r11*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))))))))))+IKsqr((gconst13*x1167))-1) <= IKFAST_SINCOS_THRESH ) |
| 10354 | continue; |
| 10355 | j5array[0]=IKatan2((x1167*(x1169.value)*(((((-1.0)*gconst13*new_r10))+((new_r11*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))))))))), (gconst13*x1167)); |
| 10356 | sj5array[0]=IKsin(j5array[0]); |
| 10357 | cj5array[0]=IKcos(j5array[0]); |
| 10358 | if( j5array[0] > IKPI ) |
| 10359 | { |
| 10360 | j5array[0]-=IK2PI; |
| 10361 | } |
| 10362 | else if( j5array[0] < -IKPI ) |
| 10363 | { j5array[0]+=IK2PI; |
| 10364 | } |
| 10365 | j5valid[0] = true; |
| 10366 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 10367 | { |
| 10368 | if( !j5valid[ij5] ) |
| 10369 | { |
| 10370 | continue; |
| 10371 | } |
| 10372 | _ij5[0] = ij5; _ij5[1] = -1; |
| 10373 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 10374 | { |
| 10375 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 10376 | { |
| 10377 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 10378 | } |
| 10379 | } |
| 10380 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 10381 | { |
| 10382 | IkReal evalcond[10]; |
| 10383 | IkReal x1170=IKcos(j5); |
| 10384 | IkReal x1171=IKsin(j5); |
| 10385 | IkReal x1172=((1.0)*gconst13); |
| 10386 | IkReal x1173=((1.0000000008)*gconst13); |
| 10387 | IkReal x1174=(new_r11*x1171); |
| 10388 | IkReal x1175=(new_r00*x1170); |
| 10389 | IkReal x1176=(new_r10*x1171); |
| 10390 | if((((1.0)+(((-1.0)*gconst13*x1172)))) < -0.00001) |
| 10391 | continue; |
| 10392 | IkReal x1177=IKsqrt(((1.0)+(((-1.0)*gconst13*x1172)))); |
| 10393 | IkReal x1178=(x1171*x1177); |
| 10394 | IkReal x1179=(x1170*x1177); |
| 10395 | evalcond[0]=(((new_r11*x1170))+(((-1.0)*x1172))); |
| 10396 | evalcond[1]=(x1175+(((-1.0)*x1173))+(((-1.0)*x1176))); |
| 10397 | evalcond[2]=(x1177+(((-1.0000000008)*x1174))); |
| 10398 | evalcond[3]=((((1.0000000008)*x1177))+(((-1.0)*x1174))); |
| 10399 | evalcond[4]=(((new_r10*x1170))+((new_r00*x1171))+(((-1.0)*x1177))); |
| 10400 | evalcond[5]=((((1.0000000008)*x1175))+(((-1.0000000008)*x1176))+(((-1.0)*x1172))); |
| 10401 | evalcond[6]=((((1.0000000008)*x1179))+(((-1.0)*x1171*x1172))); |
| 10402 | evalcond[7]=((((-1.0)*x1170*x1173))+new_r00+(((-1.0)*x1178))); |
| 10403 | evalcond[8]=(new_r10+((x1171*x1173))+(((-1.0)*x1179))); |
| 10404 | evalcond[9]=((((-1.0000000008)*x1178))+(((-1.0)*x1170*x1172))+new_r11); |
| 10405 | if( 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 ) |
| 10406 | { |
| 10407 | continue; |
| 10408 | } |
| 10409 | } |
| 10410 | |
| 10411 | { |
| 10412 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 10413 | vinfos[0].jointtype = 1; |
| 10414 | vinfos[0].foffset = j0; |
| 10415 | vinfos[0].indices[0] = _ij0[0]; |
| 10416 | vinfos[0].indices[1] = _ij0[1]; |
| 10417 | vinfos[0].maxsolutions = _nj0; |
| 10418 | vinfos[1].jointtype = 1; |
| 10419 | vinfos[1].foffset = j1; |
| 10420 | vinfos[1].indices[0] = _ij1[0]; |
| 10421 | vinfos[1].indices[1] = _ij1[1]; |
| 10422 | vinfos[1].maxsolutions = _nj1; |
| 10423 | vinfos[2].jointtype = 1; |
| 10424 | vinfos[2].foffset = j2; |
| 10425 | vinfos[2].indices[0] = _ij2[0]; |
| 10426 | vinfos[2].indices[1] = _ij2[1]; |
| 10427 | vinfos[2].maxsolutions = _nj2; |
| 10428 | vinfos[3].jointtype = 1; |
| 10429 | vinfos[3].foffset = j3; |
| 10430 | vinfos[3].indices[0] = _ij3[0]; |
| 10431 | vinfos[3].indices[1] = _ij3[1]; |
| 10432 | vinfos[3].maxsolutions = _nj3; |
| 10433 | vinfos[4].jointtype = 1; |
| 10434 | vinfos[4].foffset = j4; |
| 10435 | vinfos[4].indices[0] = _ij4[0]; |
| 10436 | vinfos[4].indices[1] = _ij4[1]; |
| 10437 | vinfos[4].maxsolutions = _nj4; |
| 10438 | vinfos[5].jointtype = 1; |
| 10439 | vinfos[5].foffset = j5; |
| 10440 | vinfos[5].indices[0] = _ij5[0]; |
| 10441 | vinfos[5].indices[1] = _ij5[1]; |
| 10442 | vinfos[5].maxsolutions = _nj5; |
| 10443 | std::vector<int> vfree(0); |
| 10444 | solutions.AddSolution(vinfos,vfree); |
| 10445 | } |
| 10446 | } |
| 10447 | } |
| 10448 | |
| 10449 | } |
| 10450 | |
| 10451 | } |
| 10452 | |
| 10453 | } else |
| 10454 | { |
| 10455 | { |
| 10456 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 10457 | bool j5valid[1]={false}; |
| 10458 | _nj5 = 1; |
| 10459 | CheckValue<IkReal> x1181=IKPowWithIntegerCheck(new_r11,-1); |
| 10460 | if(!x1181.valid){ |
| 10461 | continue; |
| 10462 | } |
| 10463 | IkReal x1180=x1181.value; |
| 10464 | CheckValue<IkReal> x1182=IKPowWithIntegerCheck(new_r10,-1); |
| 10465 | if(!x1182.valid){ |
| 10466 | continue; |
| 10467 | } |
| 10468 | if( IKabs(((4.0e-5)*x1180*(x1182.value)*(((((25000.0)*gconst13*new_r00))+(((-25000.00002)*gconst13*new_r11)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst13*x1180)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((4.0e-5)*x1180*(x1182.value)*(((((25000.0)*gconst13*new_r00))+(((-25000.00002)*gconst13*new_r11))))))+IKsqr((gconst13*x1180))-1) <= IKFAST_SINCOS_THRESH ) |
| 10469 | continue; |
| 10470 | j5array[0]=IKatan2(((4.0e-5)*x1180*(x1182.value)*(((((25000.0)*gconst13*new_r00))+(((-25000.00002)*gconst13*new_r11))))), (gconst13*x1180)); |
| 10471 | sj5array[0]=IKsin(j5array[0]); |
| 10472 | cj5array[0]=IKcos(j5array[0]); |
| 10473 | if( j5array[0] > IKPI ) |
| 10474 | { |
| 10475 | j5array[0]-=IK2PI; |
| 10476 | } |
| 10477 | else if( j5array[0] < -IKPI ) |
| 10478 | { j5array[0]+=IK2PI; |
| 10479 | } |
| 10480 | j5valid[0] = true; |
| 10481 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 10482 | { |
| 10483 | if( !j5valid[ij5] ) |
| 10484 | { |
| 10485 | continue; |
| 10486 | } |
| 10487 | _ij5[0] = ij5; _ij5[1] = -1; |
| 10488 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 10489 | { |
| 10490 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 10491 | { |
| 10492 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 10493 | } |
| 10494 | } |
| 10495 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 10496 | { |
| 10497 | IkReal evalcond[10]; |
| 10498 | IkReal x1183=IKcos(j5); |
| 10499 | IkReal x1184=IKsin(j5); |
| 10500 | IkReal x1185=((1.0)*gconst13); |
| 10501 | IkReal x1186=((1.0000000008)*gconst13); |
| 10502 | IkReal x1187=(new_r11*x1184); |
| 10503 | IkReal x1188=(new_r00*x1183); |
| 10504 | IkReal x1189=(new_r10*x1184); |
| 10505 | if((((1.0)+(((-1.0)*gconst13*x1185)))) < -0.00001) |
| 10506 | continue; |
| 10507 | IkReal x1190=IKsqrt(((1.0)+(((-1.0)*gconst13*x1185)))); |
| 10508 | IkReal x1191=(x1184*x1190); |
| 10509 | IkReal x1192=(x1183*x1190); |
| 10510 | evalcond[0]=((((-1.0)*x1185))+((new_r11*x1183))); |
| 10511 | evalcond[1]=(x1188+(((-1.0)*x1186))+(((-1.0)*x1189))); |
| 10512 | evalcond[2]=(x1190+(((-1.0000000008)*x1187))); |
| 10513 | evalcond[3]=((((1.0000000008)*x1190))+(((-1.0)*x1187))); |
| 10514 | evalcond[4]=(((new_r10*x1183))+((new_r00*x1184))+(((-1.0)*x1190))); |
| 10515 | evalcond[5]=((((1.0000000008)*x1188))+(((-1.0)*x1185))+(((-1.0000000008)*x1189))); |
| 10516 | evalcond[6]=((((1.0000000008)*x1192))+(((-1.0)*x1184*x1185))); |
| 10517 | evalcond[7]=((((-1.0)*x1183*x1186))+new_r00+(((-1.0)*x1191))); |
| 10518 | evalcond[8]=(((x1184*x1186))+new_r10+(((-1.0)*x1192))); |
| 10519 | evalcond[9]=((((-1.0000000008)*x1191))+(((-1.0)*x1183*x1185))+new_r11); |
| 10520 | if( 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 ) |
| 10521 | { |
| 10522 | continue; |
| 10523 | } |
| 10524 | } |
| 10525 | |
| 10526 | { |
| 10527 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 10528 | vinfos[0].jointtype = 1; |
| 10529 | vinfos[0].foffset = j0; |
| 10530 | vinfos[0].indices[0] = _ij0[0]; |
| 10531 | vinfos[0].indices[1] = _ij0[1]; |
| 10532 | vinfos[0].maxsolutions = _nj0; |
| 10533 | vinfos[1].jointtype = 1; |
| 10534 | vinfos[1].foffset = j1; |
| 10535 | vinfos[1].indices[0] = _ij1[0]; |
| 10536 | vinfos[1].indices[1] = _ij1[1]; |
| 10537 | vinfos[1].maxsolutions = _nj1; |
| 10538 | vinfos[2].jointtype = 1; |
| 10539 | vinfos[2].foffset = j2; |
| 10540 | vinfos[2].indices[0] = _ij2[0]; |
| 10541 | vinfos[2].indices[1] = _ij2[1]; |
| 10542 | vinfos[2].maxsolutions = _nj2; |
| 10543 | vinfos[3].jointtype = 1; |
| 10544 | vinfos[3].foffset = j3; |
| 10545 | vinfos[3].indices[0] = _ij3[0]; |
| 10546 | vinfos[3].indices[1] = _ij3[1]; |
| 10547 | vinfos[3].maxsolutions = _nj3; |
| 10548 | vinfos[4].jointtype = 1; |
| 10549 | vinfos[4].foffset = j4; |
| 10550 | vinfos[4].indices[0] = _ij4[0]; |
| 10551 | vinfos[4].indices[1] = _ij4[1]; |
| 10552 | vinfos[4].maxsolutions = _nj4; |
| 10553 | vinfos[5].jointtype = 1; |
| 10554 | vinfos[5].foffset = j5; |
| 10555 | vinfos[5].indices[0] = _ij5[0]; |
| 10556 | vinfos[5].indices[1] = _ij5[1]; |
| 10557 | vinfos[5].maxsolutions = _nj5; |
| 10558 | std::vector<int> vfree(0); |
| 10559 | solutions.AddSolution(vinfos,vfree); |
| 10560 | } |
| 10561 | } |
| 10562 | } |
| 10563 | |
| 10564 | } |
| 10565 | |
| 10566 | } |
| 10567 | |
| 10568 | } else |
| 10569 | { |
| 10570 | { |
| 10571 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 10572 | bool j5valid[1]={false}; |
| 10573 | _nj5 = 1; |
| 10574 | CheckValue<IkReal> x1194=IKPowWithIntegerCheck(new_r11,-1); |
| 10575 | if(!x1194.valid){ |
| 10576 | continue; |
| 10577 | } |
| 10578 | IkReal x1193=x1194.value; |
| 10579 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 10580 | continue; |
| 10581 | if( IKabs(((0.9999999992)*x1193*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13)))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((gconst13*x1193)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*x1193*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))))))+IKsqr((gconst13*x1193))-1) <= IKFAST_SINCOS_THRESH ) |
| 10582 | continue; |
| 10583 | j5array[0]=IKatan2(((0.9999999992)*x1193*(IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))))), (gconst13*x1193)); |
| 10584 | sj5array[0]=IKsin(j5array[0]); |
| 10585 | cj5array[0]=IKcos(j5array[0]); |
| 10586 | if( j5array[0] > IKPI ) |
| 10587 | { |
| 10588 | j5array[0]-=IK2PI; |
| 10589 | } |
| 10590 | else if( j5array[0] < -IKPI ) |
| 10591 | { j5array[0]+=IK2PI; |
| 10592 | } |
| 10593 | j5valid[0] = true; |
| 10594 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 10595 | { |
| 10596 | if( !j5valid[ij5] ) |
| 10597 | { |
| 10598 | continue; |
| 10599 | } |
| 10600 | _ij5[0] = ij5; _ij5[1] = -1; |
| 10601 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 10602 | { |
| 10603 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 10604 | { |
| 10605 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 10606 | } |
| 10607 | } |
| 10608 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 10609 | { |
| 10610 | IkReal evalcond[10]; |
| 10611 | IkReal x1195=IKcos(j5); |
| 10612 | IkReal x1196=IKsin(j5); |
| 10613 | IkReal x1197=((1.0)*gconst13); |
| 10614 | IkReal x1198=((1.0000000008)*gconst13); |
| 10615 | IkReal x1199=(new_r11*x1196); |
| 10616 | IkReal x1200=(new_r00*x1195); |
| 10617 | IkReal x1201=(new_r10*x1196); |
| 10618 | if((((1.0)+(((-1.0)*gconst13*x1197)))) < -0.00001) |
| 10619 | continue; |
| 10620 | IkReal x1202=IKsqrt(((1.0)+(((-1.0)*gconst13*x1197)))); |
| 10621 | IkReal x1203=(x1196*x1202); |
| 10622 | IkReal x1204=(x1195*x1202); |
| 10623 | evalcond[0]=((((-1.0)*x1197))+((new_r11*x1195))); |
| 10624 | evalcond[1]=(x1200+(((-1.0)*x1198))+(((-1.0)*x1201))); |
| 10625 | evalcond[2]=(x1202+(((-1.0000000008)*x1199))); |
| 10626 | evalcond[3]=((((1.0000000008)*x1202))+(((-1.0)*x1199))); |
| 10627 | evalcond[4]=((((-1.0)*x1202))+((new_r00*x1196))+((new_r10*x1195))); |
| 10628 | evalcond[5]=((((-1.0)*x1197))+(((1.0000000008)*x1200))+(((-1.0000000008)*x1201))); |
| 10629 | evalcond[6]=((((1.0000000008)*x1204))+(((-1.0)*x1196*x1197))); |
| 10630 | evalcond[7]=((((-1.0)*x1195*x1198))+(((-1.0)*x1203))+new_r00); |
| 10631 | evalcond[8]=(((x1196*x1198))+(((-1.0)*x1204))+new_r10); |
| 10632 | evalcond[9]=((((-1.0)*x1195*x1197))+(((-1.0000000008)*x1203))+new_r11); |
| 10633 | if( 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 ) |
| 10634 | { |
| 10635 | continue; |
| 10636 | } |
| 10637 | } |
| 10638 | |
| 10639 | { |
| 10640 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 10641 | vinfos[0].jointtype = 1; |
| 10642 | vinfos[0].foffset = j0; |
| 10643 | vinfos[0].indices[0] = _ij0[0]; |
| 10644 | vinfos[0].indices[1] = _ij0[1]; |
| 10645 | vinfos[0].maxsolutions = _nj0; |
| 10646 | vinfos[1].jointtype = 1; |
| 10647 | vinfos[1].foffset = j1; |
| 10648 | vinfos[1].indices[0] = _ij1[0]; |
| 10649 | vinfos[1].indices[1] = _ij1[1]; |
| 10650 | vinfos[1].maxsolutions = _nj1; |
| 10651 | vinfos[2].jointtype = 1; |
| 10652 | vinfos[2].foffset = j2; |
| 10653 | vinfos[2].indices[0] = _ij2[0]; |
| 10654 | vinfos[2].indices[1] = _ij2[1]; |
| 10655 | vinfos[2].maxsolutions = _nj2; |
| 10656 | vinfos[3].jointtype = 1; |
| 10657 | vinfos[3].foffset = j3; |
| 10658 | vinfos[3].indices[0] = _ij3[0]; |
| 10659 | vinfos[3].indices[1] = _ij3[1]; |
| 10660 | vinfos[3].maxsolutions = _nj3; |
| 10661 | vinfos[4].jointtype = 1; |
| 10662 | vinfos[4].foffset = j4; |
| 10663 | vinfos[4].indices[0] = _ij4[0]; |
| 10664 | vinfos[4].indices[1] = _ij4[1]; |
| 10665 | vinfos[4].maxsolutions = _nj4; |
| 10666 | vinfos[5].jointtype = 1; |
| 10667 | vinfos[5].foffset = j5; |
| 10668 | vinfos[5].indices[0] = _ij5[0]; |
| 10669 | vinfos[5].indices[1] = _ij5[1]; |
| 10670 | vinfos[5].maxsolutions = _nj5; |
| 10671 | std::vector<int> vfree(0); |
| 10672 | solutions.AddSolution(vinfos,vfree); |
| 10673 | } |
| 10674 | } |
| 10675 | } |
| 10676 | |
| 10677 | } |
| 10678 | |
| 10679 | } |
| 10680 | |
| 10681 | } |
| 10682 | } while(0); |
| 10683 | if( bgotonextstatement ) |
| 10684 | { |
| 10685 | bool bgotonextstatement = true; |
| 10686 | do |
| 10687 | { |
| 10688 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r00))); |
| 10689 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 10690 | { |
| 10691 | bgotonextstatement=false; |
| 10692 | { |
| 10693 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 10694 | bool j5valid[2]={false}; |
| 10695 | _nj5 = 2; |
| 10696 | cj5array[0]=new_r10; |
| 10697 | if( cj5array[0] >= -1-IKFAST_SINCOS_THRESH && cj5array[0] <= 1+IKFAST_SINCOS_THRESH ) |
| 10698 | { |
| 10699 | j5valid[0] = j5valid[1] = true; |
| 10700 | j5array[0] = IKacos(cj5array[0]); |
| 10701 | sj5array[0] = IKsin(j5array[0]); |
| 10702 | cj5array[1] = cj5array[0]; |
| 10703 | j5array[1] = -j5array[0]; |
| 10704 | sj5array[1] = -sj5array[0]; |
| 10705 | } |
| 10706 | else if( isnan(cj5array[0]) ) |
| 10707 | { |
| 10708 | // probably any value will work |
| 10709 | j5valid[0] = true; |
| 10710 | cj5array[0] = 1; sj5array[0] = 0; j5array[0] = 0; |
| 10711 | } |
| 10712 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 10713 | { |
| 10714 | if( !j5valid[ij5] ) |
| 10715 | { |
| 10716 | continue; |
| 10717 | } |
| 10718 | _ij5[0] = ij5; _ij5[1] = -1; |
| 10719 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 10720 | { |
| 10721 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 10722 | { |
| 10723 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 10724 | } |
| 10725 | } |
| 10726 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 10727 | { |
| 10728 | IkReal evalcond[9]; |
| 10729 | IkReal x1205=IKsin(j5); |
| 10730 | IkReal x1206=IKcos(j5); |
| 10731 | IkReal x1207=((1.0000000008)*x1206); |
| 10732 | IkReal x1208=((-1.0000000008)*x1205); |
| 10733 | IkReal x1209=((-1.0)*x1205); |
| 10734 | evalcond[0]=(new_r01*x1205); |
| 10735 | evalcond[1]=x1209; |
| 10736 | evalcond[2]=(new_r10*x1209); |
| 10737 | evalcond[3]=((-1.0)+((new_r10*x1206))); |
| 10738 | evalcond[4]=x1208; |
| 10739 | evalcond[5]=(new_r10*x1208); |
| 10740 | evalcond[6]=(x1207+new_r01); |
| 10741 | evalcond[7]=((1.0000000008)+((new_r01*x1206))); |
| 10742 | evalcond[8]=((1.0)+((new_r01*x1207))); |
| 10743 | if( 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 ) |
| 10744 | { |
| 10745 | continue; |
| 10746 | } |
| 10747 | } |
| 10748 | |
| 10749 | { |
| 10750 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 10751 | vinfos[0].jointtype = 1; |
| 10752 | vinfos[0].foffset = j0; |
| 10753 | vinfos[0].indices[0] = _ij0[0]; |
| 10754 | vinfos[0].indices[1] = _ij0[1]; |
| 10755 | vinfos[0].maxsolutions = _nj0; |
| 10756 | vinfos[1].jointtype = 1; |
| 10757 | vinfos[1].foffset = j1; |
| 10758 | vinfos[1].indices[0] = _ij1[0]; |
| 10759 | vinfos[1].indices[1] = _ij1[1]; |
| 10760 | vinfos[1].maxsolutions = _nj1; |
| 10761 | vinfos[2].jointtype = 1; |
| 10762 | vinfos[2].foffset = j2; |
| 10763 | vinfos[2].indices[0] = _ij2[0]; |
| 10764 | vinfos[2].indices[1] = _ij2[1]; |
| 10765 | vinfos[2].maxsolutions = _nj2; |
| 10766 | vinfos[3].jointtype = 1; |
| 10767 | vinfos[3].foffset = j3; |
| 10768 | vinfos[3].indices[0] = _ij3[0]; |
| 10769 | vinfos[3].indices[1] = _ij3[1]; |
| 10770 | vinfos[3].maxsolutions = _nj3; |
| 10771 | vinfos[4].jointtype = 1; |
| 10772 | vinfos[4].foffset = j4; |
| 10773 | vinfos[4].indices[0] = _ij4[0]; |
| 10774 | vinfos[4].indices[1] = _ij4[1]; |
| 10775 | vinfos[4].maxsolutions = _nj4; |
| 10776 | vinfos[5].jointtype = 1; |
| 10777 | vinfos[5].foffset = j5; |
| 10778 | vinfos[5].indices[0] = _ij5[0]; |
| 10779 | vinfos[5].indices[1] = _ij5[1]; |
| 10780 | vinfos[5].maxsolutions = _nj5; |
| 10781 | std::vector<int> vfree(0); |
| 10782 | solutions.AddSolution(vinfos,vfree); |
| 10783 | } |
| 10784 | } |
| 10785 | } |
| 10786 | |
| 10787 | } |
| 10788 | } while(0); |
| 10789 | if( bgotonextstatement ) |
| 10790 | { |
| 10791 | bool bgotonextstatement = true; |
| 10792 | do |
| 10793 | { |
| 10794 | evalcond[0]=((IKabs(new_r10))+(IKabs(new_r00))); |
| 10795 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 10796 | { |
| 10797 | bgotonextstatement=false; |
| 10798 | { |
| 10799 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 10800 | bool j5valid[1]={false}; |
| 10801 | _nj5 = 1; |
| 10802 | if( IKabs(((0.9999999992)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.9999999992)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*new_r11))+IKsqr(((-0.9999999992)*new_r01))-1) <= IKFAST_SINCOS_THRESH ) |
| 10803 | continue; |
| 10804 | j5array[0]=IKatan2(((0.9999999992)*new_r11), ((-0.9999999992)*new_r01)); |
| 10805 | sj5array[0]=IKsin(j5array[0]); |
| 10806 | cj5array[0]=IKcos(j5array[0]); |
| 10807 | if( j5array[0] > IKPI ) |
| 10808 | { |
| 10809 | j5array[0]-=IK2PI; |
| 10810 | } |
| 10811 | else if( j5array[0] < -IKPI ) |
| 10812 | { j5array[0]+=IK2PI; |
| 10813 | } |
| 10814 | j5valid[0] = true; |
| 10815 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 10816 | { |
| 10817 | if( !j5valid[ij5] ) |
| 10818 | { |
| 10819 | continue; |
| 10820 | } |
| 10821 | _ij5[0] = ij5; _ij5[1] = -1; |
| 10822 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 10823 | { |
| 10824 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 10825 | { |
| 10826 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 10827 | } |
| 10828 | } |
| 10829 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 10830 | { |
| 10831 | IkReal evalcond[7]; |
| 10832 | IkReal x1210=IKcos(j5); |
| 10833 | IkReal x1211=IKsin(j5); |
| 10834 | IkReal x1212=((1.0000000008)*x1211); |
| 10835 | IkReal x1213=((1.0000000008)*x1210); |
| 10836 | evalcond[0]=((-1.0)*x1211); |
| 10837 | evalcond[1]=((-1.0)*x1210); |
| 10838 | evalcond[2]=(x1213+new_r01); |
| 10839 | evalcond[3]=(new_r11+(((-1.0)*x1212))); |
| 10840 | evalcond[4]=(((new_r11*x1210))+((new_r01*x1211))); |
| 10841 | evalcond[5]=((1.0000000008)+((new_r01*x1210))+(((-1.0)*new_r11*x1211))); |
| 10842 | evalcond[6]=((1.0)+((new_r01*x1213))+(((-1.0)*new_r11*x1212))); |
| 10843 | if( 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 ) |
| 10844 | { |
| 10845 | continue; |
| 10846 | } |
| 10847 | } |
| 10848 | |
| 10849 | { |
| 10850 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 10851 | vinfos[0].jointtype = 1; |
| 10852 | vinfos[0].foffset = j0; |
| 10853 | vinfos[0].indices[0] = _ij0[0]; |
| 10854 | vinfos[0].indices[1] = _ij0[1]; |
| 10855 | vinfos[0].maxsolutions = _nj0; |
| 10856 | vinfos[1].jointtype = 1; |
| 10857 | vinfos[1].foffset = j1; |
| 10858 | vinfos[1].indices[0] = _ij1[0]; |
| 10859 | vinfos[1].indices[1] = _ij1[1]; |
| 10860 | vinfos[1].maxsolutions = _nj1; |
| 10861 | vinfos[2].jointtype = 1; |
| 10862 | vinfos[2].foffset = j2; |
| 10863 | vinfos[2].indices[0] = _ij2[0]; |
| 10864 | vinfos[2].indices[1] = _ij2[1]; |
| 10865 | vinfos[2].maxsolutions = _nj2; |
| 10866 | vinfos[3].jointtype = 1; |
| 10867 | vinfos[3].foffset = j3; |
| 10868 | vinfos[3].indices[0] = _ij3[0]; |
| 10869 | vinfos[3].indices[1] = _ij3[1]; |
| 10870 | vinfos[3].maxsolutions = _nj3; |
| 10871 | vinfos[4].jointtype = 1; |
| 10872 | vinfos[4].foffset = j4; |
| 10873 | vinfos[4].indices[0] = _ij4[0]; |
| 10874 | vinfos[4].indices[1] = _ij4[1]; |
| 10875 | vinfos[4].maxsolutions = _nj4; |
| 10876 | vinfos[5].jointtype = 1; |
| 10877 | vinfos[5].foffset = j5; |
| 10878 | vinfos[5].indices[0] = _ij5[0]; |
| 10879 | vinfos[5].indices[1] = _ij5[1]; |
| 10880 | vinfos[5].maxsolutions = _nj5; |
| 10881 | std::vector<int> vfree(0); |
| 10882 | solutions.AddSolution(vinfos,vfree); |
| 10883 | } |
| 10884 | } |
| 10885 | } |
| 10886 | |
| 10887 | } |
| 10888 | } while(0); |
| 10889 | if( bgotonextstatement ) |
| 10890 | { |
| 10891 | bool bgotonextstatement = true; |
| 10892 | do |
| 10893 | { |
| 10894 | if( 1 ) |
| 10895 | { |
| 10896 | bgotonextstatement=false; |
| 10897 | continue; // branch miss [j5] |
| 10898 | |
| 10899 | } |
| 10900 | } while(0); |
| 10901 | if( bgotonextstatement ) |
| 10902 | { |
| 10903 | } |
| 10904 | } |
| 10905 | } |
| 10906 | } |
| 10907 | } |
| 10908 | |
| 10909 | } else |
| 10910 | { |
| 10911 | { |
| 10912 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 10913 | bool j5valid[1]={false}; |
| 10914 | _nj5 = 1; |
| 10915 | CheckValue<IkReal> x1221=IKPowWithIntegerCheck(new_r01,-1); |
| 10916 | if(!x1221.valid){ |
| 10917 | continue; |
| 10918 | } |
| 10919 | IkReal x1214=x1221.value; |
| 10920 | IkReal x1215=((25000.0)*new_r00); |
| 10921 | IkReal x1216=(gconst13*x1214); |
| 10922 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 10923 | continue; |
| 10924 | IkReal x1217=IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))); |
| 10925 | IkReal x1218=((25000.0)*new_r11*x1217); |
| 10926 | CheckValue<IkReal> x1222=IKPowWithIntegerCheck(((((25000.00002)*gconst13*new_r01))+(((-1.0)*x1218))),-1); |
| 10927 | if(!x1222.valid){ |
| 10928 | continue; |
| 10929 | } |
| 10930 | IkReal x1219=x1222.value; |
| 10931 | IkReal x1220=(new_r11*x1219); |
| 10932 | CheckValue<IkReal> x1223=IKPowWithIntegerCheck(((((25000.00002)*gconst13*new_r01))+(((-25000.0)*new_r11*x1217))),-1); |
| 10933 | if(!x1223.valid){ |
| 10934 | continue; |
| 10935 | } |
| 10936 | if( IKabs((x1216+(((-1.0)*x1215*x1220))+((x1216*x1218*(x1223.value))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x1219*((((new_r01*x1215))+(((-25000.0)*gconst13*x1217)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((x1216+(((-1.0)*x1215*x1220))+((x1216*x1218*(x1223.value)))))+IKsqr((x1219*((((new_r01*x1215))+(((-25000.0)*gconst13*x1217))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 10937 | continue; |
| 10938 | j5array[0]=IKatan2((x1216+(((-1.0)*x1215*x1220))+((x1216*x1218*(x1223.value)))), (x1219*((((new_r01*x1215))+(((-25000.0)*gconst13*x1217)))))); |
| 10939 | sj5array[0]=IKsin(j5array[0]); |
| 10940 | cj5array[0]=IKcos(j5array[0]); |
| 10941 | if( j5array[0] > IKPI ) |
| 10942 | { |
| 10943 | j5array[0]-=IK2PI; |
| 10944 | } |
| 10945 | else if( j5array[0] < -IKPI ) |
| 10946 | { j5array[0]+=IK2PI; |
| 10947 | } |
| 10948 | j5valid[0] = true; |
| 10949 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 10950 | { |
| 10951 | if( !j5valid[ij5] ) |
| 10952 | { |
| 10953 | continue; |
| 10954 | } |
| 10955 | _ij5[0] = ij5; _ij5[1] = -1; |
| 10956 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 10957 | { |
| 10958 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 10959 | { |
| 10960 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 10961 | } |
| 10962 | } |
| 10963 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 10964 | { |
| 10965 | IkReal evalcond[10]; |
| 10966 | IkReal x1224=IKcos(j5); |
| 10967 | IkReal x1225=IKsin(j5); |
| 10968 | IkReal x1226=((1.0)*gconst13); |
| 10969 | IkReal x1227=((1.0000000008)*gconst13); |
| 10970 | IkReal x1228=(new_r11*x1225); |
| 10971 | IkReal x1229=(new_r01*x1224); |
| 10972 | IkReal x1230=(new_r00*x1224); |
| 10973 | IkReal x1231=(new_r10*x1225); |
| 10974 | IkReal x1232=x1217; |
| 10975 | IkReal x1233=(x1225*x1232); |
| 10976 | IkReal x1234=(x1224*x1232); |
| 10977 | evalcond[0]=((((-1.0)*x1226))+((new_r11*x1224))+((new_r01*x1225))); |
| 10978 | evalcond[1]=((((-1.0)*x1231))+x1230+(((-1.0)*x1227))); |
| 10979 | evalcond[2]=((((-1.0)*x1232))+((new_r00*x1225))+((new_r10*x1224))); |
| 10980 | evalcond[3]=((((-1.0)*x1226))+(((-1.0000000008)*x1231))+(((1.0000000008)*x1230))); |
| 10981 | evalcond[4]=((((-1.0)*x1233))+(((-1.0)*x1224*x1227))+new_r00); |
| 10982 | evalcond[5]=((((-1.0)*x1234))+((x1225*x1227))+new_r10); |
| 10983 | evalcond[6]=((((-1.0)*x1225*x1226))+new_r01+(((1.0000000008)*x1234))); |
| 10984 | evalcond[7]=((((-1.0)*x1224*x1226))+(((-1.0000000008)*x1233))+new_r11); |
| 10985 | evalcond[8]=(x1229+(((-1.0)*x1228))+(((1.0000000008)*x1232))); |
| 10986 | evalcond[9]=(x1232+(((-1.0000000008)*x1228))+(((1.0000000008)*x1229))); |
| 10987 | if( 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 ) |
| 10988 | { |
| 10989 | continue; |
| 10990 | } |
| 10991 | } |
| 10992 | |
| 10993 | { |
| 10994 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 10995 | vinfos[0].jointtype = 1; |
| 10996 | vinfos[0].foffset = j0; |
| 10997 | vinfos[0].indices[0] = _ij0[0]; |
| 10998 | vinfos[0].indices[1] = _ij0[1]; |
| 10999 | vinfos[0].maxsolutions = _nj0; |
| 11000 | vinfos[1].jointtype = 1; |
| 11001 | vinfos[1].foffset = j1; |
| 11002 | vinfos[1].indices[0] = _ij1[0]; |
| 11003 | vinfos[1].indices[1] = _ij1[1]; |
| 11004 | vinfos[1].maxsolutions = _nj1; |
| 11005 | vinfos[2].jointtype = 1; |
| 11006 | vinfos[2].foffset = j2; |
| 11007 | vinfos[2].indices[0] = _ij2[0]; |
| 11008 | vinfos[2].indices[1] = _ij2[1]; |
| 11009 | vinfos[2].maxsolutions = _nj2; |
| 11010 | vinfos[3].jointtype = 1; |
| 11011 | vinfos[3].foffset = j3; |
| 11012 | vinfos[3].indices[0] = _ij3[0]; |
| 11013 | vinfos[3].indices[1] = _ij3[1]; |
| 11014 | vinfos[3].maxsolutions = _nj3; |
| 11015 | vinfos[4].jointtype = 1; |
| 11016 | vinfos[4].foffset = j4; |
| 11017 | vinfos[4].indices[0] = _ij4[0]; |
| 11018 | vinfos[4].indices[1] = _ij4[1]; |
| 11019 | vinfos[4].maxsolutions = _nj4; |
| 11020 | vinfos[5].jointtype = 1; |
| 11021 | vinfos[5].foffset = j5; |
| 11022 | vinfos[5].indices[0] = _ij5[0]; |
| 11023 | vinfos[5].indices[1] = _ij5[1]; |
| 11024 | vinfos[5].maxsolutions = _nj5; |
| 11025 | std::vector<int> vfree(0); |
| 11026 | solutions.AddSolution(vinfos,vfree); |
| 11027 | } |
| 11028 | } |
| 11029 | } |
| 11030 | |
| 11031 | } |
| 11032 | |
| 11033 | } |
| 11034 | |
| 11035 | } else |
| 11036 | { |
| 11037 | { |
| 11038 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 11039 | bool j5valid[1]={false}; |
| 11040 | _nj5 = 1; |
| 11041 | IkReal x1235=((1.0)*new_r11); |
| 11042 | if((((1.0)+(((-1.0)*(gconst13*gconst13))))) < -0.00001) |
| 11043 | continue; |
| 11044 | IkReal x1236=IKsqrt(((1.0)+(((-1.0)*(gconst13*gconst13))))); |
| 11045 | CheckValue<IkReal> x1237 = IKatan2WithCheck(IkReal(((((-1.0)*x1235*x1236))+((gconst13*new_r10)))),IkReal(((((-1.0)*gconst13*new_r00))+((new_r01*x1236)))),IKFAST_ATAN2_MAGTHRESH); |
| 11046 | if(!x1237.valid){ |
| 11047 | continue; |
| 11048 | } |
| 11049 | CheckValue<IkReal> x1238=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r00*x1235))+((new_r01*new_r10)))),-1); |
| 11050 | if(!x1238.valid){ |
| 11051 | continue; |
| 11052 | } |
| 11053 | j5array[0]=((-1.5707963267949)+(x1237.value)+(((1.5707963267949)*(x1238.value)))); |
| 11054 | sj5array[0]=IKsin(j5array[0]); |
| 11055 | cj5array[0]=IKcos(j5array[0]); |
| 11056 | if( j5array[0] > IKPI ) |
| 11057 | { |
| 11058 | j5array[0]-=IK2PI; |
| 11059 | } |
| 11060 | else if( j5array[0] < -IKPI ) |
| 11061 | { j5array[0]+=IK2PI; |
| 11062 | } |
| 11063 | j5valid[0] = true; |
| 11064 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 11065 | { |
| 11066 | if( !j5valid[ij5] ) |
| 11067 | { |
| 11068 | continue; |
| 11069 | } |
| 11070 | _ij5[0] = ij5; _ij5[1] = -1; |
| 11071 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 11072 | { |
| 11073 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 11074 | { |
| 11075 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 11076 | } |
| 11077 | } |
| 11078 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 11079 | { |
| 11080 | IkReal evalcond[10]; |
| 11081 | IkReal x1239=IKcos(j5); |
| 11082 | IkReal x1240=IKsin(j5); |
| 11083 | IkReal x1241=((1.0)*gconst13); |
| 11084 | IkReal x1242=((1.0000000008)*gconst13); |
| 11085 | IkReal x1243=(new_r11*x1240); |
| 11086 | IkReal x1244=(new_r01*x1239); |
| 11087 | IkReal x1245=(new_r00*x1239); |
| 11088 | IkReal x1246=(new_r10*x1240); |
| 11089 | IkReal x1247=x1236; |
| 11090 | IkReal x1248=(x1240*x1247); |
| 11091 | IkReal x1249=(x1239*x1247); |
| 11092 | evalcond[0]=((((-1.0)*x1241))+((new_r11*x1239))+((new_r01*x1240))); |
| 11093 | evalcond[1]=(x1245+(((-1.0)*x1246))+(((-1.0)*x1242))); |
| 11094 | evalcond[2]=((((-1.0)*x1247))+((new_r10*x1239))+((new_r00*x1240))); |
| 11095 | evalcond[3]=((((1.0000000008)*x1245))+(((-1.0)*x1241))+(((-1.0000000008)*x1246))); |
| 11096 | evalcond[4]=((((-1.0)*x1239*x1242))+(((-1.0)*x1248))+new_r00); |
| 11097 | evalcond[5]=(((x1240*x1242))+(((-1.0)*x1249))+new_r10); |
| 11098 | evalcond[6]=((((1.0000000008)*x1249))+(((-1.0)*x1240*x1241))+new_r01); |
| 11099 | evalcond[7]=((((-1.0)*x1239*x1241))+new_r11+(((-1.0000000008)*x1248))); |
| 11100 | evalcond[8]=(x1244+(((1.0000000008)*x1247))+(((-1.0)*x1243))); |
| 11101 | evalcond[9]=(x1247+(((1.0000000008)*x1244))+(((-1.0000000008)*x1243))); |
| 11102 | if( 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 ) |
| 11103 | { |
| 11104 | continue; |
| 11105 | } |
| 11106 | } |
| 11107 | |
| 11108 | { |
| 11109 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 11110 | vinfos[0].jointtype = 1; |
| 11111 | vinfos[0].foffset = j0; |
| 11112 | vinfos[0].indices[0] = _ij0[0]; |
| 11113 | vinfos[0].indices[1] = _ij0[1]; |
| 11114 | vinfos[0].maxsolutions = _nj0; |
| 11115 | vinfos[1].jointtype = 1; |
| 11116 | vinfos[1].foffset = j1; |
| 11117 | vinfos[1].indices[0] = _ij1[0]; |
| 11118 | vinfos[1].indices[1] = _ij1[1]; |
| 11119 | vinfos[1].maxsolutions = _nj1; |
| 11120 | vinfos[2].jointtype = 1; |
| 11121 | vinfos[2].foffset = j2; |
| 11122 | vinfos[2].indices[0] = _ij2[0]; |
| 11123 | vinfos[2].indices[1] = _ij2[1]; |
| 11124 | vinfos[2].maxsolutions = _nj2; |
| 11125 | vinfos[3].jointtype = 1; |
| 11126 | vinfos[3].foffset = j3; |
| 11127 | vinfos[3].indices[0] = _ij3[0]; |
| 11128 | vinfos[3].indices[1] = _ij3[1]; |
| 11129 | vinfos[3].maxsolutions = _nj3; |
| 11130 | vinfos[4].jointtype = 1; |
| 11131 | vinfos[4].foffset = j4; |
| 11132 | vinfos[4].indices[0] = _ij4[0]; |
| 11133 | vinfos[4].indices[1] = _ij4[1]; |
| 11134 | vinfos[4].maxsolutions = _nj4; |
| 11135 | vinfos[5].jointtype = 1; |
| 11136 | vinfos[5].foffset = j5; |
| 11137 | vinfos[5].indices[0] = _ij5[0]; |
| 11138 | vinfos[5].indices[1] = _ij5[1]; |
| 11139 | vinfos[5].maxsolutions = _nj5; |
| 11140 | std::vector<int> vfree(0); |
| 11141 | solutions.AddSolution(vinfos,vfree); |
| 11142 | } |
| 11143 | } |
| 11144 | } |
| 11145 | |
| 11146 | } |
| 11147 | |
| 11148 | } |
| 11149 | |
| 11150 | } else |
| 11151 | { |
| 11152 | { |
| 11153 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 11154 | bool j5valid[1]={false}; |
| 11155 | _nj5 = 1; |
| 11156 | IkReal x1250=((25000.0)*gconst13); |
| 11157 | IkReal x1251=((25000.00002)*gconst13); |
| 11158 | CheckValue<IkReal> x1252=IKPowWithIntegerCheck(IKsign(((((25000.0)*new_r10*new_r11))+(((25000.0)*new_r00*new_r01)))),-1); |
| 11159 | if(!x1252.valid){ |
| 11160 | continue; |
| 11161 | } |
| 11162 | CheckValue<IkReal> x1253 = IKatan2WithCheck(IkReal(((((-1.0)*new_r11*x1251))+((new_r00*x1250)))),IkReal((((new_r01*x1251))+((new_r10*x1250)))),IKFAST_ATAN2_MAGTHRESH); |
| 11163 | if(!x1253.valid){ |
| 11164 | continue; |
| 11165 | } |
| 11166 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1252.value)))+(x1253.value)); |
| 11167 | sj5array[0]=IKsin(j5array[0]); |
| 11168 | cj5array[0]=IKcos(j5array[0]); |
| 11169 | if( j5array[0] > IKPI ) |
| 11170 | { |
| 11171 | j5array[0]-=IK2PI; |
| 11172 | } |
| 11173 | else if( j5array[0] < -IKPI ) |
| 11174 | { j5array[0]+=IK2PI; |
| 11175 | } |
| 11176 | j5valid[0] = true; |
| 11177 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 11178 | { |
| 11179 | if( !j5valid[ij5] ) |
| 11180 | { |
| 11181 | continue; |
| 11182 | } |
| 11183 | _ij5[0] = ij5; _ij5[1] = -1; |
| 11184 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 11185 | { |
| 11186 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 11187 | { |
| 11188 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 11189 | } |
| 11190 | } |
| 11191 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 11192 | { |
| 11193 | IkReal evalcond[10]; |
| 11194 | IkReal x1254=IKcos(j5); |
| 11195 | IkReal x1255=IKsin(j5); |
| 11196 | IkReal x1256=((1.0)*gconst13); |
| 11197 | IkReal x1257=((1.0000000008)*gconst13); |
| 11198 | IkReal x1258=(new_r11*x1255); |
| 11199 | IkReal x1259=(new_r01*x1254); |
| 11200 | IkReal x1260=(new_r00*x1254); |
| 11201 | IkReal x1261=(new_r10*x1255); |
| 11202 | if((((1.0)+(((-1.0)*gconst13*x1256)))) < -0.00001) |
| 11203 | continue; |
| 11204 | IkReal x1262=IKsqrt(((1.0)+(((-1.0)*gconst13*x1256)))); |
| 11205 | IkReal x1263=(x1255*x1262); |
| 11206 | IkReal x1264=(x1254*x1262); |
| 11207 | evalcond[0]=((((-1.0)*x1256))+((new_r01*x1255))+((new_r11*x1254))); |
| 11208 | evalcond[1]=((((-1.0)*x1257))+x1260+(((-1.0)*x1261))); |
| 11209 | evalcond[2]=(((new_r00*x1255))+(((-1.0)*x1262))+((new_r10*x1254))); |
| 11210 | evalcond[3]=((((-1.0)*x1256))+(((1.0000000008)*x1260))+(((-1.0000000008)*x1261))); |
| 11211 | evalcond[4]=((((-1.0)*x1254*x1257))+new_r00+(((-1.0)*x1263))); |
| 11212 | evalcond[5]=(((x1255*x1257))+new_r10+(((-1.0)*x1264))); |
| 11213 | evalcond[6]=((((-1.0)*x1255*x1256))+(((1.0000000008)*x1264))+new_r01); |
| 11214 | evalcond[7]=((((-1.0000000008)*x1263))+(((-1.0)*x1254*x1256))+new_r11); |
| 11215 | evalcond[8]=(x1259+(((1.0000000008)*x1262))+(((-1.0)*x1258))); |
| 11216 | evalcond[9]=(x1262+(((1.0000000008)*x1259))+(((-1.0000000008)*x1258))); |
| 11217 | if( 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 ) |
| 11218 | { |
| 11219 | continue; |
| 11220 | } |
| 11221 | } |
| 11222 | |
| 11223 | { |
| 11224 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 11225 | vinfos[0].jointtype = 1; |
| 11226 | vinfos[0].foffset = j0; |
| 11227 | vinfos[0].indices[0] = _ij0[0]; |
| 11228 | vinfos[0].indices[1] = _ij0[1]; |
| 11229 | vinfos[0].maxsolutions = _nj0; |
| 11230 | vinfos[1].jointtype = 1; |
| 11231 | vinfos[1].foffset = j1; |
| 11232 | vinfos[1].indices[0] = _ij1[0]; |
| 11233 | vinfos[1].indices[1] = _ij1[1]; |
| 11234 | vinfos[1].maxsolutions = _nj1; |
| 11235 | vinfos[2].jointtype = 1; |
| 11236 | vinfos[2].foffset = j2; |
| 11237 | vinfos[2].indices[0] = _ij2[0]; |
| 11238 | vinfos[2].indices[1] = _ij2[1]; |
| 11239 | vinfos[2].maxsolutions = _nj2; |
| 11240 | vinfos[3].jointtype = 1; |
| 11241 | vinfos[3].foffset = j3; |
| 11242 | vinfos[3].indices[0] = _ij3[0]; |
| 11243 | vinfos[3].indices[1] = _ij3[1]; |
| 11244 | vinfos[3].maxsolutions = _nj3; |
| 11245 | vinfos[4].jointtype = 1; |
| 11246 | vinfos[4].foffset = j4; |
| 11247 | vinfos[4].indices[0] = _ij4[0]; |
| 11248 | vinfos[4].indices[1] = _ij4[1]; |
| 11249 | vinfos[4].maxsolutions = _nj4; |
| 11250 | vinfos[5].jointtype = 1; |
| 11251 | vinfos[5].foffset = j5; |
| 11252 | vinfos[5].indices[0] = _ij5[0]; |
| 11253 | vinfos[5].indices[1] = _ij5[1]; |
| 11254 | vinfos[5].maxsolutions = _nj5; |
| 11255 | std::vector<int> vfree(0); |
| 11256 | solutions.AddSolution(vinfos,vfree); |
| 11257 | } |
| 11258 | } |
| 11259 | } |
| 11260 | |
| 11261 | } |
| 11262 | |
| 11263 | } |
| 11264 | |
| 11265 | } |
| 11266 | } while(0); |
| 11267 | if( bgotonextstatement ) |
| 11268 | { |
| 11269 | bool bgotonextstatement = true; |
| 11270 | do |
| 11271 | { |
| 11272 | IkReal x1266 = ((((1.0000000016)*(new_r10*new_r10)))+(new_r00*new_r00)); |
| 11273 | if(IKabs(x1266)==0){ |
| 11274 | continue; |
| 11275 | } |
| 11276 | IkReal x1265=pow(x1266,-0.5); |
| 11277 | CheckValue<IkReal> x1267 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11278 | if(!x1267.valid){ |
| 11279 | continue; |
| 11280 | } |
| 11281 | IkReal gconst14=((-1.0)*(x1267.value)); |
| 11282 | IkReal gconst15=((1.0000000008)*new_r10*x1265); |
| 11283 | IkReal gconst16=(new_r00*x1265); |
| 11284 | CheckValue<IkReal> x1268 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11285 | if(!x1268.valid){ |
| 11286 | continue; |
| 11287 | } |
| 11288 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((x1268.value)+j3)))), 6.28318530717959))); |
| 11289 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 11290 | { |
| 11291 | bgotonextstatement=false; |
| 11292 | { |
| 11293 | IkReal j5eval[3]; |
| 11294 | IkReal x1269=x1265; |
| 11295 | sj4=4.0e-5; |
| 11296 | cj4=1.0; |
| 11297 | j4=4.0e-5; |
| 11298 | sj3=gconst15; |
| 11299 | cj3=gconst16; |
| 11300 | CheckValue<IkReal> x1270 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11301 | if(!x1270.valid){ |
| 11302 | continue; |
| 11303 | } |
| 11304 | j3=((-1.0)*(x1270.value)); |
| 11305 | CheckValue<IkReal> x1271 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11306 | if(!x1271.valid){ |
| 11307 | continue; |
| 11308 | } |
| 11309 | IkReal gconst14=((-1.0)*(x1271.value)); |
| 11310 | IkReal gconst15=((1.0000000008)*new_r10*x1269); |
| 11311 | IkReal gconst16=(new_r00*x1269); |
| 11312 | IkReal x1272=new_r00*new_r00; |
| 11313 | IkReal x1273=(new_r01*new_r10); |
| 11314 | IkReal x1274=(x1273+(((-1.0)*new_r00*new_r11))); |
| 11315 | IkReal x1277 = ((((625000001.0)*(new_r10*new_r10)))+(((625000000.0)*x1272))); |
| 11316 | if(IKabs(x1277)==0){ |
| 11317 | continue; |
| 11318 | } |
| 11319 | IkReal x1275=pow(x1277,-0.5); |
| 11320 | IkReal x1276=(new_r10*x1275); |
| 11321 | j5eval[0]=x1274; |
| 11322 | j5eval[1]=IKsign(x1274); |
| 11323 | j5eval[2]=((IKabs(((((25000.0)*new_r00*x1276))+(((25000.00002)*new_r11*x1276)))))+(IKabs(((((25000.0)*x1272*x1275))+(((25000.00002)*x1273*x1275)))))); |
| 11324 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 11325 | { |
| 11326 | { |
| 11327 | IkReal j5eval[1]; |
| 11328 | IkReal x1278=x1265; |
| 11329 | sj4=4.0e-5; |
| 11330 | cj4=1.0; |
| 11331 | j4=4.0e-5; |
| 11332 | sj3=gconst15; |
| 11333 | cj3=gconst16; |
| 11334 | CheckValue<IkReal> x1279 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11335 | if(!x1279.valid){ |
| 11336 | continue; |
| 11337 | } |
| 11338 | j3=((-1.0)*(x1279.value)); |
| 11339 | CheckValue<IkReal> x1280 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11340 | if(!x1280.valid){ |
| 11341 | continue; |
| 11342 | } |
| 11343 | IkReal gconst14=((-1.0)*(x1280.value)); |
| 11344 | IkReal gconst15=((1.0000000008)*new_r10*x1278); |
| 11345 | IkReal gconst16=(new_r00*x1278); |
| 11346 | j5eval[0]=new_r00; |
| 11347 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 11348 | { |
| 11349 | { |
| 11350 | IkReal j5eval[2]; |
| 11351 | IkReal x1281=x1265; |
| 11352 | sj4=4.0e-5; |
| 11353 | cj4=1.0; |
| 11354 | j4=4.0e-5; |
| 11355 | sj3=gconst15; |
| 11356 | cj3=gconst16; |
| 11357 | CheckValue<IkReal> x1282 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11358 | if(!x1282.valid){ |
| 11359 | continue; |
| 11360 | } |
| 11361 | j3=((-1.0)*(x1282.value)); |
| 11362 | CheckValue<IkReal> x1283 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11363 | if(!x1283.valid){ |
| 11364 | continue; |
| 11365 | } |
| 11366 | IkReal gconst14=((-1.0)*(x1283.value)); |
| 11367 | IkReal gconst15=((1.0000000008)*new_r10*x1281); |
| 11368 | IkReal gconst16=(new_r00*x1281); |
| 11369 | j5eval[0]=new_r00; |
| 11370 | IkReal x1284 = ((((1.0000000016)*(new_r10*new_r10)))+(new_r00*new_r00)); |
| 11371 | if(IKabs(x1284)==0){ |
| 11372 | continue; |
| 11373 | } |
| 11374 | j5eval[1]=((-1.6e-9)*new_r00*new_r10*(pow(x1284,-0.5))); |
| 11375 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 11376 | { |
| 11377 | { |
| 11378 | IkReal evalcond[1]; |
| 11379 | bool bgotonextstatement = true; |
| 11380 | do |
| 11381 | { |
| 11382 | evalcond[0]=IKabs(new_r00); |
| 11383 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 11384 | { |
| 11385 | bgotonextstatement=false; |
| 11386 | { |
| 11387 | IkReal j5eval[1]; |
| 11388 | sj4=4.0e-5; |
| 11389 | cj4=1.0; |
| 11390 | j4=4.0e-5; |
| 11391 | sj3=gconst15; |
| 11392 | cj3=gconst16; |
| 11393 | CheckValue<IkReal> x1285 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(0),IKFAST_ATAN2_MAGTHRESH); |
| 11394 | if(!x1285.valid){ |
| 11395 | continue; |
| 11396 | } |
| 11397 | j3=((-1.0)*(x1285.value)); |
| 11398 | new_r00=0; |
| 11399 | CheckValue<IkReal> x1286 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(0),IKFAST_ATAN2_MAGTHRESH); |
| 11400 | if(!x1286.valid){ |
| 11401 | continue; |
| 11402 | } |
| 11403 | IkReal gconst14=((-1.0)*(x1286.value)); |
| 11404 | IkReal x1287 = new_r10*new_r10; |
| 11405 | if(IKabs(x1287)==0){ |
| 11406 | continue; |
| 11407 | } |
| 11408 | IkReal gconst15=(new_r10*(pow(x1287,-0.5))); |
| 11409 | IkReal gconst16=0; |
| 11410 | j5eval[0]=new_r10; |
| 11411 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 11412 | { |
| 11413 | { |
| 11414 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 11415 | bool j5valid[1]={false}; |
| 11416 | _nj5 = 1; |
| 11417 | CheckValue<IkReal> x1289=IKPowWithIntegerCheck(gconst15,-1); |
| 11418 | if(!x1289.valid){ |
| 11419 | continue; |
| 11420 | } |
| 11421 | IkReal x1288=x1289.value; |
| 11422 | if( IKabs(((-0.9999999992)*new_r11*x1288)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r10*x1288)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-0.9999999992)*new_r11*x1288))+IKsqr(((-1.0)*new_r10*x1288))-1) <= IKFAST_SINCOS_THRESH ) |
| 11423 | continue; |
| 11424 | j5array[0]=IKatan2(((-0.9999999992)*new_r11*x1288), ((-1.0)*new_r10*x1288)); |
| 11425 | sj5array[0]=IKsin(j5array[0]); |
| 11426 | cj5array[0]=IKcos(j5array[0]); |
| 11427 | if( j5array[0] > IKPI ) |
| 11428 | { |
| 11429 | j5array[0]-=IK2PI; |
| 11430 | } |
| 11431 | else if( j5array[0] < -IKPI ) |
| 11432 | { j5array[0]+=IK2PI; |
| 11433 | } |
| 11434 | j5valid[0] = true; |
| 11435 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 11436 | { |
| 11437 | if( !j5valid[ij5] ) |
| 11438 | { |
| 11439 | continue; |
| 11440 | } |
| 11441 | _ij5[0] = ij5; _ij5[1] = -1; |
| 11442 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 11443 | { |
| 11444 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 11445 | { |
| 11446 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 11447 | } |
| 11448 | } |
| 11449 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 11450 | { |
| 11451 | IkReal evalcond[10]; |
| 11452 | IkReal x1290=IKsin(j5); |
| 11453 | IkReal x1291=IKcos(j5); |
| 11454 | IkReal x1292=(gconst15*x1290); |
| 11455 | IkReal x1293=(new_r11*x1290); |
| 11456 | IkReal x1294=(gconst15*x1291); |
| 11457 | IkReal x1295=(new_r10*x1290); |
| 11458 | IkReal x1296=(new_r01*x1291); |
| 11459 | evalcond[0]=x1292; |
| 11460 | evalcond[1]=((-1.0)*x1295); |
| 11461 | evalcond[2]=(gconst15+((new_r10*x1291))); |
| 11462 | evalcond[3]=(x1294+new_r10); |
| 11463 | evalcond[4]=((-1.0000000008)*x1295); |
| 11464 | evalcond[5]=(((new_r11*x1291))+((new_r01*x1290))); |
| 11465 | evalcond[6]=((((-1.0000000008)*x1294))+new_r01); |
| 11466 | evalcond[7]=((((1.0000000008)*x1292))+new_r11); |
| 11467 | evalcond[8]=(x1296+(((-1.0000000008)*gconst15))+(((-1.0)*x1293))); |
| 11468 | evalcond[9]=((((1.0000000008)*x1296))+(((-1.0000000008)*x1293))+(((-1.0)*gconst15))); |
| 11469 | if( 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 ) |
| 11470 | { |
| 11471 | continue; |
| 11472 | } |
| 11473 | } |
| 11474 | |
| 11475 | { |
| 11476 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 11477 | vinfos[0].jointtype = 1; |
| 11478 | vinfos[0].foffset = j0; |
| 11479 | vinfos[0].indices[0] = _ij0[0]; |
| 11480 | vinfos[0].indices[1] = _ij0[1]; |
| 11481 | vinfos[0].maxsolutions = _nj0; |
| 11482 | vinfos[1].jointtype = 1; |
| 11483 | vinfos[1].foffset = j1; |
| 11484 | vinfos[1].indices[0] = _ij1[0]; |
| 11485 | vinfos[1].indices[1] = _ij1[1]; |
| 11486 | vinfos[1].maxsolutions = _nj1; |
| 11487 | vinfos[2].jointtype = 1; |
| 11488 | vinfos[2].foffset = j2; |
| 11489 | vinfos[2].indices[0] = _ij2[0]; |
| 11490 | vinfos[2].indices[1] = _ij2[1]; |
| 11491 | vinfos[2].maxsolutions = _nj2; |
| 11492 | vinfos[3].jointtype = 1; |
| 11493 | vinfos[3].foffset = j3; |
| 11494 | vinfos[3].indices[0] = _ij3[0]; |
| 11495 | vinfos[3].indices[1] = _ij3[1]; |
| 11496 | vinfos[3].maxsolutions = _nj3; |
| 11497 | vinfos[4].jointtype = 1; |
| 11498 | vinfos[4].foffset = j4; |
| 11499 | vinfos[4].indices[0] = _ij4[0]; |
| 11500 | vinfos[4].indices[1] = _ij4[1]; |
| 11501 | vinfos[4].maxsolutions = _nj4; |
| 11502 | vinfos[5].jointtype = 1; |
| 11503 | vinfos[5].foffset = j5; |
| 11504 | vinfos[5].indices[0] = _ij5[0]; |
| 11505 | vinfos[5].indices[1] = _ij5[1]; |
| 11506 | vinfos[5].maxsolutions = _nj5; |
| 11507 | std::vector<int> vfree(0); |
| 11508 | solutions.AddSolution(vinfos,vfree); |
| 11509 | } |
| 11510 | } |
| 11511 | } |
| 11512 | |
| 11513 | } else |
| 11514 | { |
| 11515 | { |
| 11516 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 11517 | bool j5valid[1]={false}; |
| 11518 | _nj5 = 1; |
| 11519 | CheckValue<IkReal> x1297=IKPowWithIntegerCheck(gconst15,-1); |
| 11520 | if(!x1297.valid){ |
| 11521 | continue; |
| 11522 | } |
| 11523 | CheckValue<IkReal> x1298=IKPowWithIntegerCheck(new_r10,-1); |
| 11524 | if(!x1298.valid){ |
| 11525 | continue; |
| 11526 | } |
| 11527 | if( IKabs(((-0.9999999992)*new_r11*(x1297.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*gconst15*(x1298.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-0.9999999992)*new_r11*(x1297.value)))+IKsqr(((-1.0)*gconst15*(x1298.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 11528 | continue; |
| 11529 | j5array[0]=IKatan2(((-0.9999999992)*new_r11*(x1297.value)), ((-1.0)*gconst15*(x1298.value))); |
| 11530 | sj5array[0]=IKsin(j5array[0]); |
| 11531 | cj5array[0]=IKcos(j5array[0]); |
| 11532 | if( j5array[0] > IKPI ) |
| 11533 | { |
| 11534 | j5array[0]-=IK2PI; |
| 11535 | } |
| 11536 | else if( j5array[0] < -IKPI ) |
| 11537 | { j5array[0]+=IK2PI; |
| 11538 | } |
| 11539 | j5valid[0] = true; |
| 11540 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 11541 | { |
| 11542 | if( !j5valid[ij5] ) |
| 11543 | { |
| 11544 | continue; |
| 11545 | } |
| 11546 | _ij5[0] = ij5; _ij5[1] = -1; |
| 11547 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 11548 | { |
| 11549 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 11550 | { |
| 11551 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 11552 | } |
| 11553 | } |
| 11554 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 11555 | { |
| 11556 | IkReal evalcond[10]; |
| 11557 | IkReal x1299=IKsin(j5); |
| 11558 | IkReal x1300=IKcos(j5); |
| 11559 | IkReal x1301=(gconst15*x1299); |
| 11560 | IkReal x1302=(new_r11*x1299); |
| 11561 | IkReal x1303=(gconst15*x1300); |
| 11562 | IkReal x1304=(new_r10*x1299); |
| 11563 | IkReal x1305=(new_r01*x1300); |
| 11564 | evalcond[0]=x1301; |
| 11565 | evalcond[1]=((-1.0)*x1304); |
| 11566 | evalcond[2]=(gconst15+((new_r10*x1300))); |
| 11567 | evalcond[3]=(x1303+new_r10); |
| 11568 | evalcond[4]=((-1.0000000008)*x1304); |
| 11569 | evalcond[5]=(((new_r11*x1300))+((new_r01*x1299))); |
| 11570 | evalcond[6]=((((-1.0000000008)*x1303))+new_r01); |
| 11571 | evalcond[7]=((((1.0000000008)*x1301))+new_r11); |
| 11572 | evalcond[8]=(x1305+(((-1.0)*x1302))+(((-1.0000000008)*gconst15))); |
| 11573 | evalcond[9]=((((-1.0000000008)*x1302))+(((1.0000000008)*x1305))+(((-1.0)*gconst15))); |
| 11574 | if( 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 ) |
| 11575 | { |
| 11576 | continue; |
| 11577 | } |
| 11578 | } |
| 11579 | |
| 11580 | { |
| 11581 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 11582 | vinfos[0].jointtype = 1; |
| 11583 | vinfos[0].foffset = j0; |
| 11584 | vinfos[0].indices[0] = _ij0[0]; |
| 11585 | vinfos[0].indices[1] = _ij0[1]; |
| 11586 | vinfos[0].maxsolutions = _nj0; |
| 11587 | vinfos[1].jointtype = 1; |
| 11588 | vinfos[1].foffset = j1; |
| 11589 | vinfos[1].indices[0] = _ij1[0]; |
| 11590 | vinfos[1].indices[1] = _ij1[1]; |
| 11591 | vinfos[1].maxsolutions = _nj1; |
| 11592 | vinfos[2].jointtype = 1; |
| 11593 | vinfos[2].foffset = j2; |
| 11594 | vinfos[2].indices[0] = _ij2[0]; |
| 11595 | vinfos[2].indices[1] = _ij2[1]; |
| 11596 | vinfos[2].maxsolutions = _nj2; |
| 11597 | vinfos[3].jointtype = 1; |
| 11598 | vinfos[3].foffset = j3; |
| 11599 | vinfos[3].indices[0] = _ij3[0]; |
| 11600 | vinfos[3].indices[1] = _ij3[1]; |
| 11601 | vinfos[3].maxsolutions = _nj3; |
| 11602 | vinfos[4].jointtype = 1; |
| 11603 | vinfos[4].foffset = j4; |
| 11604 | vinfos[4].indices[0] = _ij4[0]; |
| 11605 | vinfos[4].indices[1] = _ij4[1]; |
| 11606 | vinfos[4].maxsolutions = _nj4; |
| 11607 | vinfos[5].jointtype = 1; |
| 11608 | vinfos[5].foffset = j5; |
| 11609 | vinfos[5].indices[0] = _ij5[0]; |
| 11610 | vinfos[5].indices[1] = _ij5[1]; |
| 11611 | vinfos[5].maxsolutions = _nj5; |
| 11612 | std::vector<int> vfree(0); |
| 11613 | solutions.AddSolution(vinfos,vfree); |
| 11614 | } |
| 11615 | } |
| 11616 | } |
| 11617 | |
| 11618 | } |
| 11619 | |
| 11620 | } |
| 11621 | |
| 11622 | } |
| 11623 | } while(0); |
| 11624 | if( bgotonextstatement ) |
| 11625 | { |
| 11626 | bool bgotonextstatement = true; |
| 11627 | do |
| 11628 | { |
| 11629 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 11630 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 11631 | { |
| 11632 | bgotonextstatement=false; |
| 11633 | { |
| 11634 | IkReal j5eval[5]; |
| 11635 | IkReal x1307 = ((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 11636 | if(IKabs(x1307)==0){ |
| 11637 | continue; |
| 11638 | } |
| 11639 | IkReal x1306=pow(x1307,-0.5); |
| 11640 | sj4=4.0e-5; |
| 11641 | cj4=1.0; |
| 11642 | j4=4.0e-5; |
| 11643 | sj3=gconst15; |
| 11644 | cj3=gconst16; |
| 11645 | CheckValue<IkReal> x1308 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11646 | if(!x1308.valid){ |
| 11647 | continue; |
| 11648 | } |
| 11649 | j3=((-1.0)*(x1308.value)); |
| 11650 | new_r11=0; |
| 11651 | new_r01=0; |
| 11652 | new_r22=0; |
| 11653 | new_r20=0; |
| 11654 | CheckValue<IkReal> x1309 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11655 | if(!x1309.valid){ |
| 11656 | continue; |
| 11657 | } |
| 11658 | IkReal gconst14=((-1.0)*(x1309.value)); |
| 11659 | IkReal gconst15=((1.0000000008)*new_r10*x1306); |
| 11660 | IkReal gconst16=(new_r00*x1306); |
| 11661 | j5eval[0]=-1.0; |
| 11662 | j5eval[1]=3.90625000625e+17; |
| 11663 | j5eval[2]=((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 11664 | j5eval[3]=1.0; |
| 11665 | j5eval[4]=-1.0; |
| 11666 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 || IKabs(j5eval[3]) < 0.0000010000000000 || IKabs(j5eval[4]) < 0.0000010000000000 ) |
| 11667 | { |
| 11668 | { |
| 11669 | IkReal j5eval[1]; |
| 11670 | IkReal x1311 = ((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 11671 | if(IKabs(x1311)==0){ |
| 11672 | continue; |
| 11673 | } |
| 11674 | IkReal x1310=pow(x1311,-0.5); |
| 11675 | sj4=4.0e-5; |
| 11676 | cj4=1.0; |
| 11677 | j4=4.0e-5; |
| 11678 | sj3=gconst15; |
| 11679 | cj3=gconst16; |
| 11680 | CheckValue<IkReal> x1312 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11681 | if(!x1312.valid){ |
| 11682 | continue; |
| 11683 | } |
| 11684 | j3=((-1.0)*(x1312.value)); |
| 11685 | new_r11=0; |
| 11686 | new_r01=0; |
| 11687 | new_r22=0; |
| 11688 | new_r20=0; |
| 11689 | CheckValue<IkReal> x1313 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11690 | if(!x1313.valid){ |
| 11691 | continue; |
| 11692 | } |
| 11693 | IkReal gconst14=((-1.0)*(x1313.value)); |
| 11694 | IkReal gconst15=((1.0000000008)*new_r10*x1310); |
| 11695 | IkReal gconst16=(new_r00*x1310); |
| 11696 | IkReal x1314=new_r10*new_r10; |
| 11697 | CheckValue<IkReal> x1316=IKPowWithIntegerCheck(((1.0)+(((1.6e-9)*x1314))),-1); |
| 11698 | if(!x1316.valid){ |
| 11699 | continue; |
| 11700 | } |
| 11701 | IkReal x1315=x1316.value; |
| 11702 | IkReal x1317=((1.0)+(((-1.0)*x1314))); |
| 11703 | j5eval[0]=IKsign(((((625000002.0)*x1315*(x1314*x1314)))+(((-625000000.0)*x1315*(x1317*x1317))))); |
| 11704 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 11705 | { |
| 11706 | { |
| 11707 | IkReal j5eval[2]; |
| 11708 | IkReal x1319 = ((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 11709 | if(IKabs(x1319)==0){ |
| 11710 | continue; |
| 11711 | } |
| 11712 | IkReal x1318=pow(x1319,-0.5); |
| 11713 | sj4=4.0e-5; |
| 11714 | cj4=1.0; |
| 11715 | j4=4.0e-5; |
| 11716 | sj3=gconst15; |
| 11717 | cj3=gconst16; |
| 11718 | CheckValue<IkReal> x1320 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11719 | if(!x1320.valid){ |
| 11720 | continue; |
| 11721 | } |
| 11722 | j3=((-1.0)*(x1320.value)); |
| 11723 | new_r11=0; |
| 11724 | new_r01=0; |
| 11725 | new_r22=0; |
| 11726 | new_r20=0; |
| 11727 | CheckValue<IkReal> x1321 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 11728 | if(!x1321.valid){ |
| 11729 | continue; |
| 11730 | } |
| 11731 | IkReal gconst14=((-1.0)*(x1321.value)); |
| 11732 | IkReal gconst15=((1.0000000008)*new_r10*x1318); |
| 11733 | IkReal gconst16=(new_r00*x1318); |
| 11734 | IkReal x1322=new_r10*new_r10; |
| 11735 | IkReal x1323=((1.0)+(((1.6e-9)*x1322))); |
| 11736 | CheckValue<IkReal> x1324=IKPowWithIntegerCheck(x1323,-1); |
| 11737 | if(!x1324.valid){ |
| 11738 | continue; |
| 11739 | } |
| 11740 | j5eval[0]=((-3.20000000256e-9)*x1322*(x1324.value)*(((1.0)+(((-1.0)*x1322))))); |
| 11741 | IkReal x1325 = x1323; |
| 11742 | if(IKabs(x1325)==0){ |
| 11743 | continue; |
| 11744 | } |
| 11745 | j5eval[1]=((-1.6e-9)*new_r00*new_r10*(pow(x1325,-0.5))); |
| 11746 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 11747 | { |
| 11748 | continue; // 3 cases reached |
| 11749 | |
| 11750 | } else |
| 11751 | { |
| 11752 | { |
| 11753 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 11754 | bool j5valid[1]={false}; |
| 11755 | _nj5 = 1; |
| 11756 | IkReal x1326=gconst15*gconst15; |
| 11757 | IkReal x1327=(gconst16*new_r10); |
| 11758 | CheckValue<IkReal> x1328=IKPowWithIntegerCheck(((((625000000.0)*(x1327*x1327)))+(((-625000001.0)*x1326*(new_r00*new_r00)))),-1); |
| 11759 | if(!x1328.valid){ |
| 11760 | continue; |
| 11761 | } |
| 11762 | CheckValue<IkReal> x1329=IKPowWithIntegerCheck(((((25000.0)*x1327))+(((-25000.00002)*gconst15*new_r00))),-1); |
| 11763 | if(!x1329.valid){ |
| 11764 | continue; |
| 11765 | } |
| 11766 | if( IKabs(((x1328.value)*(((((625000000.5)*x1326*x1327))+(((625000001.0)*new_r00*(gconst15*gconst15*gconst15))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-25000.0)*gconst15*gconst16*(x1329.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x1328.value)*(((((625000000.5)*x1326*x1327))+(((625000001.0)*new_r00*(gconst15*gconst15*gconst15)))))))+IKsqr(((-25000.0)*gconst15*gconst16*(x1329.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 11767 | continue; |
| 11768 | j5array[0]=IKatan2(((x1328.value)*(((((625000000.5)*x1326*x1327))+(((625000001.0)*new_r00*(gconst15*gconst15*gconst15)))))), ((-25000.0)*gconst15*gconst16*(x1329.value))); |
| 11769 | sj5array[0]=IKsin(j5array[0]); |
| 11770 | cj5array[0]=IKcos(j5array[0]); |
| 11771 | if( j5array[0] > IKPI ) |
| 11772 | { |
| 11773 | j5array[0]-=IK2PI; |
| 11774 | } |
| 11775 | else if( j5array[0] < -IKPI ) |
| 11776 | { j5array[0]+=IK2PI; |
| 11777 | } |
| 11778 | j5valid[0] = true; |
| 11779 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 11780 | { |
| 11781 | if( !j5valid[ij5] ) |
| 11782 | { |
| 11783 | continue; |
| 11784 | } |
| 11785 | _ij5[0] = ij5; _ij5[1] = -1; |
| 11786 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 11787 | { |
| 11788 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 11789 | { |
| 11790 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 11791 | } |
| 11792 | } |
| 11793 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 11794 | { |
| 11795 | IkReal evalcond[7]; |
| 11796 | IkReal x1330=IKsin(j5); |
| 11797 | IkReal x1331=IKcos(j5); |
| 11798 | IkReal x1332=((1.0000000008)*gconst16); |
| 11799 | IkReal x1333=((1.0)*gconst16); |
| 11800 | IkReal x1334=((1.0000000008)*x1330); |
| 11801 | IkReal x1335=((1.0)*x1330); |
| 11802 | IkReal x1336=(gconst15*x1331); |
| 11803 | IkReal x1337=(new_r00*x1331); |
| 11804 | evalcond[0]=(((new_r10*x1331))+gconst15+((new_r00*x1330))); |
| 11805 | evalcond[1]=(((gconst15*x1330))+(((-1.0)*x1331*x1332))+new_r00); |
| 11806 | evalcond[2]=(x1336+((x1330*x1332))+new_r10); |
| 11807 | evalcond[3]=((((-1.0)*x1330*x1333))+(((-1.0000000008)*x1336))); |
| 11808 | evalcond[4]=(((gconst15*x1334))+(((-1.0)*x1331*x1333))); |
| 11809 | evalcond[5]=(x1337+(((-1.0)*new_r10*x1335))+(((-1.0)*x1332))); |
| 11810 | evalcond[6]=((((-1.0)*new_r10*x1334))+(((-1.0)*x1333))+(((1.0000000008)*x1337))); |
| 11811 | if( 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 ) |
| 11812 | { |
| 11813 | continue; |
| 11814 | } |
| 11815 | } |
| 11816 | |
| 11817 | { |
| 11818 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 11819 | vinfos[0].jointtype = 1; |
| 11820 | vinfos[0].foffset = j0; |
| 11821 | vinfos[0].indices[0] = _ij0[0]; |
| 11822 | vinfos[0].indices[1] = _ij0[1]; |
| 11823 | vinfos[0].maxsolutions = _nj0; |
| 11824 | vinfos[1].jointtype = 1; |
| 11825 | vinfos[1].foffset = j1; |
| 11826 | vinfos[1].indices[0] = _ij1[0]; |
| 11827 | vinfos[1].indices[1] = _ij1[1]; |
| 11828 | vinfos[1].maxsolutions = _nj1; |
| 11829 | vinfos[2].jointtype = 1; |
| 11830 | vinfos[2].foffset = j2; |
| 11831 | vinfos[2].indices[0] = _ij2[0]; |
| 11832 | vinfos[2].indices[1] = _ij2[1]; |
| 11833 | vinfos[2].maxsolutions = _nj2; |
| 11834 | vinfos[3].jointtype = 1; |
| 11835 | vinfos[3].foffset = j3; |
| 11836 | vinfos[3].indices[0] = _ij3[0]; |
| 11837 | vinfos[3].indices[1] = _ij3[1]; |
| 11838 | vinfos[3].maxsolutions = _nj3; |
| 11839 | vinfos[4].jointtype = 1; |
| 11840 | vinfos[4].foffset = j4; |
| 11841 | vinfos[4].indices[0] = _ij4[0]; |
| 11842 | vinfos[4].indices[1] = _ij4[1]; |
| 11843 | vinfos[4].maxsolutions = _nj4; |
| 11844 | vinfos[5].jointtype = 1; |
| 11845 | vinfos[5].foffset = j5; |
| 11846 | vinfos[5].indices[0] = _ij5[0]; |
| 11847 | vinfos[5].indices[1] = _ij5[1]; |
| 11848 | vinfos[5].maxsolutions = _nj5; |
| 11849 | std::vector<int> vfree(0); |
| 11850 | solutions.AddSolution(vinfos,vfree); |
| 11851 | } |
| 11852 | } |
| 11853 | } |
| 11854 | |
| 11855 | } |
| 11856 | |
| 11857 | } |
| 11858 | |
| 11859 | } else |
| 11860 | { |
| 11861 | { |
| 11862 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 11863 | bool j5valid[1]={false}; |
| 11864 | _nj5 = 1; |
| 11865 | IkReal x1338=gconst16*gconst16; |
| 11866 | IkReal x1339=gconst15*gconst15; |
| 11867 | IkReal x1340=((625000000.0)*x1338); |
| 11868 | IkReal x1341=((625000000.5)*gconst16*x1339); |
| 11869 | CheckValue<IkReal> x1342=IKPowWithIntegerCheck(IKsign(((((-1.0)*x1340*(new_r00*new_r00)))+(((625000001.0)*x1339*(new_r10*new_r10))))),-1); |
| 11870 | if(!x1342.valid){ |
| 11871 | continue; |
| 11872 | } |
| 11873 | CheckValue<IkReal> x1343 = IKatan2WithCheck(IkReal((((gconst15*new_r00*x1340))+(((-1.0)*new_r10*x1341)))),IkReal(((((-625000001.0)*new_r10*(gconst15*gconst15*gconst15)))+((new_r00*x1341)))),IKFAST_ATAN2_MAGTHRESH); |
| 11874 | if(!x1343.valid){ |
| 11875 | continue; |
| 11876 | } |
| 11877 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1342.value)))+(x1343.value)); |
| 11878 | sj5array[0]=IKsin(j5array[0]); |
| 11879 | cj5array[0]=IKcos(j5array[0]); |
| 11880 | if( j5array[0] > IKPI ) |
| 11881 | { |
| 11882 | j5array[0]-=IK2PI; |
| 11883 | } |
| 11884 | else if( j5array[0] < -IKPI ) |
| 11885 | { j5array[0]+=IK2PI; |
| 11886 | } |
| 11887 | j5valid[0] = true; |
| 11888 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 11889 | { |
| 11890 | if( !j5valid[ij5] ) |
| 11891 | { |
| 11892 | continue; |
| 11893 | } |
| 11894 | _ij5[0] = ij5; _ij5[1] = -1; |
| 11895 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 11896 | { |
| 11897 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 11898 | { |
| 11899 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 11900 | } |
| 11901 | } |
| 11902 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 11903 | { |
| 11904 | IkReal evalcond[7]; |
| 11905 | IkReal x1344=IKsin(j5); |
| 11906 | IkReal x1345=IKcos(j5); |
| 11907 | IkReal x1346=((1.0000000008)*gconst16); |
| 11908 | IkReal x1347=((1.0)*gconst16); |
| 11909 | IkReal x1348=((1.0000000008)*x1344); |
| 11910 | IkReal x1349=((1.0)*x1344); |
| 11911 | IkReal x1350=(gconst15*x1345); |
| 11912 | IkReal x1351=(new_r00*x1345); |
| 11913 | evalcond[0]=(gconst15+((new_r00*x1344))+((new_r10*x1345))); |
| 11914 | evalcond[1]=(new_r00+((gconst15*x1344))+(((-1.0)*x1345*x1346))); |
| 11915 | evalcond[2]=(x1350+((x1344*x1346))+new_r10); |
| 11916 | evalcond[3]=((((-1.0000000008)*x1350))+(((-1.0)*x1344*x1347))); |
| 11917 | evalcond[4]=(((gconst15*x1348))+(((-1.0)*x1345*x1347))); |
| 11918 | evalcond[5]=(x1351+(((-1.0)*x1346))+(((-1.0)*new_r10*x1349))); |
| 11919 | evalcond[6]=((((-1.0)*x1347))+(((-1.0)*new_r10*x1348))+(((1.0000000008)*x1351))); |
| 11920 | if( 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 ) |
| 11921 | { |
| 11922 | continue; |
| 11923 | } |
| 11924 | } |
| 11925 | |
| 11926 | { |
| 11927 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 11928 | vinfos[0].jointtype = 1; |
| 11929 | vinfos[0].foffset = j0; |
| 11930 | vinfos[0].indices[0] = _ij0[0]; |
| 11931 | vinfos[0].indices[1] = _ij0[1]; |
| 11932 | vinfos[0].maxsolutions = _nj0; |
| 11933 | vinfos[1].jointtype = 1; |
| 11934 | vinfos[1].foffset = j1; |
| 11935 | vinfos[1].indices[0] = _ij1[0]; |
| 11936 | vinfos[1].indices[1] = _ij1[1]; |
| 11937 | vinfos[1].maxsolutions = _nj1; |
| 11938 | vinfos[2].jointtype = 1; |
| 11939 | vinfos[2].foffset = j2; |
| 11940 | vinfos[2].indices[0] = _ij2[0]; |
| 11941 | vinfos[2].indices[1] = _ij2[1]; |
| 11942 | vinfos[2].maxsolutions = _nj2; |
| 11943 | vinfos[3].jointtype = 1; |
| 11944 | vinfos[3].foffset = j3; |
| 11945 | vinfos[3].indices[0] = _ij3[0]; |
| 11946 | vinfos[3].indices[1] = _ij3[1]; |
| 11947 | vinfos[3].maxsolutions = _nj3; |
| 11948 | vinfos[4].jointtype = 1; |
| 11949 | vinfos[4].foffset = j4; |
| 11950 | vinfos[4].indices[0] = _ij4[0]; |
| 11951 | vinfos[4].indices[1] = _ij4[1]; |
| 11952 | vinfos[4].maxsolutions = _nj4; |
| 11953 | vinfos[5].jointtype = 1; |
| 11954 | vinfos[5].foffset = j5; |
| 11955 | vinfos[5].indices[0] = _ij5[0]; |
| 11956 | vinfos[5].indices[1] = _ij5[1]; |
| 11957 | vinfos[5].maxsolutions = _nj5; |
| 11958 | std::vector<int> vfree(0); |
| 11959 | solutions.AddSolution(vinfos,vfree); |
| 11960 | } |
| 11961 | } |
| 11962 | } |
| 11963 | |
| 11964 | } |
| 11965 | |
| 11966 | } |
| 11967 | |
| 11968 | } else |
| 11969 | { |
| 11970 | { |
| 11971 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 11972 | bool j5valid[1]={false}; |
| 11973 | _nj5 = 1; |
| 11974 | IkReal x1352=((25000.0)*gconst15); |
| 11975 | IkReal x1353=((25000.00002)*gconst16); |
| 11976 | CheckValue<IkReal> x1354=IKPowWithIntegerCheck(IKsign(((((-25000.0)*(new_r10*new_r10)))+(((-25000.0)*(new_r00*new_r00))))),-1); |
| 11977 | if(!x1354.valid){ |
| 11978 | continue; |
| 11979 | } |
| 11980 | CheckValue<IkReal> x1355 = IKatan2WithCheck(IkReal((((new_r10*x1353))+((new_r00*x1352)))),IkReal((((new_r10*x1352))+(((-1.0)*new_r00*x1353)))),IKFAST_ATAN2_MAGTHRESH); |
| 11981 | if(!x1355.valid){ |
| 11982 | continue; |
| 11983 | } |
| 11984 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1354.value)))+(x1355.value)); |
| 11985 | sj5array[0]=IKsin(j5array[0]); |
| 11986 | cj5array[0]=IKcos(j5array[0]); |
| 11987 | if( j5array[0] > IKPI ) |
| 11988 | { |
| 11989 | j5array[0]-=IK2PI; |
| 11990 | } |
| 11991 | else if( j5array[0] < -IKPI ) |
| 11992 | { j5array[0]+=IK2PI; |
| 11993 | } |
| 11994 | j5valid[0] = true; |
| 11995 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 11996 | { |
| 11997 | if( !j5valid[ij5] ) |
| 11998 | { |
| 11999 | continue; |
| 12000 | } |
| 12001 | _ij5[0] = ij5; _ij5[1] = -1; |
| 12002 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 12003 | { |
| 12004 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 12005 | { |
| 12006 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 12007 | } |
| 12008 | } |
| 12009 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 12010 | { |
| 12011 | IkReal evalcond[7]; |
| 12012 | IkReal x1356=IKsin(j5); |
| 12013 | IkReal x1357=IKcos(j5); |
| 12014 | IkReal x1358=((1.0000000008)*gconst16); |
| 12015 | IkReal x1359=((1.0)*gconst16); |
| 12016 | IkReal x1360=((1.0000000008)*x1356); |
| 12017 | IkReal x1361=((1.0)*x1356); |
| 12018 | IkReal x1362=(gconst15*x1357); |
| 12019 | IkReal x1363=(new_r00*x1357); |
| 12020 | evalcond[0]=(((new_r10*x1357))+gconst15+((new_r00*x1356))); |
| 12021 | evalcond[1]=(((gconst15*x1356))+new_r00+(((-1.0)*x1357*x1358))); |
| 12022 | evalcond[2]=(x1362+new_r10+((x1356*x1358))); |
| 12023 | evalcond[3]=((((-1.0000000008)*x1362))+(((-1.0)*x1356*x1359))); |
| 12024 | evalcond[4]=(((gconst15*x1360))+(((-1.0)*x1357*x1359))); |
| 12025 | evalcond[5]=(x1363+(((-1.0)*x1358))+(((-1.0)*new_r10*x1361))); |
| 12026 | evalcond[6]=((((-1.0)*x1359))+(((1.0000000008)*x1363))+(((-1.0)*new_r10*x1360))); |
| 12027 | if( 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 ) |
| 12028 | { |
| 12029 | continue; |
| 12030 | } |
| 12031 | } |
| 12032 | |
| 12033 | { |
| 12034 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 12035 | vinfos[0].jointtype = 1; |
| 12036 | vinfos[0].foffset = j0; |
| 12037 | vinfos[0].indices[0] = _ij0[0]; |
| 12038 | vinfos[0].indices[1] = _ij0[1]; |
| 12039 | vinfos[0].maxsolutions = _nj0; |
| 12040 | vinfos[1].jointtype = 1; |
| 12041 | vinfos[1].foffset = j1; |
| 12042 | vinfos[1].indices[0] = _ij1[0]; |
| 12043 | vinfos[1].indices[1] = _ij1[1]; |
| 12044 | vinfos[1].maxsolutions = _nj1; |
| 12045 | vinfos[2].jointtype = 1; |
| 12046 | vinfos[2].foffset = j2; |
| 12047 | vinfos[2].indices[0] = _ij2[0]; |
| 12048 | vinfos[2].indices[1] = _ij2[1]; |
| 12049 | vinfos[2].maxsolutions = _nj2; |
| 12050 | vinfos[3].jointtype = 1; |
| 12051 | vinfos[3].foffset = j3; |
| 12052 | vinfos[3].indices[0] = _ij3[0]; |
| 12053 | vinfos[3].indices[1] = _ij3[1]; |
| 12054 | vinfos[3].maxsolutions = _nj3; |
| 12055 | vinfos[4].jointtype = 1; |
| 12056 | vinfos[4].foffset = j4; |
| 12057 | vinfos[4].indices[0] = _ij4[0]; |
| 12058 | vinfos[4].indices[1] = _ij4[1]; |
| 12059 | vinfos[4].maxsolutions = _nj4; |
| 12060 | vinfos[5].jointtype = 1; |
| 12061 | vinfos[5].foffset = j5; |
| 12062 | vinfos[5].indices[0] = _ij5[0]; |
| 12063 | vinfos[5].indices[1] = _ij5[1]; |
| 12064 | vinfos[5].maxsolutions = _nj5; |
| 12065 | std::vector<int> vfree(0); |
| 12066 | solutions.AddSolution(vinfos,vfree); |
| 12067 | } |
| 12068 | } |
| 12069 | } |
| 12070 | |
| 12071 | } |
| 12072 | |
| 12073 | } |
| 12074 | |
| 12075 | } |
| 12076 | } while(0); |
| 12077 | if( bgotonextstatement ) |
| 12078 | { |
| 12079 | bool bgotonextstatement = true; |
| 12080 | do |
| 12081 | { |
| 12082 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r10))); |
| 12083 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 12084 | { |
| 12085 | bgotonextstatement=false; |
| 12086 | { |
| 12087 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 12088 | bool j5valid[1]={false}; |
| 12089 | _nj5 = 1; |
| 12090 | CheckValue<IkReal> x1365=IKPowWithIntegerCheck(gconst16,-1); |
| 12091 | if(!x1365.valid){ |
| 12092 | continue; |
| 12093 | } |
| 12094 | IkReal x1364=x1365.value; |
| 12095 | if( IKabs((new_r01*x1364)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((0.9999999992)*new_r00*x1364)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((new_r01*x1364))+IKsqr(((0.9999999992)*new_r00*x1364))-1) <= IKFAST_SINCOS_THRESH ) |
| 12096 | continue; |
| 12097 | j5array[0]=IKatan2((new_r01*x1364), ((0.9999999992)*new_r00*x1364)); |
| 12098 | sj5array[0]=IKsin(j5array[0]); |
| 12099 | cj5array[0]=IKcos(j5array[0]); |
| 12100 | if( j5array[0] > IKPI ) |
| 12101 | { |
| 12102 | j5array[0]-=IK2PI; |
| 12103 | } |
| 12104 | else if( j5array[0] < -IKPI ) |
| 12105 | { j5array[0]+=IK2PI; |
| 12106 | } |
| 12107 | j5valid[0] = true; |
| 12108 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 12109 | { |
| 12110 | if( !j5valid[ij5] ) |
| 12111 | { |
| 12112 | continue; |
| 12113 | } |
| 12114 | _ij5[0] = ij5; _ij5[1] = -1; |
| 12115 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 12116 | { |
| 12117 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 12118 | { |
| 12119 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 12120 | } |
| 12121 | } |
| 12122 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 12123 | { |
| 12124 | IkReal evalcond[10]; |
| 12125 | IkReal x1366=IKcos(j5); |
| 12126 | IkReal x1367=IKsin(j5); |
| 12127 | IkReal x1368=((1.0)*gconst16); |
| 12128 | IkReal x1369=((1.0000000008)*gconst16); |
| 12129 | IkReal x1370=(new_r00*x1366); |
| 12130 | IkReal x1371=(new_r01*x1366); |
| 12131 | evalcond[0]=(new_r00*x1367); |
| 12132 | evalcond[1]=x1371; |
| 12133 | evalcond[2]=((-1.0)*gconst16*x1366); |
| 12134 | evalcond[3]=(new_r01+(((-1.0)*x1367*x1368))); |
| 12135 | evalcond[4]=(((new_r01*x1367))+(((-1.0)*x1368))); |
| 12136 | evalcond[5]=(x1367*x1369); |
| 12137 | evalcond[6]=((1.0000000008)*x1371); |
| 12138 | evalcond[7]=((((-1.0)*x1366*x1369))+new_r00); |
| 12139 | evalcond[8]=(x1370+(((-1.0)*x1369))); |
| 12140 | evalcond[9]=((((1.0000000008)*x1370))+(((-1.0)*x1368))); |
| 12141 | if( 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 ) |
| 12142 | { |
| 12143 | continue; |
| 12144 | } |
| 12145 | } |
| 12146 | |
| 12147 | { |
| 12148 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 12149 | vinfos[0].jointtype = 1; |
| 12150 | vinfos[0].foffset = j0; |
| 12151 | vinfos[0].indices[0] = _ij0[0]; |
| 12152 | vinfos[0].indices[1] = _ij0[1]; |
| 12153 | vinfos[0].maxsolutions = _nj0; |
| 12154 | vinfos[1].jointtype = 1; |
| 12155 | vinfos[1].foffset = j1; |
| 12156 | vinfos[1].indices[0] = _ij1[0]; |
| 12157 | vinfos[1].indices[1] = _ij1[1]; |
| 12158 | vinfos[1].maxsolutions = _nj1; |
| 12159 | vinfos[2].jointtype = 1; |
| 12160 | vinfos[2].foffset = j2; |
| 12161 | vinfos[2].indices[0] = _ij2[0]; |
| 12162 | vinfos[2].indices[1] = _ij2[1]; |
| 12163 | vinfos[2].maxsolutions = _nj2; |
| 12164 | vinfos[3].jointtype = 1; |
| 12165 | vinfos[3].foffset = j3; |
| 12166 | vinfos[3].indices[0] = _ij3[0]; |
| 12167 | vinfos[3].indices[1] = _ij3[1]; |
| 12168 | vinfos[3].maxsolutions = _nj3; |
| 12169 | vinfos[4].jointtype = 1; |
| 12170 | vinfos[4].foffset = j4; |
| 12171 | vinfos[4].indices[0] = _ij4[0]; |
| 12172 | vinfos[4].indices[1] = _ij4[1]; |
| 12173 | vinfos[4].maxsolutions = _nj4; |
| 12174 | vinfos[5].jointtype = 1; |
| 12175 | vinfos[5].foffset = j5; |
| 12176 | vinfos[5].indices[0] = _ij5[0]; |
| 12177 | vinfos[5].indices[1] = _ij5[1]; |
| 12178 | vinfos[5].maxsolutions = _nj5; |
| 12179 | std::vector<int> vfree(0); |
| 12180 | solutions.AddSolution(vinfos,vfree); |
| 12181 | } |
| 12182 | } |
| 12183 | } |
| 12184 | |
| 12185 | } |
| 12186 | } while(0); |
| 12187 | if( bgotonextstatement ) |
| 12188 | { |
| 12189 | bool bgotonextstatement = true; |
| 12190 | do |
| 12191 | { |
| 12192 | if( 1 ) |
| 12193 | { |
| 12194 | bgotonextstatement=false; |
| 12195 | continue; // branch miss [j5] |
| 12196 | |
| 12197 | } |
| 12198 | } while(0); |
| 12199 | if( bgotonextstatement ) |
| 12200 | { |
| 12201 | } |
| 12202 | } |
| 12203 | } |
| 12204 | } |
| 12205 | } |
| 12206 | |
| 12207 | } else |
| 12208 | { |
| 12209 | { |
| 12210 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 12211 | bool j5valid[1]={false}; |
| 12212 | _nj5 = 1; |
| 12213 | CheckValue<IkReal> x1378=IKPowWithIntegerCheck(new_r00,-1); |
| 12214 | if(!x1378.valid){ |
| 12215 | continue; |
| 12216 | } |
| 12217 | IkReal x1372=x1378.value; |
| 12218 | IkReal x1373=((25000.0)*gconst16); |
| 12219 | IkReal x1374=((25000.0)*new_r01); |
| 12220 | IkReal x1375=(gconst15*x1372); |
| 12221 | CheckValue<IkReal> x1379=IKPowWithIntegerCheck(((((-25000.00002)*gconst15*new_r00))+((new_r10*x1373))),-1); |
| 12222 | if(!x1379.valid){ |
| 12223 | continue; |
| 12224 | } |
| 12225 | IkReal x1376=x1379.value; |
| 12226 | IkReal x1377=(new_r10*x1376); |
| 12227 | CheckValue<IkReal> x1380=IKPowWithIntegerCheck(((((25000.0)*gconst16*new_r10))+(((-25000.00002)*gconst15*new_r00))),-1); |
| 12228 | if(!x1380.valid){ |
| 12229 | continue; |
| 12230 | } |
| 12231 | if( IKabs(((((-1.0)*x1375))+((new_r10*x1373*x1375*(x1380.value)))+((x1374*x1377)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x1376*(((((-1.0)*new_r00*x1374))+(((-1.0)*gconst15*x1373)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*x1375))+((new_r10*x1373*x1375*(x1380.value)))+((x1374*x1377))))+IKsqr((x1376*(((((-1.0)*new_r00*x1374))+(((-1.0)*gconst15*x1373))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 12232 | continue; |
| 12233 | j5array[0]=IKatan2(((((-1.0)*x1375))+((new_r10*x1373*x1375*(x1380.value)))+((x1374*x1377))), (x1376*(((((-1.0)*new_r00*x1374))+(((-1.0)*gconst15*x1373)))))); |
| 12234 | sj5array[0]=IKsin(j5array[0]); |
| 12235 | cj5array[0]=IKcos(j5array[0]); |
| 12236 | if( j5array[0] > IKPI ) |
| 12237 | { |
| 12238 | j5array[0]-=IK2PI; |
| 12239 | } |
| 12240 | else if( j5array[0] < -IKPI ) |
| 12241 | { j5array[0]+=IK2PI; |
| 12242 | } |
| 12243 | j5valid[0] = true; |
| 12244 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 12245 | { |
| 12246 | if( !j5valid[ij5] ) |
| 12247 | { |
| 12248 | continue; |
| 12249 | } |
| 12250 | _ij5[0] = ij5; _ij5[1] = -1; |
| 12251 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 12252 | { |
| 12253 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 12254 | { |
| 12255 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 12256 | } |
| 12257 | } |
| 12258 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 12259 | { |
| 12260 | IkReal evalcond[10]; |
| 12261 | IkReal x1381=IKcos(j5); |
| 12262 | IkReal x1382=IKsin(j5); |
| 12263 | IkReal x1383=((1.0)*gconst16); |
| 12264 | IkReal x1384=((1.0000000008)*gconst15); |
| 12265 | IkReal x1385=((1.0000000008)*gconst16); |
| 12266 | IkReal x1386=(gconst15*x1381); |
| 12267 | IkReal x1387=(new_r00*x1381); |
| 12268 | IkReal x1388=((1.0000000008)*x1382); |
| 12269 | IkReal x1389=(new_r01*x1381); |
| 12270 | IkReal x1390=((1.0)*x1382); |
| 12271 | evalcond[0]=(((new_r10*x1381))+gconst15+((new_r00*x1382))); |
| 12272 | evalcond[1]=((((-1.0)*x1383))+((new_r11*x1381))+((new_r01*x1382))); |
| 12273 | evalcond[2]=(((gconst15*x1382))+(((-1.0)*x1381*x1385))+new_r00); |
| 12274 | evalcond[3]=(x1386+new_r10+((x1382*x1385))); |
| 12275 | evalcond[4]=((((-1.0)*x1382*x1383))+(((-1.0)*x1381*x1384))+new_r01); |
| 12276 | evalcond[5]=((((-1.0)*x1381*x1383))+new_r11+((x1382*x1384))); |
| 12277 | evalcond[6]=((((-1.0)*x1385))+x1387+(((-1.0)*new_r10*x1390))); |
| 12278 | evalcond[7]=((((-1.0)*x1384))+x1389+(((-1.0)*new_r11*x1390))); |
| 12279 | evalcond[8]=((((-1.0)*x1383))+(((1.0000000008)*x1387))+(((-1.0)*new_r10*x1388))); |
| 12280 | evalcond[9]=((((1.0000000008)*x1389))+(((-1.0)*new_r11*x1388))+(((-1.0)*gconst15))); |
| 12281 | if( 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 ) |
| 12282 | { |
| 12283 | continue; |
| 12284 | } |
| 12285 | } |
| 12286 | |
| 12287 | { |
| 12288 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 12289 | vinfos[0].jointtype = 1; |
| 12290 | vinfos[0].foffset = j0; |
| 12291 | vinfos[0].indices[0] = _ij0[0]; |
| 12292 | vinfos[0].indices[1] = _ij0[1]; |
| 12293 | vinfos[0].maxsolutions = _nj0; |
| 12294 | vinfos[1].jointtype = 1; |
| 12295 | vinfos[1].foffset = j1; |
| 12296 | vinfos[1].indices[0] = _ij1[0]; |
| 12297 | vinfos[1].indices[1] = _ij1[1]; |
| 12298 | vinfos[1].maxsolutions = _nj1; |
| 12299 | vinfos[2].jointtype = 1; |
| 12300 | vinfos[2].foffset = j2; |
| 12301 | vinfos[2].indices[0] = _ij2[0]; |
| 12302 | vinfos[2].indices[1] = _ij2[1]; |
| 12303 | vinfos[2].maxsolutions = _nj2; |
| 12304 | vinfos[3].jointtype = 1; |
| 12305 | vinfos[3].foffset = j3; |
| 12306 | vinfos[3].indices[0] = _ij3[0]; |
| 12307 | vinfos[3].indices[1] = _ij3[1]; |
| 12308 | vinfos[3].maxsolutions = _nj3; |
| 12309 | vinfos[4].jointtype = 1; |
| 12310 | vinfos[4].foffset = j4; |
| 12311 | vinfos[4].indices[0] = _ij4[0]; |
| 12312 | vinfos[4].indices[1] = _ij4[1]; |
| 12313 | vinfos[4].maxsolutions = _nj4; |
| 12314 | vinfos[5].jointtype = 1; |
| 12315 | vinfos[5].foffset = j5; |
| 12316 | vinfos[5].indices[0] = _ij5[0]; |
| 12317 | vinfos[5].indices[1] = _ij5[1]; |
| 12318 | vinfos[5].maxsolutions = _nj5; |
| 12319 | std::vector<int> vfree(0); |
| 12320 | solutions.AddSolution(vinfos,vfree); |
| 12321 | } |
| 12322 | } |
| 12323 | } |
| 12324 | |
| 12325 | } |
| 12326 | |
| 12327 | } |
| 12328 | |
| 12329 | } else |
| 12330 | { |
| 12331 | { |
| 12332 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 12333 | bool j5valid[1]={false}; |
| 12334 | _nj5 = 1; |
| 12335 | CheckValue<IkReal> x1395=IKPowWithIntegerCheck(new_r00,-1); |
| 12336 | if(!x1395.valid){ |
| 12337 | continue; |
| 12338 | } |
| 12339 | IkReal x1391=x1395.value; |
| 12340 | IkReal x1392=gconst15*gconst15; |
| 12341 | IkReal x1393=((25000.0)*new_r10); |
| 12342 | CheckValue<IkReal> x1396=IKPowWithIntegerCheck(((((25000.00002)*gconst16*new_r00))+((gconst15*x1393))),-1); |
| 12343 | if(!x1396.valid){ |
| 12344 | continue; |
| 12345 | } |
| 12346 | IkReal x1394=x1396.value; |
| 12347 | CheckValue<IkReal> x1397=IKPowWithIntegerCheck(x1391,-2); |
| 12348 | if(!x1397.valid){ |
| 12349 | continue; |
| 12350 | } |
| 12351 | if( IKabs(((((-1.0)*gconst15*x1391))+(((-1.0)*new_r00*x1393*x1394))+((x1391*x1392*x1393*x1394)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x1394*(((((-25000.0)*x1392))+(((25000.0)*(x1397.value))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*gconst15*x1391))+(((-1.0)*new_r00*x1393*x1394))+((x1391*x1392*x1393*x1394))))+IKsqr((x1394*(((((-25000.0)*x1392))+(((25000.0)*(x1397.value)))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 12352 | continue; |
| 12353 | j5array[0]=IKatan2(((((-1.0)*gconst15*x1391))+(((-1.0)*new_r00*x1393*x1394))+((x1391*x1392*x1393*x1394))), (x1394*(((((-25000.0)*x1392))+(((25000.0)*(x1397.value))))))); |
| 12354 | sj5array[0]=IKsin(j5array[0]); |
| 12355 | cj5array[0]=IKcos(j5array[0]); |
| 12356 | if( j5array[0] > IKPI ) |
| 12357 | { |
| 12358 | j5array[0]-=IK2PI; |
| 12359 | } |
| 12360 | else if( j5array[0] < -IKPI ) |
| 12361 | { j5array[0]+=IK2PI; |
| 12362 | } |
| 12363 | j5valid[0] = true; |
| 12364 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 12365 | { |
| 12366 | if( !j5valid[ij5] ) |
| 12367 | { |
| 12368 | continue; |
| 12369 | } |
| 12370 | _ij5[0] = ij5; _ij5[1] = -1; |
| 12371 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 12372 | { |
| 12373 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 12374 | { |
| 12375 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 12376 | } |
| 12377 | } |
| 12378 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 12379 | { |
| 12380 | IkReal evalcond[10]; |
| 12381 | IkReal x1398=IKcos(j5); |
| 12382 | IkReal x1399=IKsin(j5); |
| 12383 | IkReal x1400=((1.0)*gconst16); |
| 12384 | IkReal x1401=((1.0000000008)*gconst15); |
| 12385 | IkReal x1402=((1.0000000008)*gconst16); |
| 12386 | IkReal x1403=(gconst15*x1398); |
| 12387 | IkReal x1404=(new_r00*x1398); |
| 12388 | IkReal x1405=((1.0000000008)*x1399); |
| 12389 | IkReal x1406=(new_r01*x1398); |
| 12390 | IkReal x1407=((1.0)*x1399); |
| 12391 | evalcond[0]=(((new_r10*x1398))+gconst15+((new_r00*x1399))); |
| 12392 | evalcond[1]=(((new_r11*x1398))+(((-1.0)*x1400))+((new_r01*x1399))); |
| 12393 | evalcond[2]=(((gconst15*x1399))+(((-1.0)*x1398*x1402))+new_r00); |
| 12394 | evalcond[3]=(((x1399*x1402))+x1403+new_r10); |
| 12395 | evalcond[4]=((((-1.0)*x1399*x1400))+(((-1.0)*x1398*x1401))+new_r01); |
| 12396 | evalcond[5]=((((-1.0)*x1398*x1400))+((x1399*x1401))+new_r11); |
| 12397 | evalcond[6]=((((-1.0)*x1402))+x1404+(((-1.0)*new_r10*x1407))); |
| 12398 | evalcond[7]=((((-1.0)*x1401))+x1406+(((-1.0)*new_r11*x1407))); |
| 12399 | evalcond[8]=((((1.0000000008)*x1404))+(((-1.0)*x1400))+(((-1.0)*new_r10*x1405))); |
| 12400 | evalcond[9]=((((1.0000000008)*x1406))+(((-1.0)*gconst15))+(((-1.0)*new_r11*x1405))); |
| 12401 | if( 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 ) |
| 12402 | { |
| 12403 | continue; |
| 12404 | } |
| 12405 | } |
| 12406 | |
| 12407 | { |
| 12408 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 12409 | vinfos[0].jointtype = 1; |
| 12410 | vinfos[0].foffset = j0; |
| 12411 | vinfos[0].indices[0] = _ij0[0]; |
| 12412 | vinfos[0].indices[1] = _ij0[1]; |
| 12413 | vinfos[0].maxsolutions = _nj0; |
| 12414 | vinfos[1].jointtype = 1; |
| 12415 | vinfos[1].foffset = j1; |
| 12416 | vinfos[1].indices[0] = _ij1[0]; |
| 12417 | vinfos[1].indices[1] = _ij1[1]; |
| 12418 | vinfos[1].maxsolutions = _nj1; |
| 12419 | vinfos[2].jointtype = 1; |
| 12420 | vinfos[2].foffset = j2; |
| 12421 | vinfos[2].indices[0] = _ij2[0]; |
| 12422 | vinfos[2].indices[1] = _ij2[1]; |
| 12423 | vinfos[2].maxsolutions = _nj2; |
| 12424 | vinfos[3].jointtype = 1; |
| 12425 | vinfos[3].foffset = j3; |
| 12426 | vinfos[3].indices[0] = _ij3[0]; |
| 12427 | vinfos[3].indices[1] = _ij3[1]; |
| 12428 | vinfos[3].maxsolutions = _nj3; |
| 12429 | vinfos[4].jointtype = 1; |
| 12430 | vinfos[4].foffset = j4; |
| 12431 | vinfos[4].indices[0] = _ij4[0]; |
| 12432 | vinfos[4].indices[1] = _ij4[1]; |
| 12433 | vinfos[4].maxsolutions = _nj4; |
| 12434 | vinfos[5].jointtype = 1; |
| 12435 | vinfos[5].foffset = j5; |
| 12436 | vinfos[5].indices[0] = _ij5[0]; |
| 12437 | vinfos[5].indices[1] = _ij5[1]; |
| 12438 | vinfos[5].maxsolutions = _nj5; |
| 12439 | std::vector<int> vfree(0); |
| 12440 | solutions.AddSolution(vinfos,vfree); |
| 12441 | } |
| 12442 | } |
| 12443 | } |
| 12444 | |
| 12445 | } |
| 12446 | |
| 12447 | } |
| 12448 | |
| 12449 | } else |
| 12450 | { |
| 12451 | { |
| 12452 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 12453 | bool j5valid[1]={false}; |
| 12454 | _nj5 = 1; |
| 12455 | IkReal x1408=((1.0)*new_r00); |
| 12456 | CheckValue<IkReal> x1409=IKPowWithIntegerCheck(IKsign((((new_r01*new_r10))+(((-1.0)*new_r11*x1408)))),-1); |
| 12457 | if(!x1409.valid){ |
| 12458 | continue; |
| 12459 | } |
| 12460 | CheckValue<IkReal> x1410 = IKatan2WithCheck(IkReal((((gconst16*new_r10))+((gconst15*new_r11)))),IkReal(((((-1.0)*gconst16*x1408))+(((-1.0)*gconst15*new_r01)))),IKFAST_ATAN2_MAGTHRESH); |
| 12461 | if(!x1410.valid){ |
| 12462 | continue; |
| 12463 | } |
| 12464 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1409.value)))+(x1410.value)); |
| 12465 | sj5array[0]=IKsin(j5array[0]); |
| 12466 | cj5array[0]=IKcos(j5array[0]); |
| 12467 | if( j5array[0] > IKPI ) |
| 12468 | { |
| 12469 | j5array[0]-=IK2PI; |
| 12470 | } |
| 12471 | else if( j5array[0] < -IKPI ) |
| 12472 | { j5array[0]+=IK2PI; |
| 12473 | } |
| 12474 | j5valid[0] = true; |
| 12475 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 12476 | { |
| 12477 | if( !j5valid[ij5] ) |
| 12478 | { |
| 12479 | continue; |
| 12480 | } |
| 12481 | _ij5[0] = ij5; _ij5[1] = -1; |
| 12482 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 12483 | { |
| 12484 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 12485 | { |
| 12486 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 12487 | } |
| 12488 | } |
| 12489 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 12490 | { |
| 12491 | IkReal evalcond[10]; |
| 12492 | IkReal x1411=IKcos(j5); |
| 12493 | IkReal x1412=IKsin(j5); |
| 12494 | IkReal x1413=((1.0)*gconst16); |
| 12495 | IkReal x1414=((1.0000000008)*gconst15); |
| 12496 | IkReal x1415=((1.0000000008)*gconst16); |
| 12497 | IkReal x1416=(gconst15*x1411); |
| 12498 | IkReal x1417=(new_r00*x1411); |
| 12499 | IkReal x1418=((1.0000000008)*x1412); |
| 12500 | IkReal x1419=(new_r01*x1411); |
| 12501 | IkReal x1420=((1.0)*x1412); |
| 12502 | evalcond[0]=(((new_r00*x1412))+gconst15+((new_r10*x1411))); |
| 12503 | evalcond[1]=(((new_r01*x1412))+(((-1.0)*x1413))+((new_r11*x1411))); |
| 12504 | evalcond[2]=((((-1.0)*x1411*x1415))+((gconst15*x1412))+new_r00); |
| 12505 | evalcond[3]=(((x1412*x1415))+x1416+new_r10); |
| 12506 | evalcond[4]=((((-1.0)*x1412*x1413))+(((-1.0)*x1411*x1414))+new_r01); |
| 12507 | evalcond[5]=(((x1412*x1414))+(((-1.0)*x1411*x1413))+new_r11); |
| 12508 | evalcond[6]=((((-1.0)*x1415))+(((-1.0)*new_r10*x1420))+x1417); |
| 12509 | evalcond[7]=((((-1.0)*x1414))+(((-1.0)*new_r11*x1420))+x1419); |
| 12510 | evalcond[8]=((((-1.0)*new_r10*x1418))+(((-1.0)*x1413))+(((1.0000000008)*x1417))); |
| 12511 | evalcond[9]=((((-1.0)*new_r11*x1418))+(((1.0000000008)*x1419))+(((-1.0)*gconst15))); |
| 12512 | if( 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 ) |
| 12513 | { |
| 12514 | continue; |
| 12515 | } |
| 12516 | } |
| 12517 | |
| 12518 | { |
| 12519 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 12520 | vinfos[0].jointtype = 1; |
| 12521 | vinfos[0].foffset = j0; |
| 12522 | vinfos[0].indices[0] = _ij0[0]; |
| 12523 | vinfos[0].indices[1] = _ij0[1]; |
| 12524 | vinfos[0].maxsolutions = _nj0; |
| 12525 | vinfos[1].jointtype = 1; |
| 12526 | vinfos[1].foffset = j1; |
| 12527 | vinfos[1].indices[0] = _ij1[0]; |
| 12528 | vinfos[1].indices[1] = _ij1[1]; |
| 12529 | vinfos[1].maxsolutions = _nj1; |
| 12530 | vinfos[2].jointtype = 1; |
| 12531 | vinfos[2].foffset = j2; |
| 12532 | vinfos[2].indices[0] = _ij2[0]; |
| 12533 | vinfos[2].indices[1] = _ij2[1]; |
| 12534 | vinfos[2].maxsolutions = _nj2; |
| 12535 | vinfos[3].jointtype = 1; |
| 12536 | vinfos[3].foffset = j3; |
| 12537 | vinfos[3].indices[0] = _ij3[0]; |
| 12538 | vinfos[3].indices[1] = _ij3[1]; |
| 12539 | vinfos[3].maxsolutions = _nj3; |
| 12540 | vinfos[4].jointtype = 1; |
| 12541 | vinfos[4].foffset = j4; |
| 12542 | vinfos[4].indices[0] = _ij4[0]; |
| 12543 | vinfos[4].indices[1] = _ij4[1]; |
| 12544 | vinfos[4].maxsolutions = _nj4; |
| 12545 | vinfos[5].jointtype = 1; |
| 12546 | vinfos[5].foffset = j5; |
| 12547 | vinfos[5].indices[0] = _ij5[0]; |
| 12548 | vinfos[5].indices[1] = _ij5[1]; |
| 12549 | vinfos[5].maxsolutions = _nj5; |
| 12550 | std::vector<int> vfree(0); |
| 12551 | solutions.AddSolution(vinfos,vfree); |
| 12552 | } |
| 12553 | } |
| 12554 | } |
| 12555 | |
| 12556 | } |
| 12557 | |
| 12558 | } |
| 12559 | |
| 12560 | } |
| 12561 | } while(0); |
| 12562 | if( bgotonextstatement ) |
| 12563 | { |
| 12564 | bool bgotonextstatement = true; |
| 12565 | do |
| 12566 | { |
| 12567 | IkReal x1422 = ((((1.0000000016)*(new_r10*new_r10)))+(new_r00*new_r00)); |
| 12568 | if(IKabs(x1422)==0){ |
| 12569 | continue; |
| 12570 | } |
| 12571 | IkReal x1421=pow(x1422,-0.5); |
| 12572 | CheckValue<IkReal> x1423 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 12573 | if(!x1423.valid){ |
| 12574 | continue; |
| 12575 | } |
| 12576 | IkReal gconst17=((3.14159265358979)+(((-1.0)*(x1423.value)))); |
| 12577 | IkReal gconst18=((-1.0000000008)*new_r10*x1421); |
| 12578 | IkReal gconst19=((-1.0)*new_r00*x1421); |
| 12579 | CheckValue<IkReal> x1424 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 12580 | if(!x1424.valid){ |
| 12581 | continue; |
| 12582 | } |
| 12583 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+(x1424.value)+j3)))), 6.28318530717959))); |
| 12584 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 12585 | { |
| 12586 | bgotonextstatement=false; |
| 12587 | { |
| 12588 | IkReal j5eval[2]; |
| 12589 | IkReal x1425=x1421; |
| 12590 | sj4=4.0e-5; |
| 12591 | cj4=1.0; |
| 12592 | j4=4.0e-5; |
| 12593 | sj3=gconst18; |
| 12594 | cj3=gconst19; |
| 12595 | CheckValue<IkReal> x1426 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 12596 | if(!x1426.valid){ |
| 12597 | continue; |
| 12598 | } |
| 12599 | j3=((3.14159265)+(((-1.0)*(x1426.value)))); |
| 12600 | CheckValue<IkReal> x1427 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 12601 | if(!x1427.valid){ |
| 12602 | continue; |
| 12603 | } |
| 12604 | IkReal gconst17=((3.14159265358979)+(((-1.0)*(x1427.value)))); |
| 12605 | IkReal gconst18=((-1.0000000008)*new_r10*x1425); |
| 12606 | IkReal gconst19=((-1.0)*new_r00*x1425); |
| 12607 | IkReal x1428=(((new_r01*new_r10))+(((-1.0)*new_r00*new_r11))); |
| 12608 | j5eval[0]=x1428; |
| 12609 | j5eval[1]=IKsign(x1428); |
| 12610 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 12611 | { |
| 12612 | { |
| 12613 | IkReal j5eval[1]; |
| 12614 | IkReal x1429=x1421; |
| 12615 | sj4=4.0e-5; |
| 12616 | cj4=1.0; |
| 12617 | j4=4.0e-5; |
| 12618 | sj3=gconst18; |
| 12619 | cj3=gconst19; |
| 12620 | CheckValue<IkReal> x1430 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 12621 | if(!x1430.valid){ |
| 12622 | continue; |
| 12623 | } |
| 12624 | j3=((3.14159265)+(((-1.0)*(x1430.value)))); |
| 12625 | CheckValue<IkReal> x1431 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 12626 | if(!x1431.valid){ |
| 12627 | continue; |
| 12628 | } |
| 12629 | IkReal gconst17=((3.14159265358979)+(((-1.0)*(x1431.value)))); |
| 12630 | IkReal gconst18=((-1.0000000008)*new_r10*x1429); |
| 12631 | IkReal gconst19=((-1.0)*new_r00*x1429); |
| 12632 | j5eval[0]=new_r00; |
| 12633 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 12634 | { |
| 12635 | { |
| 12636 | IkReal j5eval[2]; |
| 12637 | IkReal x1432=x1421; |
| 12638 | sj4=4.0e-5; |
| 12639 | cj4=1.0; |
| 12640 | j4=4.0e-5; |
| 12641 | sj3=gconst18; |
| 12642 | cj3=gconst19; |
| 12643 | CheckValue<IkReal> x1433 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 12644 | if(!x1433.valid){ |
| 12645 | continue; |
| 12646 | } |
| 12647 | j3=((3.14159265)+(((-1.0)*(x1433.value)))); |
| 12648 | CheckValue<IkReal> x1434 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 12649 | if(!x1434.valid){ |
| 12650 | continue; |
| 12651 | } |
| 12652 | IkReal gconst17=((3.14159265358979)+(((-1.0)*(x1434.value)))); |
| 12653 | IkReal gconst18=((-1.0000000008)*new_r10*x1432); |
| 12654 | IkReal gconst19=((-1.0)*new_r00*x1432); |
| 12655 | j5eval[0]=new_r00; |
| 12656 | IkReal x1435 = ((((1.0000000016)*(new_r10*new_r10)))+(new_r00*new_r00)); |
| 12657 | if(IKabs(x1435)==0){ |
| 12658 | continue; |
| 12659 | } |
| 12660 | j5eval[1]=((1.60000013238459e-9)*new_r00*new_r10*(pow(x1435,-0.5))); |
| 12661 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 12662 | { |
| 12663 | { |
| 12664 | IkReal evalcond[1]; |
| 12665 | bool bgotonextstatement = true; |
| 12666 | do |
| 12667 | { |
| 12668 | evalcond[0]=IKabs(new_r00); |
| 12669 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 12670 | { |
| 12671 | bgotonextstatement=false; |
| 12672 | { |
| 12673 | IkReal j5eval[1]; |
| 12674 | sj4=4.0e-5; |
| 12675 | cj4=1.0; |
| 12676 | j4=4.0e-5; |
| 12677 | sj3=gconst18; |
| 12678 | cj3=gconst19; |
| 12679 | CheckValue<IkReal> x1436 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(0),IKFAST_ATAN2_MAGTHRESH); |
| 12680 | if(!x1436.valid){ |
| 12681 | continue; |
| 12682 | } |
| 12683 | j3=((3.14159265)+(((-1.0)*(x1436.value)))); |
| 12684 | new_r00=0; |
| 12685 | CheckValue<IkReal> x1437 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(0),IKFAST_ATAN2_MAGTHRESH); |
| 12686 | if(!x1437.valid){ |
| 12687 | continue; |
| 12688 | } |
| 12689 | IkReal gconst17=((3.14159265358979)+(((-1.0)*(x1437.value)))); |
| 12690 | IkReal x1438 = new_r10*new_r10; |
| 12691 | if(IKabs(x1438)==0){ |
| 12692 | continue; |
| 12693 | } |
| 12694 | IkReal gconst18=((-1.0)*new_r10*(pow(x1438,-0.5))); |
| 12695 | IkReal gconst19=0; |
| 12696 | j5eval[0]=new_r10; |
| 12697 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 12698 | { |
| 12699 | { |
| 12700 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 12701 | bool j5valid[1]={false}; |
| 12702 | _nj5 = 1; |
| 12703 | CheckValue<IkReal> x1440=IKPowWithIntegerCheck(gconst18,-1); |
| 12704 | if(!x1440.valid){ |
| 12705 | continue; |
| 12706 | } |
| 12707 | IkReal x1439=x1440.value; |
| 12708 | if( IKabs(((-0.9999999992)*new_r11*x1439)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r10*x1439)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-0.9999999992)*new_r11*x1439))+IKsqr(((-1.0)*new_r10*x1439))-1) <= IKFAST_SINCOS_THRESH ) |
| 12709 | continue; |
| 12710 | j5array[0]=IKatan2(((-0.9999999992)*new_r11*x1439), ((-1.0)*new_r10*x1439)); |
| 12711 | sj5array[0]=IKsin(j5array[0]); |
| 12712 | cj5array[0]=IKcos(j5array[0]); |
| 12713 | if( j5array[0] > IKPI ) |
| 12714 | { |
| 12715 | j5array[0]-=IK2PI; |
| 12716 | } |
| 12717 | else if( j5array[0] < -IKPI ) |
| 12718 | { j5array[0]+=IK2PI; |
| 12719 | } |
| 12720 | j5valid[0] = true; |
| 12721 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 12722 | { |
| 12723 | if( !j5valid[ij5] ) |
| 12724 | { |
| 12725 | continue; |
| 12726 | } |
| 12727 | _ij5[0] = ij5; _ij5[1] = -1; |
| 12728 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 12729 | { |
| 12730 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 12731 | { |
| 12732 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 12733 | } |
| 12734 | } |
| 12735 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 12736 | { |
| 12737 | IkReal evalcond[10]; |
| 12738 | IkReal x1441=IKsin(j5); |
| 12739 | IkReal x1442=IKcos(j5); |
| 12740 | IkReal x1443=((1.0000000008)*gconst18); |
| 12741 | IkReal x1444=(gconst18*x1441); |
| 12742 | IkReal x1445=(new_r01*x1442); |
| 12743 | IkReal x1446=(new_r11*x1441); |
| 12744 | IkReal x1447=(new_r10*x1441); |
| 12745 | evalcond[0]=x1444; |
| 12746 | evalcond[1]=((-1.0)*x1447); |
| 12747 | evalcond[2]=(((new_r10*x1442))+gconst18); |
| 12748 | evalcond[3]=(new_r10+((gconst18*x1442))); |
| 12749 | evalcond[4]=((-1.0000000008)*x1447); |
| 12750 | evalcond[5]=(((new_r11*x1442))+((new_r01*x1441))); |
| 12751 | evalcond[6]=(new_r01+(((-1.0)*x1442*x1443))); |
| 12752 | evalcond[7]=(((x1441*x1443))+new_r11); |
| 12753 | evalcond[8]=((((-1.0)*x1446))+x1445+(((-1.0)*x1443))); |
| 12754 | evalcond[9]=((((1.0000000008)*x1445))+(((-1.0)*gconst18))+(((-1.0000000008)*x1446))); |
| 12755 | if( 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 ) |
| 12756 | { |
| 12757 | continue; |
| 12758 | } |
| 12759 | } |
| 12760 | |
| 12761 | { |
| 12762 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 12763 | vinfos[0].jointtype = 1; |
| 12764 | vinfos[0].foffset = j0; |
| 12765 | vinfos[0].indices[0] = _ij0[0]; |
| 12766 | vinfos[0].indices[1] = _ij0[1]; |
| 12767 | vinfos[0].maxsolutions = _nj0; |
| 12768 | vinfos[1].jointtype = 1; |
| 12769 | vinfos[1].foffset = j1; |
| 12770 | vinfos[1].indices[0] = _ij1[0]; |
| 12771 | vinfos[1].indices[1] = _ij1[1]; |
| 12772 | vinfos[1].maxsolutions = _nj1; |
| 12773 | vinfos[2].jointtype = 1; |
| 12774 | vinfos[2].foffset = j2; |
| 12775 | vinfos[2].indices[0] = _ij2[0]; |
| 12776 | vinfos[2].indices[1] = _ij2[1]; |
| 12777 | vinfos[2].maxsolutions = _nj2; |
| 12778 | vinfos[3].jointtype = 1; |
| 12779 | vinfos[3].foffset = j3; |
| 12780 | vinfos[3].indices[0] = _ij3[0]; |
| 12781 | vinfos[3].indices[1] = _ij3[1]; |
| 12782 | vinfos[3].maxsolutions = _nj3; |
| 12783 | vinfos[4].jointtype = 1; |
| 12784 | vinfos[4].foffset = j4; |
| 12785 | vinfos[4].indices[0] = _ij4[0]; |
| 12786 | vinfos[4].indices[1] = _ij4[1]; |
| 12787 | vinfos[4].maxsolutions = _nj4; |
| 12788 | vinfos[5].jointtype = 1; |
| 12789 | vinfos[5].foffset = j5; |
| 12790 | vinfos[5].indices[0] = _ij5[0]; |
| 12791 | vinfos[5].indices[1] = _ij5[1]; |
| 12792 | vinfos[5].maxsolutions = _nj5; |
| 12793 | std::vector<int> vfree(0); |
| 12794 | solutions.AddSolution(vinfos,vfree); |
| 12795 | } |
| 12796 | } |
| 12797 | } |
| 12798 | |
| 12799 | } else |
| 12800 | { |
| 12801 | { |
| 12802 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 12803 | bool j5valid[1]={false}; |
| 12804 | _nj5 = 1; |
| 12805 | CheckValue<IkReal> x1448=IKPowWithIntegerCheck(gconst18,-1); |
| 12806 | if(!x1448.valid){ |
| 12807 | continue; |
| 12808 | } |
| 12809 | CheckValue<IkReal> x1449=IKPowWithIntegerCheck(new_r10,-1); |
| 12810 | if(!x1449.valid){ |
| 12811 | continue; |
| 12812 | } |
| 12813 | if( IKabs(((-0.9999999992)*new_r11*(x1448.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*gconst18*(x1449.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-0.9999999992)*new_r11*(x1448.value)))+IKsqr(((-1.0)*gconst18*(x1449.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 12814 | continue; |
| 12815 | j5array[0]=IKatan2(((-0.9999999992)*new_r11*(x1448.value)), ((-1.0)*gconst18*(x1449.value))); |
| 12816 | sj5array[0]=IKsin(j5array[0]); |
| 12817 | cj5array[0]=IKcos(j5array[0]); |
| 12818 | if( j5array[0] > IKPI ) |
| 12819 | { |
| 12820 | j5array[0]-=IK2PI; |
| 12821 | } |
| 12822 | else if( j5array[0] < -IKPI ) |
| 12823 | { j5array[0]+=IK2PI; |
| 12824 | } |
| 12825 | j5valid[0] = true; |
| 12826 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 12827 | { |
| 12828 | if( !j5valid[ij5] ) |
| 12829 | { |
| 12830 | continue; |
| 12831 | } |
| 12832 | _ij5[0] = ij5; _ij5[1] = -1; |
| 12833 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 12834 | { |
| 12835 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 12836 | { |
| 12837 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 12838 | } |
| 12839 | } |
| 12840 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 12841 | { |
| 12842 | IkReal evalcond[10]; |
| 12843 | IkReal x1450=IKsin(j5); |
| 12844 | IkReal x1451=IKcos(j5); |
| 12845 | IkReal x1452=((1.0000000008)*gconst18); |
| 12846 | IkReal x1453=(gconst18*x1450); |
| 12847 | IkReal x1454=(new_r01*x1451); |
| 12848 | IkReal x1455=(new_r11*x1450); |
| 12849 | IkReal x1456=(new_r10*x1450); |
| 12850 | evalcond[0]=x1453; |
| 12851 | evalcond[1]=((-1.0)*x1456); |
| 12852 | evalcond[2]=(gconst18+((new_r10*x1451))); |
| 12853 | evalcond[3]=(((gconst18*x1451))+new_r10); |
| 12854 | evalcond[4]=((-1.0000000008)*x1456); |
| 12855 | evalcond[5]=(((new_r01*x1450))+((new_r11*x1451))); |
| 12856 | evalcond[6]=(new_r01+(((-1.0)*x1451*x1452))); |
| 12857 | evalcond[7]=(((x1450*x1452))+new_r11); |
| 12858 | evalcond[8]=((((-1.0)*x1452))+(((-1.0)*x1455))+x1454); |
| 12859 | evalcond[9]=((((1.0000000008)*x1454))+(((-1.0)*gconst18))+(((-1.0000000008)*x1455))); |
| 12860 | if( 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 ) |
| 12861 | { |
| 12862 | continue; |
| 12863 | } |
| 12864 | } |
| 12865 | |
| 12866 | { |
| 12867 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 12868 | vinfos[0].jointtype = 1; |
| 12869 | vinfos[0].foffset = j0; |
| 12870 | vinfos[0].indices[0] = _ij0[0]; |
| 12871 | vinfos[0].indices[1] = _ij0[1]; |
| 12872 | vinfos[0].maxsolutions = _nj0; |
| 12873 | vinfos[1].jointtype = 1; |
| 12874 | vinfos[1].foffset = j1; |
| 12875 | vinfos[1].indices[0] = _ij1[0]; |
| 12876 | vinfos[1].indices[1] = _ij1[1]; |
| 12877 | vinfos[1].maxsolutions = _nj1; |
| 12878 | vinfos[2].jointtype = 1; |
| 12879 | vinfos[2].foffset = j2; |
| 12880 | vinfos[2].indices[0] = _ij2[0]; |
| 12881 | vinfos[2].indices[1] = _ij2[1]; |
| 12882 | vinfos[2].maxsolutions = _nj2; |
| 12883 | vinfos[3].jointtype = 1; |
| 12884 | vinfos[3].foffset = j3; |
| 12885 | vinfos[3].indices[0] = _ij3[0]; |
| 12886 | vinfos[3].indices[1] = _ij3[1]; |
| 12887 | vinfos[3].maxsolutions = _nj3; |
| 12888 | vinfos[4].jointtype = 1; |
| 12889 | vinfos[4].foffset = j4; |
| 12890 | vinfos[4].indices[0] = _ij4[0]; |
| 12891 | vinfos[4].indices[1] = _ij4[1]; |
| 12892 | vinfos[4].maxsolutions = _nj4; |
| 12893 | vinfos[5].jointtype = 1; |
| 12894 | vinfos[5].foffset = j5; |
| 12895 | vinfos[5].indices[0] = _ij5[0]; |
| 12896 | vinfos[5].indices[1] = _ij5[1]; |
| 12897 | vinfos[5].maxsolutions = _nj5; |
| 12898 | std::vector<int> vfree(0); |
| 12899 | solutions.AddSolution(vinfos,vfree); |
| 12900 | } |
| 12901 | } |
| 12902 | } |
| 12903 | |
| 12904 | } |
| 12905 | |
| 12906 | } |
| 12907 | |
| 12908 | } |
| 12909 | } while(0); |
| 12910 | if( bgotonextstatement ) |
| 12911 | { |
| 12912 | bool bgotonextstatement = true; |
| 12913 | do |
| 12914 | { |
| 12915 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 12916 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 12917 | { |
| 12918 | bgotonextstatement=false; |
| 12919 | { |
| 12920 | IkReal j5eval[3]; |
| 12921 | IkReal x1458 = ((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 12922 | if(IKabs(x1458)==0){ |
| 12923 | continue; |
| 12924 | } |
| 12925 | IkReal x1457=pow(x1458,-0.5); |
| 12926 | sj4=4.0e-5; |
| 12927 | cj4=1.0; |
| 12928 | j4=4.0e-5; |
| 12929 | sj3=gconst18; |
| 12930 | cj3=gconst19; |
| 12931 | CheckValue<IkReal> x1459 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 12932 | if(!x1459.valid){ |
| 12933 | continue; |
| 12934 | } |
| 12935 | j3=((3.14159265)+(((-1.0)*(x1459.value)))); |
| 12936 | new_r11=0; |
| 12937 | new_r01=0; |
| 12938 | new_r22=0; |
| 12939 | new_r20=0; |
| 12940 | CheckValue<IkReal> x1460 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 12941 | if(!x1460.valid){ |
| 12942 | continue; |
| 12943 | } |
| 12944 | IkReal gconst17=((3.14159265358979)+(((-1.0)*(x1460.value)))); |
| 12945 | IkReal gconst18=((-1.0000000008)*new_r10*x1457); |
| 12946 | IkReal gconst19=((-1.0)*new_r00*x1457); |
| 12947 | IkReal x1461=new_r10*new_r10; |
| 12948 | CheckValue<IkReal> x1465=IKPowWithIntegerCheck(((625000000.0)+(((1.0)*x1461))),-1); |
| 12949 | if(!x1465.valid){ |
| 12950 | continue; |
| 12951 | } |
| 12952 | IkReal x1462=x1465.value; |
| 12953 | if((((625000000.0)+x1461)) < -0.00001) |
| 12954 | continue; |
| 12955 | IkReal x1463=IKsqrt(((625000000.0)+x1461)); |
| 12956 | IkReal x1464=(x1462*x1463); |
| 12957 | j5eval[0]=-1.0; |
| 12958 | j5eval[1]=-1.0; |
| 12959 | IkReal x1466 = ((1.0)+(((1.6e-9)*x1461))); |
| 12960 | if(IKabs(x1466)==0){ |
| 12961 | continue; |
| 12962 | } |
| 12963 | j5eval[2]=((IKabs(((50000.00004)*new_r00*new_r10*(pow(x1466,-0.5)))))+(IKabs(((((625000000.5)*x1464))+(((-1250000001.0)*x1461*x1464)))))); |
| 12964 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 12965 | { |
| 12966 | { |
| 12967 | IkReal j5eval[1]; |
| 12968 | IkReal x1468 = ((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 12969 | if(IKabs(x1468)==0){ |
| 12970 | continue; |
| 12971 | } |
| 12972 | IkReal x1467=pow(x1468,-0.5); |
| 12973 | sj4=4.0e-5; |
| 12974 | cj4=1.0; |
| 12975 | j4=4.0e-5; |
| 12976 | sj3=gconst18; |
| 12977 | cj3=gconst19; |
| 12978 | CheckValue<IkReal> x1469 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 12979 | if(!x1469.valid){ |
| 12980 | continue; |
| 12981 | } |
| 12982 | j3=((3.14159265)+(((-1.0)*(x1469.value)))); |
| 12983 | new_r11=0; |
| 12984 | new_r01=0; |
| 12985 | new_r22=0; |
| 12986 | new_r20=0; |
| 12987 | CheckValue<IkReal> x1470 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 12988 | if(!x1470.valid){ |
| 12989 | continue; |
| 12990 | } |
| 12991 | IkReal gconst17=((3.14159265358979)+(((-1.0)*(x1470.value)))); |
| 12992 | IkReal gconst18=((-1.0000000008)*new_r10*x1467); |
| 12993 | IkReal gconst19=((-1.0)*new_r00*x1467); |
| 12994 | IkReal x1471=new_r10*new_r10; |
| 12995 | CheckValue<IkReal> x1473=IKPowWithIntegerCheck(((1.0)+(((1.6e-9)*x1471))),-1); |
| 12996 | if(!x1473.valid){ |
| 12997 | continue; |
| 12998 | } |
| 12999 | IkReal x1472=x1473.value; |
| 13000 | IkReal x1474=((1.0)+(((-1.0)*x1471))); |
| 13001 | j5eval[0]=IKsign(((((625000002.0)*x1472*(x1471*x1471)))+(((-625000000.0)*x1472*(x1474*x1474))))); |
| 13002 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 13003 | { |
| 13004 | { |
| 13005 | IkReal j5eval[2]; |
| 13006 | IkReal x1476 = ((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 13007 | if(IKabs(x1476)==0){ |
| 13008 | continue; |
| 13009 | } |
| 13010 | IkReal x1475=pow(x1476,-0.5); |
| 13011 | sj4=4.0e-5; |
| 13012 | cj4=1.0; |
| 13013 | j4=4.0e-5; |
| 13014 | sj3=gconst18; |
| 13015 | cj3=gconst19; |
| 13016 | CheckValue<IkReal> x1477 = IKatan2WithCheck(IkReal(((-1.0)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 13017 | if(!x1477.valid){ |
| 13018 | continue; |
| 13019 | } |
| 13020 | j3=((3.14159265)+(((-1.0)*(x1477.value)))); |
| 13021 | new_r11=0; |
| 13022 | new_r01=0; |
| 13023 | new_r22=0; |
| 13024 | new_r20=0; |
| 13025 | CheckValue<IkReal> x1478 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 13026 | if(!x1478.valid){ |
| 13027 | continue; |
| 13028 | } |
| 13029 | IkReal gconst17=((3.14159265358979)+(((-1.0)*(x1478.value)))); |
| 13030 | IkReal gconst18=((-1.0000000008)*new_r10*x1475); |
| 13031 | IkReal gconst19=((-1.0)*new_r00*x1475); |
| 13032 | IkReal x1479=new_r10*new_r10; |
| 13033 | IkReal x1480=((1.0)+(((1.6e-9)*x1479))); |
| 13034 | CheckValue<IkReal> x1481=IKPowWithIntegerCheck(x1480,-1); |
| 13035 | if(!x1481.valid){ |
| 13036 | continue; |
| 13037 | } |
| 13038 | j5eval[0]=((-3.20000004272458e-9)*x1479*(x1481.value)*(((1.0)+(((-1.0)*x1479))))); |
| 13039 | IkReal x1482 = x1480; |
| 13040 | if(IKabs(x1482)==0){ |
| 13041 | continue; |
| 13042 | } |
| 13043 | j5eval[1]=((1.60000013238459e-9)*new_r00*new_r10*(pow(x1482,-0.5))); |
| 13044 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 13045 | { |
| 13046 | continue; // 3 cases reached |
| 13047 | |
| 13048 | } else |
| 13049 | { |
| 13050 | { |
| 13051 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 13052 | bool j5valid[1]={false}; |
| 13053 | _nj5 = 1; |
| 13054 | IkReal x1483=gconst18*gconst18; |
| 13055 | IkReal x1484=(gconst19*new_r10); |
| 13056 | CheckValue<IkReal> x1485=IKPowWithIntegerCheck(((((-625000001.0)*x1483*(new_r00*new_r00)))+(((625000000.0)*(x1484*x1484)))),-1); |
| 13057 | if(!x1485.valid){ |
| 13058 | continue; |
| 13059 | } |
| 13060 | CheckValue<IkReal> x1486=IKPowWithIntegerCheck(((((-25000.00002)*gconst18*new_r00))+(((25000.0)*x1484))),-1); |
| 13061 | if(!x1486.valid){ |
| 13062 | continue; |
| 13063 | } |
| 13064 | if( IKabs(((x1485.value)*(((((625000000.5)*x1483*x1484))+(((625000001.0)*new_r00*(gconst18*gconst18*gconst18))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-25000.0)*gconst18*gconst19*(x1486.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x1485.value)*(((((625000000.5)*x1483*x1484))+(((625000001.0)*new_r00*(gconst18*gconst18*gconst18)))))))+IKsqr(((-25000.0)*gconst18*gconst19*(x1486.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 13065 | continue; |
| 13066 | j5array[0]=IKatan2(((x1485.value)*(((((625000000.5)*x1483*x1484))+(((625000001.0)*new_r00*(gconst18*gconst18*gconst18)))))), ((-25000.0)*gconst18*gconst19*(x1486.value))); |
| 13067 | sj5array[0]=IKsin(j5array[0]); |
| 13068 | cj5array[0]=IKcos(j5array[0]); |
| 13069 | if( j5array[0] > IKPI ) |
| 13070 | { |
| 13071 | j5array[0]-=IK2PI; |
| 13072 | } |
| 13073 | else if( j5array[0] < -IKPI ) |
| 13074 | { j5array[0]+=IK2PI; |
| 13075 | } |
| 13076 | j5valid[0] = true; |
| 13077 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 13078 | { |
| 13079 | if( !j5valid[ij5] ) |
| 13080 | { |
| 13081 | continue; |
| 13082 | } |
| 13083 | _ij5[0] = ij5; _ij5[1] = -1; |
| 13084 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 13085 | { |
| 13086 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 13087 | { |
| 13088 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 13089 | } |
| 13090 | } |
| 13091 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 13092 | { |
| 13093 | IkReal evalcond[7]; |
| 13094 | IkReal x1487=IKsin(j5); |
| 13095 | IkReal x1488=IKcos(j5); |
| 13096 | IkReal x1489=((1.0000000008)*gconst19); |
| 13097 | IkReal x1490=((1.0)*gconst19); |
| 13098 | IkReal x1491=(gconst18*x1487); |
| 13099 | IkReal x1492=(new_r00*x1488); |
| 13100 | IkReal x1493=(gconst18*x1488); |
| 13101 | IkReal x1494=(new_r10*x1487); |
| 13102 | evalcond[0]=(gconst18+((new_r00*x1487))+((new_r10*x1488))); |
| 13103 | evalcond[1]=(x1491+(((-1.0)*x1488*x1489))+new_r00); |
| 13104 | evalcond[2]=(((x1487*x1489))+x1493+new_r10); |
| 13105 | evalcond[3]=((((-1.0000000008)*x1493))+(((-1.0)*x1487*x1490))); |
| 13106 | evalcond[4]=((((1.0000000008)*x1491))+(((-1.0)*x1488*x1490))); |
| 13107 | evalcond[5]=((((-1.0)*x1489))+(((-1.0)*x1494))+x1492); |
| 13108 | evalcond[6]=((((-1.0000000008)*x1494))+(((-1.0)*x1490))+(((1.0000000008)*x1492))); |
| 13109 | if( 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 ) |
| 13110 | { |
| 13111 | continue; |
| 13112 | } |
| 13113 | } |
| 13114 | |
| 13115 | { |
| 13116 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 13117 | vinfos[0].jointtype = 1; |
| 13118 | vinfos[0].foffset = j0; |
| 13119 | vinfos[0].indices[0] = _ij0[0]; |
| 13120 | vinfos[0].indices[1] = _ij0[1]; |
| 13121 | vinfos[0].maxsolutions = _nj0; |
| 13122 | vinfos[1].jointtype = 1; |
| 13123 | vinfos[1].foffset = j1; |
| 13124 | vinfos[1].indices[0] = _ij1[0]; |
| 13125 | vinfos[1].indices[1] = _ij1[1]; |
| 13126 | vinfos[1].maxsolutions = _nj1; |
| 13127 | vinfos[2].jointtype = 1; |
| 13128 | vinfos[2].foffset = j2; |
| 13129 | vinfos[2].indices[0] = _ij2[0]; |
| 13130 | vinfos[2].indices[1] = _ij2[1]; |
| 13131 | vinfos[2].maxsolutions = _nj2; |
| 13132 | vinfos[3].jointtype = 1; |
| 13133 | vinfos[3].foffset = j3; |
| 13134 | vinfos[3].indices[0] = _ij3[0]; |
| 13135 | vinfos[3].indices[1] = _ij3[1]; |
| 13136 | vinfos[3].maxsolutions = _nj3; |
| 13137 | vinfos[4].jointtype = 1; |
| 13138 | vinfos[4].foffset = j4; |
| 13139 | vinfos[4].indices[0] = _ij4[0]; |
| 13140 | vinfos[4].indices[1] = _ij4[1]; |
| 13141 | vinfos[4].maxsolutions = _nj4; |
| 13142 | vinfos[5].jointtype = 1; |
| 13143 | vinfos[5].foffset = j5; |
| 13144 | vinfos[5].indices[0] = _ij5[0]; |
| 13145 | vinfos[5].indices[1] = _ij5[1]; |
| 13146 | vinfos[5].maxsolutions = _nj5; |
| 13147 | std::vector<int> vfree(0); |
| 13148 | solutions.AddSolution(vinfos,vfree); |
| 13149 | } |
| 13150 | } |
| 13151 | } |
| 13152 | |
| 13153 | } |
| 13154 | |
| 13155 | } |
| 13156 | |
| 13157 | } else |
| 13158 | { |
| 13159 | { |
| 13160 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 13161 | bool j5valid[1]={false}; |
| 13162 | _nj5 = 1; |
| 13163 | IkReal x1495=gconst18*gconst18; |
| 13164 | IkReal x1496=gconst19*gconst19; |
| 13165 | IkReal x1497=((625000000.0)*x1496); |
| 13166 | IkReal x1498=((625000000.5)*gconst19*x1495); |
| 13167 | CheckValue<IkReal> x1499=IKPowWithIntegerCheck(IKsign(((((625000001.0)*x1495*(new_r10*new_r10)))+(((-1.0)*x1497*(new_r00*new_r00))))),-1); |
| 13168 | if(!x1499.valid){ |
| 13169 | continue; |
| 13170 | } |
| 13171 | CheckValue<IkReal> x1500 = IKatan2WithCheck(IkReal(((((-1.0)*new_r10*x1498))+((gconst18*new_r00*x1497)))),IkReal(((((-625000001.0)*new_r10*(gconst18*gconst18*gconst18)))+((new_r00*x1498)))),IKFAST_ATAN2_MAGTHRESH); |
| 13172 | if(!x1500.valid){ |
| 13173 | continue; |
| 13174 | } |
| 13175 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1499.value)))+(x1500.value)); |
| 13176 | sj5array[0]=IKsin(j5array[0]); |
| 13177 | cj5array[0]=IKcos(j5array[0]); |
| 13178 | if( j5array[0] > IKPI ) |
| 13179 | { |
| 13180 | j5array[0]-=IK2PI; |
| 13181 | } |
| 13182 | else if( j5array[0] < -IKPI ) |
| 13183 | { j5array[0]+=IK2PI; |
| 13184 | } |
| 13185 | j5valid[0] = true; |
| 13186 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 13187 | { |
| 13188 | if( !j5valid[ij5] ) |
| 13189 | { |
| 13190 | continue; |
| 13191 | } |
| 13192 | _ij5[0] = ij5; _ij5[1] = -1; |
| 13193 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 13194 | { |
| 13195 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 13196 | { |
| 13197 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 13198 | } |
| 13199 | } |
| 13200 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 13201 | { |
| 13202 | IkReal evalcond[7]; |
| 13203 | IkReal x1501=IKsin(j5); |
| 13204 | IkReal x1502=IKcos(j5); |
| 13205 | IkReal x1503=((1.0000000008)*gconst19); |
| 13206 | IkReal x1504=((1.0)*gconst19); |
| 13207 | IkReal x1505=(gconst18*x1501); |
| 13208 | IkReal x1506=(new_r00*x1502); |
| 13209 | IkReal x1507=(gconst18*x1502); |
| 13210 | IkReal x1508=(new_r10*x1501); |
| 13211 | evalcond[0]=(((new_r10*x1502))+gconst18+((new_r00*x1501))); |
| 13212 | evalcond[1]=(x1505+new_r00+(((-1.0)*x1502*x1503))); |
| 13213 | evalcond[2]=(((x1501*x1503))+x1507+new_r10); |
| 13214 | evalcond[3]=((((-1.0)*x1501*x1504))+(((-1.0000000008)*x1507))); |
| 13215 | evalcond[4]=((((-1.0)*x1502*x1504))+(((1.0000000008)*x1505))); |
| 13216 | evalcond[5]=((((-1.0)*x1503))+(((-1.0)*x1508))+x1506); |
| 13217 | evalcond[6]=((((-1.0)*x1504))+(((-1.0000000008)*x1508))+(((1.0000000008)*x1506))); |
| 13218 | if( 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 ) |
| 13219 | { |
| 13220 | continue; |
| 13221 | } |
| 13222 | } |
| 13223 | |
| 13224 | { |
| 13225 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 13226 | vinfos[0].jointtype = 1; |
| 13227 | vinfos[0].foffset = j0; |
| 13228 | vinfos[0].indices[0] = _ij0[0]; |
| 13229 | vinfos[0].indices[1] = _ij0[1]; |
| 13230 | vinfos[0].maxsolutions = _nj0; |
| 13231 | vinfos[1].jointtype = 1; |
| 13232 | vinfos[1].foffset = j1; |
| 13233 | vinfos[1].indices[0] = _ij1[0]; |
| 13234 | vinfos[1].indices[1] = _ij1[1]; |
| 13235 | vinfos[1].maxsolutions = _nj1; |
| 13236 | vinfos[2].jointtype = 1; |
| 13237 | vinfos[2].foffset = j2; |
| 13238 | vinfos[2].indices[0] = _ij2[0]; |
| 13239 | vinfos[2].indices[1] = _ij2[1]; |
| 13240 | vinfos[2].maxsolutions = _nj2; |
| 13241 | vinfos[3].jointtype = 1; |
| 13242 | vinfos[3].foffset = j3; |
| 13243 | vinfos[3].indices[0] = _ij3[0]; |
| 13244 | vinfos[3].indices[1] = _ij3[1]; |
| 13245 | vinfos[3].maxsolutions = _nj3; |
| 13246 | vinfos[4].jointtype = 1; |
| 13247 | vinfos[4].foffset = j4; |
| 13248 | vinfos[4].indices[0] = _ij4[0]; |
| 13249 | vinfos[4].indices[1] = _ij4[1]; |
| 13250 | vinfos[4].maxsolutions = _nj4; |
| 13251 | vinfos[5].jointtype = 1; |
| 13252 | vinfos[5].foffset = j5; |
| 13253 | vinfos[5].indices[0] = _ij5[0]; |
| 13254 | vinfos[5].indices[1] = _ij5[1]; |
| 13255 | vinfos[5].maxsolutions = _nj5; |
| 13256 | std::vector<int> vfree(0); |
| 13257 | solutions.AddSolution(vinfos,vfree); |
| 13258 | } |
| 13259 | } |
| 13260 | } |
| 13261 | |
| 13262 | } |
| 13263 | |
| 13264 | } |
| 13265 | |
| 13266 | } else |
| 13267 | { |
| 13268 | { |
| 13269 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 13270 | bool j5valid[1]={false}; |
| 13271 | _nj5 = 1; |
| 13272 | IkReal x1509=((25000.0)*gconst18); |
| 13273 | IkReal x1510=((25000.00002)*gconst19); |
| 13274 | CheckValue<IkReal> x1511=IKPowWithIntegerCheck(IKsign(((((-25000.0)*(new_r10*new_r10)))+(((-25000.0)*(new_r00*new_r00))))),-1); |
| 13275 | if(!x1511.valid){ |
| 13276 | continue; |
| 13277 | } |
| 13278 | CheckValue<IkReal> x1512 = IKatan2WithCheck(IkReal((((new_r10*x1510))+((new_r00*x1509)))),IkReal((((new_r10*x1509))+(((-1.0)*new_r00*x1510)))),IKFAST_ATAN2_MAGTHRESH); |
| 13279 | if(!x1512.valid){ |
| 13280 | continue; |
| 13281 | } |
| 13282 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1511.value)))+(x1512.value)); |
| 13283 | sj5array[0]=IKsin(j5array[0]); |
| 13284 | cj5array[0]=IKcos(j5array[0]); |
| 13285 | if( j5array[0] > IKPI ) |
| 13286 | { |
| 13287 | j5array[0]-=IK2PI; |
| 13288 | } |
| 13289 | else if( j5array[0] < -IKPI ) |
| 13290 | { j5array[0]+=IK2PI; |
| 13291 | } |
| 13292 | j5valid[0] = true; |
| 13293 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 13294 | { |
| 13295 | if( !j5valid[ij5] ) |
| 13296 | { |
| 13297 | continue; |
| 13298 | } |
| 13299 | _ij5[0] = ij5; _ij5[1] = -1; |
| 13300 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 13301 | { |
| 13302 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 13303 | { |
| 13304 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 13305 | } |
| 13306 | } |
| 13307 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 13308 | { |
| 13309 | IkReal evalcond[7]; |
| 13310 | IkReal x1513=IKsin(j5); |
| 13311 | IkReal x1514=IKcos(j5); |
| 13312 | IkReal x1515=((1.0000000008)*gconst19); |
| 13313 | IkReal x1516=((1.0)*gconst19); |
| 13314 | IkReal x1517=(gconst18*x1513); |
| 13315 | IkReal x1518=(new_r00*x1514); |
| 13316 | IkReal x1519=(gconst18*x1514); |
| 13317 | IkReal x1520=(new_r10*x1513); |
| 13318 | evalcond[0]=(((new_r10*x1514))+gconst18+((new_r00*x1513))); |
| 13319 | evalcond[1]=(x1517+(((-1.0)*x1514*x1515))+new_r00); |
| 13320 | evalcond[2]=(((x1513*x1515))+x1519+new_r10); |
| 13321 | evalcond[3]=((((-1.0)*x1513*x1516))+(((-1.0000000008)*x1519))); |
| 13322 | evalcond[4]=((((-1.0)*x1514*x1516))+(((1.0000000008)*x1517))); |
| 13323 | evalcond[5]=((((-1.0)*x1515))+x1518+(((-1.0)*x1520))); |
| 13324 | evalcond[6]=((((-1.0)*x1516))+(((-1.0000000008)*x1520))+(((1.0000000008)*x1518))); |
| 13325 | if( 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 ) |
| 13326 | { |
| 13327 | continue; |
| 13328 | } |
| 13329 | } |
| 13330 | |
| 13331 | { |
| 13332 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 13333 | vinfos[0].jointtype = 1; |
| 13334 | vinfos[0].foffset = j0; |
| 13335 | vinfos[0].indices[0] = _ij0[0]; |
| 13336 | vinfos[0].indices[1] = _ij0[1]; |
| 13337 | vinfos[0].maxsolutions = _nj0; |
| 13338 | vinfos[1].jointtype = 1; |
| 13339 | vinfos[1].foffset = j1; |
| 13340 | vinfos[1].indices[0] = _ij1[0]; |
| 13341 | vinfos[1].indices[1] = _ij1[1]; |
| 13342 | vinfos[1].maxsolutions = _nj1; |
| 13343 | vinfos[2].jointtype = 1; |
| 13344 | vinfos[2].foffset = j2; |
| 13345 | vinfos[2].indices[0] = _ij2[0]; |
| 13346 | vinfos[2].indices[1] = _ij2[1]; |
| 13347 | vinfos[2].maxsolutions = _nj2; |
| 13348 | vinfos[3].jointtype = 1; |
| 13349 | vinfos[3].foffset = j3; |
| 13350 | vinfos[3].indices[0] = _ij3[0]; |
| 13351 | vinfos[3].indices[1] = _ij3[1]; |
| 13352 | vinfos[3].maxsolutions = _nj3; |
| 13353 | vinfos[4].jointtype = 1; |
| 13354 | vinfos[4].foffset = j4; |
| 13355 | vinfos[4].indices[0] = _ij4[0]; |
| 13356 | vinfos[4].indices[1] = _ij4[1]; |
| 13357 | vinfos[4].maxsolutions = _nj4; |
| 13358 | vinfos[5].jointtype = 1; |
| 13359 | vinfos[5].foffset = j5; |
| 13360 | vinfos[5].indices[0] = _ij5[0]; |
| 13361 | vinfos[5].indices[1] = _ij5[1]; |
| 13362 | vinfos[5].maxsolutions = _nj5; |
| 13363 | std::vector<int> vfree(0); |
| 13364 | solutions.AddSolution(vinfos,vfree); |
| 13365 | } |
| 13366 | } |
| 13367 | } |
| 13368 | |
| 13369 | } |
| 13370 | |
| 13371 | } |
| 13372 | |
| 13373 | } |
| 13374 | } while(0); |
| 13375 | if( bgotonextstatement ) |
| 13376 | { |
| 13377 | bool bgotonextstatement = true; |
| 13378 | do |
| 13379 | { |
| 13380 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r10))); |
| 13381 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 13382 | { |
| 13383 | bgotonextstatement=false; |
| 13384 | { |
| 13385 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 13386 | bool j5valid[1]={false}; |
| 13387 | _nj5 = 1; |
| 13388 | CheckValue<IkReal> x1522=IKPowWithIntegerCheck(gconst19,-1); |
| 13389 | if(!x1522.valid){ |
| 13390 | continue; |
| 13391 | } |
| 13392 | IkReal x1521=x1522.value; |
| 13393 | if( IKabs((new_r01*x1521)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((0.9999999992)*new_r00*x1521)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((new_r01*x1521))+IKsqr(((0.9999999992)*new_r00*x1521))-1) <= IKFAST_SINCOS_THRESH ) |
| 13394 | continue; |
| 13395 | j5array[0]=IKatan2((new_r01*x1521), ((0.9999999992)*new_r00*x1521)); |
| 13396 | sj5array[0]=IKsin(j5array[0]); |
| 13397 | cj5array[0]=IKcos(j5array[0]); |
| 13398 | if( j5array[0] > IKPI ) |
| 13399 | { |
| 13400 | j5array[0]-=IK2PI; |
| 13401 | } |
| 13402 | else if( j5array[0] < -IKPI ) |
| 13403 | { j5array[0]+=IK2PI; |
| 13404 | } |
| 13405 | j5valid[0] = true; |
| 13406 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 13407 | { |
| 13408 | if( !j5valid[ij5] ) |
| 13409 | { |
| 13410 | continue; |
| 13411 | } |
| 13412 | _ij5[0] = ij5; _ij5[1] = -1; |
| 13413 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 13414 | { |
| 13415 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 13416 | { |
| 13417 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 13418 | } |
| 13419 | } |
| 13420 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 13421 | { |
| 13422 | IkReal evalcond[10]; |
| 13423 | IkReal x1523=IKcos(j5); |
| 13424 | IkReal x1524=IKsin(j5); |
| 13425 | IkReal x1525=((1.0)*gconst19); |
| 13426 | IkReal x1526=((1.0000000008)*gconst19); |
| 13427 | IkReal x1527=(new_r00*x1523); |
| 13428 | IkReal x1528=(new_r01*x1523); |
| 13429 | evalcond[0]=(new_r00*x1524); |
| 13430 | evalcond[1]=x1528; |
| 13431 | evalcond[2]=((-1.0)*gconst19*x1523); |
| 13432 | evalcond[3]=((((-1.0)*x1524*x1525))+new_r01); |
| 13433 | evalcond[4]=((((-1.0)*x1525))+((new_r01*x1524))); |
| 13434 | evalcond[5]=(x1524*x1526); |
| 13435 | evalcond[6]=((1.0000000008)*x1528); |
| 13436 | evalcond[7]=((((-1.0)*x1523*x1526))+new_r00); |
| 13437 | evalcond[8]=((((-1.0)*x1526))+x1527); |
| 13438 | evalcond[9]=((((-1.0)*x1525))+(((1.0000000008)*x1527))); |
| 13439 | if( 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 ) |
| 13440 | { |
| 13441 | continue; |
| 13442 | } |
| 13443 | } |
| 13444 | |
| 13445 | { |
| 13446 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 13447 | vinfos[0].jointtype = 1; |
| 13448 | vinfos[0].foffset = j0; |
| 13449 | vinfos[0].indices[0] = _ij0[0]; |
| 13450 | vinfos[0].indices[1] = _ij0[1]; |
| 13451 | vinfos[0].maxsolutions = _nj0; |
| 13452 | vinfos[1].jointtype = 1; |
| 13453 | vinfos[1].foffset = j1; |
| 13454 | vinfos[1].indices[0] = _ij1[0]; |
| 13455 | vinfos[1].indices[1] = _ij1[1]; |
| 13456 | vinfos[1].maxsolutions = _nj1; |
| 13457 | vinfos[2].jointtype = 1; |
| 13458 | vinfos[2].foffset = j2; |
| 13459 | vinfos[2].indices[0] = _ij2[0]; |
| 13460 | vinfos[2].indices[1] = _ij2[1]; |
| 13461 | vinfos[2].maxsolutions = _nj2; |
| 13462 | vinfos[3].jointtype = 1; |
| 13463 | vinfos[3].foffset = j3; |
| 13464 | vinfos[3].indices[0] = _ij3[0]; |
| 13465 | vinfos[3].indices[1] = _ij3[1]; |
| 13466 | vinfos[3].maxsolutions = _nj3; |
| 13467 | vinfos[4].jointtype = 1; |
| 13468 | vinfos[4].foffset = j4; |
| 13469 | vinfos[4].indices[0] = _ij4[0]; |
| 13470 | vinfos[4].indices[1] = _ij4[1]; |
| 13471 | vinfos[4].maxsolutions = _nj4; |
| 13472 | vinfos[5].jointtype = 1; |
| 13473 | vinfos[5].foffset = j5; |
| 13474 | vinfos[5].indices[0] = _ij5[0]; |
| 13475 | vinfos[5].indices[1] = _ij5[1]; |
| 13476 | vinfos[5].maxsolutions = _nj5; |
| 13477 | std::vector<int> vfree(0); |
| 13478 | solutions.AddSolution(vinfos,vfree); |
| 13479 | } |
| 13480 | } |
| 13481 | } |
| 13482 | |
| 13483 | } |
| 13484 | } while(0); |
| 13485 | if( bgotonextstatement ) |
| 13486 | { |
| 13487 | bool bgotonextstatement = true; |
| 13488 | do |
| 13489 | { |
| 13490 | if( 1 ) |
| 13491 | { |
| 13492 | bgotonextstatement=false; |
| 13493 | continue; // branch miss [j5] |
| 13494 | |
| 13495 | } |
| 13496 | } while(0); |
| 13497 | if( bgotonextstatement ) |
| 13498 | { |
| 13499 | } |
| 13500 | } |
| 13501 | } |
| 13502 | } |
| 13503 | } |
| 13504 | |
| 13505 | } else |
| 13506 | { |
| 13507 | { |
| 13508 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 13509 | bool j5valid[1]={false}; |
| 13510 | _nj5 = 1; |
| 13511 | CheckValue<IkReal> x1534=IKPowWithIntegerCheck(new_r00,-1); |
| 13512 | if(!x1534.valid){ |
| 13513 | continue; |
| 13514 | } |
| 13515 | IkReal x1529=x1534.value; |
| 13516 | IkReal x1530=((25000.0)*new_r10); |
| 13517 | IkReal x1531=((25000.0)*gconst18*gconst19); |
| 13518 | CheckValue<IkReal> x1535=IKPowWithIntegerCheck(((((-25000.00002)*gconst18*new_r00))+((gconst19*x1530))),-1); |
| 13519 | if(!x1535.valid){ |
| 13520 | continue; |
| 13521 | } |
| 13522 | IkReal x1532=x1535.value; |
| 13523 | IkReal x1533=(new_r10*x1532); |
| 13524 | CheckValue<IkReal> x1536=IKPowWithIntegerCheck(((((-25000.00002)*gconst18*new_r00))+(((25000.0)*gconst19*new_r10))),-1); |
| 13525 | if(!x1536.valid){ |
| 13526 | continue; |
| 13527 | } |
| 13528 | CheckValue<IkReal> x1537=IKPowWithIntegerCheck(((((-25000.00002)*gconst18*new_r00))+(((25000.0)*gconst19*new_r10))),-1); |
| 13529 | if(!x1537.valid){ |
| 13530 | continue; |
| 13531 | } |
| 13532 | if( IKabs((((gconst18*gconst19*x1529*x1530*(x1536.value)))+(((-1.0)*gconst18*x1529))+((new_r01*x1530*(x1537.value))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x1532*(((((-25000.0)*new_r00*new_r01))+(((-1.0)*x1531)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((gconst18*gconst19*x1529*x1530*(x1536.value)))+(((-1.0)*gconst18*x1529))+((new_r01*x1530*(x1537.value)))))+IKsqr((x1532*(((((-25000.0)*new_r00*new_r01))+(((-1.0)*x1531))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 13533 | continue; |
| 13534 | j5array[0]=IKatan2((((gconst18*gconst19*x1529*x1530*(x1536.value)))+(((-1.0)*gconst18*x1529))+((new_r01*x1530*(x1537.value)))), (x1532*(((((-25000.0)*new_r00*new_r01))+(((-1.0)*x1531)))))); |
| 13535 | sj5array[0]=IKsin(j5array[0]); |
| 13536 | cj5array[0]=IKcos(j5array[0]); |
| 13537 | if( j5array[0] > IKPI ) |
| 13538 | { |
| 13539 | j5array[0]-=IK2PI; |
| 13540 | } |
| 13541 | else if( j5array[0] < -IKPI ) |
| 13542 | { j5array[0]+=IK2PI; |
| 13543 | } |
| 13544 | j5valid[0] = true; |
| 13545 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 13546 | { |
| 13547 | if( !j5valid[ij5] ) |
| 13548 | { |
| 13549 | continue; |
| 13550 | } |
| 13551 | _ij5[0] = ij5; _ij5[1] = -1; |
| 13552 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 13553 | { |
| 13554 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 13555 | { |
| 13556 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 13557 | } |
| 13558 | } |
| 13559 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 13560 | { |
| 13561 | IkReal evalcond[10]; |
| 13562 | IkReal x1538=IKcos(j5); |
| 13563 | IkReal x1539=IKsin(j5); |
| 13564 | IkReal x1540=((1.0)*gconst19); |
| 13565 | IkReal x1541=((1.0000000008)*gconst19); |
| 13566 | IkReal x1542=(new_r11*x1539); |
| 13567 | IkReal x1543=(gconst18*x1538); |
| 13568 | IkReal x1544=(new_r01*x1538); |
| 13569 | IkReal x1545=(new_r00*x1538); |
| 13570 | IkReal x1546=(gconst18*x1539); |
| 13571 | IkReal x1547=(new_r10*x1539); |
| 13572 | evalcond[0]=(gconst18+((new_r00*x1539))+((new_r10*x1538))); |
| 13573 | evalcond[1]=(((new_r01*x1539))+((new_r11*x1538))+(((-1.0)*x1540))); |
| 13574 | evalcond[2]=(x1546+new_r00+(((-1.0)*x1538*x1541))); |
| 13575 | evalcond[3]=(((x1539*x1541))+x1543+new_r10); |
| 13576 | evalcond[4]=((((-1.0)*x1539*x1540))+new_r01+(((-1.0000000008)*x1543))); |
| 13577 | evalcond[5]=((((1.0000000008)*x1546))+new_r11+(((-1.0)*x1538*x1540))); |
| 13578 | evalcond[6]=((((-1.0)*x1547))+x1545+(((-1.0)*x1541))); |
| 13579 | evalcond[7]=((((-1.0)*x1542))+(((-1.0000000008)*gconst18))+x1544); |
| 13580 | evalcond[8]=((((1.0000000008)*x1545))+(((-1.0)*x1540))+(((-1.0000000008)*x1547))); |
| 13581 | evalcond[9]=((((1.0000000008)*x1544))+(((-1.0)*gconst18))+(((-1.0000000008)*x1542))); |
| 13582 | if( 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 ) |
| 13583 | { |
| 13584 | continue; |
| 13585 | } |
| 13586 | } |
| 13587 | |
| 13588 | { |
| 13589 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 13590 | vinfos[0].jointtype = 1; |
| 13591 | vinfos[0].foffset = j0; |
| 13592 | vinfos[0].indices[0] = _ij0[0]; |
| 13593 | vinfos[0].indices[1] = _ij0[1]; |
| 13594 | vinfos[0].maxsolutions = _nj0; |
| 13595 | vinfos[1].jointtype = 1; |
| 13596 | vinfos[1].foffset = j1; |
| 13597 | vinfos[1].indices[0] = _ij1[0]; |
| 13598 | vinfos[1].indices[1] = _ij1[1]; |
| 13599 | vinfos[1].maxsolutions = _nj1; |
| 13600 | vinfos[2].jointtype = 1; |
| 13601 | vinfos[2].foffset = j2; |
| 13602 | vinfos[2].indices[0] = _ij2[0]; |
| 13603 | vinfos[2].indices[1] = _ij2[1]; |
| 13604 | vinfos[2].maxsolutions = _nj2; |
| 13605 | vinfos[3].jointtype = 1; |
| 13606 | vinfos[3].foffset = j3; |
| 13607 | vinfos[3].indices[0] = _ij3[0]; |
| 13608 | vinfos[3].indices[1] = _ij3[1]; |
| 13609 | vinfos[3].maxsolutions = _nj3; |
| 13610 | vinfos[4].jointtype = 1; |
| 13611 | vinfos[4].foffset = j4; |
| 13612 | vinfos[4].indices[0] = _ij4[0]; |
| 13613 | vinfos[4].indices[1] = _ij4[1]; |
| 13614 | vinfos[4].maxsolutions = _nj4; |
| 13615 | vinfos[5].jointtype = 1; |
| 13616 | vinfos[5].foffset = j5; |
| 13617 | vinfos[5].indices[0] = _ij5[0]; |
| 13618 | vinfos[5].indices[1] = _ij5[1]; |
| 13619 | vinfos[5].maxsolutions = _nj5; |
| 13620 | std::vector<int> vfree(0); |
| 13621 | solutions.AddSolution(vinfos,vfree); |
| 13622 | } |
| 13623 | } |
| 13624 | } |
| 13625 | |
| 13626 | } |
| 13627 | |
| 13628 | } |
| 13629 | |
| 13630 | } else |
| 13631 | { |
| 13632 | { |
| 13633 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 13634 | bool j5valid[1]={false}; |
| 13635 | _nj5 = 1; |
| 13636 | CheckValue<IkReal> x1552=IKPowWithIntegerCheck(new_r00,-1); |
| 13637 | if(!x1552.valid){ |
| 13638 | continue; |
| 13639 | } |
| 13640 | IkReal x1548=x1552.value; |
| 13641 | IkReal x1549=gconst18*gconst18; |
| 13642 | CheckValue<IkReal> x1553=IKPowWithIntegerCheck(((((25000.00002)*gconst19*new_r00))+(((25000.0)*gconst18*new_r10))),-1); |
| 13643 | if(!x1553.valid){ |
| 13644 | continue; |
| 13645 | } |
| 13646 | IkReal x1550=x1553.value; |
| 13647 | IkReal x1551=((25000.0)*new_r10*x1550); |
| 13648 | CheckValue<IkReal> x1554=IKPowWithIntegerCheck(x1548,-2); |
| 13649 | if(!x1554.valid){ |
| 13650 | continue; |
| 13651 | } |
| 13652 | if( IKabs((((x1548*x1549*x1551))+(((-1.0)*gconst18*x1548))+(((-1.0)*new_r00*x1551)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x1550*(((((25000.0)*(x1554.value)))+(((-25000.0)*x1549)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((x1548*x1549*x1551))+(((-1.0)*gconst18*x1548))+(((-1.0)*new_r00*x1551))))+IKsqr((x1550*(((((25000.0)*(x1554.value)))+(((-25000.0)*x1549))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 13653 | continue; |
| 13654 | j5array[0]=IKatan2((((x1548*x1549*x1551))+(((-1.0)*gconst18*x1548))+(((-1.0)*new_r00*x1551))), (x1550*(((((25000.0)*(x1554.value)))+(((-25000.0)*x1549)))))); |
| 13655 | sj5array[0]=IKsin(j5array[0]); |
| 13656 | cj5array[0]=IKcos(j5array[0]); |
| 13657 | if( j5array[0] > IKPI ) |
| 13658 | { |
| 13659 | j5array[0]-=IK2PI; |
| 13660 | } |
| 13661 | else if( j5array[0] < -IKPI ) |
| 13662 | { j5array[0]+=IK2PI; |
| 13663 | } |
| 13664 | j5valid[0] = true; |
| 13665 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 13666 | { |
| 13667 | if( !j5valid[ij5] ) |
| 13668 | { |
| 13669 | continue; |
| 13670 | } |
| 13671 | _ij5[0] = ij5; _ij5[1] = -1; |
| 13672 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 13673 | { |
| 13674 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 13675 | { |
| 13676 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 13677 | } |
| 13678 | } |
| 13679 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 13680 | { |
| 13681 | IkReal evalcond[10]; |
| 13682 | IkReal x1555=IKcos(j5); |
| 13683 | IkReal x1556=IKsin(j5); |
| 13684 | IkReal x1557=((1.0)*gconst19); |
| 13685 | IkReal x1558=((1.0000000008)*gconst19); |
| 13686 | IkReal x1559=(new_r11*x1556); |
| 13687 | IkReal x1560=(gconst18*x1555); |
| 13688 | IkReal x1561=(new_r01*x1555); |
| 13689 | IkReal x1562=(new_r00*x1555); |
| 13690 | IkReal x1563=(gconst18*x1556); |
| 13691 | IkReal x1564=(new_r10*x1556); |
| 13692 | evalcond[0]=(((new_r00*x1556))+gconst18+((new_r10*x1555))); |
| 13693 | evalcond[1]=(((new_r01*x1556))+((new_r11*x1555))+(((-1.0)*x1557))); |
| 13694 | evalcond[2]=((((-1.0)*x1555*x1558))+x1563+new_r00); |
| 13695 | evalcond[3]=(((x1556*x1558))+x1560+new_r10); |
| 13696 | evalcond[4]=((((-1.0)*x1556*x1557))+new_r01+(((-1.0000000008)*x1560))); |
| 13697 | evalcond[5]=((((1.0000000008)*x1563))+(((-1.0)*x1555*x1557))+new_r11); |
| 13698 | evalcond[6]=(x1562+(((-1.0)*x1558))+(((-1.0)*x1564))); |
| 13699 | evalcond[7]=((((-1.0)*x1559))+(((-1.0000000008)*gconst18))+x1561); |
| 13700 | evalcond[8]=((((1.0000000008)*x1562))+(((-1.0)*x1557))+(((-1.0000000008)*x1564))); |
| 13701 | evalcond[9]=((((1.0000000008)*x1561))+(((-1.0)*gconst18))+(((-1.0000000008)*x1559))); |
| 13702 | if( 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 ) |
| 13703 | { |
| 13704 | continue; |
| 13705 | } |
| 13706 | } |
| 13707 | |
| 13708 | { |
| 13709 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 13710 | vinfos[0].jointtype = 1; |
| 13711 | vinfos[0].foffset = j0; |
| 13712 | vinfos[0].indices[0] = _ij0[0]; |
| 13713 | vinfos[0].indices[1] = _ij0[1]; |
| 13714 | vinfos[0].maxsolutions = _nj0; |
| 13715 | vinfos[1].jointtype = 1; |
| 13716 | vinfos[1].foffset = j1; |
| 13717 | vinfos[1].indices[0] = _ij1[0]; |
| 13718 | vinfos[1].indices[1] = _ij1[1]; |
| 13719 | vinfos[1].maxsolutions = _nj1; |
| 13720 | vinfos[2].jointtype = 1; |
| 13721 | vinfos[2].foffset = j2; |
| 13722 | vinfos[2].indices[0] = _ij2[0]; |
| 13723 | vinfos[2].indices[1] = _ij2[1]; |
| 13724 | vinfos[2].maxsolutions = _nj2; |
| 13725 | vinfos[3].jointtype = 1; |
| 13726 | vinfos[3].foffset = j3; |
| 13727 | vinfos[3].indices[0] = _ij3[0]; |
| 13728 | vinfos[3].indices[1] = _ij3[1]; |
| 13729 | vinfos[3].maxsolutions = _nj3; |
| 13730 | vinfos[4].jointtype = 1; |
| 13731 | vinfos[4].foffset = j4; |
| 13732 | vinfos[4].indices[0] = _ij4[0]; |
| 13733 | vinfos[4].indices[1] = _ij4[1]; |
| 13734 | vinfos[4].maxsolutions = _nj4; |
| 13735 | vinfos[5].jointtype = 1; |
| 13736 | vinfos[5].foffset = j5; |
| 13737 | vinfos[5].indices[0] = _ij5[0]; |
| 13738 | vinfos[5].indices[1] = _ij5[1]; |
| 13739 | vinfos[5].maxsolutions = _nj5; |
| 13740 | std::vector<int> vfree(0); |
| 13741 | solutions.AddSolution(vinfos,vfree); |
| 13742 | } |
| 13743 | } |
| 13744 | } |
| 13745 | |
| 13746 | } |
| 13747 | |
| 13748 | } |
| 13749 | |
| 13750 | } else |
| 13751 | { |
| 13752 | { |
| 13753 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 13754 | bool j5valid[1]={false}; |
| 13755 | _nj5 = 1; |
| 13756 | IkReal x1565=((1.0)*new_r00); |
| 13757 | CheckValue<IkReal> x1566 = IKatan2WithCheck(IkReal((((gconst18*new_r11))+((gconst19*new_r10)))),IkReal(((((-1.0)*gconst19*x1565))+(((-1.0)*gconst18*new_r01)))),IKFAST_ATAN2_MAGTHRESH); |
| 13758 | if(!x1566.valid){ |
| 13759 | continue; |
| 13760 | } |
| 13761 | CheckValue<IkReal> x1567=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r11*x1565))+((new_r01*new_r10)))),-1); |
| 13762 | if(!x1567.valid){ |
| 13763 | continue; |
| 13764 | } |
| 13765 | j5array[0]=((-1.5707963267949)+(x1566.value)+(((1.5707963267949)*(x1567.value)))); |
| 13766 | sj5array[0]=IKsin(j5array[0]); |
| 13767 | cj5array[0]=IKcos(j5array[0]); |
| 13768 | if( j5array[0] > IKPI ) |
| 13769 | { |
| 13770 | j5array[0]-=IK2PI; |
| 13771 | } |
| 13772 | else if( j5array[0] < -IKPI ) |
| 13773 | { j5array[0]+=IK2PI; |
| 13774 | } |
| 13775 | j5valid[0] = true; |
| 13776 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 13777 | { |
| 13778 | if( !j5valid[ij5] ) |
| 13779 | { |
| 13780 | continue; |
| 13781 | } |
| 13782 | _ij5[0] = ij5; _ij5[1] = -1; |
| 13783 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 13784 | { |
| 13785 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 13786 | { |
| 13787 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 13788 | } |
| 13789 | } |
| 13790 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 13791 | { |
| 13792 | IkReal evalcond[10]; |
| 13793 | IkReal x1568=IKcos(j5); |
| 13794 | IkReal x1569=IKsin(j5); |
| 13795 | IkReal x1570=((1.0)*gconst19); |
| 13796 | IkReal x1571=((1.0000000008)*gconst19); |
| 13797 | IkReal x1572=(new_r11*x1569); |
| 13798 | IkReal x1573=(gconst18*x1568); |
| 13799 | IkReal x1574=(new_r01*x1568); |
| 13800 | IkReal x1575=(new_r00*x1568); |
| 13801 | IkReal x1576=(gconst18*x1569); |
| 13802 | IkReal x1577=(new_r10*x1569); |
| 13803 | evalcond[0]=(((new_r00*x1569))+((new_r10*x1568))+gconst18); |
| 13804 | evalcond[1]=(((new_r01*x1569))+((new_r11*x1568))+(((-1.0)*x1570))); |
| 13805 | evalcond[2]=((((-1.0)*x1568*x1571))+x1576+new_r00); |
| 13806 | evalcond[3]=(((x1569*x1571))+x1573+new_r10); |
| 13807 | evalcond[4]=((((-1.0)*x1569*x1570))+new_r01+(((-1.0000000008)*x1573))); |
| 13808 | evalcond[5]=((((1.0000000008)*x1576))+(((-1.0)*x1568*x1570))+new_r11); |
| 13809 | evalcond[6]=(x1575+(((-1.0)*x1571))+(((-1.0)*x1577))); |
| 13810 | evalcond[7]=((((-1.0000000008)*gconst18))+x1574+(((-1.0)*x1572))); |
| 13811 | evalcond[8]=((((1.0000000008)*x1575))+(((-1.0)*x1570))+(((-1.0000000008)*x1577))); |
| 13812 | evalcond[9]=((((1.0000000008)*x1574))+(((-1.0)*gconst18))+(((-1.0000000008)*x1572))); |
| 13813 | if( 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 ) |
| 13814 | { |
| 13815 | continue; |
| 13816 | } |
| 13817 | } |
| 13818 | |
| 13819 | { |
| 13820 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 13821 | vinfos[0].jointtype = 1; |
| 13822 | vinfos[0].foffset = j0; |
| 13823 | vinfos[0].indices[0] = _ij0[0]; |
| 13824 | vinfos[0].indices[1] = _ij0[1]; |
| 13825 | vinfos[0].maxsolutions = _nj0; |
| 13826 | vinfos[1].jointtype = 1; |
| 13827 | vinfos[1].foffset = j1; |
| 13828 | vinfos[1].indices[0] = _ij1[0]; |
| 13829 | vinfos[1].indices[1] = _ij1[1]; |
| 13830 | vinfos[1].maxsolutions = _nj1; |
| 13831 | vinfos[2].jointtype = 1; |
| 13832 | vinfos[2].foffset = j2; |
| 13833 | vinfos[2].indices[0] = _ij2[0]; |
| 13834 | vinfos[2].indices[1] = _ij2[1]; |
| 13835 | vinfos[2].maxsolutions = _nj2; |
| 13836 | vinfos[3].jointtype = 1; |
| 13837 | vinfos[3].foffset = j3; |
| 13838 | vinfos[3].indices[0] = _ij3[0]; |
| 13839 | vinfos[3].indices[1] = _ij3[1]; |
| 13840 | vinfos[3].maxsolutions = _nj3; |
| 13841 | vinfos[4].jointtype = 1; |
| 13842 | vinfos[4].foffset = j4; |
| 13843 | vinfos[4].indices[0] = _ij4[0]; |
| 13844 | vinfos[4].indices[1] = _ij4[1]; |
| 13845 | vinfos[4].maxsolutions = _nj4; |
| 13846 | vinfos[5].jointtype = 1; |
| 13847 | vinfos[5].foffset = j5; |
| 13848 | vinfos[5].indices[0] = _ij5[0]; |
| 13849 | vinfos[5].indices[1] = _ij5[1]; |
| 13850 | vinfos[5].maxsolutions = _nj5; |
| 13851 | std::vector<int> vfree(0); |
| 13852 | solutions.AddSolution(vinfos,vfree); |
| 13853 | } |
| 13854 | } |
| 13855 | } |
| 13856 | |
| 13857 | } |
| 13858 | |
| 13859 | } |
| 13860 | |
| 13861 | } |
| 13862 | } while(0); |
| 13863 | if( bgotonextstatement ) |
| 13864 | { |
| 13865 | bool bgotonextstatement = true; |
| 13866 | do |
| 13867 | { |
| 13868 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 13869 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 13870 | { |
| 13871 | bgotonextstatement=false; |
| 13872 | { |
| 13873 | IkReal j5eval[1]; |
| 13874 | sj4=4.0e-5; |
| 13875 | cj4=1.0; |
| 13876 | j4=4.0e-5; |
| 13877 | new_r11=0; |
| 13878 | new_r01=0; |
| 13879 | new_r22=0; |
| 13880 | new_r20=0; |
| 13881 | j5eval[0]=((IKabs(new_r10))+(IKabs(new_r00))); |
| 13882 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 13883 | { |
| 13884 | { |
| 13885 | IkReal j5eval[1]; |
| 13886 | sj4=4.0e-5; |
| 13887 | cj4=1.0; |
| 13888 | j4=4.0e-5; |
| 13889 | new_r11=0; |
| 13890 | new_r01=0; |
| 13891 | new_r22=0; |
| 13892 | new_r20=0; |
| 13893 | j5eval[0]=1.0; |
| 13894 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 13895 | { |
| 13896 | continue; // no branches [j5] |
| 13897 | |
| 13898 | } else |
| 13899 | { |
| 13900 | { |
| 13901 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 13902 | bool j5valid[2]={false}; |
| 13903 | _nj5 = 2; |
| 13904 | CheckValue<IkReal> x1579 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r00)),IkReal(((-1.0000000008)*new_r10)),IKFAST_ATAN2_MAGTHRESH); |
| 13905 | if(!x1579.valid){ |
| 13906 | continue; |
| 13907 | } |
| 13908 | IkReal x1578=x1579.value; |
| 13909 | j5array[0]=((-1.0)*x1578); |
| 13910 | sj5array[0]=IKsin(j5array[0]); |
| 13911 | cj5array[0]=IKcos(j5array[0]); |
| 13912 | j5array[1]=((3.14159265358979)+(((-1.0)*x1578))); |
| 13913 | sj5array[1]=IKsin(j5array[1]); |
| 13914 | cj5array[1]=IKcos(j5array[1]); |
| 13915 | if( j5array[0] > IKPI ) |
| 13916 | { |
| 13917 | j5array[0]-=IK2PI; |
| 13918 | } |
| 13919 | else if( j5array[0] < -IKPI ) |
| 13920 | { j5array[0]+=IK2PI; |
| 13921 | } |
| 13922 | j5valid[0] = true; |
| 13923 | if( j5array[1] > IKPI ) |
| 13924 | { |
| 13925 | j5array[1]-=IK2PI; |
| 13926 | } |
| 13927 | else if( j5array[1] < -IKPI ) |
| 13928 | { j5array[1]+=IK2PI; |
| 13929 | } |
| 13930 | j5valid[1] = true; |
| 13931 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 13932 | { |
| 13933 | if( !j5valid[ij5] ) |
| 13934 | { |
| 13935 | continue; |
| 13936 | } |
| 13937 | _ij5[0] = ij5; _ij5[1] = -1; |
| 13938 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 13939 | { |
| 13940 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 13941 | { |
| 13942 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 13943 | } |
| 13944 | } |
| 13945 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 13946 | { |
| 13947 | IkReal evalcond[2]; |
| 13948 | IkReal x1580=IKcos(j5); |
| 13949 | IkReal x1581=IKsin(j5); |
| 13950 | evalcond[0]=(((new_r10*x1580))+((new_r00*x1581))); |
| 13951 | evalcond[1]=((((-1.0)*new_r10*x1581))+((new_r00*x1580))); |
| 13952 | if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH ) |
| 13953 | { |
| 13954 | continue; |
| 13955 | } |
| 13956 | } |
| 13957 | |
| 13958 | { |
| 13959 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 13960 | vinfos[0].jointtype = 1; |
| 13961 | vinfos[0].foffset = j0; |
| 13962 | vinfos[0].indices[0] = _ij0[0]; |
| 13963 | vinfos[0].indices[1] = _ij0[1]; |
| 13964 | vinfos[0].maxsolutions = _nj0; |
| 13965 | vinfos[1].jointtype = 1; |
| 13966 | vinfos[1].foffset = j1; |
| 13967 | vinfos[1].indices[0] = _ij1[0]; |
| 13968 | vinfos[1].indices[1] = _ij1[1]; |
| 13969 | vinfos[1].maxsolutions = _nj1; |
| 13970 | vinfos[2].jointtype = 1; |
| 13971 | vinfos[2].foffset = j2; |
| 13972 | vinfos[2].indices[0] = _ij2[0]; |
| 13973 | vinfos[2].indices[1] = _ij2[1]; |
| 13974 | vinfos[2].maxsolutions = _nj2; |
| 13975 | vinfos[3].jointtype = 1; |
| 13976 | vinfos[3].foffset = j3; |
| 13977 | vinfos[3].indices[0] = _ij3[0]; |
| 13978 | vinfos[3].indices[1] = _ij3[1]; |
| 13979 | vinfos[3].maxsolutions = _nj3; |
| 13980 | vinfos[4].jointtype = 1; |
| 13981 | vinfos[4].foffset = j4; |
| 13982 | vinfos[4].indices[0] = _ij4[0]; |
| 13983 | vinfos[4].indices[1] = _ij4[1]; |
| 13984 | vinfos[4].maxsolutions = _nj4; |
| 13985 | vinfos[5].jointtype = 1; |
| 13986 | vinfos[5].foffset = j5; |
| 13987 | vinfos[5].indices[0] = _ij5[0]; |
| 13988 | vinfos[5].indices[1] = _ij5[1]; |
| 13989 | vinfos[5].maxsolutions = _nj5; |
| 13990 | std::vector<int> vfree(0); |
| 13991 | solutions.AddSolution(vinfos,vfree); |
| 13992 | } |
| 13993 | } |
| 13994 | } |
| 13995 | |
| 13996 | } |
| 13997 | |
| 13998 | } |
| 13999 | |
| 14000 | } else |
| 14001 | { |
| 14002 | { |
| 14003 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 14004 | bool j5valid[2]={false}; |
| 14005 | _nj5 = 2; |
| 14006 | CheckValue<IkReal> x1583 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 14007 | if(!x1583.valid){ |
| 14008 | continue; |
| 14009 | } |
| 14010 | IkReal x1582=x1583.value; |
| 14011 | j5array[0]=((-1.0)*x1582); |
| 14012 | sj5array[0]=IKsin(j5array[0]); |
| 14013 | cj5array[0]=IKcos(j5array[0]); |
| 14014 | j5array[1]=((3.14159265358979)+(((-1.0)*x1582))); |
| 14015 | sj5array[1]=IKsin(j5array[1]); |
| 14016 | cj5array[1]=IKcos(j5array[1]); |
| 14017 | if( j5array[0] > IKPI ) |
| 14018 | { |
| 14019 | j5array[0]-=IK2PI; |
| 14020 | } |
| 14021 | else if( j5array[0] < -IKPI ) |
| 14022 | { j5array[0]+=IK2PI; |
| 14023 | } |
| 14024 | j5valid[0] = true; |
| 14025 | if( j5array[1] > IKPI ) |
| 14026 | { |
| 14027 | j5array[1]-=IK2PI; |
| 14028 | } |
| 14029 | else if( j5array[1] < -IKPI ) |
| 14030 | { j5array[1]+=IK2PI; |
| 14031 | } |
| 14032 | j5valid[1] = true; |
| 14033 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 14034 | { |
| 14035 | if( !j5valid[ij5] ) |
| 14036 | { |
| 14037 | continue; |
| 14038 | } |
| 14039 | _ij5[0] = ij5; _ij5[1] = -1; |
| 14040 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 14041 | { |
| 14042 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 14043 | { |
| 14044 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 14045 | } |
| 14046 | } |
| 14047 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 14048 | { |
| 14049 | IkReal evalcond[2]; |
| 14050 | IkReal x1584=IKcos(j5); |
| 14051 | IkReal x1585=IKsin(j5); |
| 14052 | IkReal x1586=(new_r00*x1584); |
| 14053 | IkReal x1587=(new_r10*x1585); |
| 14054 | evalcond[0]=(x1586+(((-1.0)*x1587))); |
| 14055 | evalcond[1]=((((-1.0000000008)*x1587))+(((1.0000000008)*x1586))); |
| 14056 | if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH ) |
| 14057 | { |
| 14058 | continue; |
| 14059 | } |
| 14060 | } |
| 14061 | |
| 14062 | { |
| 14063 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 14064 | vinfos[0].jointtype = 1; |
| 14065 | vinfos[0].foffset = j0; |
| 14066 | vinfos[0].indices[0] = _ij0[0]; |
| 14067 | vinfos[0].indices[1] = _ij0[1]; |
| 14068 | vinfos[0].maxsolutions = _nj0; |
| 14069 | vinfos[1].jointtype = 1; |
| 14070 | vinfos[1].foffset = j1; |
| 14071 | vinfos[1].indices[0] = _ij1[0]; |
| 14072 | vinfos[1].indices[1] = _ij1[1]; |
| 14073 | vinfos[1].maxsolutions = _nj1; |
| 14074 | vinfos[2].jointtype = 1; |
| 14075 | vinfos[2].foffset = j2; |
| 14076 | vinfos[2].indices[0] = _ij2[0]; |
| 14077 | vinfos[2].indices[1] = _ij2[1]; |
| 14078 | vinfos[2].maxsolutions = _nj2; |
| 14079 | vinfos[3].jointtype = 1; |
| 14080 | vinfos[3].foffset = j3; |
| 14081 | vinfos[3].indices[0] = _ij3[0]; |
| 14082 | vinfos[3].indices[1] = _ij3[1]; |
| 14083 | vinfos[3].maxsolutions = _nj3; |
| 14084 | vinfos[4].jointtype = 1; |
| 14085 | vinfos[4].foffset = j4; |
| 14086 | vinfos[4].indices[0] = _ij4[0]; |
| 14087 | vinfos[4].indices[1] = _ij4[1]; |
| 14088 | vinfos[4].maxsolutions = _nj4; |
| 14089 | vinfos[5].jointtype = 1; |
| 14090 | vinfos[5].foffset = j5; |
| 14091 | vinfos[5].indices[0] = _ij5[0]; |
| 14092 | vinfos[5].indices[1] = _ij5[1]; |
| 14093 | vinfos[5].maxsolutions = _nj5; |
| 14094 | std::vector<int> vfree(0); |
| 14095 | solutions.AddSolution(vinfos,vfree); |
| 14096 | } |
| 14097 | } |
| 14098 | } |
| 14099 | |
| 14100 | } |
| 14101 | |
| 14102 | } |
| 14103 | |
| 14104 | } |
| 14105 | } while(0); |
| 14106 | if( bgotonextstatement ) |
| 14107 | { |
| 14108 | bool bgotonextstatement = true; |
| 14109 | do |
| 14110 | { |
| 14111 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r10))); |
| 14112 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 14113 | { |
| 14114 | bgotonextstatement=false; |
| 14115 | { |
| 14116 | IkReal j5eval[1]; |
| 14117 | sj4=4.0e-5; |
| 14118 | cj4=1.0; |
| 14119 | j4=4.0e-5; |
| 14120 | new_r11=0; |
| 14121 | new_r10=0; |
| 14122 | new_r22=0; |
| 14123 | new_r02=0; |
| 14124 | j5eval[0]=new_r00; |
| 14125 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 14126 | { |
| 14127 | { |
| 14128 | IkReal j5eval[2]; |
| 14129 | sj4=4.0e-5; |
| 14130 | cj4=1.0; |
| 14131 | j4=4.0e-5; |
| 14132 | new_r11=0; |
| 14133 | new_r10=0; |
| 14134 | new_r22=0; |
| 14135 | new_r02=0; |
| 14136 | j5eval[0]=new_r00; |
| 14137 | j5eval[1]=new_r01; |
| 14138 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 14139 | { |
| 14140 | continue; // no branches [j5] |
| 14141 | |
| 14142 | } else |
| 14143 | { |
| 14144 | { |
| 14145 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 14146 | bool j5valid[1]={false}; |
| 14147 | _nj5 = 1; |
| 14148 | CheckValue<IkReal> x1588=IKPowWithIntegerCheck(new_r00,-1); |
| 14149 | if(!x1588.valid){ |
| 14150 | continue; |
| 14151 | } |
| 14152 | CheckValue<IkReal> x1589=IKPowWithIntegerCheck(new_r01,-1); |
| 14153 | if(!x1589.valid){ |
| 14154 | continue; |
| 14155 | } |
| 14156 | if( IKabs(((-1.0)*sj3*(x1588.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((1.0000000008)*sj3*(x1589.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*sj3*(x1588.value)))+IKsqr(((1.0000000008)*sj3*(x1589.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 14157 | continue; |
| 14158 | j5array[0]=IKatan2(((-1.0)*sj3*(x1588.value)), ((1.0000000008)*sj3*(x1589.value))); |
| 14159 | sj5array[0]=IKsin(j5array[0]); |
| 14160 | cj5array[0]=IKcos(j5array[0]); |
| 14161 | if( j5array[0] > IKPI ) |
| 14162 | { |
| 14163 | j5array[0]-=IK2PI; |
| 14164 | } |
| 14165 | else if( j5array[0] < -IKPI ) |
| 14166 | { j5array[0]+=IK2PI; |
| 14167 | } |
| 14168 | j5valid[0] = true; |
| 14169 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 14170 | { |
| 14171 | if( !j5valid[ij5] ) |
| 14172 | { |
| 14173 | continue; |
| 14174 | } |
| 14175 | _ij5[0] = ij5; _ij5[1] = -1; |
| 14176 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 14177 | { |
| 14178 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 14179 | { |
| 14180 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 14181 | } |
| 14182 | } |
| 14183 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 14184 | { |
| 14185 | IkReal evalcond[10]; |
| 14186 | IkReal x1590=IKsin(j5); |
| 14187 | IkReal x1591=IKcos(j5); |
| 14188 | IkReal x1592=((1.0)*cj3); |
| 14189 | IkReal x1593=((1.0000000008)*cj3); |
| 14190 | IkReal x1594=((1.0000000008)*sj3); |
| 14191 | IkReal x1595=(new_r00*x1591); |
| 14192 | IkReal x1596=(sj3*x1591); |
| 14193 | IkReal x1597=(new_r01*x1591); |
| 14194 | evalcond[0]=(sj3+((new_r00*x1590))); |
| 14195 | evalcond[1]=((((-1.0)*x1592))+((new_r01*x1590))); |
| 14196 | evalcond[2]=((((-1.0)*x1593))+x1595); |
| 14197 | evalcond[3]=((((-1.0)*x1594))+x1597); |
| 14198 | evalcond[4]=((((-1.0)*x1592))+(((1.0000000008)*x1595))); |
| 14199 | evalcond[5]=((((-1.0)*sj3))+(((1.0000000008)*x1597))); |
| 14200 | evalcond[6]=(((x1590*x1593))+x1596); |
| 14201 | evalcond[7]=((((-1.0)*x1591*x1593))+new_r00+((sj3*x1590))); |
| 14202 | evalcond[8]=(((x1590*x1594))+(((-1.0)*x1591*x1592))); |
| 14203 | evalcond[9]=((((-1.0)*x1591*x1594))+(((-1.0)*x1590*x1592))+new_r01); |
| 14204 | if( 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 ) |
| 14205 | { |
| 14206 | continue; |
| 14207 | } |
| 14208 | } |
| 14209 | |
| 14210 | { |
| 14211 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 14212 | vinfos[0].jointtype = 1; |
| 14213 | vinfos[0].foffset = j0; |
| 14214 | vinfos[0].indices[0] = _ij0[0]; |
| 14215 | vinfos[0].indices[1] = _ij0[1]; |
| 14216 | vinfos[0].maxsolutions = _nj0; |
| 14217 | vinfos[1].jointtype = 1; |
| 14218 | vinfos[1].foffset = j1; |
| 14219 | vinfos[1].indices[0] = _ij1[0]; |
| 14220 | vinfos[1].indices[1] = _ij1[1]; |
| 14221 | vinfos[1].maxsolutions = _nj1; |
| 14222 | vinfos[2].jointtype = 1; |
| 14223 | vinfos[2].foffset = j2; |
| 14224 | vinfos[2].indices[0] = _ij2[0]; |
| 14225 | vinfos[2].indices[1] = _ij2[1]; |
| 14226 | vinfos[2].maxsolutions = _nj2; |
| 14227 | vinfos[3].jointtype = 1; |
| 14228 | vinfos[3].foffset = j3; |
| 14229 | vinfos[3].indices[0] = _ij3[0]; |
| 14230 | vinfos[3].indices[1] = _ij3[1]; |
| 14231 | vinfos[3].maxsolutions = _nj3; |
| 14232 | vinfos[4].jointtype = 1; |
| 14233 | vinfos[4].foffset = j4; |
| 14234 | vinfos[4].indices[0] = _ij4[0]; |
| 14235 | vinfos[4].indices[1] = _ij4[1]; |
| 14236 | vinfos[4].maxsolutions = _nj4; |
| 14237 | vinfos[5].jointtype = 1; |
| 14238 | vinfos[5].foffset = j5; |
| 14239 | vinfos[5].indices[0] = _ij5[0]; |
| 14240 | vinfos[5].indices[1] = _ij5[1]; |
| 14241 | vinfos[5].maxsolutions = _nj5; |
| 14242 | std::vector<int> vfree(0); |
| 14243 | solutions.AddSolution(vinfos,vfree); |
| 14244 | } |
| 14245 | } |
| 14246 | } |
| 14247 | |
| 14248 | } |
| 14249 | |
| 14250 | } |
| 14251 | |
| 14252 | } else |
| 14253 | { |
| 14254 | { |
| 14255 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 14256 | bool j5valid[1]={false}; |
| 14257 | _nj5 = 1; |
| 14258 | CheckValue<IkReal> x1599=IKPowWithIntegerCheck(new_r00,-1); |
| 14259 | if(!x1599.valid){ |
| 14260 | continue; |
| 14261 | } |
| 14262 | IkReal x1598=x1599.value; |
| 14263 | if( IKabs(((-1.0)*sj3*x1598)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((1.0000000008)*cj3*x1598)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*sj3*x1598))+IKsqr(((1.0000000008)*cj3*x1598))-1) <= IKFAST_SINCOS_THRESH ) |
| 14264 | continue; |
| 14265 | j5array[0]=IKatan2(((-1.0)*sj3*x1598), ((1.0000000008)*cj3*x1598)); |
| 14266 | sj5array[0]=IKsin(j5array[0]); |
| 14267 | cj5array[0]=IKcos(j5array[0]); |
| 14268 | if( j5array[0] > IKPI ) |
| 14269 | { |
| 14270 | j5array[0]-=IK2PI; |
| 14271 | } |
| 14272 | else if( j5array[0] < -IKPI ) |
| 14273 | { j5array[0]+=IK2PI; |
| 14274 | } |
| 14275 | j5valid[0] = true; |
| 14276 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 14277 | { |
| 14278 | if( !j5valid[ij5] ) |
| 14279 | { |
| 14280 | continue; |
| 14281 | } |
| 14282 | _ij5[0] = ij5; _ij5[1] = -1; |
| 14283 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 14284 | { |
| 14285 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 14286 | { |
| 14287 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 14288 | } |
| 14289 | } |
| 14290 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 14291 | { |
| 14292 | IkReal evalcond[10]; |
| 14293 | IkReal x1600=IKsin(j5); |
| 14294 | IkReal x1601=IKcos(j5); |
| 14295 | IkReal x1602=((1.0)*cj3); |
| 14296 | IkReal x1603=((1.0000000008)*cj3); |
| 14297 | IkReal x1604=((1.0000000008)*sj3); |
| 14298 | IkReal x1605=(new_r00*x1601); |
| 14299 | IkReal x1606=(sj3*x1601); |
| 14300 | IkReal x1607=(new_r01*x1601); |
| 14301 | evalcond[0]=(sj3+((new_r00*x1600))); |
| 14302 | evalcond[1]=((((-1.0)*x1602))+((new_r01*x1600))); |
| 14303 | evalcond[2]=((((-1.0)*x1603))+x1605); |
| 14304 | evalcond[3]=((((-1.0)*x1604))+x1607); |
| 14305 | evalcond[4]=((((-1.0)*x1602))+(((1.0000000008)*x1605))); |
| 14306 | evalcond[5]=((((-1.0)*sj3))+(((1.0000000008)*x1607))); |
| 14307 | evalcond[6]=(x1606+((x1600*x1603))); |
| 14308 | evalcond[7]=(((sj3*x1600))+(((-1.0)*x1601*x1603))+new_r00); |
| 14309 | evalcond[8]=(((x1600*x1604))+(((-1.0)*x1601*x1602))); |
| 14310 | evalcond[9]=((((-1.0)*x1601*x1604))+(((-1.0)*x1600*x1602))+new_r01); |
| 14311 | if( 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 ) |
| 14312 | { |
| 14313 | continue; |
| 14314 | } |
| 14315 | } |
| 14316 | |
| 14317 | { |
| 14318 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 14319 | vinfos[0].jointtype = 1; |
| 14320 | vinfos[0].foffset = j0; |
| 14321 | vinfos[0].indices[0] = _ij0[0]; |
| 14322 | vinfos[0].indices[1] = _ij0[1]; |
| 14323 | vinfos[0].maxsolutions = _nj0; |
| 14324 | vinfos[1].jointtype = 1; |
| 14325 | vinfos[1].foffset = j1; |
| 14326 | vinfos[1].indices[0] = _ij1[0]; |
| 14327 | vinfos[1].indices[1] = _ij1[1]; |
| 14328 | vinfos[1].maxsolutions = _nj1; |
| 14329 | vinfos[2].jointtype = 1; |
| 14330 | vinfos[2].foffset = j2; |
| 14331 | vinfos[2].indices[0] = _ij2[0]; |
| 14332 | vinfos[2].indices[1] = _ij2[1]; |
| 14333 | vinfos[2].maxsolutions = _nj2; |
| 14334 | vinfos[3].jointtype = 1; |
| 14335 | vinfos[3].foffset = j3; |
| 14336 | vinfos[3].indices[0] = _ij3[0]; |
| 14337 | vinfos[3].indices[1] = _ij3[1]; |
| 14338 | vinfos[3].maxsolutions = _nj3; |
| 14339 | vinfos[4].jointtype = 1; |
| 14340 | vinfos[4].foffset = j4; |
| 14341 | vinfos[4].indices[0] = _ij4[0]; |
| 14342 | vinfos[4].indices[1] = _ij4[1]; |
| 14343 | vinfos[4].maxsolutions = _nj4; |
| 14344 | vinfos[5].jointtype = 1; |
| 14345 | vinfos[5].foffset = j5; |
| 14346 | vinfos[5].indices[0] = _ij5[0]; |
| 14347 | vinfos[5].indices[1] = _ij5[1]; |
| 14348 | vinfos[5].maxsolutions = _nj5; |
| 14349 | std::vector<int> vfree(0); |
| 14350 | solutions.AddSolution(vinfos,vfree); |
| 14351 | } |
| 14352 | } |
| 14353 | } |
| 14354 | |
| 14355 | } |
| 14356 | |
| 14357 | } |
| 14358 | |
| 14359 | } |
| 14360 | } while(0); |
| 14361 | if( bgotonextstatement ) |
| 14362 | { |
| 14363 | bool bgotonextstatement = true; |
| 14364 | do |
| 14365 | { |
| 14366 | evalcond[0]=((IKabs(new_r00))+(IKabs(new_r01))); |
| 14367 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 14368 | { |
| 14369 | bgotonextstatement=false; |
| 14370 | { |
| 14371 | IkReal j5eval[1]; |
| 14372 | sj4=4.0e-5; |
| 14373 | cj4=1.0; |
| 14374 | j4=4.0e-5; |
| 14375 | new_r00=0; |
| 14376 | new_r01=0; |
| 14377 | new_r12=0; |
| 14378 | new_r22=0; |
| 14379 | j5eval[0]=new_r10; |
| 14380 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 14381 | { |
| 14382 | { |
| 14383 | IkReal j5eval[2]; |
| 14384 | sj4=4.0e-5; |
| 14385 | cj4=1.0; |
| 14386 | j4=4.0e-5; |
| 14387 | new_r00=0; |
| 14388 | new_r01=0; |
| 14389 | new_r12=0; |
| 14390 | new_r22=0; |
| 14391 | j5eval[0]=new_r11; |
| 14392 | j5eval[1]=new_r10; |
| 14393 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 14394 | { |
| 14395 | continue; // no branches [j5] |
| 14396 | |
| 14397 | } else |
| 14398 | { |
| 14399 | { |
| 14400 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 14401 | bool j5valid[1]={false}; |
| 14402 | _nj5 = 1; |
| 14403 | CheckValue<IkReal> x1608=IKPowWithIntegerCheck(new_r11,-1); |
| 14404 | if(!x1608.valid){ |
| 14405 | continue; |
| 14406 | } |
| 14407 | CheckValue<IkReal> x1609=IKPowWithIntegerCheck(new_r10,-1); |
| 14408 | if(!x1609.valid){ |
| 14409 | continue; |
| 14410 | } |
| 14411 | if( IKabs(((-1.0000000008)*sj3*(x1608.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*sj3*(x1609.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0000000008)*sj3*(x1608.value)))+IKsqr(((-1.0)*sj3*(x1609.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 14412 | continue; |
| 14413 | j5array[0]=IKatan2(((-1.0000000008)*sj3*(x1608.value)), ((-1.0)*sj3*(x1609.value))); |
| 14414 | sj5array[0]=IKsin(j5array[0]); |
| 14415 | cj5array[0]=IKcos(j5array[0]); |
| 14416 | if( j5array[0] > IKPI ) |
| 14417 | { |
| 14418 | j5array[0]-=IK2PI; |
| 14419 | } |
| 14420 | else if( j5array[0] < -IKPI ) |
| 14421 | { j5array[0]+=IK2PI; |
| 14422 | } |
| 14423 | j5valid[0] = true; |
| 14424 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 14425 | { |
| 14426 | if( !j5valid[ij5] ) |
| 14427 | { |
| 14428 | continue; |
| 14429 | } |
| 14430 | _ij5[0] = ij5; _ij5[1] = -1; |
| 14431 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 14432 | { |
| 14433 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 14434 | { |
| 14435 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 14436 | } |
| 14437 | } |
| 14438 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 14439 | { |
| 14440 | IkReal evalcond[10]; |
| 14441 | IkReal x1610=IKcos(j5); |
| 14442 | IkReal x1611=IKsin(j5); |
| 14443 | IkReal x1612=((1.0)*cj3); |
| 14444 | IkReal x1613=((1.0000000008)*cj3); |
| 14445 | IkReal x1614=((1.0000000008)*sj3); |
| 14446 | IkReal x1615=(sj3*x1610); |
| 14447 | IkReal x1616=(new_r10*x1611); |
| 14448 | IkReal x1617=(new_r11*x1611); |
| 14449 | evalcond[0]=(sj3+((new_r10*x1610))); |
| 14450 | evalcond[1]=(((new_r11*x1610))+(((-1.0)*x1612))); |
| 14451 | evalcond[2]=((((-1.0)*x1616))+(((-1.0)*x1613))); |
| 14452 | evalcond[3]=((((-1.0)*x1617))+(((-1.0)*x1614))); |
| 14453 | evalcond[4]=((((-1.0)*x1612))+(((-1.0000000008)*x1616))); |
| 14454 | evalcond[5]=((((-1.0)*sj3))+(((-1.0000000008)*x1617))); |
| 14455 | evalcond[6]=(((sj3*x1611))+(((-1.0)*x1610*x1613))); |
| 14456 | evalcond[7]=(x1615+new_r10+((x1611*x1613))); |
| 14457 | evalcond[8]=((((-1.0)*x1611*x1612))+(((-1.0)*x1610*x1614))); |
| 14458 | evalcond[9]=((((-1.0)*x1610*x1612))+new_r11+((x1611*x1614))); |
| 14459 | if( 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 ) |
| 14460 | { |
| 14461 | continue; |
| 14462 | } |
| 14463 | } |
| 14464 | |
| 14465 | { |
| 14466 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 14467 | vinfos[0].jointtype = 1; |
| 14468 | vinfos[0].foffset = j0; |
| 14469 | vinfos[0].indices[0] = _ij0[0]; |
| 14470 | vinfos[0].indices[1] = _ij0[1]; |
| 14471 | vinfos[0].maxsolutions = _nj0; |
| 14472 | vinfos[1].jointtype = 1; |
| 14473 | vinfos[1].foffset = j1; |
| 14474 | vinfos[1].indices[0] = _ij1[0]; |
| 14475 | vinfos[1].indices[1] = _ij1[1]; |
| 14476 | vinfos[1].maxsolutions = _nj1; |
| 14477 | vinfos[2].jointtype = 1; |
| 14478 | vinfos[2].foffset = j2; |
| 14479 | vinfos[2].indices[0] = _ij2[0]; |
| 14480 | vinfos[2].indices[1] = _ij2[1]; |
| 14481 | vinfos[2].maxsolutions = _nj2; |
| 14482 | vinfos[3].jointtype = 1; |
| 14483 | vinfos[3].foffset = j3; |
| 14484 | vinfos[3].indices[0] = _ij3[0]; |
| 14485 | vinfos[3].indices[1] = _ij3[1]; |
| 14486 | vinfos[3].maxsolutions = _nj3; |
| 14487 | vinfos[4].jointtype = 1; |
| 14488 | vinfos[4].foffset = j4; |
| 14489 | vinfos[4].indices[0] = _ij4[0]; |
| 14490 | vinfos[4].indices[1] = _ij4[1]; |
| 14491 | vinfos[4].maxsolutions = _nj4; |
| 14492 | vinfos[5].jointtype = 1; |
| 14493 | vinfos[5].foffset = j5; |
| 14494 | vinfos[5].indices[0] = _ij5[0]; |
| 14495 | vinfos[5].indices[1] = _ij5[1]; |
| 14496 | vinfos[5].maxsolutions = _nj5; |
| 14497 | std::vector<int> vfree(0); |
| 14498 | solutions.AddSolution(vinfos,vfree); |
| 14499 | } |
| 14500 | } |
| 14501 | } |
| 14502 | |
| 14503 | } |
| 14504 | |
| 14505 | } |
| 14506 | |
| 14507 | } else |
| 14508 | { |
| 14509 | { |
| 14510 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 14511 | bool j5valid[1]={false}; |
| 14512 | _nj5 = 1; |
| 14513 | CheckValue<IkReal> x1619=IKPowWithIntegerCheck(new_r10,-1); |
| 14514 | if(!x1619.valid){ |
| 14515 | continue; |
| 14516 | } |
| 14517 | IkReal x1618=x1619.value; |
| 14518 | if( IKabs(((-1.0000000008)*cj3*x1618)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*sj3*x1618)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0000000008)*cj3*x1618))+IKsqr(((-1.0)*sj3*x1618))-1) <= IKFAST_SINCOS_THRESH ) |
| 14519 | continue; |
| 14520 | j5array[0]=IKatan2(((-1.0000000008)*cj3*x1618), ((-1.0)*sj3*x1618)); |
| 14521 | sj5array[0]=IKsin(j5array[0]); |
| 14522 | cj5array[0]=IKcos(j5array[0]); |
| 14523 | if( j5array[0] > IKPI ) |
| 14524 | { |
| 14525 | j5array[0]-=IK2PI; |
| 14526 | } |
| 14527 | else if( j5array[0] < -IKPI ) |
| 14528 | { j5array[0]+=IK2PI; |
| 14529 | } |
| 14530 | j5valid[0] = true; |
| 14531 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 14532 | { |
| 14533 | if( !j5valid[ij5] ) |
| 14534 | { |
| 14535 | continue; |
| 14536 | } |
| 14537 | _ij5[0] = ij5; _ij5[1] = -1; |
| 14538 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 14539 | { |
| 14540 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 14541 | { |
| 14542 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 14543 | } |
| 14544 | } |
| 14545 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 14546 | { |
| 14547 | IkReal evalcond[10]; |
| 14548 | IkReal x1620=IKcos(j5); |
| 14549 | IkReal x1621=IKsin(j5); |
| 14550 | IkReal x1622=((1.0)*cj3); |
| 14551 | IkReal x1623=((1.0000000008)*cj3); |
| 14552 | IkReal x1624=((1.0000000008)*sj3); |
| 14553 | IkReal x1625=(sj3*x1620); |
| 14554 | IkReal x1626=(new_r10*x1621); |
| 14555 | IkReal x1627=(new_r11*x1621); |
| 14556 | evalcond[0]=(sj3+((new_r10*x1620))); |
| 14557 | evalcond[1]=(((new_r11*x1620))+(((-1.0)*x1622))); |
| 14558 | evalcond[2]=((((-1.0)*x1626))+(((-1.0)*x1623))); |
| 14559 | evalcond[3]=((((-1.0)*x1627))+(((-1.0)*x1624))); |
| 14560 | evalcond[4]=((((-1.0)*x1622))+(((-1.0000000008)*x1626))); |
| 14561 | evalcond[5]=((((-1.0)*sj3))+(((-1.0000000008)*x1627))); |
| 14562 | evalcond[6]=(((sj3*x1621))+(((-1.0)*x1620*x1623))); |
| 14563 | evalcond[7]=(x1625+new_r10+((x1621*x1623))); |
| 14564 | evalcond[8]=((((-1.0)*x1621*x1622))+(((-1.0)*x1620*x1624))); |
| 14565 | evalcond[9]=((((-1.0)*x1620*x1622))+new_r11+((x1621*x1624))); |
| 14566 | if( 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 ) |
| 14567 | { |
| 14568 | continue; |
| 14569 | } |
| 14570 | } |
| 14571 | |
| 14572 | { |
| 14573 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 14574 | vinfos[0].jointtype = 1; |
| 14575 | vinfos[0].foffset = j0; |
| 14576 | vinfos[0].indices[0] = _ij0[0]; |
| 14577 | vinfos[0].indices[1] = _ij0[1]; |
| 14578 | vinfos[0].maxsolutions = _nj0; |
| 14579 | vinfos[1].jointtype = 1; |
| 14580 | vinfos[1].foffset = j1; |
| 14581 | vinfos[1].indices[0] = _ij1[0]; |
| 14582 | vinfos[1].indices[1] = _ij1[1]; |
| 14583 | vinfos[1].maxsolutions = _nj1; |
| 14584 | vinfos[2].jointtype = 1; |
| 14585 | vinfos[2].foffset = j2; |
| 14586 | vinfos[2].indices[0] = _ij2[0]; |
| 14587 | vinfos[2].indices[1] = _ij2[1]; |
| 14588 | vinfos[2].maxsolutions = _nj2; |
| 14589 | vinfos[3].jointtype = 1; |
| 14590 | vinfos[3].foffset = j3; |
| 14591 | vinfos[3].indices[0] = _ij3[0]; |
| 14592 | vinfos[3].indices[1] = _ij3[1]; |
| 14593 | vinfos[3].maxsolutions = _nj3; |
| 14594 | vinfos[4].jointtype = 1; |
| 14595 | vinfos[4].foffset = j4; |
| 14596 | vinfos[4].indices[0] = _ij4[0]; |
| 14597 | vinfos[4].indices[1] = _ij4[1]; |
| 14598 | vinfos[4].maxsolutions = _nj4; |
| 14599 | vinfos[5].jointtype = 1; |
| 14600 | vinfos[5].foffset = j5; |
| 14601 | vinfos[5].indices[0] = _ij5[0]; |
| 14602 | vinfos[5].indices[1] = _ij5[1]; |
| 14603 | vinfos[5].maxsolutions = _nj5; |
| 14604 | std::vector<int> vfree(0); |
| 14605 | solutions.AddSolution(vinfos,vfree); |
| 14606 | } |
| 14607 | } |
| 14608 | } |
| 14609 | |
| 14610 | } |
| 14611 | |
| 14612 | } |
| 14613 | |
| 14614 | } |
| 14615 | } while(0); |
| 14616 | if( bgotonextstatement ) |
| 14617 | { |
| 14618 | bool bgotonextstatement = true; |
| 14619 | do |
| 14620 | { |
| 14621 | evalcond[0]=((IKabs(new_r10))+(IKabs(new_r00))); |
| 14622 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 14623 | { |
| 14624 | bgotonextstatement=false; |
| 14625 | { |
| 14626 | IkReal j5eval[1]; |
| 14627 | sj4=4.0e-5; |
| 14628 | cj4=1.0; |
| 14629 | j4=4.0e-5; |
| 14630 | new_r00=0; |
| 14631 | new_r10=0; |
| 14632 | new_r21=0; |
| 14633 | new_r22=0; |
| 14634 | j5eval[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 14635 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 14636 | { |
| 14637 | { |
| 14638 | IkReal j5eval[1]; |
| 14639 | sj4=4.0e-5; |
| 14640 | cj4=1.0; |
| 14641 | j4=4.0e-5; |
| 14642 | new_r00=0; |
| 14643 | new_r10=0; |
| 14644 | new_r21=0; |
| 14645 | new_r22=0; |
| 14646 | j5eval[0]=1.0; |
| 14647 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 14648 | { |
| 14649 | continue; // no branches [j5] |
| 14650 | |
| 14651 | } else |
| 14652 | { |
| 14653 | { |
| 14654 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 14655 | bool j5valid[2]={false}; |
| 14656 | _nj5 = 2; |
| 14657 | CheckValue<IkReal> x1629 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r01)),IkReal(((-1.0000000008)*new_r11)),IKFAST_ATAN2_MAGTHRESH); |
| 14658 | if(!x1629.valid){ |
| 14659 | continue; |
| 14660 | } |
| 14661 | IkReal x1628=x1629.value; |
| 14662 | j5array[0]=((-1.0)*x1628); |
| 14663 | sj5array[0]=IKsin(j5array[0]); |
| 14664 | cj5array[0]=IKcos(j5array[0]); |
| 14665 | j5array[1]=((3.14159265358979)+(((-1.0)*x1628))); |
| 14666 | sj5array[1]=IKsin(j5array[1]); |
| 14667 | cj5array[1]=IKcos(j5array[1]); |
| 14668 | if( j5array[0] > IKPI ) |
| 14669 | { |
| 14670 | j5array[0]-=IK2PI; |
| 14671 | } |
| 14672 | else if( j5array[0] < -IKPI ) |
| 14673 | { j5array[0]+=IK2PI; |
| 14674 | } |
| 14675 | j5valid[0] = true; |
| 14676 | if( j5array[1] > IKPI ) |
| 14677 | { |
| 14678 | j5array[1]-=IK2PI; |
| 14679 | } |
| 14680 | else if( j5array[1] < -IKPI ) |
| 14681 | { j5array[1]+=IK2PI; |
| 14682 | } |
| 14683 | j5valid[1] = true; |
| 14684 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 14685 | { |
| 14686 | if( !j5valid[ij5] ) |
| 14687 | { |
| 14688 | continue; |
| 14689 | } |
| 14690 | _ij5[0] = ij5; _ij5[1] = -1; |
| 14691 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 14692 | { |
| 14693 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 14694 | { |
| 14695 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 14696 | } |
| 14697 | } |
| 14698 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 14699 | { |
| 14700 | IkReal evalcond[2]; |
| 14701 | IkReal x1630=IKcos(j5); |
| 14702 | IkReal x1631=IKsin(j5); |
| 14703 | evalcond[0]=(((new_r11*x1630))+((new_r01*x1631))); |
| 14704 | evalcond[1]=(((new_r01*x1630))+(((-1.0)*new_r11*x1631))); |
| 14705 | if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH ) |
| 14706 | { |
| 14707 | continue; |
| 14708 | } |
| 14709 | } |
| 14710 | |
| 14711 | { |
| 14712 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 14713 | vinfos[0].jointtype = 1; |
| 14714 | vinfos[0].foffset = j0; |
| 14715 | vinfos[0].indices[0] = _ij0[0]; |
| 14716 | vinfos[0].indices[1] = _ij0[1]; |
| 14717 | vinfos[0].maxsolutions = _nj0; |
| 14718 | vinfos[1].jointtype = 1; |
| 14719 | vinfos[1].foffset = j1; |
| 14720 | vinfos[1].indices[0] = _ij1[0]; |
| 14721 | vinfos[1].indices[1] = _ij1[1]; |
| 14722 | vinfos[1].maxsolutions = _nj1; |
| 14723 | vinfos[2].jointtype = 1; |
| 14724 | vinfos[2].foffset = j2; |
| 14725 | vinfos[2].indices[0] = _ij2[0]; |
| 14726 | vinfos[2].indices[1] = _ij2[1]; |
| 14727 | vinfos[2].maxsolutions = _nj2; |
| 14728 | vinfos[3].jointtype = 1; |
| 14729 | vinfos[3].foffset = j3; |
| 14730 | vinfos[3].indices[0] = _ij3[0]; |
| 14731 | vinfos[3].indices[1] = _ij3[1]; |
| 14732 | vinfos[3].maxsolutions = _nj3; |
| 14733 | vinfos[4].jointtype = 1; |
| 14734 | vinfos[4].foffset = j4; |
| 14735 | vinfos[4].indices[0] = _ij4[0]; |
| 14736 | vinfos[4].indices[1] = _ij4[1]; |
| 14737 | vinfos[4].maxsolutions = _nj4; |
| 14738 | vinfos[5].jointtype = 1; |
| 14739 | vinfos[5].foffset = j5; |
| 14740 | vinfos[5].indices[0] = _ij5[0]; |
| 14741 | vinfos[5].indices[1] = _ij5[1]; |
| 14742 | vinfos[5].maxsolutions = _nj5; |
| 14743 | std::vector<int> vfree(0); |
| 14744 | solutions.AddSolution(vinfos,vfree); |
| 14745 | } |
| 14746 | } |
| 14747 | } |
| 14748 | |
| 14749 | } |
| 14750 | |
| 14751 | } |
| 14752 | |
| 14753 | } else |
| 14754 | { |
| 14755 | { |
| 14756 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 14757 | bool j5valid[2]={false}; |
| 14758 | _nj5 = 2; |
| 14759 | CheckValue<IkReal> x1633 = IKatan2WithCheck(IkReal(new_r11),IkReal(new_r01),IKFAST_ATAN2_MAGTHRESH); |
| 14760 | if(!x1633.valid){ |
| 14761 | continue; |
| 14762 | } |
| 14763 | IkReal x1632=x1633.value; |
| 14764 | j5array[0]=((-1.0)*x1632); |
| 14765 | sj5array[0]=IKsin(j5array[0]); |
| 14766 | cj5array[0]=IKcos(j5array[0]); |
| 14767 | j5array[1]=((3.14159265358979)+(((-1.0)*x1632))); |
| 14768 | sj5array[1]=IKsin(j5array[1]); |
| 14769 | cj5array[1]=IKcos(j5array[1]); |
| 14770 | if( j5array[0] > IKPI ) |
| 14771 | { |
| 14772 | j5array[0]-=IK2PI; |
| 14773 | } |
| 14774 | else if( j5array[0] < -IKPI ) |
| 14775 | { j5array[0]+=IK2PI; |
| 14776 | } |
| 14777 | j5valid[0] = true; |
| 14778 | if( j5array[1] > IKPI ) |
| 14779 | { |
| 14780 | j5array[1]-=IK2PI; |
| 14781 | } |
| 14782 | else if( j5array[1] < -IKPI ) |
| 14783 | { j5array[1]+=IK2PI; |
| 14784 | } |
| 14785 | j5valid[1] = true; |
| 14786 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 14787 | { |
| 14788 | if( !j5valid[ij5] ) |
| 14789 | { |
| 14790 | continue; |
| 14791 | } |
| 14792 | _ij5[0] = ij5; _ij5[1] = -1; |
| 14793 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 14794 | { |
| 14795 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 14796 | { |
| 14797 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 14798 | } |
| 14799 | } |
| 14800 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 14801 | { |
| 14802 | IkReal evalcond[2]; |
| 14803 | IkReal x1634=IKcos(j5); |
| 14804 | IkReal x1635=IKsin(j5); |
| 14805 | IkReal x1636=(new_r11*x1635); |
| 14806 | IkReal x1637=(new_r01*x1634); |
| 14807 | evalcond[0]=(x1637+(((-1.0)*x1636))); |
| 14808 | evalcond[1]=((((-1.0000000008)*x1636))+(((1.0000000008)*x1637))); |
| 14809 | if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH ) |
| 14810 | { |
| 14811 | continue; |
| 14812 | } |
| 14813 | } |
| 14814 | |
| 14815 | { |
| 14816 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 14817 | vinfos[0].jointtype = 1; |
| 14818 | vinfos[0].foffset = j0; |
| 14819 | vinfos[0].indices[0] = _ij0[0]; |
| 14820 | vinfos[0].indices[1] = _ij0[1]; |
| 14821 | vinfos[0].maxsolutions = _nj0; |
| 14822 | vinfos[1].jointtype = 1; |
| 14823 | vinfos[1].foffset = j1; |
| 14824 | vinfos[1].indices[0] = _ij1[0]; |
| 14825 | vinfos[1].indices[1] = _ij1[1]; |
| 14826 | vinfos[1].maxsolutions = _nj1; |
| 14827 | vinfos[2].jointtype = 1; |
| 14828 | vinfos[2].foffset = j2; |
| 14829 | vinfos[2].indices[0] = _ij2[0]; |
| 14830 | vinfos[2].indices[1] = _ij2[1]; |
| 14831 | vinfos[2].maxsolutions = _nj2; |
| 14832 | vinfos[3].jointtype = 1; |
| 14833 | vinfos[3].foffset = j3; |
| 14834 | vinfos[3].indices[0] = _ij3[0]; |
| 14835 | vinfos[3].indices[1] = _ij3[1]; |
| 14836 | vinfos[3].maxsolutions = _nj3; |
| 14837 | vinfos[4].jointtype = 1; |
| 14838 | vinfos[4].foffset = j4; |
| 14839 | vinfos[4].indices[0] = _ij4[0]; |
| 14840 | vinfos[4].indices[1] = _ij4[1]; |
| 14841 | vinfos[4].maxsolutions = _nj4; |
| 14842 | vinfos[5].jointtype = 1; |
| 14843 | vinfos[5].foffset = j5; |
| 14844 | vinfos[5].indices[0] = _ij5[0]; |
| 14845 | vinfos[5].indices[1] = _ij5[1]; |
| 14846 | vinfos[5].maxsolutions = _nj5; |
| 14847 | std::vector<int> vfree(0); |
| 14848 | solutions.AddSolution(vinfos,vfree); |
| 14849 | } |
| 14850 | } |
| 14851 | } |
| 14852 | |
| 14853 | } |
| 14854 | |
| 14855 | } |
| 14856 | |
| 14857 | } |
| 14858 | } while(0); |
| 14859 | if( bgotonextstatement ) |
| 14860 | { |
| 14861 | bool bgotonextstatement = true; |
| 14862 | do |
| 14863 | { |
| 14864 | if( 1 ) |
| 14865 | { |
| 14866 | bgotonextstatement=false; |
| 14867 | continue; // branch miss [j5] |
| 14868 | |
| 14869 | } |
| 14870 | } while(0); |
| 14871 | if( bgotonextstatement ) |
| 14872 | { |
| 14873 | } |
| 14874 | } |
| 14875 | } |
| 14876 | } |
| 14877 | } |
| 14878 | } |
| 14879 | } |
| 14880 | } |
| 14881 | } |
| 14882 | } |
| 14883 | } |
| 14884 | } |
| 14885 | } |
| 14886 | } |
| 14887 | |
| 14888 | } else |
| 14889 | { |
| 14890 | { |
| 14891 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 14892 | bool j5valid[1]={false}; |
| 14893 | _nj5 = 1; |
| 14894 | CheckValue<IkReal> x1643=IKPowWithIntegerCheck(new_r00,-1); |
| 14895 | if(!x1643.valid){ |
| 14896 | continue; |
| 14897 | } |
| 14898 | IkReal x1638=x1643.value; |
| 14899 | IkReal x1639=((25000.0)*new_r01); |
| 14900 | IkReal x1640=((25000.0)*cj3*sj3); |
| 14901 | CheckValue<IkReal> x1644=IKPowWithIntegerCheck(((((25000.0)*cj3*new_r10))+(((-25000.00002)*new_r00*sj3))),-1); |
| 14902 | if(!x1644.valid){ |
| 14903 | continue; |
| 14904 | } |
| 14905 | IkReal x1641=x1644.value; |
| 14906 | IkReal x1642=(new_r10*x1641); |
| 14907 | if( IKabs(((((-1.0)*sj3*x1638))+((x1639*x1642))+((x1638*x1640*x1642)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x1641*(((((-1.0)*new_r00*x1639))+(((-1.0)*x1640)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*sj3*x1638))+((x1639*x1642))+((x1638*x1640*x1642))))+IKsqr((x1641*(((((-1.0)*new_r00*x1639))+(((-1.0)*x1640))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 14908 | continue; |
| 14909 | j5array[0]=IKatan2(((((-1.0)*sj3*x1638))+((x1639*x1642))+((x1638*x1640*x1642))), (x1641*(((((-1.0)*new_r00*x1639))+(((-1.0)*x1640)))))); |
| 14910 | sj5array[0]=IKsin(j5array[0]); |
| 14911 | cj5array[0]=IKcos(j5array[0]); |
| 14912 | if( j5array[0] > IKPI ) |
| 14913 | { |
| 14914 | j5array[0]-=IK2PI; |
| 14915 | } |
| 14916 | else if( j5array[0] < -IKPI ) |
| 14917 | { j5array[0]+=IK2PI; |
| 14918 | } |
| 14919 | j5valid[0] = true; |
| 14920 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 14921 | { |
| 14922 | if( !j5valid[ij5] ) |
| 14923 | { |
| 14924 | continue; |
| 14925 | } |
| 14926 | _ij5[0] = ij5; _ij5[1] = -1; |
| 14927 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 14928 | { |
| 14929 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 14930 | { |
| 14931 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 14932 | } |
| 14933 | } |
| 14934 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 14935 | { |
| 14936 | IkReal evalcond[10]; |
| 14937 | IkReal x1645=IKcos(j5); |
| 14938 | IkReal x1646=IKsin(j5); |
| 14939 | IkReal x1647=((1.0)*cj3); |
| 14940 | IkReal x1648=((1.0000000008)*cj3); |
| 14941 | IkReal x1649=(cj3*x1645); |
| 14942 | IkReal x1650=(new_r11*x1646); |
| 14943 | IkReal x1651=(sj3*x1646); |
| 14944 | IkReal x1652=(new_r01*x1645); |
| 14945 | IkReal x1653=(new_r00*x1645); |
| 14946 | IkReal x1654=(sj3*x1645); |
| 14947 | IkReal x1655=(new_r10*x1646); |
| 14948 | evalcond[0]=(((new_r10*x1645))+sj3+((new_r00*x1646))); |
| 14949 | evalcond[1]=(((new_r11*x1645))+(((-1.0)*x1647))+((new_r01*x1646))); |
| 14950 | evalcond[2]=(x1651+(((-1.0)*x1645*x1648))+new_r00); |
| 14951 | evalcond[3]=(x1654+((x1646*x1648))+new_r10); |
| 14952 | evalcond[4]=((((-1.0)*x1646*x1647))+(((-1.0000000008)*x1654))+new_r01); |
| 14953 | evalcond[5]=((((-1.0)*x1645*x1647))+(((1.0000000008)*x1651))+new_r11); |
| 14954 | evalcond[6]=(x1653+(((-1.0)*x1655))+(((-1.0)*x1648))); |
| 14955 | evalcond[7]=(x1652+(((-1.0)*x1650))+(((-1.0000000008)*sj3))); |
| 14956 | evalcond[8]=((((-1.0000000008)*x1655))+(((-1.0)*x1647))+(((1.0000000008)*x1653))); |
| 14957 | evalcond[9]=((((-1.0)*sj3))+(((-1.0000000008)*x1650))+(((1.0000000008)*x1652))); |
| 14958 | if( 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 ) |
| 14959 | { |
| 14960 | continue; |
| 14961 | } |
| 14962 | } |
| 14963 | |
| 14964 | { |
| 14965 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 14966 | vinfos[0].jointtype = 1; |
| 14967 | vinfos[0].foffset = j0; |
| 14968 | vinfos[0].indices[0] = _ij0[0]; |
| 14969 | vinfos[0].indices[1] = _ij0[1]; |
| 14970 | vinfos[0].maxsolutions = _nj0; |
| 14971 | vinfos[1].jointtype = 1; |
| 14972 | vinfos[1].foffset = j1; |
| 14973 | vinfos[1].indices[0] = _ij1[0]; |
| 14974 | vinfos[1].indices[1] = _ij1[1]; |
| 14975 | vinfos[1].maxsolutions = _nj1; |
| 14976 | vinfos[2].jointtype = 1; |
| 14977 | vinfos[2].foffset = j2; |
| 14978 | vinfos[2].indices[0] = _ij2[0]; |
| 14979 | vinfos[2].indices[1] = _ij2[1]; |
| 14980 | vinfos[2].maxsolutions = _nj2; |
| 14981 | vinfos[3].jointtype = 1; |
| 14982 | vinfos[3].foffset = j3; |
| 14983 | vinfos[3].indices[0] = _ij3[0]; |
| 14984 | vinfos[3].indices[1] = _ij3[1]; |
| 14985 | vinfos[3].maxsolutions = _nj3; |
| 14986 | vinfos[4].jointtype = 1; |
| 14987 | vinfos[4].foffset = j4; |
| 14988 | vinfos[4].indices[0] = _ij4[0]; |
| 14989 | vinfos[4].indices[1] = _ij4[1]; |
| 14990 | vinfos[4].maxsolutions = _nj4; |
| 14991 | vinfos[5].jointtype = 1; |
| 14992 | vinfos[5].foffset = j5; |
| 14993 | vinfos[5].indices[0] = _ij5[0]; |
| 14994 | vinfos[5].indices[1] = _ij5[1]; |
| 14995 | vinfos[5].maxsolutions = _nj5; |
| 14996 | std::vector<int> vfree(0); |
| 14997 | solutions.AddSolution(vinfos,vfree); |
| 14998 | } |
| 14999 | } |
| 15000 | } |
| 15001 | |
| 15002 | } |
| 15003 | |
| 15004 | } |
| 15005 | |
| 15006 | } else |
| 15007 | { |
| 15008 | { |
| 15009 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 15010 | bool j5valid[1]={false}; |
| 15011 | _nj5 = 1; |
| 15012 | IkReal x1656=new_r00*new_r00; |
| 15013 | IkReal x1657=cj3*cj3; |
| 15014 | IkReal x1658=new_r10*new_r10; |
| 15015 | IkReal x1659=((625000000.0)*new_r00); |
| 15016 | IkReal x1660=((25000.00002)*cj3); |
| 15017 | IkReal x1661=((625000000.5)*cj3); |
| 15018 | IkReal x1662=((25000.0)*new_r00); |
| 15019 | IkReal x1663=((625000000.0)*x1656); |
| 15020 | CheckValue<IkReal> x1664=IKPowWithIntegerCheck(((((-625000001.0)*x1657*x1658))+x1663+(((-1.0)*x1657*x1663))),-1); |
| 15021 | if(!x1664.valid){ |
| 15022 | continue; |
| 15023 | } |
| 15024 | CheckValue<IkReal> x1665=IKPowWithIntegerCheck((((sj3*x1662))+(((-1.0)*new_r10*x1660))),-1); |
| 15025 | if(!x1665.valid){ |
| 15026 | continue; |
| 15027 | } |
| 15028 | if( IKabs(((x1664.value)*(((((-1.0)*x1659*(sj3*sj3*sj3)))+((x1661*(new_r10*new_r10*new_r10)))+((new_r10*x1661*(cj3*cj3)))+(((-1.0)*new_r10*x1661))+((sj3*x1658*x1659)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((x1665.value)*((((sj3*x1660))+(((-1.0)*new_r10*x1662)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x1664.value)*(((((-1.0)*x1659*(sj3*sj3*sj3)))+((x1661*(new_r10*new_r10*new_r10)))+((new_r10*x1661*(cj3*cj3)))+(((-1.0)*new_r10*x1661))+((sj3*x1658*x1659))))))+IKsqr(((x1665.value)*((((sj3*x1660))+(((-1.0)*new_r10*x1662))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 15029 | continue; |
| 15030 | j5array[0]=IKatan2(((x1664.value)*(((((-1.0)*x1659*(sj3*sj3*sj3)))+((x1661*(new_r10*new_r10*new_r10)))+((new_r10*x1661*(cj3*cj3)))+(((-1.0)*new_r10*x1661))+((sj3*x1658*x1659))))), ((x1665.value)*((((sj3*x1660))+(((-1.0)*new_r10*x1662)))))); |
| 15031 | sj5array[0]=IKsin(j5array[0]); |
| 15032 | cj5array[0]=IKcos(j5array[0]); |
| 15033 | if( j5array[0] > IKPI ) |
| 15034 | { |
| 15035 | j5array[0]-=IK2PI; |
| 15036 | } |
| 15037 | else if( j5array[0] < -IKPI ) |
| 15038 | { j5array[0]+=IK2PI; |
| 15039 | } |
| 15040 | j5valid[0] = true; |
| 15041 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 15042 | { |
| 15043 | if( !j5valid[ij5] ) |
| 15044 | { |
| 15045 | continue; |
| 15046 | } |
| 15047 | _ij5[0] = ij5; _ij5[1] = -1; |
| 15048 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 15049 | { |
| 15050 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 15051 | { |
| 15052 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 15053 | } |
| 15054 | } |
| 15055 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 15056 | { |
| 15057 | IkReal evalcond[10]; |
| 15058 | IkReal x1666=IKcos(j5); |
| 15059 | IkReal x1667=IKsin(j5); |
| 15060 | IkReal x1668=((1.0)*cj3); |
| 15061 | IkReal x1669=((1.0000000008)*cj3); |
| 15062 | IkReal x1670=(cj3*x1666); |
| 15063 | IkReal x1671=(new_r11*x1667); |
| 15064 | IkReal x1672=(sj3*x1667); |
| 15065 | IkReal x1673=(new_r01*x1666); |
| 15066 | IkReal x1674=(new_r00*x1666); |
| 15067 | IkReal x1675=(sj3*x1666); |
| 15068 | IkReal x1676=(new_r10*x1667); |
| 15069 | evalcond[0]=(sj3+((new_r00*x1667))+((new_r10*x1666))); |
| 15070 | evalcond[1]=(((new_r11*x1666))+((new_r01*x1667))+(((-1.0)*x1668))); |
| 15071 | evalcond[2]=(x1672+new_r00+(((-1.0)*x1666*x1669))); |
| 15072 | evalcond[3]=(x1675+((x1667*x1669))+new_r10); |
| 15073 | evalcond[4]=((((-1.0)*x1667*x1668))+new_r01+(((-1.0000000008)*x1675))); |
| 15074 | evalcond[5]=((((1.0000000008)*x1672))+new_r11+(((-1.0)*x1666*x1668))); |
| 15075 | evalcond[6]=(x1674+(((-1.0)*x1676))+(((-1.0)*x1669))); |
| 15076 | evalcond[7]=(x1673+(((-1.0)*x1671))+(((-1.0000000008)*sj3))); |
| 15077 | evalcond[8]=((((1.0000000008)*x1674))+(((-1.0)*x1668))+(((-1.0000000008)*x1676))); |
| 15078 | evalcond[9]=((((-1.0)*sj3))+(((1.0000000008)*x1673))+(((-1.0000000008)*x1671))); |
| 15079 | if( 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 ) |
| 15080 | { |
| 15081 | continue; |
| 15082 | } |
| 15083 | } |
| 15084 | |
| 15085 | { |
| 15086 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 15087 | vinfos[0].jointtype = 1; |
| 15088 | vinfos[0].foffset = j0; |
| 15089 | vinfos[0].indices[0] = _ij0[0]; |
| 15090 | vinfos[0].indices[1] = _ij0[1]; |
| 15091 | vinfos[0].maxsolutions = _nj0; |
| 15092 | vinfos[1].jointtype = 1; |
| 15093 | vinfos[1].foffset = j1; |
| 15094 | vinfos[1].indices[0] = _ij1[0]; |
| 15095 | vinfos[1].indices[1] = _ij1[1]; |
| 15096 | vinfos[1].maxsolutions = _nj1; |
| 15097 | vinfos[2].jointtype = 1; |
| 15098 | vinfos[2].foffset = j2; |
| 15099 | vinfos[2].indices[0] = _ij2[0]; |
| 15100 | vinfos[2].indices[1] = _ij2[1]; |
| 15101 | vinfos[2].maxsolutions = _nj2; |
| 15102 | vinfos[3].jointtype = 1; |
| 15103 | vinfos[3].foffset = j3; |
| 15104 | vinfos[3].indices[0] = _ij3[0]; |
| 15105 | vinfos[3].indices[1] = _ij3[1]; |
| 15106 | vinfos[3].maxsolutions = _nj3; |
| 15107 | vinfos[4].jointtype = 1; |
| 15108 | vinfos[4].foffset = j4; |
| 15109 | vinfos[4].indices[0] = _ij4[0]; |
| 15110 | vinfos[4].indices[1] = _ij4[1]; |
| 15111 | vinfos[4].maxsolutions = _nj4; |
| 15112 | vinfos[5].jointtype = 1; |
| 15113 | vinfos[5].foffset = j5; |
| 15114 | vinfos[5].indices[0] = _ij5[0]; |
| 15115 | vinfos[5].indices[1] = _ij5[1]; |
| 15116 | vinfos[5].maxsolutions = _nj5; |
| 15117 | std::vector<int> vfree(0); |
| 15118 | solutions.AddSolution(vinfos,vfree); |
| 15119 | } |
| 15120 | } |
| 15121 | } |
| 15122 | |
| 15123 | } |
| 15124 | |
| 15125 | } |
| 15126 | |
| 15127 | } else |
| 15128 | { |
| 15129 | { |
| 15130 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 15131 | bool j5valid[1]={false}; |
| 15132 | _nj5 = 1; |
| 15133 | IkReal x1677=((1.0)*new_r00); |
| 15134 | CheckValue<IkReal> x1678 = IKatan2WithCheck(IkReal((((new_r11*sj3))+((cj3*new_r10)))),IkReal(((((-1.0)*new_r01*sj3))+(((-1.0)*cj3*x1677)))),IKFAST_ATAN2_MAGTHRESH); |
| 15135 | if(!x1678.valid){ |
| 15136 | continue; |
| 15137 | } |
| 15138 | CheckValue<IkReal> x1679=IKPowWithIntegerCheck(IKsign((((new_r01*new_r10))+(((-1.0)*new_r11*x1677)))),-1); |
| 15139 | if(!x1679.valid){ |
| 15140 | continue; |
| 15141 | } |
| 15142 | j5array[0]=((-1.5707963267949)+(x1678.value)+(((1.5707963267949)*(x1679.value)))); |
| 15143 | sj5array[0]=IKsin(j5array[0]); |
| 15144 | cj5array[0]=IKcos(j5array[0]); |
| 15145 | if( j5array[0] > IKPI ) |
| 15146 | { |
| 15147 | j5array[0]-=IK2PI; |
| 15148 | } |
| 15149 | else if( j5array[0] < -IKPI ) |
| 15150 | { j5array[0]+=IK2PI; |
| 15151 | } |
| 15152 | j5valid[0] = true; |
| 15153 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 15154 | { |
| 15155 | if( !j5valid[ij5] ) |
| 15156 | { |
| 15157 | continue; |
| 15158 | } |
| 15159 | _ij5[0] = ij5; _ij5[1] = -1; |
| 15160 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 15161 | { |
| 15162 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 15163 | { |
| 15164 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 15165 | } |
| 15166 | } |
| 15167 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 15168 | { |
| 15169 | IkReal evalcond[10]; |
| 15170 | IkReal x1680=IKcos(j5); |
| 15171 | IkReal x1681=IKsin(j5); |
| 15172 | IkReal x1682=((1.0)*cj3); |
| 15173 | IkReal x1683=((1.0000000008)*cj3); |
| 15174 | IkReal x1684=(cj3*x1680); |
| 15175 | IkReal x1685=(new_r11*x1681); |
| 15176 | IkReal x1686=(sj3*x1681); |
| 15177 | IkReal x1687=(new_r01*x1680); |
| 15178 | IkReal x1688=(new_r00*x1680); |
| 15179 | IkReal x1689=(sj3*x1680); |
| 15180 | IkReal x1690=(new_r10*x1681); |
| 15181 | evalcond[0]=(((new_r00*x1681))+sj3+((new_r10*x1680))); |
| 15182 | evalcond[1]=((((-1.0)*x1682))+((new_r11*x1680))+((new_r01*x1681))); |
| 15183 | evalcond[2]=(x1686+(((-1.0)*x1680*x1683))+new_r00); |
| 15184 | evalcond[3]=(((x1681*x1683))+x1689+new_r10); |
| 15185 | evalcond[4]=((((-1.0)*x1681*x1682))+(((-1.0000000008)*x1689))+new_r01); |
| 15186 | evalcond[5]=((((-1.0)*x1680*x1682))+new_r11+(((1.0000000008)*x1686))); |
| 15187 | evalcond[6]=((((-1.0)*x1683))+x1688+(((-1.0)*x1690))); |
| 15188 | evalcond[7]=(x1687+(((-1.0)*x1685))+(((-1.0000000008)*sj3))); |
| 15189 | evalcond[8]=((((-1.0)*x1682))+(((1.0000000008)*x1688))+(((-1.0000000008)*x1690))); |
| 15190 | evalcond[9]=((((-1.0)*sj3))+(((-1.0000000008)*x1685))+(((1.0000000008)*x1687))); |
| 15191 | if( 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 ) |
| 15192 | { |
| 15193 | continue; |
| 15194 | } |
| 15195 | } |
| 15196 | |
| 15197 | { |
| 15198 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 15199 | vinfos[0].jointtype = 1; |
| 15200 | vinfos[0].foffset = j0; |
| 15201 | vinfos[0].indices[0] = _ij0[0]; |
| 15202 | vinfos[0].indices[1] = _ij0[1]; |
| 15203 | vinfos[0].maxsolutions = _nj0; |
| 15204 | vinfos[1].jointtype = 1; |
| 15205 | vinfos[1].foffset = j1; |
| 15206 | vinfos[1].indices[0] = _ij1[0]; |
| 15207 | vinfos[1].indices[1] = _ij1[1]; |
| 15208 | vinfos[1].maxsolutions = _nj1; |
| 15209 | vinfos[2].jointtype = 1; |
| 15210 | vinfos[2].foffset = j2; |
| 15211 | vinfos[2].indices[0] = _ij2[0]; |
| 15212 | vinfos[2].indices[1] = _ij2[1]; |
| 15213 | vinfos[2].maxsolutions = _nj2; |
| 15214 | vinfos[3].jointtype = 1; |
| 15215 | vinfos[3].foffset = j3; |
| 15216 | vinfos[3].indices[0] = _ij3[0]; |
| 15217 | vinfos[3].indices[1] = _ij3[1]; |
| 15218 | vinfos[3].maxsolutions = _nj3; |
| 15219 | vinfos[4].jointtype = 1; |
| 15220 | vinfos[4].foffset = j4; |
| 15221 | vinfos[4].indices[0] = _ij4[0]; |
| 15222 | vinfos[4].indices[1] = _ij4[1]; |
| 15223 | vinfos[4].maxsolutions = _nj4; |
| 15224 | vinfos[5].jointtype = 1; |
| 15225 | vinfos[5].foffset = j5; |
| 15226 | vinfos[5].indices[0] = _ij5[0]; |
| 15227 | vinfos[5].indices[1] = _ij5[1]; |
| 15228 | vinfos[5].maxsolutions = _nj5; |
| 15229 | std::vector<int> vfree(0); |
| 15230 | solutions.AddSolution(vinfos,vfree); |
| 15231 | } |
| 15232 | } |
| 15233 | } |
| 15234 | |
| 15235 | } |
| 15236 | |
| 15237 | } |
| 15238 | |
| 15239 | } |
| 15240 | } while(0); |
| 15241 | if( bgotonextstatement ) |
| 15242 | { |
| 15243 | bool bgotonextstatement = true; |
| 15244 | do |
| 15245 | { |
| 15246 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14163265358977)+j4)))), 6.28318530717959))); |
| 15247 | evalcond[1]=new_r02; |
| 15248 | evalcond[2]=new_r12; |
| 15249 | evalcond[3]=new_r20; |
| 15250 | evalcond[4]=new_r21; |
| 15251 | if( 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 ) |
| 15252 | { |
| 15253 | bgotonextstatement=false; |
| 15254 | { |
| 15255 | IkReal j5eval[3]; |
| 15256 | sj4=-4.0e-5; |
| 15257 | cj4=-1.0; |
| 15258 | j4=3.14163265; |
| 15259 | IkReal x1691=((1.0)*new_r00); |
| 15260 | IkReal x1692=((((-1.0)*new_r11*x1691))+((new_r01*new_r10))); |
| 15261 | j5eval[0]=x1692; |
| 15262 | j5eval[1]=IKsign(x1692); |
| 15263 | j5eval[2]=((IKabs((((new_r11*sj3))+((cj3*new_r10)))))+(IKabs(((((-1.0)*new_r01*sj3))+(((-1.0)*cj3*x1691)))))); |
| 15264 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 15265 | { |
| 15266 | { |
| 15267 | IkReal j5eval[2]; |
| 15268 | sj4=-4.0e-5; |
| 15269 | cj4=-1.0; |
| 15270 | j4=3.14163265; |
| 15271 | j5eval[0]=((((1.0000000008)*new_r00*sj3))+((cj3*new_r10))); |
| 15272 | j5eval[1]=new_r00; |
| 15273 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 15274 | { |
| 15275 | { |
| 15276 | IkReal j5eval[2]; |
| 15277 | sj4=-4.0e-5; |
| 15278 | cj4=-1.0; |
| 15279 | j4=3.14163265; |
| 15280 | j5eval[0]=new_r00; |
| 15281 | j5eval[1]=(((new_r00*sj3))+(((1.0000000008)*cj3*new_r10))); |
| 15282 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 15283 | { |
| 15284 | { |
| 15285 | IkReal evalcond[1]; |
| 15286 | bool bgotonextstatement = true; |
| 15287 | do |
| 15288 | { |
| 15289 | IkReal x1694 = ((((1.0000000016)*(new_r10*new_r10)))+(new_r00*new_r00)); |
| 15290 | if(IKabs(x1694)==0){ |
| 15291 | continue; |
| 15292 | } |
| 15293 | IkReal x1693=pow(x1694,-0.5); |
| 15294 | CheckValue<IkReal> x1695 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15295 | if(!x1695.valid){ |
| 15296 | continue; |
| 15297 | } |
| 15298 | IkReal gconst20=((-1.0)*(x1695.value)); |
| 15299 | IkReal gconst21=((-1.0000000008)*new_r10*x1693); |
| 15300 | IkReal gconst22=(new_r00*x1693); |
| 15301 | CheckValue<IkReal> x1696 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15302 | if(!x1696.valid){ |
| 15303 | continue; |
| 15304 | } |
| 15305 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((x1696.value)+j3)))), 6.28318530717959))); |
| 15306 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 15307 | { |
| 15308 | bgotonextstatement=false; |
| 15309 | { |
| 15310 | IkReal j5eval[3]; |
| 15311 | IkReal x1697=x1693; |
| 15312 | sj4=-4.0e-5; |
| 15313 | cj4=-1.0; |
| 15314 | j4=3.14163265; |
| 15315 | sj3=gconst21; |
| 15316 | cj3=gconst22; |
| 15317 | CheckValue<IkReal> x1698 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15318 | if(!x1698.valid){ |
| 15319 | continue; |
| 15320 | } |
| 15321 | j3=((-1.0)*(x1698.value)); |
| 15322 | CheckValue<IkReal> x1699 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15323 | if(!x1699.valid){ |
| 15324 | continue; |
| 15325 | } |
| 15326 | IkReal gconst20=((-1.0)*(x1699.value)); |
| 15327 | IkReal gconst21=((-1.0000000008)*new_r10*x1697); |
| 15328 | IkReal gconst22=(new_r00*x1697); |
| 15329 | IkReal x1700=new_r00*new_r00; |
| 15330 | IkReal x1701=(new_r01*new_r10); |
| 15331 | IkReal x1702=(x1701+(((-1.0)*new_r00*new_r11))); |
| 15332 | IkReal x1705 = ((((625000000.0)*x1700))+(((625000001.0)*(new_r10*new_r10)))); |
| 15333 | if(IKabs(x1705)==0){ |
| 15334 | continue; |
| 15335 | } |
| 15336 | IkReal x1703=pow(x1705,-0.5); |
| 15337 | IkReal x1704=(new_r10*x1703); |
| 15338 | j5eval[0]=x1702; |
| 15339 | j5eval[1]=IKsign(x1702); |
| 15340 | j5eval[2]=((IKabs(((((25000.0)*new_r00*x1704))+(((-25000.00002)*new_r11*x1704)))))+(IKabs(((((-25000.0)*x1700*x1703))+(((25000.00002)*x1701*x1703)))))); |
| 15341 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 15342 | { |
| 15343 | { |
| 15344 | IkReal j5eval[2]; |
| 15345 | IkReal x1706=x1693; |
| 15346 | sj4=-4.0e-5; |
| 15347 | cj4=-1.0; |
| 15348 | j4=3.14163265; |
| 15349 | sj3=gconst21; |
| 15350 | cj3=gconst22; |
| 15351 | CheckValue<IkReal> x1707 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15352 | if(!x1707.valid){ |
| 15353 | continue; |
| 15354 | } |
| 15355 | j3=((-1.0)*(x1707.value)); |
| 15356 | CheckValue<IkReal> x1708 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15357 | if(!x1708.valid){ |
| 15358 | continue; |
| 15359 | } |
| 15360 | IkReal gconst20=((-1.0)*(x1708.value)); |
| 15361 | IkReal gconst21=((-1.0000000008)*new_r10*x1706); |
| 15362 | IkReal gconst22=(new_r00*x1706); |
| 15363 | j5eval[0]=new_r00; |
| 15364 | IkReal x1709 = ((((1.0000000016)*(new_r10*new_r10)))+(new_r00*new_r00)); |
| 15365 | if(IKabs(x1709)==0){ |
| 15366 | continue; |
| 15367 | } |
| 15368 | j5eval[1]=((-1.6e-9)*new_r00*new_r10*(pow(x1709,-0.5))); |
| 15369 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 15370 | { |
| 15371 | { |
| 15372 | IkReal j5eval[1]; |
| 15373 | IkReal x1710=x1693; |
| 15374 | sj4=-4.0e-5; |
| 15375 | cj4=-1.0; |
| 15376 | j4=3.14163265; |
| 15377 | sj3=gconst21; |
| 15378 | cj3=gconst22; |
| 15379 | CheckValue<IkReal> x1711 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15380 | if(!x1711.valid){ |
| 15381 | continue; |
| 15382 | } |
| 15383 | j3=((-1.0)*(x1711.value)); |
| 15384 | CheckValue<IkReal> x1712 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15385 | if(!x1712.valid){ |
| 15386 | continue; |
| 15387 | } |
| 15388 | IkReal gconst20=((-1.0)*(x1712.value)); |
| 15389 | IkReal gconst21=((-1.0000000008)*new_r10*x1710); |
| 15390 | IkReal gconst22=(new_r00*x1710); |
| 15391 | j5eval[0]=new_r00; |
| 15392 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 15393 | { |
| 15394 | { |
| 15395 | IkReal evalcond[1]; |
| 15396 | bool bgotonextstatement = true; |
| 15397 | do |
| 15398 | { |
| 15399 | evalcond[0]=IKabs(new_r00); |
| 15400 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 15401 | { |
| 15402 | bgotonextstatement=false; |
| 15403 | { |
| 15404 | IkReal j5eval[1]; |
| 15405 | sj4=-4.0e-5; |
| 15406 | cj4=-1.0; |
| 15407 | j4=3.14163265; |
| 15408 | sj3=gconst21; |
| 15409 | cj3=gconst22; |
| 15410 | CheckValue<IkReal> x1713 = IKatan2WithCheck(IkReal(new_r10),IkReal(0),IKFAST_ATAN2_MAGTHRESH); |
| 15411 | if(!x1713.valid){ |
| 15412 | continue; |
| 15413 | } |
| 15414 | j3=((-1.0)*(x1713.value)); |
| 15415 | new_r00=0; |
| 15416 | CheckValue<IkReal> x1714 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(0),IKFAST_ATAN2_MAGTHRESH); |
| 15417 | if(!x1714.valid){ |
| 15418 | continue; |
| 15419 | } |
| 15420 | IkReal gconst20=((-1.0)*(x1714.value)); |
| 15421 | IkReal x1715 = new_r10*new_r10; |
| 15422 | if(IKabs(x1715)==0){ |
| 15423 | continue; |
| 15424 | } |
| 15425 | IkReal gconst21=((-1.0)*new_r10*(pow(x1715,-0.5))); |
| 15426 | IkReal gconst22=0; |
| 15427 | j5eval[0]=new_r10; |
| 15428 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 15429 | { |
| 15430 | { |
| 15431 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 15432 | bool j5valid[1]={false}; |
| 15433 | _nj5 = 1; |
| 15434 | CheckValue<IkReal> x1717=IKPowWithIntegerCheck(gconst21,-1); |
| 15435 | if(!x1717.valid){ |
| 15436 | continue; |
| 15437 | } |
| 15438 | IkReal x1716=x1717.value; |
| 15439 | if( IKabs(((0.9999999992)*new_r11*x1716)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r10*x1716)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*new_r11*x1716))+IKsqr(((-1.0)*new_r10*x1716))-1) <= IKFAST_SINCOS_THRESH ) |
| 15440 | continue; |
| 15441 | j5array[0]=IKatan2(((0.9999999992)*new_r11*x1716), ((-1.0)*new_r10*x1716)); |
| 15442 | sj5array[0]=IKsin(j5array[0]); |
| 15443 | cj5array[0]=IKcos(j5array[0]); |
| 15444 | if( j5array[0] > IKPI ) |
| 15445 | { |
| 15446 | j5array[0]-=IK2PI; |
| 15447 | } |
| 15448 | else if( j5array[0] < -IKPI ) |
| 15449 | { j5array[0]+=IK2PI; |
| 15450 | } |
| 15451 | j5valid[0] = true; |
| 15452 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 15453 | { |
| 15454 | if( !j5valid[ij5] ) |
| 15455 | { |
| 15456 | continue; |
| 15457 | } |
| 15458 | _ij5[0] = ij5; _ij5[1] = -1; |
| 15459 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 15460 | { |
| 15461 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 15462 | { |
| 15463 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 15464 | } |
| 15465 | } |
| 15466 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 15467 | { |
| 15468 | IkReal evalcond[10]; |
| 15469 | IkReal x1718=IKsin(j5); |
| 15470 | IkReal x1719=IKcos(j5); |
| 15471 | IkReal x1720=(new_r10*x1718); |
| 15472 | IkReal x1721=((1.0000000008)*x1719); |
| 15473 | IkReal x1722=(new_r11*x1718); |
| 15474 | IkReal x1723=(gconst21*x1718); |
| 15475 | evalcond[0]=x1723; |
| 15476 | evalcond[1]=((-1.0)*x1720); |
| 15477 | evalcond[2]=(((new_r10*x1719))+gconst21); |
| 15478 | evalcond[3]=(((gconst21*x1719))+new_r10); |
| 15479 | evalcond[4]=((1.0000000008)*x1720); |
| 15480 | evalcond[5]=(((new_r11*x1719))+((new_r01*x1718))); |
| 15481 | evalcond[6]=(((gconst21*x1721))+new_r01); |
| 15482 | evalcond[7]=((((-1.0000000008)*x1723))+new_r11); |
| 15483 | evalcond[8]=(((new_r01*x1719))+(((1.0000000008)*gconst21))+(((-1.0)*x1722))); |
| 15484 | evalcond[9]=((((-1.0)*new_r01*x1721))+(((1.0000000008)*x1722))+(((-1.0)*gconst21))); |
| 15485 | if( 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 ) |
| 15486 | { |
| 15487 | continue; |
| 15488 | } |
| 15489 | } |
| 15490 | |
| 15491 | { |
| 15492 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 15493 | vinfos[0].jointtype = 1; |
| 15494 | vinfos[0].foffset = j0; |
| 15495 | vinfos[0].indices[0] = _ij0[0]; |
| 15496 | vinfos[0].indices[1] = _ij0[1]; |
| 15497 | vinfos[0].maxsolutions = _nj0; |
| 15498 | vinfos[1].jointtype = 1; |
| 15499 | vinfos[1].foffset = j1; |
| 15500 | vinfos[1].indices[0] = _ij1[0]; |
| 15501 | vinfos[1].indices[1] = _ij1[1]; |
| 15502 | vinfos[1].maxsolutions = _nj1; |
| 15503 | vinfos[2].jointtype = 1; |
| 15504 | vinfos[2].foffset = j2; |
| 15505 | vinfos[2].indices[0] = _ij2[0]; |
| 15506 | vinfos[2].indices[1] = _ij2[1]; |
| 15507 | vinfos[2].maxsolutions = _nj2; |
| 15508 | vinfos[3].jointtype = 1; |
| 15509 | vinfos[3].foffset = j3; |
| 15510 | vinfos[3].indices[0] = _ij3[0]; |
| 15511 | vinfos[3].indices[1] = _ij3[1]; |
| 15512 | vinfos[3].maxsolutions = _nj3; |
| 15513 | vinfos[4].jointtype = 1; |
| 15514 | vinfos[4].foffset = j4; |
| 15515 | vinfos[4].indices[0] = _ij4[0]; |
| 15516 | vinfos[4].indices[1] = _ij4[1]; |
| 15517 | vinfos[4].maxsolutions = _nj4; |
| 15518 | vinfos[5].jointtype = 1; |
| 15519 | vinfos[5].foffset = j5; |
| 15520 | vinfos[5].indices[0] = _ij5[0]; |
| 15521 | vinfos[5].indices[1] = _ij5[1]; |
| 15522 | vinfos[5].maxsolutions = _nj5; |
| 15523 | std::vector<int> vfree(0); |
| 15524 | solutions.AddSolution(vinfos,vfree); |
| 15525 | } |
| 15526 | } |
| 15527 | } |
| 15528 | |
| 15529 | } else |
| 15530 | { |
| 15531 | { |
| 15532 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 15533 | bool j5valid[1]={false}; |
| 15534 | _nj5 = 1; |
| 15535 | CheckValue<IkReal> x1724=IKPowWithIntegerCheck(gconst21,-1); |
| 15536 | if(!x1724.valid){ |
| 15537 | continue; |
| 15538 | } |
| 15539 | CheckValue<IkReal> x1725=IKPowWithIntegerCheck(new_r10,-1); |
| 15540 | if(!x1725.valid){ |
| 15541 | continue; |
| 15542 | } |
| 15543 | if( IKabs(((0.9999999992)*new_r11*(x1724.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*gconst21*(x1725.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*new_r11*(x1724.value)))+IKsqr(((-1.0)*gconst21*(x1725.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 15544 | continue; |
| 15545 | j5array[0]=IKatan2(((0.9999999992)*new_r11*(x1724.value)), ((-1.0)*gconst21*(x1725.value))); |
| 15546 | sj5array[0]=IKsin(j5array[0]); |
| 15547 | cj5array[0]=IKcos(j5array[0]); |
| 15548 | if( j5array[0] > IKPI ) |
| 15549 | { |
| 15550 | j5array[0]-=IK2PI; |
| 15551 | } |
| 15552 | else if( j5array[0] < -IKPI ) |
| 15553 | { j5array[0]+=IK2PI; |
| 15554 | } |
| 15555 | j5valid[0] = true; |
| 15556 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 15557 | { |
| 15558 | if( !j5valid[ij5] ) |
| 15559 | { |
| 15560 | continue; |
| 15561 | } |
| 15562 | _ij5[0] = ij5; _ij5[1] = -1; |
| 15563 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 15564 | { |
| 15565 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 15566 | { |
| 15567 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 15568 | } |
| 15569 | } |
| 15570 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 15571 | { |
| 15572 | IkReal evalcond[10]; |
| 15573 | IkReal x1726=IKsin(j5); |
| 15574 | IkReal x1727=IKcos(j5); |
| 15575 | IkReal x1728=(new_r10*x1726); |
| 15576 | IkReal x1729=((1.0000000008)*x1727); |
| 15577 | IkReal x1730=(new_r11*x1726); |
| 15578 | IkReal x1731=(gconst21*x1726); |
| 15579 | evalcond[0]=x1731; |
| 15580 | evalcond[1]=((-1.0)*x1728); |
| 15581 | evalcond[2]=(gconst21+((new_r10*x1727))); |
| 15582 | evalcond[3]=(((gconst21*x1727))+new_r10); |
| 15583 | evalcond[4]=((1.0000000008)*x1728); |
| 15584 | evalcond[5]=(((new_r11*x1727))+((new_r01*x1726))); |
| 15585 | evalcond[6]=(((gconst21*x1729))+new_r01); |
| 15586 | evalcond[7]=((((-1.0000000008)*x1731))+new_r11); |
| 15587 | evalcond[8]=((((1.0000000008)*gconst21))+(((-1.0)*x1730))+((new_r01*x1727))); |
| 15588 | evalcond[9]=((((-1.0)*new_r01*x1729))+(((1.0000000008)*x1730))+(((-1.0)*gconst21))); |
| 15589 | if( 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 ) |
| 15590 | { |
| 15591 | continue; |
| 15592 | } |
| 15593 | } |
| 15594 | |
| 15595 | { |
| 15596 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 15597 | vinfos[0].jointtype = 1; |
| 15598 | vinfos[0].foffset = j0; |
| 15599 | vinfos[0].indices[0] = _ij0[0]; |
| 15600 | vinfos[0].indices[1] = _ij0[1]; |
| 15601 | vinfos[0].maxsolutions = _nj0; |
| 15602 | vinfos[1].jointtype = 1; |
| 15603 | vinfos[1].foffset = j1; |
| 15604 | vinfos[1].indices[0] = _ij1[0]; |
| 15605 | vinfos[1].indices[1] = _ij1[1]; |
| 15606 | vinfos[1].maxsolutions = _nj1; |
| 15607 | vinfos[2].jointtype = 1; |
| 15608 | vinfos[2].foffset = j2; |
| 15609 | vinfos[2].indices[0] = _ij2[0]; |
| 15610 | vinfos[2].indices[1] = _ij2[1]; |
| 15611 | vinfos[2].maxsolutions = _nj2; |
| 15612 | vinfos[3].jointtype = 1; |
| 15613 | vinfos[3].foffset = j3; |
| 15614 | vinfos[3].indices[0] = _ij3[0]; |
| 15615 | vinfos[3].indices[1] = _ij3[1]; |
| 15616 | vinfos[3].maxsolutions = _nj3; |
| 15617 | vinfos[4].jointtype = 1; |
| 15618 | vinfos[4].foffset = j4; |
| 15619 | vinfos[4].indices[0] = _ij4[0]; |
| 15620 | vinfos[4].indices[1] = _ij4[1]; |
| 15621 | vinfos[4].maxsolutions = _nj4; |
| 15622 | vinfos[5].jointtype = 1; |
| 15623 | vinfos[5].foffset = j5; |
| 15624 | vinfos[5].indices[0] = _ij5[0]; |
| 15625 | vinfos[5].indices[1] = _ij5[1]; |
| 15626 | vinfos[5].maxsolutions = _nj5; |
| 15627 | std::vector<int> vfree(0); |
| 15628 | solutions.AddSolution(vinfos,vfree); |
| 15629 | } |
| 15630 | } |
| 15631 | } |
| 15632 | |
| 15633 | } |
| 15634 | |
| 15635 | } |
| 15636 | |
| 15637 | } |
| 15638 | } while(0); |
| 15639 | if( bgotonextstatement ) |
| 15640 | { |
| 15641 | bool bgotonextstatement = true; |
| 15642 | do |
| 15643 | { |
| 15644 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 15645 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 15646 | { |
| 15647 | bgotonextstatement=false; |
| 15648 | { |
| 15649 | IkReal j5eval[5]; |
| 15650 | IkReal x1733 = ((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 15651 | if(IKabs(x1733)==0){ |
| 15652 | continue; |
| 15653 | } |
| 15654 | IkReal x1732=pow(x1733,-0.5); |
| 15655 | sj4=-4.0e-5; |
| 15656 | cj4=-1.0; |
| 15657 | j4=3.14163265; |
| 15658 | sj3=gconst21; |
| 15659 | cj3=gconst22; |
| 15660 | CheckValue<IkReal> x1734 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15661 | if(!x1734.valid){ |
| 15662 | continue; |
| 15663 | } |
| 15664 | j3=((-1.0)*(x1734.value)); |
| 15665 | new_r11=0; |
| 15666 | new_r01=0; |
| 15667 | new_r22=0; |
| 15668 | new_r20=0; |
| 15669 | CheckValue<IkReal> x1735 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15670 | if(!x1735.valid){ |
| 15671 | continue; |
| 15672 | } |
| 15673 | IkReal gconst20=((-1.0)*(x1735.value)); |
| 15674 | IkReal gconst21=((-1.0000000008)*new_r10*x1732); |
| 15675 | IkReal gconst22=(new_r00*x1732); |
| 15676 | j5eval[0]=1.0; |
| 15677 | j5eval[1]=1.0; |
| 15678 | j5eval[2]=3.90625000625e+17; |
| 15679 | j5eval[3]=((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 15680 | j5eval[4]=1.0; |
| 15681 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 || IKabs(j5eval[3]) < 0.0000010000000000 || IKabs(j5eval[4]) < 0.0000010000000000 ) |
| 15682 | { |
| 15683 | { |
| 15684 | IkReal j5eval[1]; |
| 15685 | IkReal x1737 = ((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 15686 | if(IKabs(x1737)==0){ |
| 15687 | continue; |
| 15688 | } |
| 15689 | IkReal x1736=pow(x1737,-0.5); |
| 15690 | sj4=-4.0e-5; |
| 15691 | cj4=-1.0; |
| 15692 | j4=3.14163265; |
| 15693 | sj3=gconst21; |
| 15694 | cj3=gconst22; |
| 15695 | CheckValue<IkReal> x1738 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15696 | if(!x1738.valid){ |
| 15697 | continue; |
| 15698 | } |
| 15699 | j3=((-1.0)*(x1738.value)); |
| 15700 | new_r11=0; |
| 15701 | new_r01=0; |
| 15702 | new_r22=0; |
| 15703 | new_r20=0; |
| 15704 | CheckValue<IkReal> x1739 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15705 | if(!x1739.valid){ |
| 15706 | continue; |
| 15707 | } |
| 15708 | IkReal gconst20=((-1.0)*(x1739.value)); |
| 15709 | IkReal gconst21=((-1.0000000008)*new_r10*x1736); |
| 15710 | IkReal gconst22=(new_r00*x1736); |
| 15711 | IkReal x1740=new_r10*new_r10; |
| 15712 | CheckValue<IkReal> x1742=IKPowWithIntegerCheck(((1.0)+(((1.6e-9)*x1740))),-1); |
| 15713 | if(!x1742.valid){ |
| 15714 | continue; |
| 15715 | } |
| 15716 | IkReal x1741=x1742.value; |
| 15717 | IkReal x1743=((1.0)+(((-1.0)*x1740))); |
| 15718 | j5eval[0]=IKsign(((((625000002.0)*x1741*(x1740*x1740)))+(((-625000000.0)*x1741*(x1743*x1743))))); |
| 15719 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 15720 | { |
| 15721 | { |
| 15722 | IkReal j5eval[2]; |
| 15723 | IkReal x1745 = ((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 15724 | if(IKabs(x1745)==0){ |
| 15725 | continue; |
| 15726 | } |
| 15727 | IkReal x1744=pow(x1745,-0.5); |
| 15728 | sj4=-4.0e-5; |
| 15729 | cj4=-1.0; |
| 15730 | j4=3.14163265; |
| 15731 | sj3=gconst21; |
| 15732 | cj3=gconst22; |
| 15733 | CheckValue<IkReal> x1746 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15734 | if(!x1746.valid){ |
| 15735 | continue; |
| 15736 | } |
| 15737 | j3=((-1.0)*(x1746.value)); |
| 15738 | new_r11=0; |
| 15739 | new_r01=0; |
| 15740 | new_r22=0; |
| 15741 | new_r20=0; |
| 15742 | CheckValue<IkReal> x1747 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 15743 | if(!x1747.valid){ |
| 15744 | continue; |
| 15745 | } |
| 15746 | IkReal gconst20=((-1.0)*(x1747.value)); |
| 15747 | IkReal gconst21=((-1.0000000008)*new_r10*x1744); |
| 15748 | IkReal gconst22=(new_r00*x1744); |
| 15749 | IkReal x1748=new_r10*new_r10; |
| 15750 | IkReal x1749=((1.0)+(((1.6e-9)*x1748))); |
| 15751 | CheckValue<IkReal> x1750=IKPowWithIntegerCheck(x1749,-1); |
| 15752 | if(!x1750.valid){ |
| 15753 | continue; |
| 15754 | } |
| 15755 | j5eval[0]=((-3.20000000256e-9)*x1748*(x1750.value)*(((1.0)+(((-1.0)*x1748))))); |
| 15756 | IkReal x1751 = x1749; |
| 15757 | if(IKabs(x1751)==0){ |
| 15758 | continue; |
| 15759 | } |
| 15760 | j5eval[1]=((-1.6e-9)*new_r00*new_r10*(pow(x1751,-0.5))); |
| 15761 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 15762 | { |
| 15763 | continue; // 3 cases reached |
| 15764 | |
| 15765 | } else |
| 15766 | { |
| 15767 | { |
| 15768 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 15769 | bool j5valid[1]={false}; |
| 15770 | _nj5 = 1; |
| 15771 | IkReal x1752=gconst21*gconst21; |
| 15772 | IkReal x1753=(gconst22*new_r10); |
| 15773 | CheckValue<IkReal> x1754=IKPowWithIntegerCheck(((((-625000001.0)*x1752*(new_r00*new_r00)))+(((625000000.0)*(x1753*x1753)))),-1); |
| 15774 | if(!x1754.valid){ |
| 15775 | continue; |
| 15776 | } |
| 15777 | CheckValue<IkReal> x1755=IKPowWithIntegerCheck(((((25000.00002)*gconst21*new_r00))+(((25000.0)*x1753))),-1); |
| 15778 | if(!x1755.valid){ |
| 15779 | continue; |
| 15780 | } |
| 15781 | if( IKabs(((x1754.value)*(((((-625000000.5)*x1752*x1753))+(((625000001.0)*new_r00*(gconst21*gconst21*gconst21))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-25000.0)*gconst21*gconst22*(x1755.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x1754.value)*(((((-625000000.5)*x1752*x1753))+(((625000001.0)*new_r00*(gconst21*gconst21*gconst21)))))))+IKsqr(((-25000.0)*gconst21*gconst22*(x1755.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 15782 | continue; |
| 15783 | j5array[0]=IKatan2(((x1754.value)*(((((-625000000.5)*x1752*x1753))+(((625000001.0)*new_r00*(gconst21*gconst21*gconst21)))))), ((-25000.0)*gconst21*gconst22*(x1755.value))); |
| 15784 | sj5array[0]=IKsin(j5array[0]); |
| 15785 | cj5array[0]=IKcos(j5array[0]); |
| 15786 | if( j5array[0] > IKPI ) |
| 15787 | { |
| 15788 | j5array[0]-=IK2PI; |
| 15789 | } |
| 15790 | else if( j5array[0] < -IKPI ) |
| 15791 | { j5array[0]+=IK2PI; |
| 15792 | } |
| 15793 | j5valid[0] = true; |
| 15794 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 15795 | { |
| 15796 | if( !j5valid[ij5] ) |
| 15797 | { |
| 15798 | continue; |
| 15799 | } |
| 15800 | _ij5[0] = ij5; _ij5[1] = -1; |
| 15801 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 15802 | { |
| 15803 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 15804 | { |
| 15805 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 15806 | } |
| 15807 | } |
| 15808 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 15809 | { |
| 15810 | IkReal evalcond[7]; |
| 15811 | IkReal x1756=IKcos(j5); |
| 15812 | IkReal x1757=IKsin(j5); |
| 15813 | IkReal x1758=((1.0)*gconst22); |
| 15814 | IkReal x1759=((1.0000000008)*gconst22); |
| 15815 | IkReal x1760=((1.0000000008)*x1757); |
| 15816 | IkReal x1761=(gconst21*x1756); |
| 15817 | IkReal x1762=(new_r00*x1756); |
| 15818 | evalcond[0]=(gconst21+((new_r00*x1757))+((new_r10*x1756))); |
| 15819 | evalcond[1]=(((gconst21*x1757))+new_r00+((x1756*x1759))); |
| 15820 | evalcond[2]=((((-1.0)*x1757*x1759))+x1761+new_r10); |
| 15821 | evalcond[3]=((((-1.0)*x1757*x1758))+(((1.0000000008)*x1761))); |
| 15822 | evalcond[4]=((((-1.0)*gconst21*x1760))+(((-1.0)*x1756*x1758))); |
| 15823 | evalcond[5]=(x1762+x1759+(((-1.0)*new_r10*x1757))); |
| 15824 | evalcond[6]=((((-1.0000000008)*x1762))+((new_r10*x1760))+(((-1.0)*x1758))); |
| 15825 | if( 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 ) |
| 15826 | { |
| 15827 | continue; |
| 15828 | } |
| 15829 | } |
| 15830 | |
| 15831 | { |
| 15832 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 15833 | vinfos[0].jointtype = 1; |
| 15834 | vinfos[0].foffset = j0; |
| 15835 | vinfos[0].indices[0] = _ij0[0]; |
| 15836 | vinfos[0].indices[1] = _ij0[1]; |
| 15837 | vinfos[0].maxsolutions = _nj0; |
| 15838 | vinfos[1].jointtype = 1; |
| 15839 | vinfos[1].foffset = j1; |
| 15840 | vinfos[1].indices[0] = _ij1[0]; |
| 15841 | vinfos[1].indices[1] = _ij1[1]; |
| 15842 | vinfos[1].maxsolutions = _nj1; |
| 15843 | vinfos[2].jointtype = 1; |
| 15844 | vinfos[2].foffset = j2; |
| 15845 | vinfos[2].indices[0] = _ij2[0]; |
| 15846 | vinfos[2].indices[1] = _ij2[1]; |
| 15847 | vinfos[2].maxsolutions = _nj2; |
| 15848 | vinfos[3].jointtype = 1; |
| 15849 | vinfos[3].foffset = j3; |
| 15850 | vinfos[3].indices[0] = _ij3[0]; |
| 15851 | vinfos[3].indices[1] = _ij3[1]; |
| 15852 | vinfos[3].maxsolutions = _nj3; |
| 15853 | vinfos[4].jointtype = 1; |
| 15854 | vinfos[4].foffset = j4; |
| 15855 | vinfos[4].indices[0] = _ij4[0]; |
| 15856 | vinfos[4].indices[1] = _ij4[1]; |
| 15857 | vinfos[4].maxsolutions = _nj4; |
| 15858 | vinfos[5].jointtype = 1; |
| 15859 | vinfos[5].foffset = j5; |
| 15860 | vinfos[5].indices[0] = _ij5[0]; |
| 15861 | vinfos[5].indices[1] = _ij5[1]; |
| 15862 | vinfos[5].maxsolutions = _nj5; |
| 15863 | std::vector<int> vfree(0); |
| 15864 | solutions.AddSolution(vinfos,vfree); |
| 15865 | } |
| 15866 | } |
| 15867 | } |
| 15868 | |
| 15869 | } |
| 15870 | |
| 15871 | } |
| 15872 | |
| 15873 | } else |
| 15874 | { |
| 15875 | { |
| 15876 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 15877 | bool j5valid[1]={false}; |
| 15878 | _nj5 = 1; |
| 15879 | IkReal x1763=gconst22*gconst22; |
| 15880 | IkReal x1764=gconst21*gconst21; |
| 15881 | IkReal x1765=((625000000.0)*x1763); |
| 15882 | IkReal x1766=((625000000.5)*gconst22*x1764); |
| 15883 | CheckValue<IkReal> x1767 = IKatan2WithCheck(IkReal((((gconst21*new_r00*x1765))+((new_r10*x1766)))),IkReal(((((-625000001.0)*new_r10*(gconst21*gconst21*gconst21)))+(((-1.0)*new_r00*x1766)))),IKFAST_ATAN2_MAGTHRESH); |
| 15884 | if(!x1767.valid){ |
| 15885 | continue; |
| 15886 | } |
| 15887 | CheckValue<IkReal> x1768=IKPowWithIntegerCheck(IKsign(((((625000001.0)*x1764*(new_r10*new_r10)))+(((-1.0)*x1765*(new_r00*new_r00))))),-1); |
| 15888 | if(!x1768.valid){ |
| 15889 | continue; |
| 15890 | } |
| 15891 | j5array[0]=((-1.5707963267949)+(x1767.value)+(((1.5707963267949)*(x1768.value)))); |
| 15892 | sj5array[0]=IKsin(j5array[0]); |
| 15893 | cj5array[0]=IKcos(j5array[0]); |
| 15894 | if( j5array[0] > IKPI ) |
| 15895 | { |
| 15896 | j5array[0]-=IK2PI; |
| 15897 | } |
| 15898 | else if( j5array[0] < -IKPI ) |
| 15899 | { j5array[0]+=IK2PI; |
| 15900 | } |
| 15901 | j5valid[0] = true; |
| 15902 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 15903 | { |
| 15904 | if( !j5valid[ij5] ) |
| 15905 | { |
| 15906 | continue; |
| 15907 | } |
| 15908 | _ij5[0] = ij5; _ij5[1] = -1; |
| 15909 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 15910 | { |
| 15911 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 15912 | { |
| 15913 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 15914 | } |
| 15915 | } |
| 15916 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 15917 | { |
| 15918 | IkReal evalcond[7]; |
| 15919 | IkReal x1769=IKcos(j5); |
| 15920 | IkReal x1770=IKsin(j5); |
| 15921 | IkReal x1771=((1.0)*gconst22); |
| 15922 | IkReal x1772=((1.0000000008)*gconst22); |
| 15923 | IkReal x1773=((1.0000000008)*x1770); |
| 15924 | IkReal x1774=(gconst21*x1769); |
| 15925 | IkReal x1775=(new_r00*x1769); |
| 15926 | evalcond[0]=(((new_r00*x1770))+((new_r10*x1769))+gconst21); |
| 15927 | evalcond[1]=(new_r00+((gconst21*x1770))+((x1769*x1772))); |
| 15928 | evalcond[2]=(x1774+(((-1.0)*x1770*x1772))+new_r10); |
| 15929 | evalcond[3]=((((-1.0)*x1770*x1771))+(((1.0000000008)*x1774))); |
| 15930 | evalcond[4]=((((-1.0)*gconst21*x1773))+(((-1.0)*x1769*x1771))); |
| 15931 | evalcond[5]=(x1775+x1772+(((-1.0)*new_r10*x1770))); |
| 15932 | evalcond[6]=((((-1.0000000008)*x1775))+(((-1.0)*x1771))+((new_r10*x1773))); |
| 15933 | if( 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 ) |
| 15934 | { |
| 15935 | continue; |
| 15936 | } |
| 15937 | } |
| 15938 | |
| 15939 | { |
| 15940 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 15941 | vinfos[0].jointtype = 1; |
| 15942 | vinfos[0].foffset = j0; |
| 15943 | vinfos[0].indices[0] = _ij0[0]; |
| 15944 | vinfos[0].indices[1] = _ij0[1]; |
| 15945 | vinfos[0].maxsolutions = _nj0; |
| 15946 | vinfos[1].jointtype = 1; |
| 15947 | vinfos[1].foffset = j1; |
| 15948 | vinfos[1].indices[0] = _ij1[0]; |
| 15949 | vinfos[1].indices[1] = _ij1[1]; |
| 15950 | vinfos[1].maxsolutions = _nj1; |
| 15951 | vinfos[2].jointtype = 1; |
| 15952 | vinfos[2].foffset = j2; |
| 15953 | vinfos[2].indices[0] = _ij2[0]; |
| 15954 | vinfos[2].indices[1] = _ij2[1]; |
| 15955 | vinfos[2].maxsolutions = _nj2; |
| 15956 | vinfos[3].jointtype = 1; |
| 15957 | vinfos[3].foffset = j3; |
| 15958 | vinfos[3].indices[0] = _ij3[0]; |
| 15959 | vinfos[3].indices[1] = _ij3[1]; |
| 15960 | vinfos[3].maxsolutions = _nj3; |
| 15961 | vinfos[4].jointtype = 1; |
| 15962 | vinfos[4].foffset = j4; |
| 15963 | vinfos[4].indices[0] = _ij4[0]; |
| 15964 | vinfos[4].indices[1] = _ij4[1]; |
| 15965 | vinfos[4].maxsolutions = _nj4; |
| 15966 | vinfos[5].jointtype = 1; |
| 15967 | vinfos[5].foffset = j5; |
| 15968 | vinfos[5].indices[0] = _ij5[0]; |
| 15969 | vinfos[5].indices[1] = _ij5[1]; |
| 15970 | vinfos[5].maxsolutions = _nj5; |
| 15971 | std::vector<int> vfree(0); |
| 15972 | solutions.AddSolution(vinfos,vfree); |
| 15973 | } |
| 15974 | } |
| 15975 | } |
| 15976 | |
| 15977 | } |
| 15978 | |
| 15979 | } |
| 15980 | |
| 15981 | } else |
| 15982 | { |
| 15983 | { |
| 15984 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 15985 | bool j5valid[1]={false}; |
| 15986 | _nj5 = 1; |
| 15987 | IkReal x1776=((25000.00002)*gconst22); |
| 15988 | IkReal x1777=((25000.0)*gconst21); |
| 15989 | CheckValue<IkReal> x1778=IKPowWithIntegerCheck(IKsign(((((25000.0)*(new_r10*new_r10)))+(((25000.0)*(new_r00*new_r00))))),-1); |
| 15990 | if(!x1778.valid){ |
| 15991 | continue; |
| 15992 | } |
| 15993 | CheckValue<IkReal> x1779 = IKatan2WithCheck(IkReal((((new_r10*x1776))+(((-1.0)*new_r00*x1777)))),IkReal(((((-1.0)*new_r10*x1777))+(((-1.0)*new_r00*x1776)))),IKFAST_ATAN2_MAGTHRESH); |
| 15994 | if(!x1779.valid){ |
| 15995 | continue; |
| 15996 | } |
| 15997 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1778.value)))+(x1779.value)); |
| 15998 | sj5array[0]=IKsin(j5array[0]); |
| 15999 | cj5array[0]=IKcos(j5array[0]); |
| 16000 | if( j5array[0] > IKPI ) |
| 16001 | { |
| 16002 | j5array[0]-=IK2PI; |
| 16003 | } |
| 16004 | else if( j5array[0] < -IKPI ) |
| 16005 | { j5array[0]+=IK2PI; |
| 16006 | } |
| 16007 | j5valid[0] = true; |
| 16008 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 16009 | { |
| 16010 | if( !j5valid[ij5] ) |
| 16011 | { |
| 16012 | continue; |
| 16013 | } |
| 16014 | _ij5[0] = ij5; _ij5[1] = -1; |
| 16015 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 16016 | { |
| 16017 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 16018 | { |
| 16019 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 16020 | } |
| 16021 | } |
| 16022 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 16023 | { |
| 16024 | IkReal evalcond[7]; |
| 16025 | IkReal x1780=IKcos(j5); |
| 16026 | IkReal x1781=IKsin(j5); |
| 16027 | IkReal x1782=((1.0)*gconst22); |
| 16028 | IkReal x1783=((1.0000000008)*gconst22); |
| 16029 | IkReal x1784=((1.0000000008)*x1781); |
| 16030 | IkReal x1785=(gconst21*x1780); |
| 16031 | IkReal x1786=(new_r00*x1780); |
| 16032 | evalcond[0]=(gconst21+((new_r10*x1780))+((new_r00*x1781))); |
| 16033 | evalcond[1]=(((gconst21*x1781))+new_r00+((x1780*x1783))); |
| 16034 | evalcond[2]=(x1785+new_r10+(((-1.0)*x1781*x1783))); |
| 16035 | evalcond[3]=((((1.0000000008)*x1785))+(((-1.0)*x1781*x1782))); |
| 16036 | evalcond[4]=((((-1.0)*gconst21*x1784))+(((-1.0)*x1780*x1782))); |
| 16037 | evalcond[5]=(x1783+x1786+(((-1.0)*new_r10*x1781))); |
| 16038 | evalcond[6]=((((-1.0)*x1782))+((new_r10*x1784))+(((-1.0000000008)*x1786))); |
| 16039 | if( 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 ) |
| 16040 | { |
| 16041 | continue; |
| 16042 | } |
| 16043 | } |
| 16044 | |
| 16045 | { |
| 16046 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 16047 | vinfos[0].jointtype = 1; |
| 16048 | vinfos[0].foffset = j0; |
| 16049 | vinfos[0].indices[0] = _ij0[0]; |
| 16050 | vinfos[0].indices[1] = _ij0[1]; |
| 16051 | vinfos[0].maxsolutions = _nj0; |
| 16052 | vinfos[1].jointtype = 1; |
| 16053 | vinfos[1].foffset = j1; |
| 16054 | vinfos[1].indices[0] = _ij1[0]; |
| 16055 | vinfos[1].indices[1] = _ij1[1]; |
| 16056 | vinfos[1].maxsolutions = _nj1; |
| 16057 | vinfos[2].jointtype = 1; |
| 16058 | vinfos[2].foffset = j2; |
| 16059 | vinfos[2].indices[0] = _ij2[0]; |
| 16060 | vinfos[2].indices[1] = _ij2[1]; |
| 16061 | vinfos[2].maxsolutions = _nj2; |
| 16062 | vinfos[3].jointtype = 1; |
| 16063 | vinfos[3].foffset = j3; |
| 16064 | vinfos[3].indices[0] = _ij3[0]; |
| 16065 | vinfos[3].indices[1] = _ij3[1]; |
| 16066 | vinfos[3].maxsolutions = _nj3; |
| 16067 | vinfos[4].jointtype = 1; |
| 16068 | vinfos[4].foffset = j4; |
| 16069 | vinfos[4].indices[0] = _ij4[0]; |
| 16070 | vinfos[4].indices[1] = _ij4[1]; |
| 16071 | vinfos[4].maxsolutions = _nj4; |
| 16072 | vinfos[5].jointtype = 1; |
| 16073 | vinfos[5].foffset = j5; |
| 16074 | vinfos[5].indices[0] = _ij5[0]; |
| 16075 | vinfos[5].indices[1] = _ij5[1]; |
| 16076 | vinfos[5].maxsolutions = _nj5; |
| 16077 | std::vector<int> vfree(0); |
| 16078 | solutions.AddSolution(vinfos,vfree); |
| 16079 | } |
| 16080 | } |
| 16081 | } |
| 16082 | |
| 16083 | } |
| 16084 | |
| 16085 | } |
| 16086 | |
| 16087 | } |
| 16088 | } while(0); |
| 16089 | if( bgotonextstatement ) |
| 16090 | { |
| 16091 | bool bgotonextstatement = true; |
| 16092 | do |
| 16093 | { |
| 16094 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r10))); |
| 16095 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 16096 | { |
| 16097 | bgotonextstatement=false; |
| 16098 | { |
| 16099 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 16100 | bool j5valid[1]={false}; |
| 16101 | _nj5 = 1; |
| 16102 | CheckValue<IkReal> x1788=IKPowWithIntegerCheck(gconst22,-1); |
| 16103 | if(!x1788.valid){ |
| 16104 | continue; |
| 16105 | } |
| 16106 | IkReal x1787=x1788.value; |
| 16107 | if( IKabs((new_r01*x1787)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.9999999992)*new_r00*x1787)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((new_r01*x1787))+IKsqr(((-0.9999999992)*new_r00*x1787))-1) <= IKFAST_SINCOS_THRESH ) |
| 16108 | continue; |
| 16109 | j5array[0]=IKatan2((new_r01*x1787), ((-0.9999999992)*new_r00*x1787)); |
| 16110 | sj5array[0]=IKsin(j5array[0]); |
| 16111 | cj5array[0]=IKcos(j5array[0]); |
| 16112 | if( j5array[0] > IKPI ) |
| 16113 | { |
| 16114 | j5array[0]-=IK2PI; |
| 16115 | } |
| 16116 | else if( j5array[0] < -IKPI ) |
| 16117 | { j5array[0]+=IK2PI; |
| 16118 | } |
| 16119 | j5valid[0] = true; |
| 16120 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 16121 | { |
| 16122 | if( !j5valid[ij5] ) |
| 16123 | { |
| 16124 | continue; |
| 16125 | } |
| 16126 | _ij5[0] = ij5; _ij5[1] = -1; |
| 16127 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 16128 | { |
| 16129 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 16130 | { |
| 16131 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 16132 | } |
| 16133 | } |
| 16134 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 16135 | { |
| 16136 | IkReal evalcond[10]; |
| 16137 | IkReal x1789=IKcos(j5); |
| 16138 | IkReal x1790=IKsin(j5); |
| 16139 | IkReal x1791=((1.0)*gconst22); |
| 16140 | IkReal x1792=(gconst22*x1790); |
| 16141 | IkReal x1793=(gconst22*x1789); |
| 16142 | IkReal x1794=(new_r00*x1789); |
| 16143 | IkReal x1795=(new_r01*x1789); |
| 16144 | evalcond[0]=(new_r00*x1790); |
| 16145 | evalcond[1]=x1795; |
| 16146 | evalcond[2]=((-1.0)*x1793); |
| 16147 | evalcond[3]=((((-1.0)*x1790*x1791))+new_r01); |
| 16148 | evalcond[4]=((((-1.0)*x1791))+((new_r01*x1790))); |
| 16149 | evalcond[5]=((-1.0000000008)*x1792); |
| 16150 | evalcond[6]=((-1.0000000008)*x1795); |
| 16151 | evalcond[7]=((((1.0000000008)*x1793))+new_r00); |
| 16152 | evalcond[8]=(x1794+(((1.0000000008)*gconst22))); |
| 16153 | evalcond[9]=((((-1.0)*x1791))+(((-1.0000000008)*x1794))); |
| 16154 | if( 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 ) |
| 16155 | { |
| 16156 | continue; |
| 16157 | } |
| 16158 | } |
| 16159 | |
| 16160 | { |
| 16161 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 16162 | vinfos[0].jointtype = 1; |
| 16163 | vinfos[0].foffset = j0; |
| 16164 | vinfos[0].indices[0] = _ij0[0]; |
| 16165 | vinfos[0].indices[1] = _ij0[1]; |
| 16166 | vinfos[0].maxsolutions = _nj0; |
| 16167 | vinfos[1].jointtype = 1; |
| 16168 | vinfos[1].foffset = j1; |
| 16169 | vinfos[1].indices[0] = _ij1[0]; |
| 16170 | vinfos[1].indices[1] = _ij1[1]; |
| 16171 | vinfos[1].maxsolutions = _nj1; |
| 16172 | vinfos[2].jointtype = 1; |
| 16173 | vinfos[2].foffset = j2; |
| 16174 | vinfos[2].indices[0] = _ij2[0]; |
| 16175 | vinfos[2].indices[1] = _ij2[1]; |
| 16176 | vinfos[2].maxsolutions = _nj2; |
| 16177 | vinfos[3].jointtype = 1; |
| 16178 | vinfos[3].foffset = j3; |
| 16179 | vinfos[3].indices[0] = _ij3[0]; |
| 16180 | vinfos[3].indices[1] = _ij3[1]; |
| 16181 | vinfos[3].maxsolutions = _nj3; |
| 16182 | vinfos[4].jointtype = 1; |
| 16183 | vinfos[4].foffset = j4; |
| 16184 | vinfos[4].indices[0] = _ij4[0]; |
| 16185 | vinfos[4].indices[1] = _ij4[1]; |
| 16186 | vinfos[4].maxsolutions = _nj4; |
| 16187 | vinfos[5].jointtype = 1; |
| 16188 | vinfos[5].foffset = j5; |
| 16189 | vinfos[5].indices[0] = _ij5[0]; |
| 16190 | vinfos[5].indices[1] = _ij5[1]; |
| 16191 | vinfos[5].maxsolutions = _nj5; |
| 16192 | std::vector<int> vfree(0); |
| 16193 | solutions.AddSolution(vinfos,vfree); |
| 16194 | } |
| 16195 | } |
| 16196 | } |
| 16197 | |
| 16198 | } |
| 16199 | } while(0); |
| 16200 | if( bgotonextstatement ) |
| 16201 | { |
| 16202 | bool bgotonextstatement = true; |
| 16203 | do |
| 16204 | { |
| 16205 | if( 1 ) |
| 16206 | { |
| 16207 | bgotonextstatement=false; |
| 16208 | continue; // branch miss [j5] |
| 16209 | |
| 16210 | } |
| 16211 | } while(0); |
| 16212 | if( bgotonextstatement ) |
| 16213 | { |
| 16214 | } |
| 16215 | } |
| 16216 | } |
| 16217 | } |
| 16218 | } |
| 16219 | |
| 16220 | } else |
| 16221 | { |
| 16222 | { |
| 16223 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 16224 | bool j5valid[1]={false}; |
| 16225 | _nj5 = 1; |
| 16226 | CheckValue<IkReal> x1802=IKPowWithIntegerCheck(new_r00,-1); |
| 16227 | if(!x1802.valid){ |
| 16228 | continue; |
| 16229 | } |
| 16230 | IkReal x1796=x1802.value; |
| 16231 | IkReal x1797=gconst21*gconst21; |
| 16232 | IkReal x1798=((25000.0)*new_r10); |
| 16233 | IkReal x1799=((25000.0)*x1797); |
| 16234 | CheckValue<IkReal> x1803=IKPowWithIntegerCheck(((((-1.0)*gconst21*x1798))+(((25000.00002)*gconst22*new_r00))),-1); |
| 16235 | if(!x1803.valid){ |
| 16236 | continue; |
| 16237 | } |
| 16238 | IkReal x1800=x1803.value; |
| 16239 | CheckValue<IkReal> x1804=IKPowWithIntegerCheck(((((-25000.0)*gconst21*new_r10))+(((25000.00002)*gconst22*new_r00))),-1); |
| 16240 | if(!x1804.valid){ |
| 16241 | continue; |
| 16242 | } |
| 16243 | IkReal x1801=(x1798*(x1804.value)); |
| 16244 | CheckValue<IkReal> x1805=IKPowWithIntegerCheck(x1796,-2); |
| 16245 | if(!x1805.valid){ |
| 16246 | continue; |
| 16247 | } |
| 16248 | if( IKabs((((new_r00*x1801))+(((-1.0)*gconst21*x1796))+(((-1.0)*x1796*x1797*x1801)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x1800*((x1799+(((-25000.0)*(x1805.value))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((new_r00*x1801))+(((-1.0)*gconst21*x1796))+(((-1.0)*x1796*x1797*x1801))))+IKsqr((x1800*((x1799+(((-25000.0)*(x1805.value)))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 16249 | continue; |
| 16250 | j5array[0]=IKatan2((((new_r00*x1801))+(((-1.0)*gconst21*x1796))+(((-1.0)*x1796*x1797*x1801))), (x1800*((x1799+(((-25000.0)*(x1805.value))))))); |
| 16251 | sj5array[0]=IKsin(j5array[0]); |
| 16252 | cj5array[0]=IKcos(j5array[0]); |
| 16253 | if( j5array[0] > IKPI ) |
| 16254 | { |
| 16255 | j5array[0]-=IK2PI; |
| 16256 | } |
| 16257 | else if( j5array[0] < -IKPI ) |
| 16258 | { j5array[0]+=IK2PI; |
| 16259 | } |
| 16260 | j5valid[0] = true; |
| 16261 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 16262 | { |
| 16263 | if( !j5valid[ij5] ) |
| 16264 | { |
| 16265 | continue; |
| 16266 | } |
| 16267 | _ij5[0] = ij5; _ij5[1] = -1; |
| 16268 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 16269 | { |
| 16270 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 16271 | { |
| 16272 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 16273 | } |
| 16274 | } |
| 16275 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 16276 | { |
| 16277 | IkReal evalcond[10]; |
| 16278 | IkReal x1806=IKcos(j5); |
| 16279 | IkReal x1807=IKsin(j5); |
| 16280 | IkReal x1808=((1.0)*gconst22); |
| 16281 | IkReal x1809=((1.0000000008)*gconst21); |
| 16282 | IkReal x1810=((1.0000000008)*gconst22); |
| 16283 | IkReal x1811=(gconst22*x1807); |
| 16284 | IkReal x1812=(new_r11*x1807); |
| 16285 | IkReal x1813=(gconst21*x1807); |
| 16286 | IkReal x1814=(new_r01*x1806); |
| 16287 | IkReal x1815=(new_r00*x1806); |
| 16288 | IkReal x1816=(new_r10*x1807); |
| 16289 | evalcond[0]=(((new_r00*x1807))+gconst21+((new_r10*x1806))); |
| 16290 | evalcond[1]=((((-1.0)*x1808))+((new_r11*x1806))+((new_r01*x1807))); |
| 16291 | evalcond[2]=(x1813+new_r00+((x1806*x1810))); |
| 16292 | evalcond[3]=((((-1.0)*x1807*x1810))+((gconst21*x1806))+new_r10); |
| 16293 | evalcond[4]=(((x1806*x1809))+new_r01+(((-1.0)*x1807*x1808))); |
| 16294 | evalcond[5]=((((-1.0)*x1806*x1808))+new_r11+(((-1.0)*x1807*x1809))); |
| 16295 | evalcond[6]=(x1815+x1810+(((-1.0)*x1816))); |
| 16296 | evalcond[7]=(x1814+x1809+(((-1.0)*x1812))); |
| 16297 | evalcond[8]=((((-1.0)*x1808))+(((1.0000000008)*x1816))+(((-1.0000000008)*x1815))); |
| 16298 | evalcond[9]=((((-1.0)*gconst21))+(((1.0000000008)*x1812))+(((-1.0000000008)*x1814))); |
| 16299 | if( 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 ) |
| 16300 | { |
| 16301 | continue; |
| 16302 | } |
| 16303 | } |
| 16304 | |
| 16305 | { |
| 16306 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 16307 | vinfos[0].jointtype = 1; |
| 16308 | vinfos[0].foffset = j0; |
| 16309 | vinfos[0].indices[0] = _ij0[0]; |
| 16310 | vinfos[0].indices[1] = _ij0[1]; |
| 16311 | vinfos[0].maxsolutions = _nj0; |
| 16312 | vinfos[1].jointtype = 1; |
| 16313 | vinfos[1].foffset = j1; |
| 16314 | vinfos[1].indices[0] = _ij1[0]; |
| 16315 | vinfos[1].indices[1] = _ij1[1]; |
| 16316 | vinfos[1].maxsolutions = _nj1; |
| 16317 | vinfos[2].jointtype = 1; |
| 16318 | vinfos[2].foffset = j2; |
| 16319 | vinfos[2].indices[0] = _ij2[0]; |
| 16320 | vinfos[2].indices[1] = _ij2[1]; |
| 16321 | vinfos[2].maxsolutions = _nj2; |
| 16322 | vinfos[3].jointtype = 1; |
| 16323 | vinfos[3].foffset = j3; |
| 16324 | vinfos[3].indices[0] = _ij3[0]; |
| 16325 | vinfos[3].indices[1] = _ij3[1]; |
| 16326 | vinfos[3].maxsolutions = _nj3; |
| 16327 | vinfos[4].jointtype = 1; |
| 16328 | vinfos[4].foffset = j4; |
| 16329 | vinfos[4].indices[0] = _ij4[0]; |
| 16330 | vinfos[4].indices[1] = _ij4[1]; |
| 16331 | vinfos[4].maxsolutions = _nj4; |
| 16332 | vinfos[5].jointtype = 1; |
| 16333 | vinfos[5].foffset = j5; |
| 16334 | vinfos[5].indices[0] = _ij5[0]; |
| 16335 | vinfos[5].indices[1] = _ij5[1]; |
| 16336 | vinfos[5].maxsolutions = _nj5; |
| 16337 | std::vector<int> vfree(0); |
| 16338 | solutions.AddSolution(vinfos,vfree); |
| 16339 | } |
| 16340 | } |
| 16341 | } |
| 16342 | |
| 16343 | } |
| 16344 | |
| 16345 | } |
| 16346 | |
| 16347 | } else |
| 16348 | { |
| 16349 | { |
| 16350 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 16351 | bool j5valid[1]={false}; |
| 16352 | _nj5 = 1; |
| 16353 | CheckValue<IkReal> x1822=IKPowWithIntegerCheck(new_r00,-1); |
| 16354 | if(!x1822.valid){ |
| 16355 | continue; |
| 16356 | } |
| 16357 | IkReal x1817=x1822.value; |
| 16358 | IkReal x1818=(gconst21*x1817); |
| 16359 | IkReal x1819=((25000.0)*new_r01); |
| 16360 | IkReal x1820=((25000.0)*gconst22*new_r10); |
| 16361 | CheckValue<IkReal> x1823=IKPowWithIntegerCheck((x1820+(((25000.00002)*gconst21*new_r00))),-1); |
| 16362 | if(!x1823.valid){ |
| 16363 | continue; |
| 16364 | } |
| 16365 | IkReal x1821=x1823.value; |
| 16366 | if( IKabs((((new_r10*x1819*x1821))+((x1818*x1820*x1821))+(((-1.0)*x1818)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x1821*(((((-25000.0)*gconst21*gconst22))+(((-1.0)*new_r00*x1819)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((new_r10*x1819*x1821))+((x1818*x1820*x1821))+(((-1.0)*x1818))))+IKsqr((x1821*(((((-25000.0)*gconst21*gconst22))+(((-1.0)*new_r00*x1819))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 16367 | continue; |
| 16368 | j5array[0]=IKatan2((((new_r10*x1819*x1821))+((x1818*x1820*x1821))+(((-1.0)*x1818))), (x1821*(((((-25000.0)*gconst21*gconst22))+(((-1.0)*new_r00*x1819)))))); |
| 16369 | sj5array[0]=IKsin(j5array[0]); |
| 16370 | cj5array[0]=IKcos(j5array[0]); |
| 16371 | if( j5array[0] > IKPI ) |
| 16372 | { |
| 16373 | j5array[0]-=IK2PI; |
| 16374 | } |
| 16375 | else if( j5array[0] < -IKPI ) |
| 16376 | { j5array[0]+=IK2PI; |
| 16377 | } |
| 16378 | j5valid[0] = true; |
| 16379 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 16380 | { |
| 16381 | if( !j5valid[ij5] ) |
| 16382 | { |
| 16383 | continue; |
| 16384 | } |
| 16385 | _ij5[0] = ij5; _ij5[1] = -1; |
| 16386 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 16387 | { |
| 16388 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 16389 | { |
| 16390 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 16391 | } |
| 16392 | } |
| 16393 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 16394 | { |
| 16395 | IkReal evalcond[10]; |
| 16396 | IkReal x1824=IKcos(j5); |
| 16397 | IkReal x1825=IKsin(j5); |
| 16398 | IkReal x1826=((1.0)*gconst22); |
| 16399 | IkReal x1827=((1.0000000008)*gconst21); |
| 16400 | IkReal x1828=((1.0000000008)*gconst22); |
| 16401 | IkReal x1829=(gconst22*x1825); |
| 16402 | IkReal x1830=(new_r11*x1825); |
| 16403 | IkReal x1831=(gconst21*x1825); |
| 16404 | IkReal x1832=(new_r01*x1824); |
| 16405 | IkReal x1833=(new_r00*x1824); |
| 16406 | IkReal x1834=(new_r10*x1825); |
| 16407 | evalcond[0]=(((new_r10*x1824))+((new_r00*x1825))+gconst21); |
| 16408 | evalcond[1]=((((-1.0)*x1826))+((new_r01*x1825))+((new_r11*x1824))); |
| 16409 | evalcond[2]=(((x1824*x1828))+x1831+new_r00); |
| 16410 | evalcond[3]=((((-1.0)*x1825*x1828))+((gconst21*x1824))+new_r10); |
| 16411 | evalcond[4]=(((x1824*x1827))+(((-1.0)*x1825*x1826))+new_r01); |
| 16412 | evalcond[5]=((((-1.0)*x1825*x1827))+(((-1.0)*x1824*x1826))+new_r11); |
| 16413 | evalcond[6]=((((-1.0)*x1834))+x1828+x1833); |
| 16414 | evalcond[7]=((((-1.0)*x1830))+x1827+x1832); |
| 16415 | evalcond[8]=((((-1.0)*x1826))+(((1.0000000008)*x1834))+(((-1.0000000008)*x1833))); |
| 16416 | evalcond[9]=((((1.0000000008)*x1830))+(((-1.0000000008)*x1832))+(((-1.0)*gconst21))); |
| 16417 | if( 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 ) |
| 16418 | { |
| 16419 | continue; |
| 16420 | } |
| 16421 | } |
| 16422 | |
| 16423 | { |
| 16424 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 16425 | vinfos[0].jointtype = 1; |
| 16426 | vinfos[0].foffset = j0; |
| 16427 | vinfos[0].indices[0] = _ij0[0]; |
| 16428 | vinfos[0].indices[1] = _ij0[1]; |
| 16429 | vinfos[0].maxsolutions = _nj0; |
| 16430 | vinfos[1].jointtype = 1; |
| 16431 | vinfos[1].foffset = j1; |
| 16432 | vinfos[1].indices[0] = _ij1[0]; |
| 16433 | vinfos[1].indices[1] = _ij1[1]; |
| 16434 | vinfos[1].maxsolutions = _nj1; |
| 16435 | vinfos[2].jointtype = 1; |
| 16436 | vinfos[2].foffset = j2; |
| 16437 | vinfos[2].indices[0] = _ij2[0]; |
| 16438 | vinfos[2].indices[1] = _ij2[1]; |
| 16439 | vinfos[2].maxsolutions = _nj2; |
| 16440 | vinfos[3].jointtype = 1; |
| 16441 | vinfos[3].foffset = j3; |
| 16442 | vinfos[3].indices[0] = _ij3[0]; |
| 16443 | vinfos[3].indices[1] = _ij3[1]; |
| 16444 | vinfos[3].maxsolutions = _nj3; |
| 16445 | vinfos[4].jointtype = 1; |
| 16446 | vinfos[4].foffset = j4; |
| 16447 | vinfos[4].indices[0] = _ij4[0]; |
| 16448 | vinfos[4].indices[1] = _ij4[1]; |
| 16449 | vinfos[4].maxsolutions = _nj4; |
| 16450 | vinfos[5].jointtype = 1; |
| 16451 | vinfos[5].foffset = j5; |
| 16452 | vinfos[5].indices[0] = _ij5[0]; |
| 16453 | vinfos[5].indices[1] = _ij5[1]; |
| 16454 | vinfos[5].maxsolutions = _nj5; |
| 16455 | std::vector<int> vfree(0); |
| 16456 | solutions.AddSolution(vinfos,vfree); |
| 16457 | } |
| 16458 | } |
| 16459 | } |
| 16460 | |
| 16461 | } |
| 16462 | |
| 16463 | } |
| 16464 | |
| 16465 | } else |
| 16466 | { |
| 16467 | { |
| 16468 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 16469 | bool j5valid[1]={false}; |
| 16470 | _nj5 = 1; |
| 16471 | IkReal x1835=((1.0)*new_r00); |
| 16472 | CheckValue<IkReal> x1836=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r11*x1835))+((new_r01*new_r10)))),-1); |
| 16473 | if(!x1836.valid){ |
| 16474 | continue; |
| 16475 | } |
| 16476 | CheckValue<IkReal> x1837 = IKatan2WithCheck(IkReal((((gconst21*new_r11))+((gconst22*new_r10)))),IkReal(((((-1.0)*gconst21*new_r01))+(((-1.0)*gconst22*x1835)))),IKFAST_ATAN2_MAGTHRESH); |
| 16477 | if(!x1837.valid){ |
| 16478 | continue; |
| 16479 | } |
| 16480 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x1836.value)))+(x1837.value)); |
| 16481 | sj5array[0]=IKsin(j5array[0]); |
| 16482 | cj5array[0]=IKcos(j5array[0]); |
| 16483 | if( j5array[0] > IKPI ) |
| 16484 | { |
| 16485 | j5array[0]-=IK2PI; |
| 16486 | } |
| 16487 | else if( j5array[0] < -IKPI ) |
| 16488 | { j5array[0]+=IK2PI; |
| 16489 | } |
| 16490 | j5valid[0] = true; |
| 16491 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 16492 | { |
| 16493 | if( !j5valid[ij5] ) |
| 16494 | { |
| 16495 | continue; |
| 16496 | } |
| 16497 | _ij5[0] = ij5; _ij5[1] = -1; |
| 16498 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 16499 | { |
| 16500 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 16501 | { |
| 16502 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 16503 | } |
| 16504 | } |
| 16505 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 16506 | { |
| 16507 | IkReal evalcond[10]; |
| 16508 | IkReal x1838=IKcos(j5); |
| 16509 | IkReal x1839=IKsin(j5); |
| 16510 | IkReal x1840=((1.0)*gconst22); |
| 16511 | IkReal x1841=((1.0000000008)*gconst21); |
| 16512 | IkReal x1842=((1.0000000008)*gconst22); |
| 16513 | IkReal x1843=(gconst22*x1839); |
| 16514 | IkReal x1844=(new_r11*x1839); |
| 16515 | IkReal x1845=(gconst21*x1839); |
| 16516 | IkReal x1846=(new_r01*x1838); |
| 16517 | IkReal x1847=(new_r00*x1838); |
| 16518 | IkReal x1848=(new_r10*x1839); |
| 16519 | evalcond[0]=(((new_r00*x1839))+gconst21+((new_r10*x1838))); |
| 16520 | evalcond[1]=(((new_r01*x1839))+(((-1.0)*x1840))+((new_r11*x1838))); |
| 16521 | evalcond[2]=(((x1838*x1842))+x1845+new_r00); |
| 16522 | evalcond[3]=((((-1.0)*x1839*x1842))+new_r10+((gconst21*x1838))); |
| 16523 | evalcond[4]=(((x1838*x1841))+(((-1.0)*x1839*x1840))+new_r01); |
| 16524 | evalcond[5]=((((-1.0)*x1839*x1841))+new_r11+(((-1.0)*x1838*x1840))); |
| 16525 | evalcond[6]=(x1842+x1847+(((-1.0)*x1848))); |
| 16526 | evalcond[7]=(x1841+x1846+(((-1.0)*x1844))); |
| 16527 | evalcond[8]=((((-1.0000000008)*x1847))+(((-1.0)*x1840))+(((1.0000000008)*x1848))); |
| 16528 | evalcond[9]=((((-1.0000000008)*x1846))+(((1.0000000008)*x1844))+(((-1.0)*gconst21))); |
| 16529 | if( 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 ) |
| 16530 | { |
| 16531 | continue; |
| 16532 | } |
| 16533 | } |
| 16534 | |
| 16535 | { |
| 16536 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 16537 | vinfos[0].jointtype = 1; |
| 16538 | vinfos[0].foffset = j0; |
| 16539 | vinfos[0].indices[0] = _ij0[0]; |
| 16540 | vinfos[0].indices[1] = _ij0[1]; |
| 16541 | vinfos[0].maxsolutions = _nj0; |
| 16542 | vinfos[1].jointtype = 1; |
| 16543 | vinfos[1].foffset = j1; |
| 16544 | vinfos[1].indices[0] = _ij1[0]; |
| 16545 | vinfos[1].indices[1] = _ij1[1]; |
| 16546 | vinfos[1].maxsolutions = _nj1; |
| 16547 | vinfos[2].jointtype = 1; |
| 16548 | vinfos[2].foffset = j2; |
| 16549 | vinfos[2].indices[0] = _ij2[0]; |
| 16550 | vinfos[2].indices[1] = _ij2[1]; |
| 16551 | vinfos[2].maxsolutions = _nj2; |
| 16552 | vinfos[3].jointtype = 1; |
| 16553 | vinfos[3].foffset = j3; |
| 16554 | vinfos[3].indices[0] = _ij3[0]; |
| 16555 | vinfos[3].indices[1] = _ij3[1]; |
| 16556 | vinfos[3].maxsolutions = _nj3; |
| 16557 | vinfos[4].jointtype = 1; |
| 16558 | vinfos[4].foffset = j4; |
| 16559 | vinfos[4].indices[0] = _ij4[0]; |
| 16560 | vinfos[4].indices[1] = _ij4[1]; |
| 16561 | vinfos[4].maxsolutions = _nj4; |
| 16562 | vinfos[5].jointtype = 1; |
| 16563 | vinfos[5].foffset = j5; |
| 16564 | vinfos[5].indices[0] = _ij5[0]; |
| 16565 | vinfos[5].indices[1] = _ij5[1]; |
| 16566 | vinfos[5].maxsolutions = _nj5; |
| 16567 | std::vector<int> vfree(0); |
| 16568 | solutions.AddSolution(vinfos,vfree); |
| 16569 | } |
| 16570 | } |
| 16571 | } |
| 16572 | |
| 16573 | } |
| 16574 | |
| 16575 | } |
| 16576 | |
| 16577 | } |
| 16578 | } while(0); |
| 16579 | if( bgotonextstatement ) |
| 16580 | { |
| 16581 | bool bgotonextstatement = true; |
| 16582 | do |
| 16583 | { |
| 16584 | IkReal x1850 = ((((1.0000000016)*(new_r10*new_r10)))+(new_r00*new_r00)); |
| 16585 | if(IKabs(x1850)==0){ |
| 16586 | continue; |
| 16587 | } |
| 16588 | IkReal x1849=pow(x1850,-0.5); |
| 16589 | CheckValue<IkReal> x1851 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 16590 | if(!x1851.valid){ |
| 16591 | continue; |
| 16592 | } |
| 16593 | IkReal gconst23=((3.14159265358979)+(((-1.0)*(x1851.value)))); |
| 16594 | IkReal gconst24=((1.0000000008)*new_r10*x1849); |
| 16595 | IkReal gconst25=((-1.0)*new_r00*x1849); |
| 16596 | CheckValue<IkReal> x1852 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 16597 | if(!x1852.valid){ |
| 16598 | continue; |
| 16599 | } |
| 16600 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+(x1852.value)+j3)))), 6.28318530717959))); |
| 16601 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 16602 | { |
| 16603 | bgotonextstatement=false; |
| 16604 | { |
| 16605 | IkReal j5eval[2]; |
| 16606 | IkReal x1853=x1849; |
| 16607 | sj4=-4.0e-5; |
| 16608 | cj4=-1.0; |
| 16609 | j4=3.14163265; |
| 16610 | sj3=gconst24; |
| 16611 | cj3=gconst25; |
| 16612 | CheckValue<IkReal> x1854 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 16613 | if(!x1854.valid){ |
| 16614 | continue; |
| 16615 | } |
| 16616 | j3=((3.14159265)+(((-1.0)*(x1854.value)))); |
| 16617 | CheckValue<IkReal> x1855 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 16618 | if(!x1855.valid){ |
| 16619 | continue; |
| 16620 | } |
| 16621 | IkReal gconst23=((3.14159265358979)+(((-1.0)*(x1855.value)))); |
| 16622 | IkReal gconst24=((1.0000000008)*new_r10*x1853); |
| 16623 | IkReal gconst25=((-1.0)*new_r00*x1853); |
| 16624 | IkReal x1856=(((new_r01*new_r10))+(((-1.0)*new_r00*new_r11))); |
| 16625 | j5eval[0]=x1856; |
| 16626 | j5eval[1]=IKsign(x1856); |
| 16627 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 16628 | { |
| 16629 | { |
| 16630 | IkReal j5eval[2]; |
| 16631 | IkReal x1857=x1849; |
| 16632 | sj4=-4.0e-5; |
| 16633 | cj4=-1.0; |
| 16634 | j4=3.14163265; |
| 16635 | sj3=gconst24; |
| 16636 | cj3=gconst25; |
| 16637 | CheckValue<IkReal> x1858 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 16638 | if(!x1858.valid){ |
| 16639 | continue; |
| 16640 | } |
| 16641 | j3=((3.14159265)+(((-1.0)*(x1858.value)))); |
| 16642 | CheckValue<IkReal> x1859 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 16643 | if(!x1859.valid){ |
| 16644 | continue; |
| 16645 | } |
| 16646 | IkReal gconst23=((3.14159265358979)+(((-1.0)*(x1859.value)))); |
| 16647 | IkReal gconst24=((1.0000000008)*new_r10*x1857); |
| 16648 | IkReal gconst25=((-1.0)*new_r00*x1857); |
| 16649 | j5eval[0]=new_r00; |
| 16650 | IkReal x1860 = ((((1.0000000016)*(new_r10*new_r10)))+(new_r00*new_r00)); |
| 16651 | if(IKabs(x1860)==0){ |
| 16652 | continue; |
| 16653 | } |
| 16654 | j5eval[1]=((1.60000013238459e-9)*new_r00*new_r10*(pow(x1860,-0.5))); |
| 16655 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 16656 | { |
| 16657 | { |
| 16658 | IkReal j5eval[1]; |
| 16659 | IkReal x1861=x1849; |
| 16660 | sj4=-4.0e-5; |
| 16661 | cj4=-1.0; |
| 16662 | j4=3.14163265; |
| 16663 | sj3=gconst24; |
| 16664 | cj3=gconst25; |
| 16665 | CheckValue<IkReal> x1862 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 16666 | if(!x1862.valid){ |
| 16667 | continue; |
| 16668 | } |
| 16669 | j3=((3.14159265)+(((-1.0)*(x1862.value)))); |
| 16670 | CheckValue<IkReal> x1863 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 16671 | if(!x1863.valid){ |
| 16672 | continue; |
| 16673 | } |
| 16674 | IkReal gconst23=((3.14159265358979)+(((-1.0)*(x1863.value)))); |
| 16675 | IkReal gconst24=((1.0000000008)*new_r10*x1861); |
| 16676 | IkReal gconst25=((-1.0)*new_r00*x1861); |
| 16677 | j5eval[0]=new_r00; |
| 16678 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 16679 | { |
| 16680 | { |
| 16681 | IkReal evalcond[1]; |
| 16682 | bool bgotonextstatement = true; |
| 16683 | do |
| 16684 | { |
| 16685 | evalcond[0]=IKabs(new_r00); |
| 16686 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 16687 | { |
| 16688 | bgotonextstatement=false; |
| 16689 | { |
| 16690 | IkReal j5eval[1]; |
| 16691 | sj4=-4.0e-5; |
| 16692 | cj4=-1.0; |
| 16693 | j4=3.14163265; |
| 16694 | sj3=gconst24; |
| 16695 | cj3=gconst25; |
| 16696 | CheckValue<IkReal> x1864 = IKatan2WithCheck(IkReal(new_r10),IkReal(0),IKFAST_ATAN2_MAGTHRESH); |
| 16697 | if(!x1864.valid){ |
| 16698 | continue; |
| 16699 | } |
| 16700 | j3=((3.14159265)+(((-1.0)*(x1864.value)))); |
| 16701 | new_r00=0; |
| 16702 | CheckValue<IkReal> x1865 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(0),IKFAST_ATAN2_MAGTHRESH); |
| 16703 | if(!x1865.valid){ |
| 16704 | continue; |
| 16705 | } |
| 16706 | IkReal gconst23=((3.14159265358979)+(((-1.0)*(x1865.value)))); |
| 16707 | IkReal x1866 = new_r10*new_r10; |
| 16708 | if(IKabs(x1866)==0){ |
| 16709 | continue; |
| 16710 | } |
| 16711 | IkReal gconst24=((1.0)*new_r10*(pow(x1866,-0.5))); |
| 16712 | IkReal gconst25=0; |
| 16713 | j5eval[0]=new_r10; |
| 16714 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 16715 | { |
| 16716 | { |
| 16717 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 16718 | bool j5valid[1]={false}; |
| 16719 | _nj5 = 1; |
| 16720 | CheckValue<IkReal> x1868=IKPowWithIntegerCheck(gconst24,-1); |
| 16721 | if(!x1868.valid){ |
| 16722 | continue; |
| 16723 | } |
| 16724 | IkReal x1867=x1868.value; |
| 16725 | if( IKabs(((0.9999999992)*new_r11*x1867)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r10*x1867)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*new_r11*x1867))+IKsqr(((-1.0)*new_r10*x1867))-1) <= IKFAST_SINCOS_THRESH ) |
| 16726 | continue; |
| 16727 | j5array[0]=IKatan2(((0.9999999992)*new_r11*x1867), ((-1.0)*new_r10*x1867)); |
| 16728 | sj5array[0]=IKsin(j5array[0]); |
| 16729 | cj5array[0]=IKcos(j5array[0]); |
| 16730 | if( j5array[0] > IKPI ) |
| 16731 | { |
| 16732 | j5array[0]-=IK2PI; |
| 16733 | } |
| 16734 | else if( j5array[0] < -IKPI ) |
| 16735 | { j5array[0]+=IK2PI; |
| 16736 | } |
| 16737 | j5valid[0] = true; |
| 16738 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 16739 | { |
| 16740 | if( !j5valid[ij5] ) |
| 16741 | { |
| 16742 | continue; |
| 16743 | } |
| 16744 | _ij5[0] = ij5; _ij5[1] = -1; |
| 16745 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 16746 | { |
| 16747 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 16748 | { |
| 16749 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 16750 | } |
| 16751 | } |
| 16752 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 16753 | { |
| 16754 | IkReal evalcond[10]; |
| 16755 | IkReal x1869=IKsin(j5); |
| 16756 | IkReal x1870=IKcos(j5); |
| 16757 | IkReal x1871=((1.0000000008)*x1869); |
| 16758 | IkReal x1872=((1.0000000008)*x1870); |
| 16759 | evalcond[0]=(gconst24*x1869); |
| 16760 | evalcond[1]=((-1.0)*new_r10*x1869); |
| 16761 | evalcond[2]=(((new_r10*x1870))+gconst24); |
| 16762 | evalcond[3]=(((gconst24*x1870))+new_r10); |
| 16763 | evalcond[4]=(new_r10*x1871); |
| 16764 | evalcond[5]=(((new_r01*x1869))+((new_r11*x1870))); |
| 16765 | evalcond[6]=(((gconst24*x1872))+new_r01); |
| 16766 | evalcond[7]=((((-1.0)*gconst24*x1871))+new_r11); |
| 16767 | evalcond[8]=((((1.0000000008)*gconst24))+((new_r01*x1870))+(((-1.0)*new_r11*x1869))); |
| 16768 | evalcond[9]=((((-1.0)*gconst24))+((new_r11*x1871))+(((-1.0)*new_r01*x1872))); |
| 16769 | if( 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 ) |
| 16770 | { |
| 16771 | continue; |
| 16772 | } |
| 16773 | } |
| 16774 | |
| 16775 | { |
| 16776 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 16777 | vinfos[0].jointtype = 1; |
| 16778 | vinfos[0].foffset = j0; |
| 16779 | vinfos[0].indices[0] = _ij0[0]; |
| 16780 | vinfos[0].indices[1] = _ij0[1]; |
| 16781 | vinfos[0].maxsolutions = _nj0; |
| 16782 | vinfos[1].jointtype = 1; |
| 16783 | vinfos[1].foffset = j1; |
| 16784 | vinfos[1].indices[0] = _ij1[0]; |
| 16785 | vinfos[1].indices[1] = _ij1[1]; |
| 16786 | vinfos[1].maxsolutions = _nj1; |
| 16787 | vinfos[2].jointtype = 1; |
| 16788 | vinfos[2].foffset = j2; |
| 16789 | vinfos[2].indices[0] = _ij2[0]; |
| 16790 | vinfos[2].indices[1] = _ij2[1]; |
| 16791 | vinfos[2].maxsolutions = _nj2; |
| 16792 | vinfos[3].jointtype = 1; |
| 16793 | vinfos[3].foffset = j3; |
| 16794 | vinfos[3].indices[0] = _ij3[0]; |
| 16795 | vinfos[3].indices[1] = _ij3[1]; |
| 16796 | vinfos[3].maxsolutions = _nj3; |
| 16797 | vinfos[4].jointtype = 1; |
| 16798 | vinfos[4].foffset = j4; |
| 16799 | vinfos[4].indices[0] = _ij4[0]; |
| 16800 | vinfos[4].indices[1] = _ij4[1]; |
| 16801 | vinfos[4].maxsolutions = _nj4; |
| 16802 | vinfos[5].jointtype = 1; |
| 16803 | vinfos[5].foffset = j5; |
| 16804 | vinfos[5].indices[0] = _ij5[0]; |
| 16805 | vinfos[5].indices[1] = _ij5[1]; |
| 16806 | vinfos[5].maxsolutions = _nj5; |
| 16807 | std::vector<int> vfree(0); |
| 16808 | solutions.AddSolution(vinfos,vfree); |
| 16809 | } |
| 16810 | } |
| 16811 | } |
| 16812 | |
| 16813 | } else |
| 16814 | { |
| 16815 | { |
| 16816 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 16817 | bool j5valid[1]={false}; |
| 16818 | _nj5 = 1; |
| 16819 | CheckValue<IkReal> x1873=IKPowWithIntegerCheck(gconst24,-1); |
| 16820 | if(!x1873.valid){ |
| 16821 | continue; |
| 16822 | } |
| 16823 | CheckValue<IkReal> x1874=IKPowWithIntegerCheck(new_r10,-1); |
| 16824 | if(!x1874.valid){ |
| 16825 | continue; |
| 16826 | } |
| 16827 | if( IKabs(((0.9999999992)*new_r11*(x1873.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*gconst24*(x1874.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*new_r11*(x1873.value)))+IKsqr(((-1.0)*gconst24*(x1874.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 16828 | continue; |
| 16829 | j5array[0]=IKatan2(((0.9999999992)*new_r11*(x1873.value)), ((-1.0)*gconst24*(x1874.value))); |
| 16830 | sj5array[0]=IKsin(j5array[0]); |
| 16831 | cj5array[0]=IKcos(j5array[0]); |
| 16832 | if( j5array[0] > IKPI ) |
| 16833 | { |
| 16834 | j5array[0]-=IK2PI; |
| 16835 | } |
| 16836 | else if( j5array[0] < -IKPI ) |
| 16837 | { j5array[0]+=IK2PI; |
| 16838 | } |
| 16839 | j5valid[0] = true; |
| 16840 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 16841 | { |
| 16842 | if( !j5valid[ij5] ) |
| 16843 | { |
| 16844 | continue; |
| 16845 | } |
| 16846 | _ij5[0] = ij5; _ij5[1] = -1; |
| 16847 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 16848 | { |
| 16849 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 16850 | { |
| 16851 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 16852 | } |
| 16853 | } |
| 16854 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 16855 | { |
| 16856 | IkReal evalcond[10]; |
| 16857 | IkReal x1875=IKsin(j5); |
| 16858 | IkReal x1876=IKcos(j5); |
| 16859 | IkReal x1877=((1.0000000008)*x1875); |
| 16860 | IkReal x1878=((1.0000000008)*x1876); |
| 16861 | evalcond[0]=(gconst24*x1875); |
| 16862 | evalcond[1]=((-1.0)*new_r10*x1875); |
| 16863 | evalcond[2]=(((new_r10*x1876))+gconst24); |
| 16864 | evalcond[3]=(((gconst24*x1876))+new_r10); |
| 16865 | evalcond[4]=(new_r10*x1877); |
| 16866 | evalcond[5]=(((new_r01*x1875))+((new_r11*x1876))); |
| 16867 | evalcond[6]=(((gconst24*x1878))+new_r01); |
| 16868 | evalcond[7]=((((-1.0)*gconst24*x1877))+new_r11); |
| 16869 | evalcond[8]=((((1.0000000008)*gconst24))+(((-1.0)*new_r11*x1875))+((new_r01*x1876))); |
| 16870 | evalcond[9]=((((-1.0)*gconst24))+((new_r11*x1877))+(((-1.0)*new_r01*x1878))); |
| 16871 | if( 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 ) |
| 16872 | { |
| 16873 | continue; |
| 16874 | } |
| 16875 | } |
| 16876 | |
| 16877 | { |
| 16878 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 16879 | vinfos[0].jointtype = 1; |
| 16880 | vinfos[0].foffset = j0; |
| 16881 | vinfos[0].indices[0] = _ij0[0]; |
| 16882 | vinfos[0].indices[1] = _ij0[1]; |
| 16883 | vinfos[0].maxsolutions = _nj0; |
| 16884 | vinfos[1].jointtype = 1; |
| 16885 | vinfos[1].foffset = j1; |
| 16886 | vinfos[1].indices[0] = _ij1[0]; |
| 16887 | vinfos[1].indices[1] = _ij1[1]; |
| 16888 | vinfos[1].maxsolutions = _nj1; |
| 16889 | vinfos[2].jointtype = 1; |
| 16890 | vinfos[2].foffset = j2; |
| 16891 | vinfos[2].indices[0] = _ij2[0]; |
| 16892 | vinfos[2].indices[1] = _ij2[1]; |
| 16893 | vinfos[2].maxsolutions = _nj2; |
| 16894 | vinfos[3].jointtype = 1; |
| 16895 | vinfos[3].foffset = j3; |
| 16896 | vinfos[3].indices[0] = _ij3[0]; |
| 16897 | vinfos[3].indices[1] = _ij3[1]; |
| 16898 | vinfos[3].maxsolutions = _nj3; |
| 16899 | vinfos[4].jointtype = 1; |
| 16900 | vinfos[4].foffset = j4; |
| 16901 | vinfos[4].indices[0] = _ij4[0]; |
| 16902 | vinfos[4].indices[1] = _ij4[1]; |
| 16903 | vinfos[4].maxsolutions = _nj4; |
| 16904 | vinfos[5].jointtype = 1; |
| 16905 | vinfos[5].foffset = j5; |
| 16906 | vinfos[5].indices[0] = _ij5[0]; |
| 16907 | vinfos[5].indices[1] = _ij5[1]; |
| 16908 | vinfos[5].maxsolutions = _nj5; |
| 16909 | std::vector<int> vfree(0); |
| 16910 | solutions.AddSolution(vinfos,vfree); |
| 16911 | } |
| 16912 | } |
| 16913 | } |
| 16914 | |
| 16915 | } |
| 16916 | |
| 16917 | } |
| 16918 | |
| 16919 | } |
| 16920 | } while(0); |
| 16921 | if( bgotonextstatement ) |
| 16922 | { |
| 16923 | bool bgotonextstatement = true; |
| 16924 | do |
| 16925 | { |
| 16926 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 16927 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 16928 | { |
| 16929 | bgotonextstatement=false; |
| 16930 | { |
| 16931 | IkReal j5eval[3]; |
| 16932 | IkReal x1880 = ((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 16933 | if(IKabs(x1880)==0){ |
| 16934 | continue; |
| 16935 | } |
| 16936 | IkReal x1879=pow(x1880,-0.5); |
| 16937 | sj4=-4.0e-5; |
| 16938 | cj4=-1.0; |
| 16939 | j4=3.14163265; |
| 16940 | sj3=gconst24; |
| 16941 | cj3=gconst25; |
| 16942 | CheckValue<IkReal> x1881 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 16943 | if(!x1881.valid){ |
| 16944 | continue; |
| 16945 | } |
| 16946 | j3=((3.14159265)+(((-1.0)*(x1881.value)))); |
| 16947 | new_r11=0; |
| 16948 | new_r01=0; |
| 16949 | new_r22=0; |
| 16950 | new_r20=0; |
| 16951 | CheckValue<IkReal> x1882 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 16952 | if(!x1882.valid){ |
| 16953 | continue; |
| 16954 | } |
| 16955 | IkReal gconst23=((3.14159265358979)+(((-1.0)*(x1882.value)))); |
| 16956 | IkReal gconst24=((1.0000000008)*new_r10*x1879); |
| 16957 | IkReal gconst25=((-1.0)*new_r00*x1879); |
| 16958 | IkReal x1883=new_r10*new_r10; |
| 16959 | CheckValue<IkReal> x1887=IKPowWithIntegerCheck(((625000000.0)+(((1.0)*x1883))),-1); |
| 16960 | if(!x1887.valid){ |
| 16961 | continue; |
| 16962 | } |
| 16963 | IkReal x1884=x1887.value; |
| 16964 | if((((625000000.0)+x1883)) < -0.00001) |
| 16965 | continue; |
| 16966 | IkReal x1885=IKsqrt(((625000000.0)+x1883)); |
| 16967 | IkReal x1886=(x1884*x1885); |
| 16968 | j5eval[0]=1.0; |
| 16969 | j5eval[1]=1.0; |
| 16970 | IkReal x1888 = ((1.0)+(((1.6e-9)*x1883))); |
| 16971 | if(IKabs(x1888)==0){ |
| 16972 | continue; |
| 16973 | } |
| 16974 | j5eval[2]=((IKabs(((((-1250000001.0)*x1883*x1886))+(((625000000.5)*x1886)))))+(IKabs(((50000.00004)*new_r00*new_r10*(pow(x1888,-0.5)))))); |
| 16975 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 16976 | { |
| 16977 | { |
| 16978 | IkReal j5eval[1]; |
| 16979 | IkReal x1890 = ((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 16980 | if(IKabs(x1890)==0){ |
| 16981 | continue; |
| 16982 | } |
| 16983 | IkReal x1889=pow(x1890,-0.5); |
| 16984 | sj4=-4.0e-5; |
| 16985 | cj4=-1.0; |
| 16986 | j4=3.14163265; |
| 16987 | sj3=gconst24; |
| 16988 | cj3=gconst25; |
| 16989 | CheckValue<IkReal> x1891 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 16990 | if(!x1891.valid){ |
| 16991 | continue; |
| 16992 | } |
| 16993 | j3=((3.14159265)+(((-1.0)*(x1891.value)))); |
| 16994 | new_r11=0; |
| 16995 | new_r01=0; |
| 16996 | new_r22=0; |
| 16997 | new_r20=0; |
| 16998 | CheckValue<IkReal> x1892 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 16999 | if(!x1892.valid){ |
| 17000 | continue; |
| 17001 | } |
| 17002 | IkReal gconst23=((3.14159265358979)+(((-1.0)*(x1892.value)))); |
| 17003 | IkReal gconst24=((1.0000000008)*new_r10*x1889); |
| 17004 | IkReal gconst25=((-1.0)*new_r00*x1889); |
| 17005 | IkReal x1893=new_r10*new_r10; |
| 17006 | CheckValue<IkReal> x1895=IKPowWithIntegerCheck(((1.0)+(((1.6e-9)*x1893))),-1); |
| 17007 | if(!x1895.valid){ |
| 17008 | continue; |
| 17009 | } |
| 17010 | IkReal x1894=x1895.value; |
| 17011 | IkReal x1896=((1.0)+(((-1.0)*x1893))); |
| 17012 | j5eval[0]=IKsign(((((-625000000.0)*x1894*(x1896*x1896)))+(((625000002.0)*x1894*(x1893*x1893))))); |
| 17013 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 17014 | { |
| 17015 | { |
| 17016 | IkReal j5eval[2]; |
| 17017 | IkReal x1898 = ((1.0)+(((1.6e-9)*(new_r10*new_r10)))); |
| 17018 | if(IKabs(x1898)==0){ |
| 17019 | continue; |
| 17020 | } |
| 17021 | IkReal x1897=pow(x1898,-0.5); |
| 17022 | sj4=-4.0e-5; |
| 17023 | cj4=-1.0; |
| 17024 | j4=3.14163265; |
| 17025 | sj3=gconst24; |
| 17026 | cj3=gconst25; |
| 17027 | CheckValue<IkReal> x1899 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 17028 | if(!x1899.valid){ |
| 17029 | continue; |
| 17030 | } |
| 17031 | j3=((3.14159265)+(((-1.0)*(x1899.value)))); |
| 17032 | new_r11=0; |
| 17033 | new_r01=0; |
| 17034 | new_r22=0; |
| 17035 | new_r20=0; |
| 17036 | CheckValue<IkReal> x1900 = IKatan2WithCheck(IkReal(((1.0000000008)*new_r10)),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 17037 | if(!x1900.valid){ |
| 17038 | continue; |
| 17039 | } |
| 17040 | IkReal gconst23=((3.14159265358979)+(((-1.0)*(x1900.value)))); |
| 17041 | IkReal gconst24=((1.0000000008)*new_r10*x1897); |
| 17042 | IkReal gconst25=((-1.0)*new_r00*x1897); |
| 17043 | IkReal x1901=new_r10*new_r10; |
| 17044 | IkReal x1902=((1.0)+(((1.6e-9)*x1901))); |
| 17045 | CheckValue<IkReal> x1903=IKPowWithIntegerCheck(x1902,-1); |
| 17046 | if(!x1903.valid){ |
| 17047 | continue; |
| 17048 | } |
| 17049 | j5eval[0]=((-3.20000004272458e-9)*x1901*(x1903.value)*(((1.0)+(((-1.0)*x1901))))); |
| 17050 | IkReal x1904 = x1902; |
| 17051 | if(IKabs(x1904)==0){ |
| 17052 | continue; |
| 17053 | } |
| 17054 | j5eval[1]=((1.60000013238459e-9)*new_r00*new_r10*(pow(x1904,-0.5))); |
| 17055 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 17056 | { |
| 17057 | continue; // 3 cases reached |
| 17058 | |
| 17059 | } else |
| 17060 | { |
| 17061 | { |
| 17062 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 17063 | bool j5valid[1]={false}; |
| 17064 | _nj5 = 1; |
| 17065 | IkReal x1905=gconst24*gconst24; |
| 17066 | IkReal x1906=(gconst25*new_r10); |
| 17067 | CheckValue<IkReal> x1907=IKPowWithIntegerCheck(((((625000000.0)*(x1906*x1906)))+(((-625000001.0)*x1905*(new_r00*new_r00)))),-1); |
| 17068 | if(!x1907.valid){ |
| 17069 | continue; |
| 17070 | } |
| 17071 | CheckValue<IkReal> x1908=IKPowWithIntegerCheck(((((25000.0)*x1906))+(((25000.00002)*gconst24*new_r00))),-1); |
| 17072 | if(!x1908.valid){ |
| 17073 | continue; |
| 17074 | } |
| 17075 | if( IKabs(((x1907.value)*(((((-625000000.5)*x1905*x1906))+(((625000001.0)*new_r00*(gconst24*gconst24*gconst24))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-25000.0)*gconst24*gconst25*(x1908.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((x1907.value)*(((((-625000000.5)*x1905*x1906))+(((625000001.0)*new_r00*(gconst24*gconst24*gconst24)))))))+IKsqr(((-25000.0)*gconst24*gconst25*(x1908.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 17076 | continue; |
| 17077 | j5array[0]=IKatan2(((x1907.value)*(((((-625000000.5)*x1905*x1906))+(((625000001.0)*new_r00*(gconst24*gconst24*gconst24)))))), ((-25000.0)*gconst24*gconst25*(x1908.value))); |
| 17078 | sj5array[0]=IKsin(j5array[0]); |
| 17079 | cj5array[0]=IKcos(j5array[0]); |
| 17080 | if( j5array[0] > IKPI ) |
| 17081 | { |
| 17082 | j5array[0]-=IK2PI; |
| 17083 | } |
| 17084 | else if( j5array[0] < -IKPI ) |
| 17085 | { j5array[0]+=IK2PI; |
| 17086 | } |
| 17087 | j5valid[0] = true; |
| 17088 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 17089 | { |
| 17090 | if( !j5valid[ij5] ) |
| 17091 | { |
| 17092 | continue; |
| 17093 | } |
| 17094 | _ij5[0] = ij5; _ij5[1] = -1; |
| 17095 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 17096 | { |
| 17097 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 17098 | { |
| 17099 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 17100 | } |
| 17101 | } |
| 17102 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 17103 | { |
| 17104 | IkReal evalcond[7]; |
| 17105 | IkReal x1909=IKsin(j5); |
| 17106 | IkReal x1910=IKcos(j5); |
| 17107 | IkReal x1911=((1.0)*gconst25); |
| 17108 | IkReal x1912=((1.0000000008)*x1909); |
| 17109 | IkReal x1913=((1.0000000008)*x1910); |
| 17110 | evalcond[0]=(gconst24+((new_r10*x1910))+((new_r00*x1909))); |
| 17111 | evalcond[1]=(((gconst24*x1909))+((gconst25*x1913))+new_r00); |
| 17112 | evalcond[2]=((((-1.0)*gconst25*x1912))+((gconst24*x1910))+new_r10); |
| 17113 | evalcond[3]=(((gconst24*x1913))+(((-1.0)*x1909*x1911))); |
| 17114 | evalcond[4]=((((-1.0)*x1910*x1911))+(((-1.0)*gconst24*x1912))); |
| 17115 | evalcond[5]=((((1.0000000008)*gconst25))+(((-1.0)*new_r10*x1909))+((new_r00*x1910))); |
| 17116 | evalcond[6]=((((-1.0)*new_r00*x1913))+((new_r10*x1912))+(((-1.0)*x1911))); |
| 17117 | if( 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 ) |
| 17118 | { |
| 17119 | continue; |
| 17120 | } |
| 17121 | } |
| 17122 | |
| 17123 | { |
| 17124 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 17125 | vinfos[0].jointtype = 1; |
| 17126 | vinfos[0].foffset = j0; |
| 17127 | vinfos[0].indices[0] = _ij0[0]; |
| 17128 | vinfos[0].indices[1] = _ij0[1]; |
| 17129 | vinfos[0].maxsolutions = _nj0; |
| 17130 | vinfos[1].jointtype = 1; |
| 17131 | vinfos[1].foffset = j1; |
| 17132 | vinfos[1].indices[0] = _ij1[0]; |
| 17133 | vinfos[1].indices[1] = _ij1[1]; |
| 17134 | vinfos[1].maxsolutions = _nj1; |
| 17135 | vinfos[2].jointtype = 1; |
| 17136 | vinfos[2].foffset = j2; |
| 17137 | vinfos[2].indices[0] = _ij2[0]; |
| 17138 | vinfos[2].indices[1] = _ij2[1]; |
| 17139 | vinfos[2].maxsolutions = _nj2; |
| 17140 | vinfos[3].jointtype = 1; |
| 17141 | vinfos[3].foffset = j3; |
| 17142 | vinfos[3].indices[0] = _ij3[0]; |
| 17143 | vinfos[3].indices[1] = _ij3[1]; |
| 17144 | vinfos[3].maxsolutions = _nj3; |
| 17145 | vinfos[4].jointtype = 1; |
| 17146 | vinfos[4].foffset = j4; |
| 17147 | vinfos[4].indices[0] = _ij4[0]; |
| 17148 | vinfos[4].indices[1] = _ij4[1]; |
| 17149 | vinfos[4].maxsolutions = _nj4; |
| 17150 | vinfos[5].jointtype = 1; |
| 17151 | vinfos[5].foffset = j5; |
| 17152 | vinfos[5].indices[0] = _ij5[0]; |
| 17153 | vinfos[5].indices[1] = _ij5[1]; |
| 17154 | vinfos[5].maxsolutions = _nj5; |
| 17155 | std::vector<int> vfree(0); |
| 17156 | solutions.AddSolution(vinfos,vfree); |
| 17157 | } |
| 17158 | } |
| 17159 | } |
| 17160 | |
| 17161 | } |
| 17162 | |
| 17163 | } |
| 17164 | |
| 17165 | } else |
| 17166 | { |
| 17167 | { |
| 17168 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 17169 | bool j5valid[1]={false}; |
| 17170 | _nj5 = 1; |
| 17171 | IkReal x1914=gconst25*gconst25; |
| 17172 | IkReal x1915=gconst24*gconst24; |
| 17173 | IkReal x1916=((625000000.0)*x1914); |
| 17174 | IkReal x1917=((625000000.5)*gconst25*x1915); |
| 17175 | CheckValue<IkReal> x1918 = IKatan2WithCheck(IkReal((((new_r10*x1917))+((gconst24*new_r00*x1916)))),IkReal(((((-625000001.0)*new_r10*(gconst24*gconst24*gconst24)))+(((-1.0)*new_r00*x1917)))),IKFAST_ATAN2_MAGTHRESH); |
| 17176 | if(!x1918.valid){ |
| 17177 | continue; |
| 17178 | } |
| 17179 | CheckValue<IkReal> x1919=IKPowWithIntegerCheck(IKsign(((((-1.0)*x1916*(new_r00*new_r00)))+(((625000001.0)*x1915*(new_r10*new_r10))))),-1); |
| 17180 | if(!x1919.valid){ |
| 17181 | continue; |
| 17182 | } |
| 17183 | j5array[0]=((-1.5707963267949)+(x1918.value)+(((1.5707963267949)*(x1919.value)))); |
| 17184 | sj5array[0]=IKsin(j5array[0]); |
| 17185 | cj5array[0]=IKcos(j5array[0]); |
| 17186 | if( j5array[0] > IKPI ) |
| 17187 | { |
| 17188 | j5array[0]-=IK2PI; |
| 17189 | } |
| 17190 | else if( j5array[0] < -IKPI ) |
| 17191 | { j5array[0]+=IK2PI; |
| 17192 | } |
| 17193 | j5valid[0] = true; |
| 17194 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 17195 | { |
| 17196 | if( !j5valid[ij5] ) |
| 17197 | { |
| 17198 | continue; |
| 17199 | } |
| 17200 | _ij5[0] = ij5; _ij5[1] = -1; |
| 17201 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 17202 | { |
| 17203 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 17204 | { |
| 17205 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 17206 | } |
| 17207 | } |
| 17208 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 17209 | { |
| 17210 | IkReal evalcond[7]; |
| 17211 | IkReal x1920=IKsin(j5); |
| 17212 | IkReal x1921=IKcos(j5); |
| 17213 | IkReal x1922=((1.0)*gconst25); |
| 17214 | IkReal x1923=((1.0000000008)*x1920); |
| 17215 | IkReal x1924=((1.0000000008)*x1921); |
| 17216 | evalcond[0]=(gconst24+((new_r00*x1920))+((new_r10*x1921))); |
| 17217 | evalcond[1]=(((gconst25*x1924))+((gconst24*x1920))+new_r00); |
| 17218 | evalcond[2]=((((-1.0)*gconst25*x1923))+((gconst24*x1921))+new_r10); |
| 17219 | evalcond[3]=(((gconst24*x1924))+(((-1.0)*x1920*x1922))); |
| 17220 | evalcond[4]=((((-1.0)*gconst24*x1923))+(((-1.0)*x1921*x1922))); |
| 17221 | evalcond[5]=((((1.0000000008)*gconst25))+((new_r00*x1921))+(((-1.0)*new_r10*x1920))); |
| 17222 | evalcond[6]=((((-1.0)*x1922))+((new_r10*x1923))+(((-1.0)*new_r00*x1924))); |
| 17223 | if( 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 ) |
| 17224 | { |
| 17225 | continue; |
| 17226 | } |
| 17227 | } |
| 17228 | |
| 17229 | { |
| 17230 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 17231 | vinfos[0].jointtype = 1; |
| 17232 | vinfos[0].foffset = j0; |
| 17233 | vinfos[0].indices[0] = _ij0[0]; |
| 17234 | vinfos[0].indices[1] = _ij0[1]; |
| 17235 | vinfos[0].maxsolutions = _nj0; |
| 17236 | vinfos[1].jointtype = 1; |
| 17237 | vinfos[1].foffset = j1; |
| 17238 | vinfos[1].indices[0] = _ij1[0]; |
| 17239 | vinfos[1].indices[1] = _ij1[1]; |
| 17240 | vinfos[1].maxsolutions = _nj1; |
| 17241 | vinfos[2].jointtype = 1; |
| 17242 | vinfos[2].foffset = j2; |
| 17243 | vinfos[2].indices[0] = _ij2[0]; |
| 17244 | vinfos[2].indices[1] = _ij2[1]; |
| 17245 | vinfos[2].maxsolutions = _nj2; |
| 17246 | vinfos[3].jointtype = 1; |
| 17247 | vinfos[3].foffset = j3; |
| 17248 | vinfos[3].indices[0] = _ij3[0]; |
| 17249 | vinfos[3].indices[1] = _ij3[1]; |
| 17250 | vinfos[3].maxsolutions = _nj3; |
| 17251 | vinfos[4].jointtype = 1; |
| 17252 | vinfos[4].foffset = j4; |
| 17253 | vinfos[4].indices[0] = _ij4[0]; |
| 17254 | vinfos[4].indices[1] = _ij4[1]; |
| 17255 | vinfos[4].maxsolutions = _nj4; |
| 17256 | vinfos[5].jointtype = 1; |
| 17257 | vinfos[5].foffset = j5; |
| 17258 | vinfos[5].indices[0] = _ij5[0]; |
| 17259 | vinfos[5].indices[1] = _ij5[1]; |
| 17260 | vinfos[5].maxsolutions = _nj5; |
| 17261 | std::vector<int> vfree(0); |
| 17262 | solutions.AddSolution(vinfos,vfree); |
| 17263 | } |
| 17264 | } |
| 17265 | } |
| 17266 | |
| 17267 | } |
| 17268 | |
| 17269 | } |
| 17270 | |
| 17271 | } else |
| 17272 | { |
| 17273 | { |
| 17274 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 17275 | bool j5valid[1]={false}; |
| 17276 | _nj5 = 1; |
| 17277 | IkReal x1925=((25000.00002)*gconst25); |
| 17278 | IkReal x1926=((25000.0)*gconst24); |
| 17279 | CheckValue<IkReal> x1927 = IKatan2WithCheck(IkReal((((new_r10*x1925))+(((-1.0)*new_r00*x1926)))),IkReal(((((-1.0)*new_r10*x1926))+(((-1.0)*new_r00*x1925)))),IKFAST_ATAN2_MAGTHRESH); |
| 17280 | if(!x1927.valid){ |
| 17281 | continue; |
| 17282 | } |
| 17283 | CheckValue<IkReal> x1928=IKPowWithIntegerCheck(IKsign(((((25000.0)*(new_r10*new_r10)))+(((25000.0)*(new_r00*new_r00))))),-1); |
| 17284 | if(!x1928.valid){ |
| 17285 | continue; |
| 17286 | } |
| 17287 | j5array[0]=((-1.5707963267949)+(x1927.value)+(((1.5707963267949)*(x1928.value)))); |
| 17288 | sj5array[0]=IKsin(j5array[0]); |
| 17289 | cj5array[0]=IKcos(j5array[0]); |
| 17290 | if( j5array[0] > IKPI ) |
| 17291 | { |
| 17292 | j5array[0]-=IK2PI; |
| 17293 | } |
| 17294 | else if( j5array[0] < -IKPI ) |
| 17295 | { j5array[0]+=IK2PI; |
| 17296 | } |
| 17297 | j5valid[0] = true; |
| 17298 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 17299 | { |
| 17300 | if( !j5valid[ij5] ) |
| 17301 | { |
| 17302 | continue; |
| 17303 | } |
| 17304 | _ij5[0] = ij5; _ij5[1] = -1; |
| 17305 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 17306 | { |
| 17307 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 17308 | { |
| 17309 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 17310 | } |
| 17311 | } |
| 17312 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 17313 | { |
| 17314 | IkReal evalcond[7]; |
| 17315 | IkReal x1929=IKsin(j5); |
| 17316 | IkReal x1930=IKcos(j5); |
| 17317 | IkReal x1931=((1.0)*gconst25); |
| 17318 | IkReal x1932=((1.0000000008)*x1929); |
| 17319 | IkReal x1933=((1.0000000008)*x1930); |
| 17320 | evalcond[0]=(gconst24+((new_r10*x1930))+((new_r00*x1929))); |
| 17321 | evalcond[1]=(((gconst24*x1929))+((gconst25*x1933))+new_r00); |
| 17322 | evalcond[2]=((((-1.0)*gconst25*x1932))+((gconst24*x1930))+new_r10); |
| 17323 | evalcond[3]=(((gconst24*x1933))+(((-1.0)*x1929*x1931))); |
| 17324 | evalcond[4]=((((-1.0)*x1930*x1931))+(((-1.0)*gconst24*x1932))); |
| 17325 | evalcond[5]=((((1.0000000008)*gconst25))+((new_r00*x1930))+(((-1.0)*new_r10*x1929))); |
| 17326 | evalcond[6]=((((-1.0)*new_r00*x1933))+((new_r10*x1932))+(((-1.0)*x1931))); |
| 17327 | if( 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 ) |
| 17328 | { |
| 17329 | continue; |
| 17330 | } |
| 17331 | } |
| 17332 | |
| 17333 | { |
| 17334 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 17335 | vinfos[0].jointtype = 1; |
| 17336 | vinfos[0].foffset = j0; |
| 17337 | vinfos[0].indices[0] = _ij0[0]; |
| 17338 | vinfos[0].indices[1] = _ij0[1]; |
| 17339 | vinfos[0].maxsolutions = _nj0; |
| 17340 | vinfos[1].jointtype = 1; |
| 17341 | vinfos[1].foffset = j1; |
| 17342 | vinfos[1].indices[0] = _ij1[0]; |
| 17343 | vinfos[1].indices[1] = _ij1[1]; |
| 17344 | vinfos[1].maxsolutions = _nj1; |
| 17345 | vinfos[2].jointtype = 1; |
| 17346 | vinfos[2].foffset = j2; |
| 17347 | vinfos[2].indices[0] = _ij2[0]; |
| 17348 | vinfos[2].indices[1] = _ij2[1]; |
| 17349 | vinfos[2].maxsolutions = _nj2; |
| 17350 | vinfos[3].jointtype = 1; |
| 17351 | vinfos[3].foffset = j3; |
| 17352 | vinfos[3].indices[0] = _ij3[0]; |
| 17353 | vinfos[3].indices[1] = _ij3[1]; |
| 17354 | vinfos[3].maxsolutions = _nj3; |
| 17355 | vinfos[4].jointtype = 1; |
| 17356 | vinfos[4].foffset = j4; |
| 17357 | vinfos[4].indices[0] = _ij4[0]; |
| 17358 | vinfos[4].indices[1] = _ij4[1]; |
| 17359 | vinfos[4].maxsolutions = _nj4; |
| 17360 | vinfos[5].jointtype = 1; |
| 17361 | vinfos[5].foffset = j5; |
| 17362 | vinfos[5].indices[0] = _ij5[0]; |
| 17363 | vinfos[5].indices[1] = _ij5[1]; |
| 17364 | vinfos[5].maxsolutions = _nj5; |
| 17365 | std::vector<int> vfree(0); |
| 17366 | solutions.AddSolution(vinfos,vfree); |
| 17367 | } |
| 17368 | } |
| 17369 | } |
| 17370 | |
| 17371 | } |
| 17372 | |
| 17373 | } |
| 17374 | |
| 17375 | } |
| 17376 | } while(0); |
| 17377 | if( bgotonextstatement ) |
| 17378 | { |
| 17379 | bool bgotonextstatement = true; |
| 17380 | do |
| 17381 | { |
| 17382 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r10))); |
| 17383 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 17384 | { |
| 17385 | bgotonextstatement=false; |
| 17386 | { |
| 17387 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 17388 | bool j5valid[1]={false}; |
| 17389 | _nj5 = 1; |
| 17390 | CheckValue<IkReal> x1935=IKPowWithIntegerCheck(gconst25,-1); |
| 17391 | if(!x1935.valid){ |
| 17392 | continue; |
| 17393 | } |
| 17394 | IkReal x1934=x1935.value; |
| 17395 | if( IKabs((new_r01*x1934)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.9999999992)*new_r00*x1934)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((new_r01*x1934))+IKsqr(((-0.9999999992)*new_r00*x1934))-1) <= IKFAST_SINCOS_THRESH ) |
| 17396 | continue; |
| 17397 | j5array[0]=IKatan2((new_r01*x1934), ((-0.9999999992)*new_r00*x1934)); |
| 17398 | sj5array[0]=IKsin(j5array[0]); |
| 17399 | cj5array[0]=IKcos(j5array[0]); |
| 17400 | if( j5array[0] > IKPI ) |
| 17401 | { |
| 17402 | j5array[0]-=IK2PI; |
| 17403 | } |
| 17404 | else if( j5array[0] < -IKPI ) |
| 17405 | { j5array[0]+=IK2PI; |
| 17406 | } |
| 17407 | j5valid[0] = true; |
| 17408 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 17409 | { |
| 17410 | if( !j5valid[ij5] ) |
| 17411 | { |
| 17412 | continue; |
| 17413 | } |
| 17414 | _ij5[0] = ij5; _ij5[1] = -1; |
| 17415 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 17416 | { |
| 17417 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 17418 | { |
| 17419 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 17420 | } |
| 17421 | } |
| 17422 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 17423 | { |
| 17424 | IkReal evalcond[10]; |
| 17425 | IkReal x1936=IKcos(j5); |
| 17426 | IkReal x1937=IKsin(j5); |
| 17427 | IkReal x1938=((1.0)*gconst25); |
| 17428 | IkReal x1939=(gconst25*x1936); |
| 17429 | IkReal x1940=(new_r00*x1936); |
| 17430 | IkReal x1941=(new_r01*x1936); |
| 17431 | evalcond[0]=(new_r00*x1937); |
| 17432 | evalcond[1]=x1941; |
| 17433 | evalcond[2]=((-1.0)*x1939); |
| 17434 | evalcond[3]=((((-1.0)*x1937*x1938))+new_r01); |
| 17435 | evalcond[4]=(((new_r01*x1937))+(((-1.0)*x1938))); |
| 17436 | evalcond[5]=((-1.0000000008)*gconst25*x1937); |
| 17437 | evalcond[6]=((-1.0000000008)*x1941); |
| 17438 | evalcond[7]=((((1.0000000008)*x1939))+new_r00); |
| 17439 | evalcond[8]=((((1.0000000008)*gconst25))+x1940); |
| 17440 | evalcond[9]=((((-1.0000000008)*x1940))+(((-1.0)*x1938))); |
| 17441 | if( 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 ) |
| 17442 | { |
| 17443 | continue; |
| 17444 | } |
| 17445 | } |
| 17446 | |
| 17447 | { |
| 17448 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 17449 | vinfos[0].jointtype = 1; |
| 17450 | vinfos[0].foffset = j0; |
| 17451 | vinfos[0].indices[0] = _ij0[0]; |
| 17452 | vinfos[0].indices[1] = _ij0[1]; |
| 17453 | vinfos[0].maxsolutions = _nj0; |
| 17454 | vinfos[1].jointtype = 1; |
| 17455 | vinfos[1].foffset = j1; |
| 17456 | vinfos[1].indices[0] = _ij1[0]; |
| 17457 | vinfos[1].indices[1] = _ij1[1]; |
| 17458 | vinfos[1].maxsolutions = _nj1; |
| 17459 | vinfos[2].jointtype = 1; |
| 17460 | vinfos[2].foffset = j2; |
| 17461 | vinfos[2].indices[0] = _ij2[0]; |
| 17462 | vinfos[2].indices[1] = _ij2[1]; |
| 17463 | vinfos[2].maxsolutions = _nj2; |
| 17464 | vinfos[3].jointtype = 1; |
| 17465 | vinfos[3].foffset = j3; |
| 17466 | vinfos[3].indices[0] = _ij3[0]; |
| 17467 | vinfos[3].indices[1] = _ij3[1]; |
| 17468 | vinfos[3].maxsolutions = _nj3; |
| 17469 | vinfos[4].jointtype = 1; |
| 17470 | vinfos[4].foffset = j4; |
| 17471 | vinfos[4].indices[0] = _ij4[0]; |
| 17472 | vinfos[4].indices[1] = _ij4[1]; |
| 17473 | vinfos[4].maxsolutions = _nj4; |
| 17474 | vinfos[5].jointtype = 1; |
| 17475 | vinfos[5].foffset = j5; |
| 17476 | vinfos[5].indices[0] = _ij5[0]; |
| 17477 | vinfos[5].indices[1] = _ij5[1]; |
| 17478 | vinfos[5].maxsolutions = _nj5; |
| 17479 | std::vector<int> vfree(0); |
| 17480 | solutions.AddSolution(vinfos,vfree); |
| 17481 | } |
| 17482 | } |
| 17483 | } |
| 17484 | |
| 17485 | } |
| 17486 | } while(0); |
| 17487 | if( bgotonextstatement ) |
| 17488 | { |
| 17489 | bool bgotonextstatement = true; |
| 17490 | do |
| 17491 | { |
| 17492 | if( 1 ) |
| 17493 | { |
| 17494 | bgotonextstatement=false; |
| 17495 | continue; // branch miss [j5] |
| 17496 | |
| 17497 | } |
| 17498 | } while(0); |
| 17499 | if( bgotonextstatement ) |
| 17500 | { |
| 17501 | } |
| 17502 | } |
| 17503 | } |
| 17504 | } |
| 17505 | } |
| 17506 | |
| 17507 | } else |
| 17508 | { |
| 17509 | { |
| 17510 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 17511 | bool j5valid[1]={false}; |
| 17512 | _nj5 = 1; |
| 17513 | CheckValue<IkReal> x1946=IKPowWithIntegerCheck(new_r00,-1); |
| 17514 | if(!x1946.valid){ |
| 17515 | continue; |
| 17516 | } |
| 17517 | IkReal x1942=x1946.value; |
| 17518 | IkReal x1943=gconst24*gconst24; |
| 17519 | IkReal x1944=((25000.0)*new_r10); |
| 17520 | CheckValue<IkReal> x1947=IKPowWithIntegerCheck(((((-1.0)*gconst24*x1944))+(((25000.00002)*gconst25*new_r00))),-1); |
| 17521 | if(!x1947.valid){ |
| 17522 | continue; |
| 17523 | } |
| 17524 | IkReal x1945=x1947.value; |
| 17525 | CheckValue<IkReal> x1948=IKPowWithIntegerCheck(((((-25000.0)*gconst24*new_r10))+(((25000.00002)*gconst25*new_r00))),-1); |
| 17526 | if(!x1948.valid){ |
| 17527 | continue; |
| 17528 | } |
| 17529 | CheckValue<IkReal> x1949=IKPowWithIntegerCheck(((((-25000.0)*gconst24*new_r10))+(((25000.00002)*gconst25*new_r00))),-1); |
| 17530 | if(!x1949.valid){ |
| 17531 | continue; |
| 17532 | } |
| 17533 | CheckValue<IkReal> x1950=IKPowWithIntegerCheck(x1942,-2); |
| 17534 | if(!x1950.valid){ |
| 17535 | continue; |
| 17536 | } |
| 17537 | if( IKabs(((((-1.0)*gconst24*x1942))+((new_r00*x1944*(x1948.value)))+(((-1.0)*x1942*x1943*x1944*(x1949.value))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x1945*(((((25000.0)*x1943))+(((-25000.0)*(x1950.value))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*gconst24*x1942))+((new_r00*x1944*(x1948.value)))+(((-1.0)*x1942*x1943*x1944*(x1949.value)))))+IKsqr((x1945*(((((25000.0)*x1943))+(((-25000.0)*(x1950.value)))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 17538 | continue; |
| 17539 | j5array[0]=IKatan2(((((-1.0)*gconst24*x1942))+((new_r00*x1944*(x1948.value)))+(((-1.0)*x1942*x1943*x1944*(x1949.value)))), (x1945*(((((25000.0)*x1943))+(((-25000.0)*(x1950.value))))))); |
| 17540 | sj5array[0]=IKsin(j5array[0]); |
| 17541 | cj5array[0]=IKcos(j5array[0]); |
| 17542 | if( j5array[0] > IKPI ) |
| 17543 | { |
| 17544 | j5array[0]-=IK2PI; |
| 17545 | } |
| 17546 | else if( j5array[0] < -IKPI ) |
| 17547 | { j5array[0]+=IK2PI; |
| 17548 | } |
| 17549 | j5valid[0] = true; |
| 17550 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 17551 | { |
| 17552 | if( !j5valid[ij5] ) |
| 17553 | { |
| 17554 | continue; |
| 17555 | } |
| 17556 | _ij5[0] = ij5; _ij5[1] = -1; |
| 17557 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 17558 | { |
| 17559 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 17560 | { |
| 17561 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 17562 | } |
| 17563 | } |
| 17564 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 17565 | { |
| 17566 | IkReal evalcond[10]; |
| 17567 | IkReal x1951=IKcos(j5); |
| 17568 | IkReal x1952=IKsin(j5); |
| 17569 | IkReal x1953=((1.0)*gconst25); |
| 17570 | IkReal x1954=((1.0000000008)*gconst25); |
| 17571 | IkReal x1955=((1.0000000008)*gconst24); |
| 17572 | IkReal x1956=(new_r11*x1952); |
| 17573 | IkReal x1957=(new_r01*x1951); |
| 17574 | IkReal x1958=(new_r00*x1951); |
| 17575 | IkReal x1959=(new_r10*x1952); |
| 17576 | evalcond[0]=(((new_r10*x1951))+((new_r00*x1952))+gconst24); |
| 17577 | evalcond[1]=(((new_r11*x1951))+(((-1.0)*x1953))+((new_r01*x1952))); |
| 17578 | evalcond[2]=(((gconst24*x1952))+((x1951*x1954))+new_r00); |
| 17579 | evalcond[3]=((((-1.0)*x1952*x1954))+((gconst24*x1951))+new_r10); |
| 17580 | evalcond[4]=((((-1.0)*x1952*x1953))+((x1951*x1955))+new_r01); |
| 17581 | evalcond[5]=((((-1.0)*x1952*x1955))+(((-1.0)*x1951*x1953))+new_r11); |
| 17582 | evalcond[6]=(x1954+x1958+(((-1.0)*x1959))); |
| 17583 | evalcond[7]=(x1955+x1957+(((-1.0)*x1956))); |
| 17584 | evalcond[8]=((((1.0000000008)*x1959))+(((-1.0)*x1953))+(((-1.0000000008)*x1958))); |
| 17585 | evalcond[9]=((((1.0000000008)*x1956))+(((-1.0000000008)*x1957))+(((-1.0)*gconst24))); |
| 17586 | if( 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 ) |
| 17587 | { |
| 17588 | continue; |
| 17589 | } |
| 17590 | } |
| 17591 | |
| 17592 | { |
| 17593 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 17594 | vinfos[0].jointtype = 1; |
| 17595 | vinfos[0].foffset = j0; |
| 17596 | vinfos[0].indices[0] = _ij0[0]; |
| 17597 | vinfos[0].indices[1] = _ij0[1]; |
| 17598 | vinfos[0].maxsolutions = _nj0; |
| 17599 | vinfos[1].jointtype = 1; |
| 17600 | vinfos[1].foffset = j1; |
| 17601 | vinfos[1].indices[0] = _ij1[0]; |
| 17602 | vinfos[1].indices[1] = _ij1[1]; |
| 17603 | vinfos[1].maxsolutions = _nj1; |
| 17604 | vinfos[2].jointtype = 1; |
| 17605 | vinfos[2].foffset = j2; |
| 17606 | vinfos[2].indices[0] = _ij2[0]; |
| 17607 | vinfos[2].indices[1] = _ij2[1]; |
| 17608 | vinfos[2].maxsolutions = _nj2; |
| 17609 | vinfos[3].jointtype = 1; |
| 17610 | vinfos[3].foffset = j3; |
| 17611 | vinfos[3].indices[0] = _ij3[0]; |
| 17612 | vinfos[3].indices[1] = _ij3[1]; |
| 17613 | vinfos[3].maxsolutions = _nj3; |
| 17614 | vinfos[4].jointtype = 1; |
| 17615 | vinfos[4].foffset = j4; |
| 17616 | vinfos[4].indices[0] = _ij4[0]; |
| 17617 | vinfos[4].indices[1] = _ij4[1]; |
| 17618 | vinfos[4].maxsolutions = _nj4; |
| 17619 | vinfos[5].jointtype = 1; |
| 17620 | vinfos[5].foffset = j5; |
| 17621 | vinfos[5].indices[0] = _ij5[0]; |
| 17622 | vinfos[5].indices[1] = _ij5[1]; |
| 17623 | vinfos[5].maxsolutions = _nj5; |
| 17624 | std::vector<int> vfree(0); |
| 17625 | solutions.AddSolution(vinfos,vfree); |
| 17626 | } |
| 17627 | } |
| 17628 | } |
| 17629 | |
| 17630 | } |
| 17631 | |
| 17632 | } |
| 17633 | |
| 17634 | } else |
| 17635 | { |
| 17636 | { |
| 17637 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 17638 | bool j5valid[1]={false}; |
| 17639 | _nj5 = 1; |
| 17640 | CheckValue<IkReal> x1964=IKPowWithIntegerCheck(new_r00,-1); |
| 17641 | if(!x1964.valid){ |
| 17642 | continue; |
| 17643 | } |
| 17644 | IkReal x1960=x1964.value; |
| 17645 | IkReal x1961=((25000.0)*new_r10); |
| 17646 | IkReal x1962=(gconst24*x1960); |
| 17647 | CheckValue<IkReal> x1965=IKPowWithIntegerCheck((((gconst25*x1961))+(((25000.00002)*gconst24*new_r00))),-1); |
| 17648 | if(!x1965.valid){ |
| 17649 | continue; |
| 17650 | } |
| 17651 | IkReal x1963=x1965.value; |
| 17652 | if( IKabs(((((-1.0)*x1962))+((new_r01*x1961*x1963))+((gconst25*x1961*x1962*x1963)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x1963*(((((-25000.0)*new_r00*new_r01))+(((-25000.0)*gconst24*gconst25)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*x1962))+((new_r01*x1961*x1963))+((gconst25*x1961*x1962*x1963))))+IKsqr((x1963*(((((-25000.0)*new_r00*new_r01))+(((-25000.0)*gconst24*gconst25))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 17653 | continue; |
| 17654 | j5array[0]=IKatan2(((((-1.0)*x1962))+((new_r01*x1961*x1963))+((gconst25*x1961*x1962*x1963))), (x1963*(((((-25000.0)*new_r00*new_r01))+(((-25000.0)*gconst24*gconst25)))))); |
| 17655 | sj5array[0]=IKsin(j5array[0]); |
| 17656 | cj5array[0]=IKcos(j5array[0]); |
| 17657 | if( j5array[0] > IKPI ) |
| 17658 | { |
| 17659 | j5array[0]-=IK2PI; |
| 17660 | } |
| 17661 | else if( j5array[0] < -IKPI ) |
| 17662 | { j5array[0]+=IK2PI; |
| 17663 | } |
| 17664 | j5valid[0] = true; |
| 17665 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 17666 | { |
| 17667 | if( !j5valid[ij5] ) |
| 17668 | { |
| 17669 | continue; |
| 17670 | } |
| 17671 | _ij5[0] = ij5; _ij5[1] = -1; |
| 17672 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 17673 | { |
| 17674 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 17675 | { |
| 17676 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 17677 | } |
| 17678 | } |
| 17679 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 17680 | { |
| 17681 | IkReal evalcond[10]; |
| 17682 | IkReal x1966=IKcos(j5); |
| 17683 | IkReal x1967=IKsin(j5); |
| 17684 | IkReal x1968=((1.0)*gconst25); |
| 17685 | IkReal x1969=((1.0000000008)*gconst25); |
| 17686 | IkReal x1970=((1.0000000008)*gconst24); |
| 17687 | IkReal x1971=(new_r11*x1967); |
| 17688 | IkReal x1972=(new_r01*x1966); |
| 17689 | IkReal x1973=(new_r00*x1966); |
| 17690 | IkReal x1974=(new_r10*x1967); |
| 17691 | evalcond[0]=(((new_r00*x1967))+gconst24+((new_r10*x1966))); |
| 17692 | evalcond[1]=(((new_r11*x1966))+((new_r01*x1967))+(((-1.0)*x1968))); |
| 17693 | evalcond[2]=(((gconst24*x1967))+((x1966*x1969))+new_r00); |
| 17694 | evalcond[3]=(((gconst24*x1966))+new_r10+(((-1.0)*x1967*x1969))); |
| 17695 | evalcond[4]=(((x1966*x1970))+new_r01+(((-1.0)*x1967*x1968))); |
| 17696 | evalcond[5]=((((-1.0)*x1966*x1968))+new_r11+(((-1.0)*x1967*x1970))); |
| 17697 | evalcond[6]=((((-1.0)*x1974))+x1969+x1973); |
| 17698 | evalcond[7]=((((-1.0)*x1971))+x1972+x1970); |
| 17699 | evalcond[8]=((((-1.0)*x1968))+(((-1.0000000008)*x1973))+(((1.0000000008)*x1974))); |
| 17700 | evalcond[9]=((((-1.0)*gconst24))+(((-1.0000000008)*x1972))+(((1.0000000008)*x1971))); |
| 17701 | if( 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 ) |
| 17702 | { |
| 17703 | continue; |
| 17704 | } |
| 17705 | } |
| 17706 | |
| 17707 | { |
| 17708 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 17709 | vinfos[0].jointtype = 1; |
| 17710 | vinfos[0].foffset = j0; |
| 17711 | vinfos[0].indices[0] = _ij0[0]; |
| 17712 | vinfos[0].indices[1] = _ij0[1]; |
| 17713 | vinfos[0].maxsolutions = _nj0; |
| 17714 | vinfos[1].jointtype = 1; |
| 17715 | vinfos[1].foffset = j1; |
| 17716 | vinfos[1].indices[0] = _ij1[0]; |
| 17717 | vinfos[1].indices[1] = _ij1[1]; |
| 17718 | vinfos[1].maxsolutions = _nj1; |
| 17719 | vinfos[2].jointtype = 1; |
| 17720 | vinfos[2].foffset = j2; |
| 17721 | vinfos[2].indices[0] = _ij2[0]; |
| 17722 | vinfos[2].indices[1] = _ij2[1]; |
| 17723 | vinfos[2].maxsolutions = _nj2; |
| 17724 | vinfos[3].jointtype = 1; |
| 17725 | vinfos[3].foffset = j3; |
| 17726 | vinfos[3].indices[0] = _ij3[0]; |
| 17727 | vinfos[3].indices[1] = _ij3[1]; |
| 17728 | vinfos[3].maxsolutions = _nj3; |
| 17729 | vinfos[4].jointtype = 1; |
| 17730 | vinfos[4].foffset = j4; |
| 17731 | vinfos[4].indices[0] = _ij4[0]; |
| 17732 | vinfos[4].indices[1] = _ij4[1]; |
| 17733 | vinfos[4].maxsolutions = _nj4; |
| 17734 | vinfos[5].jointtype = 1; |
| 17735 | vinfos[5].foffset = j5; |
| 17736 | vinfos[5].indices[0] = _ij5[0]; |
| 17737 | vinfos[5].indices[1] = _ij5[1]; |
| 17738 | vinfos[5].maxsolutions = _nj5; |
| 17739 | std::vector<int> vfree(0); |
| 17740 | solutions.AddSolution(vinfos,vfree); |
| 17741 | } |
| 17742 | } |
| 17743 | } |
| 17744 | |
| 17745 | } |
| 17746 | |
| 17747 | } |
| 17748 | |
| 17749 | } else |
| 17750 | { |
| 17751 | { |
| 17752 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 17753 | bool j5valid[1]={false}; |
| 17754 | _nj5 = 1; |
| 17755 | IkReal x1975=((1.0)*new_r00); |
| 17756 | CheckValue<IkReal> x1976 = IKatan2WithCheck(IkReal((((gconst25*new_r10))+((gconst24*new_r11)))),IkReal(((((-1.0)*gconst24*new_r01))+(((-1.0)*gconst25*x1975)))),IKFAST_ATAN2_MAGTHRESH); |
| 17757 | if(!x1976.valid){ |
| 17758 | continue; |
| 17759 | } |
| 17760 | CheckValue<IkReal> x1977=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r11*x1975))+((new_r01*new_r10)))),-1); |
| 17761 | if(!x1977.valid){ |
| 17762 | continue; |
| 17763 | } |
| 17764 | j5array[0]=((-1.5707963267949)+(x1976.value)+(((1.5707963267949)*(x1977.value)))); |
| 17765 | sj5array[0]=IKsin(j5array[0]); |
| 17766 | cj5array[0]=IKcos(j5array[0]); |
| 17767 | if( j5array[0] > IKPI ) |
| 17768 | { |
| 17769 | j5array[0]-=IK2PI; |
| 17770 | } |
| 17771 | else if( j5array[0] < -IKPI ) |
| 17772 | { j5array[0]+=IK2PI; |
| 17773 | } |
| 17774 | j5valid[0] = true; |
| 17775 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 17776 | { |
| 17777 | if( !j5valid[ij5] ) |
| 17778 | { |
| 17779 | continue; |
| 17780 | } |
| 17781 | _ij5[0] = ij5; _ij5[1] = -1; |
| 17782 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 17783 | { |
| 17784 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 17785 | { |
| 17786 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 17787 | } |
| 17788 | } |
| 17789 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 17790 | { |
| 17791 | IkReal evalcond[10]; |
| 17792 | IkReal x1978=IKcos(j5); |
| 17793 | IkReal x1979=IKsin(j5); |
| 17794 | IkReal x1980=((1.0)*gconst25); |
| 17795 | IkReal x1981=((1.0000000008)*gconst25); |
| 17796 | IkReal x1982=((1.0000000008)*gconst24); |
| 17797 | IkReal x1983=(new_r11*x1979); |
| 17798 | IkReal x1984=(new_r01*x1978); |
| 17799 | IkReal x1985=(new_r00*x1978); |
| 17800 | IkReal x1986=(new_r10*x1979); |
| 17801 | evalcond[0]=(((new_r10*x1978))+((new_r00*x1979))+gconst24); |
| 17802 | evalcond[1]=(((new_r01*x1979))+((new_r11*x1978))+(((-1.0)*x1980))); |
| 17803 | evalcond[2]=(((gconst24*x1979))+((x1978*x1981))+new_r00); |
| 17804 | evalcond[3]=(((gconst24*x1978))+(((-1.0)*x1979*x1981))+new_r10); |
| 17805 | evalcond[4]=((((-1.0)*x1979*x1980))+((x1978*x1982))+new_r01); |
| 17806 | evalcond[5]=((((-1.0)*x1979*x1982))+new_r11+(((-1.0)*x1978*x1980))); |
| 17807 | evalcond[6]=(x1985+x1981+(((-1.0)*x1986))); |
| 17808 | evalcond[7]=(x1984+x1982+(((-1.0)*x1983))); |
| 17809 | evalcond[8]=((((1.0000000008)*x1986))+(((-1.0)*x1980))+(((-1.0000000008)*x1985))); |
| 17810 | evalcond[9]=((((1.0000000008)*x1983))+(((-1.0000000008)*x1984))+(((-1.0)*gconst24))); |
| 17811 | if( 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 ) |
| 17812 | { |
| 17813 | continue; |
| 17814 | } |
| 17815 | } |
| 17816 | |
| 17817 | { |
| 17818 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 17819 | vinfos[0].jointtype = 1; |
| 17820 | vinfos[0].foffset = j0; |
| 17821 | vinfos[0].indices[0] = _ij0[0]; |
| 17822 | vinfos[0].indices[1] = _ij0[1]; |
| 17823 | vinfos[0].maxsolutions = _nj0; |
| 17824 | vinfos[1].jointtype = 1; |
| 17825 | vinfos[1].foffset = j1; |
| 17826 | vinfos[1].indices[0] = _ij1[0]; |
| 17827 | vinfos[1].indices[1] = _ij1[1]; |
| 17828 | vinfos[1].maxsolutions = _nj1; |
| 17829 | vinfos[2].jointtype = 1; |
| 17830 | vinfos[2].foffset = j2; |
| 17831 | vinfos[2].indices[0] = _ij2[0]; |
| 17832 | vinfos[2].indices[1] = _ij2[1]; |
| 17833 | vinfos[2].maxsolutions = _nj2; |
| 17834 | vinfos[3].jointtype = 1; |
| 17835 | vinfos[3].foffset = j3; |
| 17836 | vinfos[3].indices[0] = _ij3[0]; |
| 17837 | vinfos[3].indices[1] = _ij3[1]; |
| 17838 | vinfos[3].maxsolutions = _nj3; |
| 17839 | vinfos[4].jointtype = 1; |
| 17840 | vinfos[4].foffset = j4; |
| 17841 | vinfos[4].indices[0] = _ij4[0]; |
| 17842 | vinfos[4].indices[1] = _ij4[1]; |
| 17843 | vinfos[4].maxsolutions = _nj4; |
| 17844 | vinfos[5].jointtype = 1; |
| 17845 | vinfos[5].foffset = j5; |
| 17846 | vinfos[5].indices[0] = _ij5[0]; |
| 17847 | vinfos[5].indices[1] = _ij5[1]; |
| 17848 | vinfos[5].maxsolutions = _nj5; |
| 17849 | std::vector<int> vfree(0); |
| 17850 | solutions.AddSolution(vinfos,vfree); |
| 17851 | } |
| 17852 | } |
| 17853 | } |
| 17854 | |
| 17855 | } |
| 17856 | |
| 17857 | } |
| 17858 | |
| 17859 | } |
| 17860 | } while(0); |
| 17861 | if( bgotonextstatement ) |
| 17862 | { |
| 17863 | bool bgotonextstatement = true; |
| 17864 | do |
| 17865 | { |
| 17866 | IkReal x1987=((1.0000000008)*new_r00); |
| 17867 | IkReal x1989 = ((((1.0000000016)*(new_r00*new_r00)))+(new_r10*new_r10)); |
| 17868 | if(IKabs(x1989)==0){ |
| 17869 | continue; |
| 17870 | } |
| 17871 | IkReal x1988=pow(x1989,-0.5); |
| 17872 | CheckValue<IkReal> x1990 = IKatan2WithCheck(IkReal(new_r10),IkReal(x1987),IKFAST_ATAN2_MAGTHRESH); |
| 17873 | if(!x1990.valid){ |
| 17874 | continue; |
| 17875 | } |
| 17876 | IkReal gconst26=((-1.0)*(x1990.value)); |
| 17877 | IkReal gconst27=((-1.0)*new_r10*x1988); |
| 17878 | IkReal gconst28=(x1987*x1988); |
| 17879 | CheckValue<IkReal> x1991 = IKatan2WithCheck(IkReal(new_r10),IkReal(((1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 17880 | if(!x1991.valid){ |
| 17881 | continue; |
| 17882 | } |
| 17883 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((x1991.value)+j3)))), 6.28318530717959))); |
| 17884 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 17885 | { |
| 17886 | bgotonextstatement=false; |
| 17887 | { |
| 17888 | IkReal j5eval[3]; |
| 17889 | IkReal x1992=((1.0000000008)*new_r00); |
| 17890 | IkReal x1993=x1988; |
| 17891 | sj4=-4.0e-5; |
| 17892 | cj4=-1.0; |
| 17893 | j4=3.14163265; |
| 17894 | sj3=gconst27; |
| 17895 | cj3=gconst28; |
| 17896 | CheckValue<IkReal> x1994 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 17897 | if(!x1994.valid){ |
| 17898 | continue; |
| 17899 | } |
| 17900 | j3=((-1.0)*(x1994.value)); |
| 17901 | CheckValue<IkReal> x1995 = IKatan2WithCheck(IkReal(new_r10),IkReal(x1992),IKFAST_ATAN2_MAGTHRESH); |
| 17902 | if(!x1995.valid){ |
| 17903 | continue; |
| 17904 | } |
| 17905 | IkReal gconst26=((-1.0)*(x1995.value)); |
| 17906 | IkReal gconst27=((-1.0)*new_r10*x1993); |
| 17907 | IkReal gconst28=(x1992*x1993); |
| 17908 | IkReal x1996=new_r00*new_r00; |
| 17909 | IkReal x1997=(new_r01*new_r10); |
| 17910 | IkReal x1998=(x1997+(((-1.0)*new_r00*new_r11))); |
| 17911 | IkReal x2001 = ((((625000000.0)*(new_r10*new_r10)))+(((625000001.0)*x1996))); |
| 17912 | if(IKabs(x2001)==0){ |
| 17913 | continue; |
| 17914 | } |
| 17915 | IkReal x1999=pow(x2001,-0.5); |
| 17916 | IkReal x2000=(new_r10*x1999); |
| 17917 | j5eval[0]=x1998; |
| 17918 | j5eval[1]=IKsign(x1998); |
| 17919 | j5eval[2]=((IKabs(((((25000.00002)*new_r00*x2000))+(((-25000.0)*new_r11*x2000)))))+(IKabs(((((25000.0)*x1997*x1999))+(((-25000.00002)*x1996*x1999)))))); |
| 17920 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 17921 | { |
| 17922 | { |
| 17923 | IkReal j5eval[1]; |
| 17924 | IkReal x2002=((1.0000000008)*new_r00); |
| 17925 | IkReal x2003=x1988; |
| 17926 | sj4=-4.0e-5; |
| 17927 | cj4=-1.0; |
| 17928 | j4=3.14163265; |
| 17929 | sj3=gconst27; |
| 17930 | cj3=gconst28; |
| 17931 | CheckValue<IkReal> x2004 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 17932 | if(!x2004.valid){ |
| 17933 | continue; |
| 17934 | } |
| 17935 | j3=((-1.0)*(x2004.value)); |
| 17936 | CheckValue<IkReal> x2005 = IKatan2WithCheck(IkReal(new_r10),IkReal(x2002),IKFAST_ATAN2_MAGTHRESH); |
| 17937 | if(!x2005.valid){ |
| 17938 | continue; |
| 17939 | } |
| 17940 | IkReal gconst26=((-1.0)*(x2005.value)); |
| 17941 | IkReal gconst27=((-1.0)*new_r10*x2003); |
| 17942 | IkReal gconst28=(x2002*x2003); |
| 17943 | j5eval[0]=new_r00; |
| 17944 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 17945 | { |
| 17946 | { |
| 17947 | IkReal j5eval[2]; |
| 17948 | IkReal x2006=((1.0000000008)*new_r00); |
| 17949 | IkReal x2007=x1988; |
| 17950 | sj4=-4.0e-5; |
| 17951 | cj4=-1.0; |
| 17952 | j4=3.14163265; |
| 17953 | sj3=gconst27; |
| 17954 | cj3=gconst28; |
| 17955 | CheckValue<IkReal> x2008 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 17956 | if(!x2008.valid){ |
| 17957 | continue; |
| 17958 | } |
| 17959 | j3=((-1.0)*(x2008.value)); |
| 17960 | CheckValue<IkReal> x2009 = IKatan2WithCheck(IkReal(new_r10),IkReal(x2006),IKFAST_ATAN2_MAGTHRESH); |
| 17961 | if(!x2009.valid){ |
| 17962 | continue; |
| 17963 | } |
| 17964 | IkReal gconst26=((-1.0)*(x2009.value)); |
| 17965 | IkReal gconst27=((-1.0)*new_r10*x2007); |
| 17966 | IkReal gconst28=(x2006*x2007); |
| 17967 | j5eval[0]=new_r00; |
| 17968 | IkReal x2010 = ((((1.0000000016)*(new_r00*new_r00)))+(new_r10*new_r10)); |
| 17969 | if(IKabs(x2010)==0){ |
| 17970 | continue; |
| 17971 | } |
| 17972 | j5eval[1]=((1.6e-9)*new_r00*new_r10*(pow(x2010,-0.5))); |
| 17973 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 17974 | { |
| 17975 | { |
| 17976 | IkReal evalcond[1]; |
| 17977 | bool bgotonextstatement = true; |
| 17978 | do |
| 17979 | { |
| 17980 | evalcond[0]=IKabs(new_r00); |
| 17981 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 17982 | { |
| 17983 | bgotonextstatement=false; |
| 17984 | { |
| 17985 | IkReal j5eval[1]; |
| 17986 | CheckValue<IkReal> x2012 = IKatan2WithCheck(IkReal(new_r10),IkReal(0),IKFAST_ATAN2_MAGTHRESH); |
| 17987 | if(!x2012.valid){ |
| 17988 | continue; |
| 17989 | } |
| 17990 | IkReal x2011=((-1.0)*(x2012.value)); |
| 17991 | sj4=-4.0e-5; |
| 17992 | cj4=-1.0; |
| 17993 | j4=3.14163265; |
| 17994 | sj3=gconst27; |
| 17995 | cj3=gconst28; |
| 17996 | j3=x2011; |
| 17997 | new_r00=0; |
| 17998 | IkReal gconst26=x2011; |
| 17999 | IkReal x2013 = new_r10*new_r10; |
| 18000 | if(IKabs(x2013)==0){ |
| 18001 | continue; |
| 18002 | } |
| 18003 | IkReal gconst27=((-1.0)*new_r10*(pow(x2013,-0.5))); |
| 18004 | IkReal gconst28=0; |
| 18005 | j5eval[0]=new_r10; |
| 18006 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 18007 | { |
| 18008 | { |
| 18009 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 18010 | bool j5valid[1]={false}; |
| 18011 | _nj5 = 1; |
| 18012 | CheckValue<IkReal> x2015=IKPowWithIntegerCheck(gconst27,-1); |
| 18013 | if(!x2015.valid){ |
| 18014 | continue; |
| 18015 | } |
| 18016 | IkReal x2014=x2015.value; |
| 18017 | if( IKabs(((0.9999999992)*new_r11*x2014)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r10*x2014)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*new_r11*x2014))+IKsqr(((-1.0)*new_r10*x2014))-1) <= IKFAST_SINCOS_THRESH ) |
| 18018 | continue; |
| 18019 | j5array[0]=IKatan2(((0.9999999992)*new_r11*x2014), ((-1.0)*new_r10*x2014)); |
| 18020 | sj5array[0]=IKsin(j5array[0]); |
| 18021 | cj5array[0]=IKcos(j5array[0]); |
| 18022 | if( j5array[0] > IKPI ) |
| 18023 | { |
| 18024 | j5array[0]-=IK2PI; |
| 18025 | } |
| 18026 | else if( j5array[0] < -IKPI ) |
| 18027 | { j5array[0]+=IK2PI; |
| 18028 | } |
| 18029 | j5valid[0] = true; |
| 18030 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 18031 | { |
| 18032 | if( !j5valid[ij5] ) |
| 18033 | { |
| 18034 | continue; |
| 18035 | } |
| 18036 | _ij5[0] = ij5; _ij5[1] = -1; |
| 18037 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 18038 | { |
| 18039 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 18040 | { |
| 18041 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 18042 | } |
| 18043 | } |
| 18044 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 18045 | { |
| 18046 | IkReal evalcond[10]; |
| 18047 | IkReal x2016=IKsin(j5); |
| 18048 | IkReal x2017=IKcos(j5); |
| 18049 | IkReal x2018=((1.0000000008)*x2016); |
| 18050 | IkReal x2019=(gconst27*x2017); |
| 18051 | IkReal x2020=(new_r01*x2017); |
| 18052 | evalcond[0]=(gconst27*x2016); |
| 18053 | evalcond[1]=((-1.0)*new_r10*x2016); |
| 18054 | evalcond[2]=(gconst27+((new_r10*x2017))); |
| 18055 | evalcond[3]=(x2019+new_r10); |
| 18056 | evalcond[4]=(new_r10*x2018); |
| 18057 | evalcond[5]=(((new_r11*x2017))+((new_r01*x2016))); |
| 18058 | evalcond[6]=((((1.0000000008)*x2019))+new_r01); |
| 18059 | evalcond[7]=(new_r11+(((-1.0)*gconst27*x2018))); |
| 18060 | evalcond[8]=(x2020+(((1.0000000008)*gconst27))+(((-1.0)*new_r11*x2016))); |
| 18061 | evalcond[9]=(((new_r11*x2018))+(((-1.0000000008)*x2020))+(((-1.0)*gconst27))); |
| 18062 | if( 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 ) |
| 18063 | { |
| 18064 | continue; |
| 18065 | } |
| 18066 | } |
| 18067 | |
| 18068 | { |
| 18069 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 18070 | vinfos[0].jointtype = 1; |
| 18071 | vinfos[0].foffset = j0; |
| 18072 | vinfos[0].indices[0] = _ij0[0]; |
| 18073 | vinfos[0].indices[1] = _ij0[1]; |
| 18074 | vinfos[0].maxsolutions = _nj0; |
| 18075 | vinfos[1].jointtype = 1; |
| 18076 | vinfos[1].foffset = j1; |
| 18077 | vinfos[1].indices[0] = _ij1[0]; |
| 18078 | vinfos[1].indices[1] = _ij1[1]; |
| 18079 | vinfos[1].maxsolutions = _nj1; |
| 18080 | vinfos[2].jointtype = 1; |
| 18081 | vinfos[2].foffset = j2; |
| 18082 | vinfos[2].indices[0] = _ij2[0]; |
| 18083 | vinfos[2].indices[1] = _ij2[1]; |
| 18084 | vinfos[2].maxsolutions = _nj2; |
| 18085 | vinfos[3].jointtype = 1; |
| 18086 | vinfos[3].foffset = j3; |
| 18087 | vinfos[3].indices[0] = _ij3[0]; |
| 18088 | vinfos[3].indices[1] = _ij3[1]; |
| 18089 | vinfos[3].maxsolutions = _nj3; |
| 18090 | vinfos[4].jointtype = 1; |
| 18091 | vinfos[4].foffset = j4; |
| 18092 | vinfos[4].indices[0] = _ij4[0]; |
| 18093 | vinfos[4].indices[1] = _ij4[1]; |
| 18094 | vinfos[4].maxsolutions = _nj4; |
| 18095 | vinfos[5].jointtype = 1; |
| 18096 | vinfos[5].foffset = j5; |
| 18097 | vinfos[5].indices[0] = _ij5[0]; |
| 18098 | vinfos[5].indices[1] = _ij5[1]; |
| 18099 | vinfos[5].maxsolutions = _nj5; |
| 18100 | std::vector<int> vfree(0); |
| 18101 | solutions.AddSolution(vinfos,vfree); |
| 18102 | } |
| 18103 | } |
| 18104 | } |
| 18105 | |
| 18106 | } else |
| 18107 | { |
| 18108 | { |
| 18109 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 18110 | bool j5valid[1]={false}; |
| 18111 | _nj5 = 1; |
| 18112 | CheckValue<IkReal> x2021=IKPowWithIntegerCheck(gconst27,-1); |
| 18113 | if(!x2021.valid){ |
| 18114 | continue; |
| 18115 | } |
| 18116 | CheckValue<IkReal> x2022=IKPowWithIntegerCheck(new_r10,-1); |
| 18117 | if(!x2022.valid){ |
| 18118 | continue; |
| 18119 | } |
| 18120 | if( IKabs(((0.9999999992)*new_r11*(x2021.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*gconst27*(x2022.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*new_r11*(x2021.value)))+IKsqr(((-1.0)*gconst27*(x2022.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 18121 | continue; |
| 18122 | j5array[0]=IKatan2(((0.9999999992)*new_r11*(x2021.value)), ((-1.0)*gconst27*(x2022.value))); |
| 18123 | sj5array[0]=IKsin(j5array[0]); |
| 18124 | cj5array[0]=IKcos(j5array[0]); |
| 18125 | if( j5array[0] > IKPI ) |
| 18126 | { |
| 18127 | j5array[0]-=IK2PI; |
| 18128 | } |
| 18129 | else if( j5array[0] < -IKPI ) |
| 18130 | { j5array[0]+=IK2PI; |
| 18131 | } |
| 18132 | j5valid[0] = true; |
| 18133 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 18134 | { |
| 18135 | if( !j5valid[ij5] ) |
| 18136 | { |
| 18137 | continue; |
| 18138 | } |
| 18139 | _ij5[0] = ij5; _ij5[1] = -1; |
| 18140 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 18141 | { |
| 18142 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 18143 | { |
| 18144 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 18145 | } |
| 18146 | } |
| 18147 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 18148 | { |
| 18149 | IkReal evalcond[10]; |
| 18150 | IkReal x2023=IKsin(j5); |
| 18151 | IkReal x2024=IKcos(j5); |
| 18152 | IkReal x2025=((1.0000000008)*x2023); |
| 18153 | IkReal x2026=(gconst27*x2024); |
| 18154 | IkReal x2027=(new_r01*x2024); |
| 18155 | evalcond[0]=(gconst27*x2023); |
| 18156 | evalcond[1]=((-1.0)*new_r10*x2023); |
| 18157 | evalcond[2]=(((new_r10*x2024))+gconst27); |
| 18158 | evalcond[3]=(x2026+new_r10); |
| 18159 | evalcond[4]=(new_r10*x2025); |
| 18160 | evalcond[5]=(((new_r01*x2023))+((new_r11*x2024))); |
| 18161 | evalcond[6]=((((1.0000000008)*x2026))+new_r01); |
| 18162 | evalcond[7]=((((-1.0)*gconst27*x2025))+new_r11); |
| 18163 | evalcond[8]=(x2027+(((1.0000000008)*gconst27))+(((-1.0)*new_r11*x2023))); |
| 18164 | evalcond[9]=((((-1.0000000008)*x2027))+((new_r11*x2025))+(((-1.0)*gconst27))); |
| 18165 | if( 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 ) |
| 18166 | { |
| 18167 | continue; |
| 18168 | } |
| 18169 | } |
| 18170 | |
| 18171 | { |
| 18172 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 18173 | vinfos[0].jointtype = 1; |
| 18174 | vinfos[0].foffset = j0; |
| 18175 | vinfos[0].indices[0] = _ij0[0]; |
| 18176 | vinfos[0].indices[1] = _ij0[1]; |
| 18177 | vinfos[0].maxsolutions = _nj0; |
| 18178 | vinfos[1].jointtype = 1; |
| 18179 | vinfos[1].foffset = j1; |
| 18180 | vinfos[1].indices[0] = _ij1[0]; |
| 18181 | vinfos[1].indices[1] = _ij1[1]; |
| 18182 | vinfos[1].maxsolutions = _nj1; |
| 18183 | vinfos[2].jointtype = 1; |
| 18184 | vinfos[2].foffset = j2; |
| 18185 | vinfos[2].indices[0] = _ij2[0]; |
| 18186 | vinfos[2].indices[1] = _ij2[1]; |
| 18187 | vinfos[2].maxsolutions = _nj2; |
| 18188 | vinfos[3].jointtype = 1; |
| 18189 | vinfos[3].foffset = j3; |
| 18190 | vinfos[3].indices[0] = _ij3[0]; |
| 18191 | vinfos[3].indices[1] = _ij3[1]; |
| 18192 | vinfos[3].maxsolutions = _nj3; |
| 18193 | vinfos[4].jointtype = 1; |
| 18194 | vinfos[4].foffset = j4; |
| 18195 | vinfos[4].indices[0] = _ij4[0]; |
| 18196 | vinfos[4].indices[1] = _ij4[1]; |
| 18197 | vinfos[4].maxsolutions = _nj4; |
| 18198 | vinfos[5].jointtype = 1; |
| 18199 | vinfos[5].foffset = j5; |
| 18200 | vinfos[5].indices[0] = _ij5[0]; |
| 18201 | vinfos[5].indices[1] = _ij5[1]; |
| 18202 | vinfos[5].maxsolutions = _nj5; |
| 18203 | std::vector<int> vfree(0); |
| 18204 | solutions.AddSolution(vinfos,vfree); |
| 18205 | } |
| 18206 | } |
| 18207 | } |
| 18208 | |
| 18209 | } |
| 18210 | |
| 18211 | } |
| 18212 | |
| 18213 | } |
| 18214 | } while(0); |
| 18215 | if( bgotonextstatement ) |
| 18216 | { |
| 18217 | bool bgotonextstatement = true; |
| 18218 | do |
| 18219 | { |
| 18220 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 18221 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 18222 | { |
| 18223 | bgotonextstatement=false; |
| 18224 | { |
| 18225 | IkReal j5eval[3]; |
| 18226 | IkReal x2028=((1.0000000008)*new_r00); |
| 18227 | IkReal x2030 = ((1.0000000016)+(((-1.6e-9)*(new_r10*new_r10)))); |
| 18228 | if(IKabs(x2030)==0){ |
| 18229 | continue; |
| 18230 | } |
| 18231 | IkReal x2029=pow(x2030,-0.5); |
| 18232 | sj4=-4.0e-5; |
| 18233 | cj4=-1.0; |
| 18234 | j4=3.14163265; |
| 18235 | sj3=gconst27; |
| 18236 | cj3=gconst28; |
| 18237 | CheckValue<IkReal> x2031 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 18238 | if(!x2031.valid){ |
| 18239 | continue; |
| 18240 | } |
| 18241 | j3=((-1.0)*(x2031.value)); |
| 18242 | new_r11=0; |
| 18243 | new_r01=0; |
| 18244 | new_r22=0; |
| 18245 | new_r20=0; |
| 18246 | CheckValue<IkReal> x2032 = IKatan2WithCheck(IkReal(new_r10),IkReal(x2028),IKFAST_ATAN2_MAGTHRESH); |
| 18247 | if(!x2032.valid){ |
| 18248 | continue; |
| 18249 | } |
| 18250 | IkReal gconst26=((-1.0)*(x2032.value)); |
| 18251 | IkReal gconst27=((-1.0)*new_r10*x2029); |
| 18252 | IkReal gconst28=(x2028*x2029); |
| 18253 | IkReal x2033=new_r10*new_r10; |
| 18254 | CheckValue<IkReal> x2037=IKPowWithIntegerCheck(((-625000001.0)+x2033),-1); |
| 18255 | if(!x2037.valid){ |
| 18256 | continue; |
| 18257 | } |
| 18258 | IkReal x2034=x2037.value; |
| 18259 | if((((625000001.0)+(((-1.0)*x2033)))) < -0.00001) |
| 18260 | continue; |
| 18261 | IkReal x2035=IKsqrt(((625000001.0)+(((-1.0)*x2033)))); |
| 18262 | IkReal x2036=(x2034*x2035); |
| 18263 | j5eval[0]=1.0; |
| 18264 | j5eval[1]=1.0; |
| 18265 | IkReal x2038 = ((1.0000000016)+(((-1.6e-9)*x2033))); |
| 18266 | if(IKabs(x2038)==0){ |
| 18267 | continue; |
| 18268 | } |
| 18269 | j5eval[2]=((((50000.00004)*(IKabs((new_r00*new_r10*(pow(x2038,-0.5)))))))+(IKabs(((((-1250000001.0)*x2033*x2036))+(((625000001.0)*x2036)))))); |
| 18270 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 18271 | { |
| 18272 | { |
| 18273 | IkReal j5eval[1]; |
| 18274 | IkReal x2039=((1.0000000008)*new_r00); |
| 18275 | IkReal x2041 = ((1.0000000016)+(((-1.6e-9)*(new_r10*new_r10)))); |
| 18276 | if(IKabs(x2041)==0){ |
| 18277 | continue; |
| 18278 | } |
| 18279 | IkReal x2040=pow(x2041,-0.5); |
| 18280 | sj4=-4.0e-5; |
| 18281 | cj4=-1.0; |
| 18282 | j4=3.14163265; |
| 18283 | sj3=gconst27; |
| 18284 | cj3=gconst28; |
| 18285 | CheckValue<IkReal> x2042 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 18286 | if(!x2042.valid){ |
| 18287 | continue; |
| 18288 | } |
| 18289 | j3=((-1.0)*(x2042.value)); |
| 18290 | new_r11=0; |
| 18291 | new_r01=0; |
| 18292 | new_r22=0; |
| 18293 | new_r20=0; |
| 18294 | CheckValue<IkReal> x2043 = IKatan2WithCheck(IkReal(new_r10),IkReal(x2039),IKFAST_ATAN2_MAGTHRESH); |
| 18295 | if(!x2043.valid){ |
| 18296 | continue; |
| 18297 | } |
| 18298 | IkReal gconst26=((-1.0)*(x2043.value)); |
| 18299 | IkReal gconst27=((-1.0)*new_r10*x2040); |
| 18300 | IkReal gconst28=(x2039*x2040); |
| 18301 | IkReal x2044=new_r10*new_r10; |
| 18302 | CheckValue<IkReal> x2047=IKPowWithIntegerCheck(((1.0000000016)+(((-1.6e-9)*x2044))),-1); |
| 18303 | if(!x2047.valid){ |
| 18304 | continue; |
| 18305 | } |
| 18306 | IkReal x2045=x2047.value; |
| 18307 | IkReal x2046=((625000001.0)*x2045); |
| 18308 | IkReal x2048=((1.0)+(((-1.0)*x2044))); |
| 18309 | j5eval[0]=IKsign((((x2046*(x2044*x2044)))+(((-1.0)*x2046*(x2048*x2048))))); |
| 18310 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 18311 | { |
| 18312 | { |
| 18313 | IkReal j5eval[1]; |
| 18314 | IkReal x2049=((1.0000000008)*new_r00); |
| 18315 | IkReal x2051 = ((1.0000000016)+(((-1.6e-9)*(new_r10*new_r10)))); |
| 18316 | if(IKabs(x2051)==0){ |
| 18317 | continue; |
| 18318 | } |
| 18319 | IkReal x2050=pow(x2051,-0.5); |
| 18320 | sj4=-4.0e-5; |
| 18321 | cj4=-1.0; |
| 18322 | j4=3.14163265; |
| 18323 | sj3=gconst27; |
| 18324 | cj3=gconst28; |
| 18325 | CheckValue<IkReal> x2052 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 18326 | if(!x2052.valid){ |
| 18327 | continue; |
| 18328 | } |
| 18329 | j3=((-1.0)*(x2052.value)); |
| 18330 | new_r11=0; |
| 18331 | new_r01=0; |
| 18332 | new_r22=0; |
| 18333 | new_r20=0; |
| 18334 | CheckValue<IkReal> x2053 = IKatan2WithCheck(IkReal(new_r10),IkReal(x2049),IKFAST_ATAN2_MAGTHRESH); |
| 18335 | if(!x2053.valid){ |
| 18336 | continue; |
| 18337 | } |
| 18338 | IkReal gconst26=((-1.0)*(x2053.value)); |
| 18339 | IkReal gconst27=((-1.0)*new_r10*x2050); |
| 18340 | IkReal gconst28=(x2049*x2050); |
| 18341 | j5eval[0]=new_r00; |
| 18342 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 18343 | { |
| 18344 | continue; // 3 cases reached |
| 18345 | |
| 18346 | } else |
| 18347 | { |
| 18348 | { |
| 18349 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 18350 | bool j5valid[1]={false}; |
| 18351 | _nj5 = 1; |
| 18352 | CheckValue<IkReal> x2060=IKPowWithIntegerCheck(new_r00,-1); |
| 18353 | if(!x2060.valid){ |
| 18354 | continue; |
| 18355 | } |
| 18356 | IkReal x2054=x2060.value; |
| 18357 | IkReal x2055=gconst27*gconst27; |
| 18358 | IkReal x2056=((25000.0)*new_r10); |
| 18359 | IkReal x2057=((25000.0)*x2055); |
| 18360 | CheckValue<IkReal> x2061=IKPowWithIntegerCheck(((((-1.0)*gconst27*x2056))+(((25000.00002)*gconst28*new_r00))),-1); |
| 18361 | if(!x2061.valid){ |
| 18362 | continue; |
| 18363 | } |
| 18364 | IkReal x2058=x2061.value; |
| 18365 | IkReal x2059=(new_r10*x2058); |
| 18366 | CheckValue<IkReal> x2062=IKPowWithIntegerCheck(((((-25000.0)*gconst27*new_r10))+(((25000.00002)*gconst28*new_r00))),-1); |
| 18367 | if(!x2062.valid){ |
| 18368 | continue; |
| 18369 | } |
| 18370 | CheckValue<IkReal> x2063=IKPowWithIntegerCheck(((((-25000.0)*gconst27*new_r10))+(((25000.00002)*gconst28*new_r00))),-1); |
| 18371 | if(!x2063.valid){ |
| 18372 | continue; |
| 18373 | } |
| 18374 | CheckValue<IkReal> x2064=IKPowWithIntegerCheck(x2054,-2); |
| 18375 | if(!x2064.valid){ |
| 18376 | continue; |
| 18377 | } |
| 18378 | if( IKabs(((((-1.0)*x2054*x2055*x2056*(x2062.value)))+(((-1.0)*gconst27*x2054))+((new_r00*x2056*(x2063.value))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x2058*((x2057+(((-25000.0)*(x2064.value))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*x2054*x2055*x2056*(x2062.value)))+(((-1.0)*gconst27*x2054))+((new_r00*x2056*(x2063.value)))))+IKsqr((x2058*((x2057+(((-25000.0)*(x2064.value)))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 18379 | continue; |
| 18380 | j5array[0]=IKatan2(((((-1.0)*x2054*x2055*x2056*(x2062.value)))+(((-1.0)*gconst27*x2054))+((new_r00*x2056*(x2063.value)))), (x2058*((x2057+(((-25000.0)*(x2064.value))))))); |
| 18381 | sj5array[0]=IKsin(j5array[0]); |
| 18382 | cj5array[0]=IKcos(j5array[0]); |
| 18383 | if( j5array[0] > IKPI ) |
| 18384 | { |
| 18385 | j5array[0]-=IK2PI; |
| 18386 | } |
| 18387 | else if( j5array[0] < -IKPI ) |
| 18388 | { j5array[0]+=IK2PI; |
| 18389 | } |
| 18390 | j5valid[0] = true; |
| 18391 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 18392 | { |
| 18393 | if( !j5valid[ij5] ) |
| 18394 | { |
| 18395 | continue; |
| 18396 | } |
| 18397 | _ij5[0] = ij5; _ij5[1] = -1; |
| 18398 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 18399 | { |
| 18400 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 18401 | { |
| 18402 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 18403 | } |
| 18404 | } |
| 18405 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 18406 | { |
| 18407 | IkReal evalcond[7]; |
| 18408 | IkReal x2065=IKcos(j5); |
| 18409 | IkReal x2066=IKsin(j5); |
| 18410 | IkReal x2067=((1.0000000008)*gconst28); |
| 18411 | IkReal x2068=((1.0)*gconst28); |
| 18412 | IkReal x2069=((1.0000000008)*x2066); |
| 18413 | IkReal x2070=(gconst27*x2065); |
| 18414 | IkReal x2071=(new_r00*x2065); |
| 18415 | evalcond[0]=(gconst27+((new_r10*x2065))+((new_r00*x2066))); |
| 18416 | evalcond[1]=(((gconst27*x2066))+new_r00+((x2065*x2067))); |
| 18417 | evalcond[2]=(x2070+new_r10+(((-1.0)*x2066*x2067))); |
| 18418 | evalcond[3]=((((1.0000000008)*x2070))+(((-1.0)*x2066*x2068))); |
| 18419 | evalcond[4]=((((-1.0)*gconst27*x2069))+(((-1.0)*x2065*x2068))); |
| 18420 | evalcond[5]=(x2067+x2071+(((-1.0)*new_r10*x2066))); |
| 18421 | evalcond[6]=((((-1.0000000008)*x2071))+(((-1.0)*x2068))+((new_r10*x2069))); |
| 18422 | if( 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 ) |
| 18423 | { |
| 18424 | continue; |
| 18425 | } |
| 18426 | } |
| 18427 | |
| 18428 | { |
| 18429 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 18430 | vinfos[0].jointtype = 1; |
| 18431 | vinfos[0].foffset = j0; |
| 18432 | vinfos[0].indices[0] = _ij0[0]; |
| 18433 | vinfos[0].indices[1] = _ij0[1]; |
| 18434 | vinfos[0].maxsolutions = _nj0; |
| 18435 | vinfos[1].jointtype = 1; |
| 18436 | vinfos[1].foffset = j1; |
| 18437 | vinfos[1].indices[0] = _ij1[0]; |
| 18438 | vinfos[1].indices[1] = _ij1[1]; |
| 18439 | vinfos[1].maxsolutions = _nj1; |
| 18440 | vinfos[2].jointtype = 1; |
| 18441 | vinfos[2].foffset = j2; |
| 18442 | vinfos[2].indices[0] = _ij2[0]; |
| 18443 | vinfos[2].indices[1] = _ij2[1]; |
| 18444 | vinfos[2].maxsolutions = _nj2; |
| 18445 | vinfos[3].jointtype = 1; |
| 18446 | vinfos[3].foffset = j3; |
| 18447 | vinfos[3].indices[0] = _ij3[0]; |
| 18448 | vinfos[3].indices[1] = _ij3[1]; |
| 18449 | vinfos[3].maxsolutions = _nj3; |
| 18450 | vinfos[4].jointtype = 1; |
| 18451 | vinfos[4].foffset = j4; |
| 18452 | vinfos[4].indices[0] = _ij4[0]; |
| 18453 | vinfos[4].indices[1] = _ij4[1]; |
| 18454 | vinfos[4].maxsolutions = _nj4; |
| 18455 | vinfos[5].jointtype = 1; |
| 18456 | vinfos[5].foffset = j5; |
| 18457 | vinfos[5].indices[0] = _ij5[0]; |
| 18458 | vinfos[5].indices[1] = _ij5[1]; |
| 18459 | vinfos[5].maxsolutions = _nj5; |
| 18460 | std::vector<int> vfree(0); |
| 18461 | solutions.AddSolution(vinfos,vfree); |
| 18462 | } |
| 18463 | } |
| 18464 | } |
| 18465 | |
| 18466 | } |
| 18467 | |
| 18468 | } |
| 18469 | |
| 18470 | } else |
| 18471 | { |
| 18472 | { |
| 18473 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 18474 | bool j5valid[1]={false}; |
| 18475 | _nj5 = 1; |
| 18476 | IkReal x2072=gconst27*gconst27; |
| 18477 | IkReal x2073=gconst28*gconst28; |
| 18478 | IkReal x2074=((625000000.0)*x2073); |
| 18479 | IkReal x2075=((625000000.5)*gconst28*x2072); |
| 18480 | CheckValue<IkReal> x2076 = IKatan2WithCheck(IkReal((((gconst27*new_r00*x2074))+((new_r10*x2075)))),IkReal(((((-625000001.0)*new_r10*(gconst27*gconst27*gconst27)))+(((-1.0)*new_r00*x2075)))),IKFAST_ATAN2_MAGTHRESH); |
| 18481 | if(!x2076.valid){ |
| 18482 | continue; |
| 18483 | } |
| 18484 | CheckValue<IkReal> x2077=IKPowWithIntegerCheck(IKsign(((((625000001.0)*x2072*(new_r10*new_r10)))+(((-1.0)*x2074*(new_r00*new_r00))))),-1); |
| 18485 | if(!x2077.valid){ |
| 18486 | continue; |
| 18487 | } |
| 18488 | j5array[0]=((-1.5707963267949)+(x2076.value)+(((1.5707963267949)*(x2077.value)))); |
| 18489 | sj5array[0]=IKsin(j5array[0]); |
| 18490 | cj5array[0]=IKcos(j5array[0]); |
| 18491 | if( j5array[0] > IKPI ) |
| 18492 | { |
| 18493 | j5array[0]-=IK2PI; |
| 18494 | } |
| 18495 | else if( j5array[0] < -IKPI ) |
| 18496 | { j5array[0]+=IK2PI; |
| 18497 | } |
| 18498 | j5valid[0] = true; |
| 18499 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 18500 | { |
| 18501 | if( !j5valid[ij5] ) |
| 18502 | { |
| 18503 | continue; |
| 18504 | } |
| 18505 | _ij5[0] = ij5; _ij5[1] = -1; |
| 18506 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 18507 | { |
| 18508 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 18509 | { |
| 18510 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 18511 | } |
| 18512 | } |
| 18513 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 18514 | { |
| 18515 | IkReal evalcond[7]; |
| 18516 | IkReal x2078=IKcos(j5); |
| 18517 | IkReal x2079=IKsin(j5); |
| 18518 | IkReal x2080=((1.0000000008)*gconst28); |
| 18519 | IkReal x2081=((1.0)*gconst28); |
| 18520 | IkReal x2082=((1.0000000008)*x2079); |
| 18521 | IkReal x2083=(gconst27*x2078); |
| 18522 | IkReal x2084=(new_r00*x2078); |
| 18523 | evalcond[0]=(gconst27+((new_r00*x2079))+((new_r10*x2078))); |
| 18524 | evalcond[1]=(((gconst27*x2079))+((x2078*x2080))+new_r00); |
| 18525 | evalcond[2]=(x2083+(((-1.0)*x2079*x2080))+new_r10); |
| 18526 | evalcond[3]=((((1.0000000008)*x2083))+(((-1.0)*x2079*x2081))); |
| 18527 | evalcond[4]=((((-1.0)*x2078*x2081))+(((-1.0)*gconst27*x2082))); |
| 18528 | evalcond[5]=(x2080+x2084+(((-1.0)*new_r10*x2079))); |
| 18529 | evalcond[6]=((((-1.0000000008)*x2084))+(((-1.0)*x2081))+((new_r10*x2082))); |
| 18530 | if( 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 ) |
| 18531 | { |
| 18532 | continue; |
| 18533 | } |
| 18534 | } |
| 18535 | |
| 18536 | { |
| 18537 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 18538 | vinfos[0].jointtype = 1; |
| 18539 | vinfos[0].foffset = j0; |
| 18540 | vinfos[0].indices[0] = _ij0[0]; |
| 18541 | vinfos[0].indices[1] = _ij0[1]; |
| 18542 | vinfos[0].maxsolutions = _nj0; |
| 18543 | vinfos[1].jointtype = 1; |
| 18544 | vinfos[1].foffset = j1; |
| 18545 | vinfos[1].indices[0] = _ij1[0]; |
| 18546 | vinfos[1].indices[1] = _ij1[1]; |
| 18547 | vinfos[1].maxsolutions = _nj1; |
| 18548 | vinfos[2].jointtype = 1; |
| 18549 | vinfos[2].foffset = j2; |
| 18550 | vinfos[2].indices[0] = _ij2[0]; |
| 18551 | vinfos[2].indices[1] = _ij2[1]; |
| 18552 | vinfos[2].maxsolutions = _nj2; |
| 18553 | vinfos[3].jointtype = 1; |
| 18554 | vinfos[3].foffset = j3; |
| 18555 | vinfos[3].indices[0] = _ij3[0]; |
| 18556 | vinfos[3].indices[1] = _ij3[1]; |
| 18557 | vinfos[3].maxsolutions = _nj3; |
| 18558 | vinfos[4].jointtype = 1; |
| 18559 | vinfos[4].foffset = j4; |
| 18560 | vinfos[4].indices[0] = _ij4[0]; |
| 18561 | vinfos[4].indices[1] = _ij4[1]; |
| 18562 | vinfos[4].maxsolutions = _nj4; |
| 18563 | vinfos[5].jointtype = 1; |
| 18564 | vinfos[5].foffset = j5; |
| 18565 | vinfos[5].indices[0] = _ij5[0]; |
| 18566 | vinfos[5].indices[1] = _ij5[1]; |
| 18567 | vinfos[5].maxsolutions = _nj5; |
| 18568 | std::vector<int> vfree(0); |
| 18569 | solutions.AddSolution(vinfos,vfree); |
| 18570 | } |
| 18571 | } |
| 18572 | } |
| 18573 | |
| 18574 | } |
| 18575 | |
| 18576 | } |
| 18577 | |
| 18578 | } else |
| 18579 | { |
| 18580 | { |
| 18581 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 18582 | bool j5valid[1]={false}; |
| 18583 | _nj5 = 1; |
| 18584 | IkReal x2085=((25000.0)*gconst27); |
| 18585 | IkReal x2086=((25000.00002)*gconst28); |
| 18586 | CheckValue<IkReal> x2087 = IKatan2WithCheck(IkReal((((new_r10*x2086))+(((-1.0)*new_r00*x2085)))),IkReal(((((-1.0)*new_r10*x2085))+(((-1.0)*new_r00*x2086)))),IKFAST_ATAN2_MAGTHRESH); |
| 18587 | if(!x2087.valid){ |
| 18588 | continue; |
| 18589 | } |
| 18590 | CheckValue<IkReal> x2088=IKPowWithIntegerCheck(IKsign(((((25000.0)*(new_r10*new_r10)))+(((25000.0)*(new_r00*new_r00))))),-1); |
| 18591 | if(!x2088.valid){ |
| 18592 | continue; |
| 18593 | } |
| 18594 | j5array[0]=((-1.5707963267949)+(x2087.value)+(((1.5707963267949)*(x2088.value)))); |
| 18595 | sj5array[0]=IKsin(j5array[0]); |
| 18596 | cj5array[0]=IKcos(j5array[0]); |
| 18597 | if( j5array[0] > IKPI ) |
| 18598 | { |
| 18599 | j5array[0]-=IK2PI; |
| 18600 | } |
| 18601 | else if( j5array[0] < -IKPI ) |
| 18602 | { j5array[0]+=IK2PI; |
| 18603 | } |
| 18604 | j5valid[0] = true; |
| 18605 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 18606 | { |
| 18607 | if( !j5valid[ij5] ) |
| 18608 | { |
| 18609 | continue; |
| 18610 | } |
| 18611 | _ij5[0] = ij5; _ij5[1] = -1; |
| 18612 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 18613 | { |
| 18614 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 18615 | { |
| 18616 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 18617 | } |
| 18618 | } |
| 18619 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 18620 | { |
| 18621 | IkReal evalcond[7]; |
| 18622 | IkReal x2089=IKcos(j5); |
| 18623 | IkReal x2090=IKsin(j5); |
| 18624 | IkReal x2091=((1.0000000008)*gconst28); |
| 18625 | IkReal x2092=((1.0)*gconst28); |
| 18626 | IkReal x2093=((1.0000000008)*x2090); |
| 18627 | IkReal x2094=(gconst27*x2089); |
| 18628 | IkReal x2095=(new_r00*x2089); |
| 18629 | evalcond[0]=(gconst27+((new_r00*x2090))+((new_r10*x2089))); |
| 18630 | evalcond[1]=(((gconst27*x2090))+((x2089*x2091))+new_r00); |
| 18631 | evalcond[2]=((((-1.0)*x2090*x2091))+x2094+new_r10); |
| 18632 | evalcond[3]=((((-1.0)*x2090*x2092))+(((1.0000000008)*x2094))); |
| 18633 | evalcond[4]=((((-1.0)*x2089*x2092))+(((-1.0)*gconst27*x2093))); |
| 18634 | evalcond[5]=(x2095+x2091+(((-1.0)*new_r10*x2090))); |
| 18635 | evalcond[6]=((((-1.0)*x2092))+((new_r10*x2093))+(((-1.0000000008)*x2095))); |
| 18636 | if( 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 ) |
| 18637 | { |
| 18638 | continue; |
| 18639 | } |
| 18640 | } |
| 18641 | |
| 18642 | { |
| 18643 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 18644 | vinfos[0].jointtype = 1; |
| 18645 | vinfos[0].foffset = j0; |
| 18646 | vinfos[0].indices[0] = _ij0[0]; |
| 18647 | vinfos[0].indices[1] = _ij0[1]; |
| 18648 | vinfos[0].maxsolutions = _nj0; |
| 18649 | vinfos[1].jointtype = 1; |
| 18650 | vinfos[1].foffset = j1; |
| 18651 | vinfos[1].indices[0] = _ij1[0]; |
| 18652 | vinfos[1].indices[1] = _ij1[1]; |
| 18653 | vinfos[1].maxsolutions = _nj1; |
| 18654 | vinfos[2].jointtype = 1; |
| 18655 | vinfos[2].foffset = j2; |
| 18656 | vinfos[2].indices[0] = _ij2[0]; |
| 18657 | vinfos[2].indices[1] = _ij2[1]; |
| 18658 | vinfos[2].maxsolutions = _nj2; |
| 18659 | vinfos[3].jointtype = 1; |
| 18660 | vinfos[3].foffset = j3; |
| 18661 | vinfos[3].indices[0] = _ij3[0]; |
| 18662 | vinfos[3].indices[1] = _ij3[1]; |
| 18663 | vinfos[3].maxsolutions = _nj3; |
| 18664 | vinfos[4].jointtype = 1; |
| 18665 | vinfos[4].foffset = j4; |
| 18666 | vinfos[4].indices[0] = _ij4[0]; |
| 18667 | vinfos[4].indices[1] = _ij4[1]; |
| 18668 | vinfos[4].maxsolutions = _nj4; |
| 18669 | vinfos[5].jointtype = 1; |
| 18670 | vinfos[5].foffset = j5; |
| 18671 | vinfos[5].indices[0] = _ij5[0]; |
| 18672 | vinfos[5].indices[1] = _ij5[1]; |
| 18673 | vinfos[5].maxsolutions = _nj5; |
| 18674 | std::vector<int> vfree(0); |
| 18675 | solutions.AddSolution(vinfos,vfree); |
| 18676 | } |
| 18677 | } |
| 18678 | } |
| 18679 | |
| 18680 | } |
| 18681 | |
| 18682 | } |
| 18683 | |
| 18684 | } |
| 18685 | } while(0); |
| 18686 | if( bgotonextstatement ) |
| 18687 | { |
| 18688 | bool bgotonextstatement = true; |
| 18689 | do |
| 18690 | { |
| 18691 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r10))); |
| 18692 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 18693 | { |
| 18694 | bgotonextstatement=false; |
| 18695 | { |
| 18696 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 18697 | bool j5valid[1]={false}; |
| 18698 | _nj5 = 1; |
| 18699 | CheckValue<IkReal> x2097=IKPowWithIntegerCheck(gconst28,-1); |
| 18700 | if(!x2097.valid){ |
| 18701 | continue; |
| 18702 | } |
| 18703 | IkReal x2096=x2097.value; |
| 18704 | if( IKabs((new_r01*x2096)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.9999999992)*new_r00*x2096)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((new_r01*x2096))+IKsqr(((-0.9999999992)*new_r00*x2096))-1) <= IKFAST_SINCOS_THRESH ) |
| 18705 | continue; |
| 18706 | j5array[0]=IKatan2((new_r01*x2096), ((-0.9999999992)*new_r00*x2096)); |
| 18707 | sj5array[0]=IKsin(j5array[0]); |
| 18708 | cj5array[0]=IKcos(j5array[0]); |
| 18709 | if( j5array[0] > IKPI ) |
| 18710 | { |
| 18711 | j5array[0]-=IK2PI; |
| 18712 | } |
| 18713 | else if( j5array[0] < -IKPI ) |
| 18714 | { j5array[0]+=IK2PI; |
| 18715 | } |
| 18716 | j5valid[0] = true; |
| 18717 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 18718 | { |
| 18719 | if( !j5valid[ij5] ) |
| 18720 | { |
| 18721 | continue; |
| 18722 | } |
| 18723 | _ij5[0] = ij5; _ij5[1] = -1; |
| 18724 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 18725 | { |
| 18726 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 18727 | { |
| 18728 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 18729 | } |
| 18730 | } |
| 18731 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 18732 | { |
| 18733 | IkReal evalcond[10]; |
| 18734 | IkReal x2098=IKcos(j5); |
| 18735 | IkReal x2099=IKsin(j5); |
| 18736 | IkReal x2100=((1.0)*gconst28); |
| 18737 | IkReal x2101=((1.0000000008)*gconst28); |
| 18738 | IkReal x2102=(new_r00*x2098); |
| 18739 | IkReal x2103=(new_r01*x2098); |
| 18740 | evalcond[0]=(new_r00*x2099); |
| 18741 | evalcond[1]=x2103; |
| 18742 | evalcond[2]=((-1.0)*gconst28*x2098); |
| 18743 | evalcond[3]=((((-1.0)*x2099*x2100))+new_r01); |
| 18744 | evalcond[4]=((((-1.0)*x2100))+((new_r01*x2099))); |
| 18745 | evalcond[5]=((-1.0000000008)*gconst28*x2099); |
| 18746 | evalcond[6]=((-1.0000000008)*x2103); |
| 18747 | evalcond[7]=(((x2098*x2101))+new_r00); |
| 18748 | evalcond[8]=(x2102+x2101); |
| 18749 | evalcond[9]=((((-1.0)*x2100))+(((-1.0000000008)*x2102))); |
| 18750 | if( 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 ) |
| 18751 | { |
| 18752 | continue; |
| 18753 | } |
| 18754 | } |
| 18755 | |
| 18756 | { |
| 18757 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 18758 | vinfos[0].jointtype = 1; |
| 18759 | vinfos[0].foffset = j0; |
| 18760 | vinfos[0].indices[0] = _ij0[0]; |
| 18761 | vinfos[0].indices[1] = _ij0[1]; |
| 18762 | vinfos[0].maxsolutions = _nj0; |
| 18763 | vinfos[1].jointtype = 1; |
| 18764 | vinfos[1].foffset = j1; |
| 18765 | vinfos[1].indices[0] = _ij1[0]; |
| 18766 | vinfos[1].indices[1] = _ij1[1]; |
| 18767 | vinfos[1].maxsolutions = _nj1; |
| 18768 | vinfos[2].jointtype = 1; |
| 18769 | vinfos[2].foffset = j2; |
| 18770 | vinfos[2].indices[0] = _ij2[0]; |
| 18771 | vinfos[2].indices[1] = _ij2[1]; |
| 18772 | vinfos[2].maxsolutions = _nj2; |
| 18773 | vinfos[3].jointtype = 1; |
| 18774 | vinfos[3].foffset = j3; |
| 18775 | vinfos[3].indices[0] = _ij3[0]; |
| 18776 | vinfos[3].indices[1] = _ij3[1]; |
| 18777 | vinfos[3].maxsolutions = _nj3; |
| 18778 | vinfos[4].jointtype = 1; |
| 18779 | vinfos[4].foffset = j4; |
| 18780 | vinfos[4].indices[0] = _ij4[0]; |
| 18781 | vinfos[4].indices[1] = _ij4[1]; |
| 18782 | vinfos[4].maxsolutions = _nj4; |
| 18783 | vinfos[5].jointtype = 1; |
| 18784 | vinfos[5].foffset = j5; |
| 18785 | vinfos[5].indices[0] = _ij5[0]; |
| 18786 | vinfos[5].indices[1] = _ij5[1]; |
| 18787 | vinfos[5].maxsolutions = _nj5; |
| 18788 | std::vector<int> vfree(0); |
| 18789 | solutions.AddSolution(vinfos,vfree); |
| 18790 | } |
| 18791 | } |
| 18792 | } |
| 18793 | |
| 18794 | } |
| 18795 | } while(0); |
| 18796 | if( bgotonextstatement ) |
| 18797 | { |
| 18798 | bool bgotonextstatement = true; |
| 18799 | do |
| 18800 | { |
| 18801 | if( 1 ) |
| 18802 | { |
| 18803 | bgotonextstatement=false; |
| 18804 | continue; // branch miss [j5] |
| 18805 | |
| 18806 | } |
| 18807 | } while(0); |
| 18808 | if( bgotonextstatement ) |
| 18809 | { |
| 18810 | } |
| 18811 | } |
| 18812 | } |
| 18813 | } |
| 18814 | } |
| 18815 | |
| 18816 | } else |
| 18817 | { |
| 18818 | { |
| 18819 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 18820 | bool j5valid[1]={false}; |
| 18821 | _nj5 = 1; |
| 18822 | CheckValue<IkReal> x2109=IKPowWithIntegerCheck(new_r00,-1); |
| 18823 | if(!x2109.valid){ |
| 18824 | continue; |
| 18825 | } |
| 18826 | IkReal x2104=x2109.value; |
| 18827 | IkReal x2105=((25000.0)*new_r00); |
| 18828 | IkReal x2106=(gconst27*x2104); |
| 18829 | IkReal x2107=((25000.00002)*gconst28); |
| 18830 | CheckValue<IkReal> x2110=IKPowWithIntegerCheck((((new_r10*x2107))+((gconst27*x2105))),-1); |
| 18831 | if(!x2110.valid){ |
| 18832 | continue; |
| 18833 | } |
| 18834 | IkReal x2108=x2110.value; |
| 18835 | if( IKabs(((((25000.0)*x2108*(new_r10*new_r10)))+((new_r10*x2106*x2107*x2108))+(((-1.0)*x2106)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x2108*(((((-1.0)*gconst27*x2107))+(((-1.0)*new_r10*x2105)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((25000.0)*x2108*(new_r10*new_r10)))+((new_r10*x2106*x2107*x2108))+(((-1.0)*x2106))))+IKsqr((x2108*(((((-1.0)*gconst27*x2107))+(((-1.0)*new_r10*x2105))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 18836 | continue; |
| 18837 | j5array[0]=IKatan2(((((25000.0)*x2108*(new_r10*new_r10)))+((new_r10*x2106*x2107*x2108))+(((-1.0)*x2106))), (x2108*(((((-1.0)*gconst27*x2107))+(((-1.0)*new_r10*x2105)))))); |
| 18838 | sj5array[0]=IKsin(j5array[0]); |
| 18839 | cj5array[0]=IKcos(j5array[0]); |
| 18840 | if( j5array[0] > IKPI ) |
| 18841 | { |
| 18842 | j5array[0]-=IK2PI; |
| 18843 | } |
| 18844 | else if( j5array[0] < -IKPI ) |
| 18845 | { j5array[0]+=IK2PI; |
| 18846 | } |
| 18847 | j5valid[0] = true; |
| 18848 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 18849 | { |
| 18850 | if( !j5valid[ij5] ) |
| 18851 | { |
| 18852 | continue; |
| 18853 | } |
| 18854 | _ij5[0] = ij5; _ij5[1] = -1; |
| 18855 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 18856 | { |
| 18857 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 18858 | { |
| 18859 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 18860 | } |
| 18861 | } |
| 18862 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 18863 | { |
| 18864 | IkReal evalcond[10]; |
| 18865 | IkReal x2111=IKcos(j5); |
| 18866 | IkReal x2112=IKsin(j5); |
| 18867 | IkReal x2113=((1.0)*gconst28); |
| 18868 | IkReal x2114=((1.0000000008)*gconst27); |
| 18869 | IkReal x2115=(new_r11*x2112); |
| 18870 | IkReal x2116=((1.0000000008)*x2111); |
| 18871 | IkReal x2117=((1.0000000008)*x2112); |
| 18872 | evalcond[0]=(((new_r00*x2112))+gconst27+((new_r10*x2111))); |
| 18873 | evalcond[1]=(((new_r01*x2112))+((new_r11*x2111))+(((-1.0)*x2113))); |
| 18874 | evalcond[2]=(((gconst28*x2116))+new_r00+((gconst27*x2112))); |
| 18875 | evalcond[3]=(new_r10+(((-1.0)*gconst28*x2117))+((gconst27*x2111))); |
| 18876 | evalcond[4]=((((-1.0)*x2112*x2113))+((x2111*x2114))+new_r01); |
| 18877 | evalcond[5]=((((-1.0)*x2112*x2114))+(((-1.0)*x2111*x2113))+new_r11); |
| 18878 | evalcond[6]=(((new_r00*x2111))+(((-1.0)*new_r10*x2112))+(((1.0000000008)*gconst28))); |
| 18879 | evalcond[7]=(((new_r01*x2111))+x2114+(((-1.0)*x2115))); |
| 18880 | evalcond[8]=((((-1.0)*new_r00*x2116))+(((-1.0)*x2113))+((new_r10*x2117))); |
| 18881 | evalcond[9]=((((-1.0)*new_r01*x2116))+(((1.0000000008)*x2115))+(((-1.0)*gconst27))); |
| 18882 | if( 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 ) |
| 18883 | { |
| 18884 | continue; |
| 18885 | } |
| 18886 | } |
| 18887 | |
| 18888 | { |
| 18889 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 18890 | vinfos[0].jointtype = 1; |
| 18891 | vinfos[0].foffset = j0; |
| 18892 | vinfos[0].indices[0] = _ij0[0]; |
| 18893 | vinfos[0].indices[1] = _ij0[1]; |
| 18894 | vinfos[0].maxsolutions = _nj0; |
| 18895 | vinfos[1].jointtype = 1; |
| 18896 | vinfos[1].foffset = j1; |
| 18897 | vinfos[1].indices[0] = _ij1[0]; |
| 18898 | vinfos[1].indices[1] = _ij1[1]; |
| 18899 | vinfos[1].maxsolutions = _nj1; |
| 18900 | vinfos[2].jointtype = 1; |
| 18901 | vinfos[2].foffset = j2; |
| 18902 | vinfos[2].indices[0] = _ij2[0]; |
| 18903 | vinfos[2].indices[1] = _ij2[1]; |
| 18904 | vinfos[2].maxsolutions = _nj2; |
| 18905 | vinfos[3].jointtype = 1; |
| 18906 | vinfos[3].foffset = j3; |
| 18907 | vinfos[3].indices[0] = _ij3[0]; |
| 18908 | vinfos[3].indices[1] = _ij3[1]; |
| 18909 | vinfos[3].maxsolutions = _nj3; |
| 18910 | vinfos[4].jointtype = 1; |
| 18911 | vinfos[4].foffset = j4; |
| 18912 | vinfos[4].indices[0] = _ij4[0]; |
| 18913 | vinfos[4].indices[1] = _ij4[1]; |
| 18914 | vinfos[4].maxsolutions = _nj4; |
| 18915 | vinfos[5].jointtype = 1; |
| 18916 | vinfos[5].foffset = j5; |
| 18917 | vinfos[5].indices[0] = _ij5[0]; |
| 18918 | vinfos[5].indices[1] = _ij5[1]; |
| 18919 | vinfos[5].maxsolutions = _nj5; |
| 18920 | std::vector<int> vfree(0); |
| 18921 | solutions.AddSolution(vinfos,vfree); |
| 18922 | } |
| 18923 | } |
| 18924 | } |
| 18925 | |
| 18926 | } |
| 18927 | |
| 18928 | } |
| 18929 | |
| 18930 | } else |
| 18931 | { |
| 18932 | { |
| 18933 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 18934 | bool j5valid[1]={false}; |
| 18935 | _nj5 = 1; |
| 18936 | CheckValue<IkReal> x2124=IKPowWithIntegerCheck(new_r00,-1); |
| 18937 | if(!x2124.valid){ |
| 18938 | continue; |
| 18939 | } |
| 18940 | IkReal x2118=x2124.value; |
| 18941 | IkReal x2119=gconst27*gconst27; |
| 18942 | IkReal x2120=((25000.0)*new_r10); |
| 18943 | IkReal x2121=((25000.0)*x2119); |
| 18944 | CheckValue<IkReal> x2125=IKPowWithIntegerCheck(((((-1.0)*gconst27*x2120))+(((25000.00002)*gconst28*new_r00))),-1); |
| 18945 | if(!x2125.valid){ |
| 18946 | continue; |
| 18947 | } |
| 18948 | IkReal x2122=x2125.value; |
| 18949 | IkReal x2123=(new_r10*x2122); |
| 18950 | CheckValue<IkReal> x2126=IKPowWithIntegerCheck(((((-25000.0)*gconst27*new_r10))+(((25000.00002)*gconst28*new_r00))),-1); |
| 18951 | if(!x2126.valid){ |
| 18952 | continue; |
| 18953 | } |
| 18954 | CheckValue<IkReal> x2127=IKPowWithIntegerCheck(((((-25000.0)*gconst27*new_r10))+(((25000.00002)*gconst28*new_r00))),-1); |
| 18955 | if(!x2127.valid){ |
| 18956 | continue; |
| 18957 | } |
| 18958 | CheckValue<IkReal> x2128=IKPowWithIntegerCheck(x2118,-2); |
| 18959 | if(!x2128.valid){ |
| 18960 | continue; |
| 18961 | } |
| 18962 | if( IKabs(((((-1.0)*x2118*x2119*x2120*(x2126.value)))+(((-1.0)*gconst27*x2118))+((new_r00*x2120*(x2127.value))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x2122*(((((-25000.0)*(x2128.value)))+x2121)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*x2118*x2119*x2120*(x2126.value)))+(((-1.0)*gconst27*x2118))+((new_r00*x2120*(x2127.value)))))+IKsqr((x2122*(((((-25000.0)*(x2128.value)))+x2121))))-1) <= IKFAST_SINCOS_THRESH ) |
| 18963 | continue; |
| 18964 | j5array[0]=IKatan2(((((-1.0)*x2118*x2119*x2120*(x2126.value)))+(((-1.0)*gconst27*x2118))+((new_r00*x2120*(x2127.value)))), (x2122*(((((-25000.0)*(x2128.value)))+x2121)))); |
| 18965 | sj5array[0]=IKsin(j5array[0]); |
| 18966 | cj5array[0]=IKcos(j5array[0]); |
| 18967 | if( j5array[0] > IKPI ) |
| 18968 | { |
| 18969 | j5array[0]-=IK2PI; |
| 18970 | } |
| 18971 | else if( j5array[0] < -IKPI ) |
| 18972 | { j5array[0]+=IK2PI; |
| 18973 | } |
| 18974 | j5valid[0] = true; |
| 18975 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 18976 | { |
| 18977 | if( !j5valid[ij5] ) |
| 18978 | { |
| 18979 | continue; |
| 18980 | } |
| 18981 | _ij5[0] = ij5; _ij5[1] = -1; |
| 18982 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 18983 | { |
| 18984 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 18985 | { |
| 18986 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 18987 | } |
| 18988 | } |
| 18989 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 18990 | { |
| 18991 | IkReal evalcond[10]; |
| 18992 | IkReal x2129=IKcos(j5); |
| 18993 | IkReal x2130=IKsin(j5); |
| 18994 | IkReal x2131=((1.0)*gconst28); |
| 18995 | IkReal x2132=((1.0000000008)*gconst27); |
| 18996 | IkReal x2133=(new_r11*x2130); |
| 18997 | IkReal x2134=((1.0000000008)*x2129); |
| 18998 | IkReal x2135=((1.0000000008)*x2130); |
| 18999 | evalcond[0]=(gconst27+((new_r00*x2130))+((new_r10*x2129))); |
| 19000 | evalcond[1]=((((-1.0)*x2131))+((new_r11*x2129))+((new_r01*x2130))); |
| 19001 | evalcond[2]=(((gconst28*x2134))+((gconst27*x2130))+new_r00); |
| 19002 | evalcond[3]=(((gconst27*x2129))+(((-1.0)*gconst28*x2135))+new_r10); |
| 19003 | evalcond[4]=((((-1.0)*x2130*x2131))+new_r01+((x2129*x2132))); |
| 19004 | evalcond[5]=((((-1.0)*x2130*x2132))+(((-1.0)*x2129*x2131))+new_r11); |
| 19005 | evalcond[6]=((((-1.0)*new_r10*x2130))+(((1.0000000008)*gconst28))+((new_r00*x2129))); |
| 19006 | evalcond[7]=(x2132+((new_r01*x2129))+(((-1.0)*x2133))); |
| 19007 | evalcond[8]=(((new_r10*x2135))+(((-1.0)*x2131))+(((-1.0)*new_r00*x2134))); |
| 19008 | evalcond[9]=((((-1.0)*new_r01*x2134))+(((1.0000000008)*x2133))+(((-1.0)*gconst27))); |
| 19009 | if( 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 ) |
| 19010 | { |
| 19011 | continue; |
| 19012 | } |
| 19013 | } |
| 19014 | |
| 19015 | { |
| 19016 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 19017 | vinfos[0].jointtype = 1; |
| 19018 | vinfos[0].foffset = j0; |
| 19019 | vinfos[0].indices[0] = _ij0[0]; |
| 19020 | vinfos[0].indices[1] = _ij0[1]; |
| 19021 | vinfos[0].maxsolutions = _nj0; |
| 19022 | vinfos[1].jointtype = 1; |
| 19023 | vinfos[1].foffset = j1; |
| 19024 | vinfos[1].indices[0] = _ij1[0]; |
| 19025 | vinfos[1].indices[1] = _ij1[1]; |
| 19026 | vinfos[1].maxsolutions = _nj1; |
| 19027 | vinfos[2].jointtype = 1; |
| 19028 | vinfos[2].foffset = j2; |
| 19029 | vinfos[2].indices[0] = _ij2[0]; |
| 19030 | vinfos[2].indices[1] = _ij2[1]; |
| 19031 | vinfos[2].maxsolutions = _nj2; |
| 19032 | vinfos[3].jointtype = 1; |
| 19033 | vinfos[3].foffset = j3; |
| 19034 | vinfos[3].indices[0] = _ij3[0]; |
| 19035 | vinfos[3].indices[1] = _ij3[1]; |
| 19036 | vinfos[3].maxsolutions = _nj3; |
| 19037 | vinfos[4].jointtype = 1; |
| 19038 | vinfos[4].foffset = j4; |
| 19039 | vinfos[4].indices[0] = _ij4[0]; |
| 19040 | vinfos[4].indices[1] = _ij4[1]; |
| 19041 | vinfos[4].maxsolutions = _nj4; |
| 19042 | vinfos[5].jointtype = 1; |
| 19043 | vinfos[5].foffset = j5; |
| 19044 | vinfos[5].indices[0] = _ij5[0]; |
| 19045 | vinfos[5].indices[1] = _ij5[1]; |
| 19046 | vinfos[5].maxsolutions = _nj5; |
| 19047 | std::vector<int> vfree(0); |
| 19048 | solutions.AddSolution(vinfos,vfree); |
| 19049 | } |
| 19050 | } |
| 19051 | } |
| 19052 | |
| 19053 | } |
| 19054 | |
| 19055 | } |
| 19056 | |
| 19057 | } else |
| 19058 | { |
| 19059 | { |
| 19060 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 19061 | bool j5valid[1]={false}; |
| 19062 | _nj5 = 1; |
| 19063 | IkReal x2136=((1.0)*new_r00); |
| 19064 | CheckValue<IkReal> x2137=IKPowWithIntegerCheck(IKsign((((new_r01*new_r10))+(((-1.0)*new_r11*x2136)))),-1); |
| 19065 | if(!x2137.valid){ |
| 19066 | continue; |
| 19067 | } |
| 19068 | CheckValue<IkReal> x2138 = IKatan2WithCheck(IkReal((((gconst28*new_r10))+((gconst27*new_r11)))),IkReal(((((-1.0)*gconst27*new_r01))+(((-1.0)*gconst28*x2136)))),IKFAST_ATAN2_MAGTHRESH); |
| 19069 | if(!x2138.valid){ |
| 19070 | continue; |
| 19071 | } |
| 19072 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x2137.value)))+(x2138.value)); |
| 19073 | sj5array[0]=IKsin(j5array[0]); |
| 19074 | cj5array[0]=IKcos(j5array[0]); |
| 19075 | if( j5array[0] > IKPI ) |
| 19076 | { |
| 19077 | j5array[0]-=IK2PI; |
| 19078 | } |
| 19079 | else if( j5array[0] < -IKPI ) |
| 19080 | { j5array[0]+=IK2PI; |
| 19081 | } |
| 19082 | j5valid[0] = true; |
| 19083 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 19084 | { |
| 19085 | if( !j5valid[ij5] ) |
| 19086 | { |
| 19087 | continue; |
| 19088 | } |
| 19089 | _ij5[0] = ij5; _ij5[1] = -1; |
| 19090 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 19091 | { |
| 19092 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 19093 | { |
| 19094 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 19095 | } |
| 19096 | } |
| 19097 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 19098 | { |
| 19099 | IkReal evalcond[10]; |
| 19100 | IkReal x2139=IKcos(j5); |
| 19101 | IkReal x2140=IKsin(j5); |
| 19102 | IkReal x2141=((1.0)*gconst28); |
| 19103 | IkReal x2142=((1.0000000008)*gconst27); |
| 19104 | IkReal x2143=(new_r11*x2140); |
| 19105 | IkReal x2144=((1.0000000008)*x2139); |
| 19106 | IkReal x2145=((1.0000000008)*x2140); |
| 19107 | evalcond[0]=(((new_r00*x2140))+((new_r10*x2139))+gconst27); |
| 19108 | evalcond[1]=(((new_r11*x2139))+((new_r01*x2140))+(((-1.0)*x2141))); |
| 19109 | evalcond[2]=(((gconst27*x2140))+new_r00+((gconst28*x2144))); |
| 19110 | evalcond[3]=(((gconst27*x2139))+new_r10+(((-1.0)*gconst28*x2145))); |
| 19111 | evalcond[4]=((((-1.0)*x2140*x2141))+new_r01+((x2139*x2142))); |
| 19112 | evalcond[5]=((((-1.0)*x2140*x2142))+new_r11+(((-1.0)*x2139*x2141))); |
| 19113 | evalcond[6]=((((1.0000000008)*gconst28))+((new_r00*x2139))+(((-1.0)*new_r10*x2140))); |
| 19114 | evalcond[7]=((((-1.0)*x2143))+x2142+((new_r01*x2139))); |
| 19115 | evalcond[8]=((((-1.0)*x2141))+(((-1.0)*new_r00*x2144))+((new_r10*x2145))); |
| 19116 | evalcond[9]=((((-1.0)*new_r01*x2144))+(((1.0000000008)*x2143))+(((-1.0)*gconst27))); |
| 19117 | if( 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 ) |
| 19118 | { |
| 19119 | continue; |
| 19120 | } |
| 19121 | } |
| 19122 | |
| 19123 | { |
| 19124 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 19125 | vinfos[0].jointtype = 1; |
| 19126 | vinfos[0].foffset = j0; |
| 19127 | vinfos[0].indices[0] = _ij0[0]; |
| 19128 | vinfos[0].indices[1] = _ij0[1]; |
| 19129 | vinfos[0].maxsolutions = _nj0; |
| 19130 | vinfos[1].jointtype = 1; |
| 19131 | vinfos[1].foffset = j1; |
| 19132 | vinfos[1].indices[0] = _ij1[0]; |
| 19133 | vinfos[1].indices[1] = _ij1[1]; |
| 19134 | vinfos[1].maxsolutions = _nj1; |
| 19135 | vinfos[2].jointtype = 1; |
| 19136 | vinfos[2].foffset = j2; |
| 19137 | vinfos[2].indices[0] = _ij2[0]; |
| 19138 | vinfos[2].indices[1] = _ij2[1]; |
| 19139 | vinfos[2].maxsolutions = _nj2; |
| 19140 | vinfos[3].jointtype = 1; |
| 19141 | vinfos[3].foffset = j3; |
| 19142 | vinfos[3].indices[0] = _ij3[0]; |
| 19143 | vinfos[3].indices[1] = _ij3[1]; |
| 19144 | vinfos[3].maxsolutions = _nj3; |
| 19145 | vinfos[4].jointtype = 1; |
| 19146 | vinfos[4].foffset = j4; |
| 19147 | vinfos[4].indices[0] = _ij4[0]; |
| 19148 | vinfos[4].indices[1] = _ij4[1]; |
| 19149 | vinfos[4].maxsolutions = _nj4; |
| 19150 | vinfos[5].jointtype = 1; |
| 19151 | vinfos[5].foffset = j5; |
| 19152 | vinfos[5].indices[0] = _ij5[0]; |
| 19153 | vinfos[5].indices[1] = _ij5[1]; |
| 19154 | vinfos[5].maxsolutions = _nj5; |
| 19155 | std::vector<int> vfree(0); |
| 19156 | solutions.AddSolution(vinfos,vfree); |
| 19157 | } |
| 19158 | } |
| 19159 | } |
| 19160 | |
| 19161 | } |
| 19162 | |
| 19163 | } |
| 19164 | |
| 19165 | } |
| 19166 | } while(0); |
| 19167 | if( bgotonextstatement ) |
| 19168 | { |
| 19169 | bool bgotonextstatement = true; |
| 19170 | do |
| 19171 | { |
| 19172 | IkReal x2147 = ((((1.0000000016)*(new_r00*new_r00)))+(new_r10*new_r10)); |
| 19173 | if(IKabs(x2147)==0){ |
| 19174 | continue; |
| 19175 | } |
| 19176 | IkReal x2146=pow(x2147,-0.5); |
| 19177 | CheckValue<IkReal> x2148 = IKatan2WithCheck(IkReal(new_r10),IkReal(((1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 19178 | if(!x2148.valid){ |
| 19179 | continue; |
| 19180 | } |
| 19181 | IkReal gconst29=((3.14159265358979)+(((-1.0)*(x2148.value)))); |
| 19182 | IkReal gconst30=((1.0)*new_r10*x2146); |
| 19183 | IkReal gconst31=((-1.0000000008)*new_r00*x2146); |
| 19184 | CheckValue<IkReal> x2149 = IKatan2WithCheck(IkReal(new_r10),IkReal(((1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 19185 | if(!x2149.valid){ |
| 19186 | continue; |
| 19187 | } |
| 19188 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+(x2149.value)+j3)))), 6.28318530717959))); |
| 19189 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 19190 | { |
| 19191 | bgotonextstatement=false; |
| 19192 | { |
| 19193 | IkReal j5eval[2]; |
| 19194 | IkReal x2150=x2146; |
| 19195 | sj4=-4.0e-5; |
| 19196 | cj4=-1.0; |
| 19197 | j4=3.14163265; |
| 19198 | sj3=gconst30; |
| 19199 | cj3=gconst31; |
| 19200 | CheckValue<IkReal> x2151 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 19201 | if(!x2151.valid){ |
| 19202 | continue; |
| 19203 | } |
| 19204 | j3=((3.14159265)+(((-1.0)*(x2151.value)))); |
| 19205 | CheckValue<IkReal> x2152 = IKatan2WithCheck(IkReal(new_r10),IkReal(((1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 19206 | if(!x2152.valid){ |
| 19207 | continue; |
| 19208 | } |
| 19209 | IkReal gconst29=((3.14159265358979)+(((-1.0)*(x2152.value)))); |
| 19210 | IkReal gconst30=((1.0)*new_r10*x2150); |
| 19211 | IkReal gconst31=((-1.0000000008)*new_r00*x2150); |
| 19212 | IkReal x2153=(((new_r01*new_r10))+(((-1.0)*new_r00*new_r11))); |
| 19213 | j5eval[0]=x2153; |
| 19214 | j5eval[1]=IKsign(x2153); |
| 19215 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 19216 | { |
| 19217 | { |
| 19218 | IkReal j5eval[1]; |
| 19219 | IkReal x2154=x2146; |
| 19220 | sj4=-4.0e-5; |
| 19221 | cj4=-1.0; |
| 19222 | j4=3.14163265; |
| 19223 | sj3=gconst30; |
| 19224 | cj3=gconst31; |
| 19225 | CheckValue<IkReal> x2155 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 19226 | if(!x2155.valid){ |
| 19227 | continue; |
| 19228 | } |
| 19229 | j3=((3.14159265)+(((-1.0)*(x2155.value)))); |
| 19230 | CheckValue<IkReal> x2156 = IKatan2WithCheck(IkReal(new_r10),IkReal(((1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 19231 | if(!x2156.valid){ |
| 19232 | continue; |
| 19233 | } |
| 19234 | IkReal gconst29=((3.14159265358979)+(((-1.0)*(x2156.value)))); |
| 19235 | IkReal gconst30=((1.0)*new_r10*x2154); |
| 19236 | IkReal gconst31=((-1.0000000008)*new_r00*x2154); |
| 19237 | j5eval[0]=new_r00; |
| 19238 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 19239 | { |
| 19240 | { |
| 19241 | IkReal j5eval[2]; |
| 19242 | IkReal x2157=x2146; |
| 19243 | sj4=-4.0e-5; |
| 19244 | cj4=-1.0; |
| 19245 | j4=3.14163265; |
| 19246 | sj3=gconst30; |
| 19247 | cj3=gconst31; |
| 19248 | CheckValue<IkReal> x2158 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 19249 | if(!x2158.valid){ |
| 19250 | continue; |
| 19251 | } |
| 19252 | j3=((3.14159265)+(((-1.0)*(x2158.value)))); |
| 19253 | CheckValue<IkReal> x2159 = IKatan2WithCheck(IkReal(new_r10),IkReal(((1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 19254 | if(!x2159.valid){ |
| 19255 | continue; |
| 19256 | } |
| 19257 | IkReal gconst29=((3.14159265358979)+(((-1.0)*(x2159.value)))); |
| 19258 | IkReal gconst30=((1.0)*new_r10*x2157); |
| 19259 | IkReal gconst31=((-1.0000000008)*new_r00*x2157); |
| 19260 | IkReal x2160 = ((((1.0000000016)*(new_r00*new_r00)))+(new_r10*new_r10)); |
| 19261 | if(IKabs(x2160)==0){ |
| 19262 | continue; |
| 19263 | } |
| 19264 | j5eval[0]=((-1.60000013238459e-9)*new_r00*new_r10*(pow(x2160,-0.5))); |
| 19265 | j5eval[1]=new_r00; |
| 19266 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 19267 | { |
| 19268 | { |
| 19269 | IkReal evalcond[1]; |
| 19270 | bool bgotonextstatement = true; |
| 19271 | do |
| 19272 | { |
| 19273 | evalcond[0]=IKabs(new_r00); |
| 19274 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 19275 | { |
| 19276 | bgotonextstatement=false; |
| 19277 | { |
| 19278 | IkReal j5eval[1]; |
| 19279 | CheckValue<IkReal> x2162 = IKatan2WithCheck(IkReal(new_r10),IkReal(0),IKFAST_ATAN2_MAGTHRESH); |
| 19280 | if(!x2162.valid){ |
| 19281 | continue; |
| 19282 | } |
| 19283 | IkReal x2161=((1.0)*(x2162.value)); |
| 19284 | sj4=-4.0e-5; |
| 19285 | cj4=-1.0; |
| 19286 | j4=3.14163265; |
| 19287 | sj3=gconst30; |
| 19288 | cj3=gconst31; |
| 19289 | j3=((3.14159265)+(((-1.0)*x2161))); |
| 19290 | new_r00=0; |
| 19291 | IkReal gconst29=((3.14159265358979)+(((-1.0)*x2161))); |
| 19292 | IkReal x2163 = new_r10*new_r10; |
| 19293 | if(IKabs(x2163)==0){ |
| 19294 | continue; |
| 19295 | } |
| 19296 | IkReal gconst30=((1.0)*new_r10*(pow(x2163,-0.5))); |
| 19297 | IkReal gconst31=0; |
| 19298 | j5eval[0]=new_r10; |
| 19299 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 19300 | { |
| 19301 | { |
| 19302 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 19303 | bool j5valid[1]={false}; |
| 19304 | _nj5 = 1; |
| 19305 | CheckValue<IkReal> x2165=IKPowWithIntegerCheck(gconst30,-1); |
| 19306 | if(!x2165.valid){ |
| 19307 | continue; |
| 19308 | } |
| 19309 | IkReal x2164=x2165.value; |
| 19310 | if( IKabs(((0.9999999992)*new_r11*x2164)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r10*x2164)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*new_r11*x2164))+IKsqr(((-1.0)*new_r10*x2164))-1) <= IKFAST_SINCOS_THRESH ) |
| 19311 | continue; |
| 19312 | j5array[0]=IKatan2(((0.9999999992)*new_r11*x2164), ((-1.0)*new_r10*x2164)); |
| 19313 | sj5array[0]=IKsin(j5array[0]); |
| 19314 | cj5array[0]=IKcos(j5array[0]); |
| 19315 | if( j5array[0] > IKPI ) |
| 19316 | { |
| 19317 | j5array[0]-=IK2PI; |
| 19318 | } |
| 19319 | else if( j5array[0] < -IKPI ) |
| 19320 | { j5array[0]+=IK2PI; |
| 19321 | } |
| 19322 | j5valid[0] = true; |
| 19323 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 19324 | { |
| 19325 | if( !j5valid[ij5] ) |
| 19326 | { |
| 19327 | continue; |
| 19328 | } |
| 19329 | _ij5[0] = ij5; _ij5[1] = -1; |
| 19330 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 19331 | { |
| 19332 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 19333 | { |
| 19334 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 19335 | } |
| 19336 | } |
| 19337 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 19338 | { |
| 19339 | IkReal evalcond[10]; |
| 19340 | IkReal x2166=IKsin(j5); |
| 19341 | IkReal x2167=IKcos(j5); |
| 19342 | IkReal x2168=((1.0000000008)*x2166); |
| 19343 | IkReal x2169=(gconst30*x2167); |
| 19344 | IkReal x2170=(new_r01*x2167); |
| 19345 | evalcond[0]=(gconst30*x2166); |
| 19346 | evalcond[1]=((-1.0)*new_r10*x2166); |
| 19347 | evalcond[2]=(gconst30+((new_r10*x2167))); |
| 19348 | evalcond[3]=(x2169+new_r10); |
| 19349 | evalcond[4]=(new_r10*x2168); |
| 19350 | evalcond[5]=(((new_r11*x2167))+((new_r01*x2166))); |
| 19351 | evalcond[6]=((((1.0000000008)*x2169))+new_r01); |
| 19352 | evalcond[7]=((((-1.0)*gconst30*x2168))+new_r11); |
| 19353 | evalcond[8]=((((-1.0)*new_r11*x2166))+x2170+(((1.0000000008)*gconst30))); |
| 19354 | evalcond[9]=((((-1.0000000008)*x2170))+((new_r11*x2168))+(((-1.0)*gconst30))); |
| 19355 | if( 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 ) |
| 19356 | { |
| 19357 | continue; |
| 19358 | } |
| 19359 | } |
| 19360 | |
| 19361 | { |
| 19362 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 19363 | vinfos[0].jointtype = 1; |
| 19364 | vinfos[0].foffset = j0; |
| 19365 | vinfos[0].indices[0] = _ij0[0]; |
| 19366 | vinfos[0].indices[1] = _ij0[1]; |
| 19367 | vinfos[0].maxsolutions = _nj0; |
| 19368 | vinfos[1].jointtype = 1; |
| 19369 | vinfos[1].foffset = j1; |
| 19370 | vinfos[1].indices[0] = _ij1[0]; |
| 19371 | vinfos[1].indices[1] = _ij1[1]; |
| 19372 | vinfos[1].maxsolutions = _nj1; |
| 19373 | vinfos[2].jointtype = 1; |
| 19374 | vinfos[2].foffset = j2; |
| 19375 | vinfos[2].indices[0] = _ij2[0]; |
| 19376 | vinfos[2].indices[1] = _ij2[1]; |
| 19377 | vinfos[2].maxsolutions = _nj2; |
| 19378 | vinfos[3].jointtype = 1; |
| 19379 | vinfos[3].foffset = j3; |
| 19380 | vinfos[3].indices[0] = _ij3[0]; |
| 19381 | vinfos[3].indices[1] = _ij3[1]; |
| 19382 | vinfos[3].maxsolutions = _nj3; |
| 19383 | vinfos[4].jointtype = 1; |
| 19384 | vinfos[4].foffset = j4; |
| 19385 | vinfos[4].indices[0] = _ij4[0]; |
| 19386 | vinfos[4].indices[1] = _ij4[1]; |
| 19387 | vinfos[4].maxsolutions = _nj4; |
| 19388 | vinfos[5].jointtype = 1; |
| 19389 | vinfos[5].foffset = j5; |
| 19390 | vinfos[5].indices[0] = _ij5[0]; |
| 19391 | vinfos[5].indices[1] = _ij5[1]; |
| 19392 | vinfos[5].maxsolutions = _nj5; |
| 19393 | std::vector<int> vfree(0); |
| 19394 | solutions.AddSolution(vinfos,vfree); |
| 19395 | } |
| 19396 | } |
| 19397 | } |
| 19398 | |
| 19399 | } else |
| 19400 | { |
| 19401 | { |
| 19402 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 19403 | bool j5valid[1]={false}; |
| 19404 | _nj5 = 1; |
| 19405 | CheckValue<IkReal> x2171=IKPowWithIntegerCheck(gconst30,-1); |
| 19406 | if(!x2171.valid){ |
| 19407 | continue; |
| 19408 | } |
| 19409 | CheckValue<IkReal> x2172=IKPowWithIntegerCheck(new_r10,-1); |
| 19410 | if(!x2172.valid){ |
| 19411 | continue; |
| 19412 | } |
| 19413 | if( IKabs(((0.9999999992)*new_r11*(x2171.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*gconst30*(x2172.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*new_r11*(x2171.value)))+IKsqr(((-1.0)*gconst30*(x2172.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 19414 | continue; |
| 19415 | j5array[0]=IKatan2(((0.9999999992)*new_r11*(x2171.value)), ((-1.0)*gconst30*(x2172.value))); |
| 19416 | sj5array[0]=IKsin(j5array[0]); |
| 19417 | cj5array[0]=IKcos(j5array[0]); |
| 19418 | if( j5array[0] > IKPI ) |
| 19419 | { |
| 19420 | j5array[0]-=IK2PI; |
| 19421 | } |
| 19422 | else if( j5array[0] < -IKPI ) |
| 19423 | { j5array[0]+=IK2PI; |
| 19424 | } |
| 19425 | j5valid[0] = true; |
| 19426 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 19427 | { |
| 19428 | if( !j5valid[ij5] ) |
| 19429 | { |
| 19430 | continue; |
| 19431 | } |
| 19432 | _ij5[0] = ij5; _ij5[1] = -1; |
| 19433 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 19434 | { |
| 19435 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 19436 | { |
| 19437 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 19438 | } |
| 19439 | } |
| 19440 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 19441 | { |
| 19442 | IkReal evalcond[10]; |
| 19443 | IkReal x2173=IKsin(j5); |
| 19444 | IkReal x2174=IKcos(j5); |
| 19445 | IkReal x2175=((1.0000000008)*x2173); |
| 19446 | IkReal x2176=(gconst30*x2174); |
| 19447 | IkReal x2177=(new_r01*x2174); |
| 19448 | evalcond[0]=(gconst30*x2173); |
| 19449 | evalcond[1]=((-1.0)*new_r10*x2173); |
| 19450 | evalcond[2]=(gconst30+((new_r10*x2174))); |
| 19451 | evalcond[3]=(x2176+new_r10); |
| 19452 | evalcond[4]=(new_r10*x2175); |
| 19453 | evalcond[5]=(((new_r11*x2174))+((new_r01*x2173))); |
| 19454 | evalcond[6]=((((1.0000000008)*x2176))+new_r01); |
| 19455 | evalcond[7]=((((-1.0)*gconst30*x2175))+new_r11); |
| 19456 | evalcond[8]=(x2177+(((-1.0)*new_r11*x2173))+(((1.0000000008)*gconst30))); |
| 19457 | evalcond[9]=(((new_r11*x2175))+(((-1.0000000008)*x2177))+(((-1.0)*gconst30))); |
| 19458 | if( 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 ) |
| 19459 | { |
| 19460 | continue; |
| 19461 | } |
| 19462 | } |
| 19463 | |
| 19464 | { |
| 19465 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 19466 | vinfos[0].jointtype = 1; |
| 19467 | vinfos[0].foffset = j0; |
| 19468 | vinfos[0].indices[0] = _ij0[0]; |
| 19469 | vinfos[0].indices[1] = _ij0[1]; |
| 19470 | vinfos[0].maxsolutions = _nj0; |
| 19471 | vinfos[1].jointtype = 1; |
| 19472 | vinfos[1].foffset = j1; |
| 19473 | vinfos[1].indices[0] = _ij1[0]; |
| 19474 | vinfos[1].indices[1] = _ij1[1]; |
| 19475 | vinfos[1].maxsolutions = _nj1; |
| 19476 | vinfos[2].jointtype = 1; |
| 19477 | vinfos[2].foffset = j2; |
| 19478 | vinfos[2].indices[0] = _ij2[0]; |
| 19479 | vinfos[2].indices[1] = _ij2[1]; |
| 19480 | vinfos[2].maxsolutions = _nj2; |
| 19481 | vinfos[3].jointtype = 1; |
| 19482 | vinfos[3].foffset = j3; |
| 19483 | vinfos[3].indices[0] = _ij3[0]; |
| 19484 | vinfos[3].indices[1] = _ij3[1]; |
| 19485 | vinfos[3].maxsolutions = _nj3; |
| 19486 | vinfos[4].jointtype = 1; |
| 19487 | vinfos[4].foffset = j4; |
| 19488 | vinfos[4].indices[0] = _ij4[0]; |
| 19489 | vinfos[4].indices[1] = _ij4[1]; |
| 19490 | vinfos[4].maxsolutions = _nj4; |
| 19491 | vinfos[5].jointtype = 1; |
| 19492 | vinfos[5].foffset = j5; |
| 19493 | vinfos[5].indices[0] = _ij5[0]; |
| 19494 | vinfos[5].indices[1] = _ij5[1]; |
| 19495 | vinfos[5].maxsolutions = _nj5; |
| 19496 | std::vector<int> vfree(0); |
| 19497 | solutions.AddSolution(vinfos,vfree); |
| 19498 | } |
| 19499 | } |
| 19500 | } |
| 19501 | |
| 19502 | } |
| 19503 | |
| 19504 | } |
| 19505 | |
| 19506 | } |
| 19507 | } while(0); |
| 19508 | if( bgotonextstatement ) |
| 19509 | { |
| 19510 | bool bgotonextstatement = true; |
| 19511 | do |
| 19512 | { |
| 19513 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 19514 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 19515 | { |
| 19516 | bgotonextstatement=false; |
| 19517 | { |
| 19518 | IkReal j5eval[3]; |
| 19519 | IkReal x2179 = ((1.0000000016)+(((-1.6e-9)*(new_r10*new_r10)))); |
| 19520 | if(IKabs(x2179)==0){ |
| 19521 | continue; |
| 19522 | } |
| 19523 | IkReal x2178=pow(x2179,-0.5); |
| 19524 | sj4=-4.0e-5; |
| 19525 | cj4=-1.0; |
| 19526 | j4=3.14163265; |
| 19527 | sj3=gconst30; |
| 19528 | cj3=gconst31; |
| 19529 | CheckValue<IkReal> x2180 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 19530 | if(!x2180.valid){ |
| 19531 | continue; |
| 19532 | } |
| 19533 | j3=((3.14159265)+(((-1.0)*(x2180.value)))); |
| 19534 | new_r11=0; |
| 19535 | new_r01=0; |
| 19536 | new_r22=0; |
| 19537 | new_r20=0; |
| 19538 | CheckValue<IkReal> x2181 = IKatan2WithCheck(IkReal(new_r10),IkReal(((1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 19539 | if(!x2181.valid){ |
| 19540 | continue; |
| 19541 | } |
| 19542 | IkReal gconst29=((3.14159265358979)+(((-1.0)*(x2181.value)))); |
| 19543 | IkReal gconst30=((1.0)*new_r10*x2178); |
| 19544 | IkReal gconst31=((-1.0000000008)*new_r00*x2178); |
| 19545 | IkReal x2182=new_r10*new_r10; |
| 19546 | CheckValue<IkReal> x2186=IKPowWithIntegerCheck(((-3.90625000625e+17)+(((625000000.0)*x2182))),-1); |
| 19547 | if(!x2186.valid){ |
| 19548 | continue; |
| 19549 | } |
| 19550 | IkReal x2183=x2186.value; |
| 19551 | if((((625000001.0)+(((-1.0)*x2182)))) < -0.00001) |
| 19552 | continue; |
| 19553 | IkReal x2184=IKsqrt(((625000001.0)+(((-1.0)*x2182)))); |
| 19554 | IkReal x2185=(x2183*x2184); |
| 19555 | j5eval[0]=1.0; |
| 19556 | j5eval[1]=1.0; |
| 19557 | IkReal x2187 = ((1.0000000016)+(((-1.6e-9)*x2182))); |
| 19558 | if(IKabs(x2187)==0){ |
| 19559 | continue; |
| 19560 | } |
| 19561 | j5eval[2]=((IKabs(((((-3.90625000625e+17)*x2185))+(((7.81250000625e+17)*x2182*x2185)))))+(IKabs(((50000.00004)*new_r00*new_r10*(pow(x2187,-0.5)))))); |
| 19562 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 19563 | { |
| 19564 | { |
| 19565 | IkReal j5eval[1]; |
| 19566 | IkReal x2189 = ((1.0000000016)+(((-1.6e-9)*(new_r10*new_r10)))); |
| 19567 | if(IKabs(x2189)==0){ |
| 19568 | continue; |
| 19569 | } |
| 19570 | IkReal x2188=pow(x2189,-0.5); |
| 19571 | sj4=-4.0e-5; |
| 19572 | cj4=-1.0; |
| 19573 | j4=3.14163265; |
| 19574 | sj3=gconst30; |
| 19575 | cj3=gconst31; |
| 19576 | CheckValue<IkReal> x2190 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 19577 | if(!x2190.valid){ |
| 19578 | continue; |
| 19579 | } |
| 19580 | j3=((3.14159265)+(((-1.0)*(x2190.value)))); |
| 19581 | new_r11=0; |
| 19582 | new_r01=0; |
| 19583 | new_r22=0; |
| 19584 | new_r20=0; |
| 19585 | CheckValue<IkReal> x2191 = IKatan2WithCheck(IkReal(new_r10),IkReal(((1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 19586 | if(!x2191.valid){ |
| 19587 | continue; |
| 19588 | } |
| 19589 | IkReal gconst29=((3.14159265358979)+(((-1.0)*(x2191.value)))); |
| 19590 | IkReal gconst30=((1.0)*new_r10*x2188); |
| 19591 | IkReal gconst31=((-1.0000000008)*new_r00*x2188); |
| 19592 | IkReal x2192=new_r10*new_r10; |
| 19593 | CheckValue<IkReal> x2194=IKPowWithIntegerCheck(((1.0000000016)+(((-1.6e-9)*x2192))),-1); |
| 19594 | if(!x2194.valid){ |
| 19595 | continue; |
| 19596 | } |
| 19597 | IkReal x2193=x2194.value; |
| 19598 | IkReal x2195=((1.0)+(((-1.0)*x2192))); |
| 19599 | j5eval[0]=IKsign(((((-625000001.0)*x2193*(x2195*x2195)))+(((625000001.0)*x2193*(x2192*x2192))))); |
| 19600 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 19601 | { |
| 19602 | { |
| 19603 | IkReal j5eval[1]; |
| 19604 | IkReal x2197 = ((1.0000000016)+(((-1.6e-9)*(new_r10*new_r10)))); |
| 19605 | if(IKabs(x2197)==0){ |
| 19606 | continue; |
| 19607 | } |
| 19608 | IkReal x2196=pow(x2197,-0.5); |
| 19609 | sj4=-4.0e-5; |
| 19610 | cj4=-1.0; |
| 19611 | j4=3.14163265; |
| 19612 | sj3=gconst30; |
| 19613 | cj3=gconst31; |
| 19614 | CheckValue<IkReal> x2198 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 19615 | if(!x2198.valid){ |
| 19616 | continue; |
| 19617 | } |
| 19618 | j3=((3.14159265)+(((-1.0)*(x2198.value)))); |
| 19619 | new_r11=0; |
| 19620 | new_r01=0; |
| 19621 | new_r22=0; |
| 19622 | new_r20=0; |
| 19623 | CheckValue<IkReal> x2199 = IKatan2WithCheck(IkReal(new_r10),IkReal(((1.0000000008)*new_r00)),IKFAST_ATAN2_MAGTHRESH); |
| 19624 | if(!x2199.valid){ |
| 19625 | continue; |
| 19626 | } |
| 19627 | IkReal gconst29=((3.14159265358979)+(((-1.0)*(x2199.value)))); |
| 19628 | IkReal gconst30=((1.0)*new_r10*x2196); |
| 19629 | IkReal gconst31=((-1.0000000008)*new_r00*x2196); |
| 19630 | j5eval[0]=new_r00; |
| 19631 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 19632 | { |
| 19633 | continue; // 3 cases reached |
| 19634 | |
| 19635 | } else |
| 19636 | { |
| 19637 | { |
| 19638 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 19639 | bool j5valid[1]={false}; |
| 19640 | _nj5 = 1; |
| 19641 | CheckValue<IkReal> x2206=IKPowWithIntegerCheck(new_r00,-1); |
| 19642 | if(!x2206.valid){ |
| 19643 | continue; |
| 19644 | } |
| 19645 | IkReal x2200=x2206.value; |
| 19646 | IkReal x2201=gconst30*gconst30; |
| 19647 | IkReal x2202=((25000.0)*new_r10); |
| 19648 | IkReal x2203=((25000.0)*x2201); |
| 19649 | CheckValue<IkReal> x2207=IKPowWithIntegerCheck(((((-1.0)*gconst30*x2202))+(((25000.00002)*gconst31*new_r00))),-1); |
| 19650 | if(!x2207.valid){ |
| 19651 | continue; |
| 19652 | } |
| 19653 | IkReal x2204=x2207.value; |
| 19654 | IkReal x2205=(new_r10*x2204); |
| 19655 | CheckValue<IkReal> x2208=IKPowWithIntegerCheck(((((-25000.0)*gconst30*new_r10))+(((25000.00002)*gconst31*new_r00))),-1); |
| 19656 | if(!x2208.valid){ |
| 19657 | continue; |
| 19658 | } |
| 19659 | CheckValue<IkReal> x2209=IKPowWithIntegerCheck(((((-25000.0)*gconst30*new_r10))+(((25000.00002)*gconst31*new_r00))),-1); |
| 19660 | if(!x2209.valid){ |
| 19661 | continue; |
| 19662 | } |
| 19663 | CheckValue<IkReal> x2210=IKPowWithIntegerCheck(x2200,-2); |
| 19664 | if(!x2210.valid){ |
| 19665 | continue; |
| 19666 | } |
| 19667 | if( IKabs(((((-1.0)*gconst30*x2200))+((new_r00*x2202*(x2208.value)))+(((-1.0)*x2200*x2201*x2202*(x2209.value))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x2204*((x2203+(((-25000.0)*(x2210.value))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*gconst30*x2200))+((new_r00*x2202*(x2208.value)))+(((-1.0)*x2200*x2201*x2202*(x2209.value)))))+IKsqr((x2204*((x2203+(((-25000.0)*(x2210.value)))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 19668 | continue; |
| 19669 | j5array[0]=IKatan2(((((-1.0)*gconst30*x2200))+((new_r00*x2202*(x2208.value)))+(((-1.0)*x2200*x2201*x2202*(x2209.value)))), (x2204*((x2203+(((-25000.0)*(x2210.value))))))); |
| 19670 | sj5array[0]=IKsin(j5array[0]); |
| 19671 | cj5array[0]=IKcos(j5array[0]); |
| 19672 | if( j5array[0] > IKPI ) |
| 19673 | { |
| 19674 | j5array[0]-=IK2PI; |
| 19675 | } |
| 19676 | else if( j5array[0] < -IKPI ) |
| 19677 | { j5array[0]+=IK2PI; |
| 19678 | } |
| 19679 | j5valid[0] = true; |
| 19680 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 19681 | { |
| 19682 | if( !j5valid[ij5] ) |
| 19683 | { |
| 19684 | continue; |
| 19685 | } |
| 19686 | _ij5[0] = ij5; _ij5[1] = -1; |
| 19687 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 19688 | { |
| 19689 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 19690 | { |
| 19691 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 19692 | } |
| 19693 | } |
| 19694 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 19695 | { |
| 19696 | IkReal evalcond[7]; |
| 19697 | IkReal x2211=IKsin(j5); |
| 19698 | IkReal x2212=IKcos(j5); |
| 19699 | IkReal x2213=((1.0)*gconst31); |
| 19700 | IkReal x2214=((1.0000000008)*x2212); |
| 19701 | IkReal x2215=((1.0000000008)*x2211); |
| 19702 | evalcond[0]=(gconst30+((new_r00*x2211))+((new_r10*x2212))); |
| 19703 | evalcond[1]=(((gconst31*x2214))+((gconst30*x2211))+new_r00); |
| 19704 | evalcond[2]=(((gconst30*x2212))+(((-1.0)*gconst31*x2215))+new_r10); |
| 19705 | evalcond[3]=(((gconst30*x2214))+(((-1.0)*x2211*x2213))); |
| 19706 | evalcond[4]=((((-1.0)*gconst30*x2215))+(((-1.0)*x2212*x2213))); |
| 19707 | evalcond[5]=((((-1.0)*new_r10*x2211))+((new_r00*x2212))+(((1.0000000008)*gconst31))); |
| 19708 | evalcond[6]=((((-1.0)*x2213))+((new_r10*x2215))+(((-1.0)*new_r00*x2214))); |
| 19709 | if( 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 ) |
| 19710 | { |
| 19711 | continue; |
| 19712 | } |
| 19713 | } |
| 19714 | |
| 19715 | { |
| 19716 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 19717 | vinfos[0].jointtype = 1; |
| 19718 | vinfos[0].foffset = j0; |
| 19719 | vinfos[0].indices[0] = _ij0[0]; |
| 19720 | vinfos[0].indices[1] = _ij0[1]; |
| 19721 | vinfos[0].maxsolutions = _nj0; |
| 19722 | vinfos[1].jointtype = 1; |
| 19723 | vinfos[1].foffset = j1; |
| 19724 | vinfos[1].indices[0] = _ij1[0]; |
| 19725 | vinfos[1].indices[1] = _ij1[1]; |
| 19726 | vinfos[1].maxsolutions = _nj1; |
| 19727 | vinfos[2].jointtype = 1; |
| 19728 | vinfos[2].foffset = j2; |
| 19729 | vinfos[2].indices[0] = _ij2[0]; |
| 19730 | vinfos[2].indices[1] = _ij2[1]; |
| 19731 | vinfos[2].maxsolutions = _nj2; |
| 19732 | vinfos[3].jointtype = 1; |
| 19733 | vinfos[3].foffset = j3; |
| 19734 | vinfos[3].indices[0] = _ij3[0]; |
| 19735 | vinfos[3].indices[1] = _ij3[1]; |
| 19736 | vinfos[3].maxsolutions = _nj3; |
| 19737 | vinfos[4].jointtype = 1; |
| 19738 | vinfos[4].foffset = j4; |
| 19739 | vinfos[4].indices[0] = _ij4[0]; |
| 19740 | vinfos[4].indices[1] = _ij4[1]; |
| 19741 | vinfos[4].maxsolutions = _nj4; |
| 19742 | vinfos[5].jointtype = 1; |
| 19743 | vinfos[5].foffset = j5; |
| 19744 | vinfos[5].indices[0] = _ij5[0]; |
| 19745 | vinfos[5].indices[1] = _ij5[1]; |
| 19746 | vinfos[5].maxsolutions = _nj5; |
| 19747 | std::vector<int> vfree(0); |
| 19748 | solutions.AddSolution(vinfos,vfree); |
| 19749 | } |
| 19750 | } |
| 19751 | } |
| 19752 | |
| 19753 | } |
| 19754 | |
| 19755 | } |
| 19756 | |
| 19757 | } else |
| 19758 | { |
| 19759 | { |
| 19760 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 19761 | bool j5valid[1]={false}; |
| 19762 | _nj5 = 1; |
| 19763 | IkReal x2216=gconst30*gconst30; |
| 19764 | IkReal x2217=gconst31*gconst31; |
| 19765 | IkReal x2218=((625000000.0)*x2217); |
| 19766 | IkReal x2219=((625000000.5)*gconst31*x2216); |
| 19767 | CheckValue<IkReal> x2220=IKPowWithIntegerCheck(IKsign(((((625000001.0)*x2216*(new_r10*new_r10)))+(((-1.0)*x2218*(new_r00*new_r00))))),-1); |
| 19768 | if(!x2220.valid){ |
| 19769 | continue; |
| 19770 | } |
| 19771 | CheckValue<IkReal> x2221 = IKatan2WithCheck(IkReal((((gconst30*new_r00*x2218))+((new_r10*x2219)))),IkReal(((((-625000001.0)*new_r10*(gconst30*gconst30*gconst30)))+(((-1.0)*new_r00*x2219)))),IKFAST_ATAN2_MAGTHRESH); |
| 19772 | if(!x2221.valid){ |
| 19773 | continue; |
| 19774 | } |
| 19775 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x2220.value)))+(x2221.value)); |
| 19776 | sj5array[0]=IKsin(j5array[0]); |
| 19777 | cj5array[0]=IKcos(j5array[0]); |
| 19778 | if( j5array[0] > IKPI ) |
| 19779 | { |
| 19780 | j5array[0]-=IK2PI; |
| 19781 | } |
| 19782 | else if( j5array[0] < -IKPI ) |
| 19783 | { j5array[0]+=IK2PI; |
| 19784 | } |
| 19785 | j5valid[0] = true; |
| 19786 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 19787 | { |
| 19788 | if( !j5valid[ij5] ) |
| 19789 | { |
| 19790 | continue; |
| 19791 | } |
| 19792 | _ij5[0] = ij5; _ij5[1] = -1; |
| 19793 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 19794 | { |
| 19795 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 19796 | { |
| 19797 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 19798 | } |
| 19799 | } |
| 19800 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 19801 | { |
| 19802 | IkReal evalcond[7]; |
| 19803 | IkReal x2222=IKsin(j5); |
| 19804 | IkReal x2223=IKcos(j5); |
| 19805 | IkReal x2224=((1.0)*gconst31); |
| 19806 | IkReal x2225=((1.0000000008)*x2223); |
| 19807 | IkReal x2226=((1.0000000008)*x2222); |
| 19808 | evalcond[0]=(((new_r00*x2222))+((new_r10*x2223))+gconst30); |
| 19809 | evalcond[1]=(((gconst30*x2222))+((gconst31*x2225))+new_r00); |
| 19810 | evalcond[2]=(((gconst30*x2223))+(((-1.0)*gconst31*x2226))+new_r10); |
| 19811 | evalcond[3]=((((-1.0)*x2222*x2224))+((gconst30*x2225))); |
| 19812 | evalcond[4]=((((-1.0)*x2223*x2224))+(((-1.0)*gconst30*x2226))); |
| 19813 | evalcond[5]=(((new_r00*x2223))+(((1.0000000008)*gconst31))+(((-1.0)*new_r10*x2222))); |
| 19814 | evalcond[6]=((((-1.0)*new_r00*x2225))+((new_r10*x2226))+(((-1.0)*x2224))); |
| 19815 | if( 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 ) |
| 19816 | { |
| 19817 | continue; |
| 19818 | } |
| 19819 | } |
| 19820 | |
| 19821 | { |
| 19822 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 19823 | vinfos[0].jointtype = 1; |
| 19824 | vinfos[0].foffset = j0; |
| 19825 | vinfos[0].indices[0] = _ij0[0]; |
| 19826 | vinfos[0].indices[1] = _ij0[1]; |
| 19827 | vinfos[0].maxsolutions = _nj0; |
| 19828 | vinfos[1].jointtype = 1; |
| 19829 | vinfos[1].foffset = j1; |
| 19830 | vinfos[1].indices[0] = _ij1[0]; |
| 19831 | vinfos[1].indices[1] = _ij1[1]; |
| 19832 | vinfos[1].maxsolutions = _nj1; |
| 19833 | vinfos[2].jointtype = 1; |
| 19834 | vinfos[2].foffset = j2; |
| 19835 | vinfos[2].indices[0] = _ij2[0]; |
| 19836 | vinfos[2].indices[1] = _ij2[1]; |
| 19837 | vinfos[2].maxsolutions = _nj2; |
| 19838 | vinfos[3].jointtype = 1; |
| 19839 | vinfos[3].foffset = j3; |
| 19840 | vinfos[3].indices[0] = _ij3[0]; |
| 19841 | vinfos[3].indices[1] = _ij3[1]; |
| 19842 | vinfos[3].maxsolutions = _nj3; |
| 19843 | vinfos[4].jointtype = 1; |
| 19844 | vinfos[4].foffset = j4; |
| 19845 | vinfos[4].indices[0] = _ij4[0]; |
| 19846 | vinfos[4].indices[1] = _ij4[1]; |
| 19847 | vinfos[4].maxsolutions = _nj4; |
| 19848 | vinfos[5].jointtype = 1; |
| 19849 | vinfos[5].foffset = j5; |
| 19850 | vinfos[5].indices[0] = _ij5[0]; |
| 19851 | vinfos[5].indices[1] = _ij5[1]; |
| 19852 | vinfos[5].maxsolutions = _nj5; |
| 19853 | std::vector<int> vfree(0); |
| 19854 | solutions.AddSolution(vinfos,vfree); |
| 19855 | } |
| 19856 | } |
| 19857 | } |
| 19858 | |
| 19859 | } |
| 19860 | |
| 19861 | } |
| 19862 | |
| 19863 | } else |
| 19864 | { |
| 19865 | { |
| 19866 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 19867 | bool j5valid[1]={false}; |
| 19868 | _nj5 = 1; |
| 19869 | IkReal x2227=((25000.0)*gconst30); |
| 19870 | IkReal x2228=((25000.00002)*gconst31); |
| 19871 | CheckValue<IkReal> x2229 = IKatan2WithCheck(IkReal(((((-1.0)*new_r00*x2227))+((new_r10*x2228)))),IkReal(((((-1.0)*new_r00*x2228))+(((-1.0)*new_r10*x2227)))),IKFAST_ATAN2_MAGTHRESH); |
| 19872 | if(!x2229.valid){ |
| 19873 | continue; |
| 19874 | } |
| 19875 | CheckValue<IkReal> x2230=IKPowWithIntegerCheck(IKsign(((((25000.0)*(new_r10*new_r10)))+(((25000.0)*(new_r00*new_r00))))),-1); |
| 19876 | if(!x2230.valid){ |
| 19877 | continue; |
| 19878 | } |
| 19879 | j5array[0]=((-1.5707963267949)+(x2229.value)+(((1.5707963267949)*(x2230.value)))); |
| 19880 | sj5array[0]=IKsin(j5array[0]); |
| 19881 | cj5array[0]=IKcos(j5array[0]); |
| 19882 | if( j5array[0] > IKPI ) |
| 19883 | { |
| 19884 | j5array[0]-=IK2PI; |
| 19885 | } |
| 19886 | else if( j5array[0] < -IKPI ) |
| 19887 | { j5array[0]+=IK2PI; |
| 19888 | } |
| 19889 | j5valid[0] = true; |
| 19890 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 19891 | { |
| 19892 | if( !j5valid[ij5] ) |
| 19893 | { |
| 19894 | continue; |
| 19895 | } |
| 19896 | _ij5[0] = ij5; _ij5[1] = -1; |
| 19897 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 19898 | { |
| 19899 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 19900 | { |
| 19901 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 19902 | } |
| 19903 | } |
| 19904 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 19905 | { |
| 19906 | IkReal evalcond[7]; |
| 19907 | IkReal x2231=IKsin(j5); |
| 19908 | IkReal x2232=IKcos(j5); |
| 19909 | IkReal x2233=((1.0)*gconst31); |
| 19910 | IkReal x2234=((1.0000000008)*x2232); |
| 19911 | IkReal x2235=((1.0000000008)*x2231); |
| 19912 | evalcond[0]=(((new_r00*x2231))+((new_r10*x2232))+gconst30); |
| 19913 | evalcond[1]=(((gconst31*x2234))+((gconst30*x2231))+new_r00); |
| 19914 | evalcond[2]=(((gconst30*x2232))+(((-1.0)*gconst31*x2235))+new_r10); |
| 19915 | evalcond[3]=(((gconst30*x2234))+(((-1.0)*x2231*x2233))); |
| 19916 | evalcond[4]=((((-1.0)*x2232*x2233))+(((-1.0)*gconst30*x2235))); |
| 19917 | evalcond[5]=(((new_r00*x2232))+(((1.0000000008)*gconst31))+(((-1.0)*new_r10*x2231))); |
| 19918 | evalcond[6]=((((-1.0)*new_r00*x2234))+((new_r10*x2235))+(((-1.0)*x2233))); |
| 19919 | if( 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 ) |
| 19920 | { |
| 19921 | continue; |
| 19922 | } |
| 19923 | } |
| 19924 | |
| 19925 | { |
| 19926 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 19927 | vinfos[0].jointtype = 1; |
| 19928 | vinfos[0].foffset = j0; |
| 19929 | vinfos[0].indices[0] = _ij0[0]; |
| 19930 | vinfos[0].indices[1] = _ij0[1]; |
| 19931 | vinfos[0].maxsolutions = _nj0; |
| 19932 | vinfos[1].jointtype = 1; |
| 19933 | vinfos[1].foffset = j1; |
| 19934 | vinfos[1].indices[0] = _ij1[0]; |
| 19935 | vinfos[1].indices[1] = _ij1[1]; |
| 19936 | vinfos[1].maxsolutions = _nj1; |
| 19937 | vinfos[2].jointtype = 1; |
| 19938 | vinfos[2].foffset = j2; |
| 19939 | vinfos[2].indices[0] = _ij2[0]; |
| 19940 | vinfos[2].indices[1] = _ij2[1]; |
| 19941 | vinfos[2].maxsolutions = _nj2; |
| 19942 | vinfos[3].jointtype = 1; |
| 19943 | vinfos[3].foffset = j3; |
| 19944 | vinfos[3].indices[0] = _ij3[0]; |
| 19945 | vinfos[3].indices[1] = _ij3[1]; |
| 19946 | vinfos[3].maxsolutions = _nj3; |
| 19947 | vinfos[4].jointtype = 1; |
| 19948 | vinfos[4].foffset = j4; |
| 19949 | vinfos[4].indices[0] = _ij4[0]; |
| 19950 | vinfos[4].indices[1] = _ij4[1]; |
| 19951 | vinfos[4].maxsolutions = _nj4; |
| 19952 | vinfos[5].jointtype = 1; |
| 19953 | vinfos[5].foffset = j5; |
| 19954 | vinfos[5].indices[0] = _ij5[0]; |
| 19955 | vinfos[5].indices[1] = _ij5[1]; |
| 19956 | vinfos[5].maxsolutions = _nj5; |
| 19957 | std::vector<int> vfree(0); |
| 19958 | solutions.AddSolution(vinfos,vfree); |
| 19959 | } |
| 19960 | } |
| 19961 | } |
| 19962 | |
| 19963 | } |
| 19964 | |
| 19965 | } |
| 19966 | |
| 19967 | } |
| 19968 | } while(0); |
| 19969 | if( bgotonextstatement ) |
| 19970 | { |
| 19971 | bool bgotonextstatement = true; |
| 19972 | do |
| 19973 | { |
| 19974 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r10))); |
| 19975 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 19976 | { |
| 19977 | bgotonextstatement=false; |
| 19978 | { |
| 19979 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 19980 | bool j5valid[1]={false}; |
| 19981 | _nj5 = 1; |
| 19982 | CheckValue<IkReal> x2237=IKPowWithIntegerCheck(gconst31,-1); |
| 19983 | if(!x2237.valid){ |
| 19984 | continue; |
| 19985 | } |
| 19986 | IkReal x2236=x2237.value; |
| 19987 | if( IKabs((new_r01*x2236)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.9999999992)*new_r00*x2236)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((new_r01*x2236))+IKsqr(((-0.9999999992)*new_r00*x2236))-1) <= IKFAST_SINCOS_THRESH ) |
| 19988 | continue; |
| 19989 | j5array[0]=IKatan2((new_r01*x2236), ((-0.9999999992)*new_r00*x2236)); |
| 19990 | sj5array[0]=IKsin(j5array[0]); |
| 19991 | cj5array[0]=IKcos(j5array[0]); |
| 19992 | if( j5array[0] > IKPI ) |
| 19993 | { |
| 19994 | j5array[0]-=IK2PI; |
| 19995 | } |
| 19996 | else if( j5array[0] < -IKPI ) |
| 19997 | { j5array[0]+=IK2PI; |
| 19998 | } |
| 19999 | j5valid[0] = true; |
| 20000 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 20001 | { |
| 20002 | if( !j5valid[ij5] ) |
| 20003 | { |
| 20004 | continue; |
| 20005 | } |
| 20006 | _ij5[0] = ij5; _ij5[1] = -1; |
| 20007 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 20008 | { |
| 20009 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 20010 | { |
| 20011 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 20012 | } |
| 20013 | } |
| 20014 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 20015 | { |
| 20016 | IkReal evalcond[10]; |
| 20017 | IkReal x2238=IKcos(j5); |
| 20018 | IkReal x2239=IKsin(j5); |
| 20019 | IkReal x2240=((1.0)*gconst31); |
| 20020 | IkReal x2241=((1.0000000008)*gconst31); |
| 20021 | IkReal x2242=(new_r00*x2238); |
| 20022 | IkReal x2243=(new_r01*x2238); |
| 20023 | evalcond[0]=(new_r00*x2239); |
| 20024 | evalcond[1]=x2243; |
| 20025 | evalcond[2]=((-1.0)*gconst31*x2238); |
| 20026 | evalcond[3]=((((-1.0)*x2239*x2240))+new_r01); |
| 20027 | evalcond[4]=(((new_r01*x2239))+(((-1.0)*x2240))); |
| 20028 | evalcond[5]=((-1.0000000008)*gconst31*x2239); |
| 20029 | evalcond[6]=((-1.0000000008)*x2243); |
| 20030 | evalcond[7]=(new_r00+((x2238*x2241))); |
| 20031 | evalcond[8]=(x2241+x2242); |
| 20032 | evalcond[9]=((((-1.0000000008)*x2242))+(((-1.0)*x2240))); |
| 20033 | if( 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 ) |
| 20034 | { |
| 20035 | continue; |
| 20036 | } |
| 20037 | } |
| 20038 | |
| 20039 | { |
| 20040 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 20041 | vinfos[0].jointtype = 1; |
| 20042 | vinfos[0].foffset = j0; |
| 20043 | vinfos[0].indices[0] = _ij0[0]; |
| 20044 | vinfos[0].indices[1] = _ij0[1]; |
| 20045 | vinfos[0].maxsolutions = _nj0; |
| 20046 | vinfos[1].jointtype = 1; |
| 20047 | vinfos[1].foffset = j1; |
| 20048 | vinfos[1].indices[0] = _ij1[0]; |
| 20049 | vinfos[1].indices[1] = _ij1[1]; |
| 20050 | vinfos[1].maxsolutions = _nj1; |
| 20051 | vinfos[2].jointtype = 1; |
| 20052 | vinfos[2].foffset = j2; |
| 20053 | vinfos[2].indices[0] = _ij2[0]; |
| 20054 | vinfos[2].indices[1] = _ij2[1]; |
| 20055 | vinfos[2].maxsolutions = _nj2; |
| 20056 | vinfos[3].jointtype = 1; |
| 20057 | vinfos[3].foffset = j3; |
| 20058 | vinfos[3].indices[0] = _ij3[0]; |
| 20059 | vinfos[3].indices[1] = _ij3[1]; |
| 20060 | vinfos[3].maxsolutions = _nj3; |
| 20061 | vinfos[4].jointtype = 1; |
| 20062 | vinfos[4].foffset = j4; |
| 20063 | vinfos[4].indices[0] = _ij4[0]; |
| 20064 | vinfos[4].indices[1] = _ij4[1]; |
| 20065 | vinfos[4].maxsolutions = _nj4; |
| 20066 | vinfos[5].jointtype = 1; |
| 20067 | vinfos[5].foffset = j5; |
| 20068 | vinfos[5].indices[0] = _ij5[0]; |
| 20069 | vinfos[5].indices[1] = _ij5[1]; |
| 20070 | vinfos[5].maxsolutions = _nj5; |
| 20071 | std::vector<int> vfree(0); |
| 20072 | solutions.AddSolution(vinfos,vfree); |
| 20073 | } |
| 20074 | } |
| 20075 | } |
| 20076 | |
| 20077 | } |
| 20078 | } while(0); |
| 20079 | if( bgotonextstatement ) |
| 20080 | { |
| 20081 | bool bgotonextstatement = true; |
| 20082 | do |
| 20083 | { |
| 20084 | if( 1 ) |
| 20085 | { |
| 20086 | bgotonextstatement=false; |
| 20087 | continue; // branch miss [j5] |
| 20088 | |
| 20089 | } |
| 20090 | } while(0); |
| 20091 | if( bgotonextstatement ) |
| 20092 | { |
| 20093 | } |
| 20094 | } |
| 20095 | } |
| 20096 | } |
| 20097 | } |
| 20098 | |
| 20099 | } else |
| 20100 | { |
| 20101 | { |
| 20102 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 20103 | bool j5valid[1]={false}; |
| 20104 | _nj5 = 1; |
| 20105 | CheckValue<IkReal> x2249=IKPowWithIntegerCheck(new_r00,-1); |
| 20106 | if(!x2249.valid){ |
| 20107 | continue; |
| 20108 | } |
| 20109 | IkReal x2244=x2249.value; |
| 20110 | IkReal x2245=((25000.00002)*gconst31); |
| 20111 | IkReal x2246=((25000.0)*new_r00); |
| 20112 | IkReal x2247=(gconst30*x2244); |
| 20113 | CheckValue<IkReal> x2250=IKPowWithIntegerCheck((((new_r10*x2245))+((gconst30*x2246))),-1); |
| 20114 | if(!x2250.valid){ |
| 20115 | continue; |
| 20116 | } |
| 20117 | IkReal x2248=x2250.value; |
| 20118 | if( IKabs(((((-1.0)*x2247))+((new_r10*x2245*x2247*x2248))+(((25000.0)*x2248*(new_r10*new_r10))))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x2248*(((((-1.0)*new_r10*x2246))+(((-1.0)*gconst30*x2245)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*x2247))+((new_r10*x2245*x2247*x2248))+(((25000.0)*x2248*(new_r10*new_r10)))))+IKsqr((x2248*(((((-1.0)*new_r10*x2246))+(((-1.0)*gconst30*x2245))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 20119 | continue; |
| 20120 | j5array[0]=IKatan2(((((-1.0)*x2247))+((new_r10*x2245*x2247*x2248))+(((25000.0)*x2248*(new_r10*new_r10)))), (x2248*(((((-1.0)*new_r10*x2246))+(((-1.0)*gconst30*x2245)))))); |
| 20121 | sj5array[0]=IKsin(j5array[0]); |
| 20122 | cj5array[0]=IKcos(j5array[0]); |
| 20123 | if( j5array[0] > IKPI ) |
| 20124 | { |
| 20125 | j5array[0]-=IK2PI; |
| 20126 | } |
| 20127 | else if( j5array[0] < -IKPI ) |
| 20128 | { j5array[0]+=IK2PI; |
| 20129 | } |
| 20130 | j5valid[0] = true; |
| 20131 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 20132 | { |
| 20133 | if( !j5valid[ij5] ) |
| 20134 | { |
| 20135 | continue; |
| 20136 | } |
| 20137 | _ij5[0] = ij5; _ij5[1] = -1; |
| 20138 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 20139 | { |
| 20140 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 20141 | { |
| 20142 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 20143 | } |
| 20144 | } |
| 20145 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 20146 | { |
| 20147 | IkReal evalcond[10]; |
| 20148 | IkReal x2251=IKcos(j5); |
| 20149 | IkReal x2252=IKsin(j5); |
| 20150 | IkReal x2253=((1.0)*gconst31); |
| 20151 | IkReal x2254=((1.0000000008)*gconst31); |
| 20152 | IkReal x2255=(gconst30*x2252); |
| 20153 | IkReal x2256=(gconst30*x2251); |
| 20154 | IkReal x2257=(new_r11*x2252); |
| 20155 | IkReal x2258=(new_r01*x2251); |
| 20156 | IkReal x2259=(new_r00*x2251); |
| 20157 | IkReal x2260=(new_r10*x2252); |
| 20158 | evalcond[0]=(((new_r00*x2252))+gconst30+((new_r10*x2251))); |
| 20159 | evalcond[1]=((((-1.0)*x2253))+((new_r11*x2251))+((new_r01*x2252))); |
| 20160 | evalcond[2]=(x2255+new_r00+((x2251*x2254))); |
| 20161 | evalcond[3]=(x2256+(((-1.0)*x2252*x2254))+new_r10); |
| 20162 | evalcond[4]=((((-1.0)*x2252*x2253))+new_r01+(((1.0000000008)*x2256))); |
| 20163 | evalcond[5]=((((-1.0000000008)*x2255))+new_r11+(((-1.0)*x2251*x2253))); |
| 20164 | evalcond[6]=(x2259+x2254+(((-1.0)*x2260))); |
| 20165 | evalcond[7]=(x2258+(((-1.0)*x2257))+(((1.0000000008)*gconst30))); |
| 20166 | evalcond[8]=((((1.0000000008)*x2260))+(((-1.0000000008)*x2259))+(((-1.0)*x2253))); |
| 20167 | evalcond[9]=((((-1.0000000008)*x2258))+(((-1.0)*gconst30))+(((1.0000000008)*x2257))); |
| 20168 | if( 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 ) |
| 20169 | { |
| 20170 | continue; |
| 20171 | } |
| 20172 | } |
| 20173 | |
| 20174 | { |
| 20175 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 20176 | vinfos[0].jointtype = 1; |
| 20177 | vinfos[0].foffset = j0; |
| 20178 | vinfos[0].indices[0] = _ij0[0]; |
| 20179 | vinfos[0].indices[1] = _ij0[1]; |
| 20180 | vinfos[0].maxsolutions = _nj0; |
| 20181 | vinfos[1].jointtype = 1; |
| 20182 | vinfos[1].foffset = j1; |
| 20183 | vinfos[1].indices[0] = _ij1[0]; |
| 20184 | vinfos[1].indices[1] = _ij1[1]; |
| 20185 | vinfos[1].maxsolutions = _nj1; |
| 20186 | vinfos[2].jointtype = 1; |
| 20187 | vinfos[2].foffset = j2; |
| 20188 | vinfos[2].indices[0] = _ij2[0]; |
| 20189 | vinfos[2].indices[1] = _ij2[1]; |
| 20190 | vinfos[2].maxsolutions = _nj2; |
| 20191 | vinfos[3].jointtype = 1; |
| 20192 | vinfos[3].foffset = j3; |
| 20193 | vinfos[3].indices[0] = _ij3[0]; |
| 20194 | vinfos[3].indices[1] = _ij3[1]; |
| 20195 | vinfos[3].maxsolutions = _nj3; |
| 20196 | vinfos[4].jointtype = 1; |
| 20197 | vinfos[4].foffset = j4; |
| 20198 | vinfos[4].indices[0] = _ij4[0]; |
| 20199 | vinfos[4].indices[1] = _ij4[1]; |
| 20200 | vinfos[4].maxsolutions = _nj4; |
| 20201 | vinfos[5].jointtype = 1; |
| 20202 | vinfos[5].foffset = j5; |
| 20203 | vinfos[5].indices[0] = _ij5[0]; |
| 20204 | vinfos[5].indices[1] = _ij5[1]; |
| 20205 | vinfos[5].maxsolutions = _nj5; |
| 20206 | std::vector<int> vfree(0); |
| 20207 | solutions.AddSolution(vinfos,vfree); |
| 20208 | } |
| 20209 | } |
| 20210 | } |
| 20211 | |
| 20212 | } |
| 20213 | |
| 20214 | } |
| 20215 | |
| 20216 | } else |
| 20217 | { |
| 20218 | { |
| 20219 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 20220 | bool j5valid[1]={false}; |
| 20221 | _nj5 = 1; |
| 20222 | CheckValue<IkReal> x2267=IKPowWithIntegerCheck(new_r00,-1); |
| 20223 | if(!x2267.valid){ |
| 20224 | continue; |
| 20225 | } |
| 20226 | IkReal x2261=x2267.value; |
| 20227 | IkReal x2262=gconst30*gconst30; |
| 20228 | IkReal x2263=((25000.0)*new_r10); |
| 20229 | IkReal x2264=((25000.0)*x2262); |
| 20230 | CheckValue<IkReal> x2268=IKPowWithIntegerCheck(((((-1.0)*gconst30*x2263))+(((25000.00002)*gconst31*new_r00))),-1); |
| 20231 | if(!x2268.valid){ |
| 20232 | continue; |
| 20233 | } |
| 20234 | IkReal x2265=x2268.value; |
| 20235 | IkReal x2266=(new_r10*x2265); |
| 20236 | CheckValue<IkReal> x2269=IKPowWithIntegerCheck(((((-25000.0)*gconst30*new_r10))+(((25000.00002)*gconst31*new_r00))),-1); |
| 20237 | if(!x2269.valid){ |
| 20238 | continue; |
| 20239 | } |
| 20240 | CheckValue<IkReal> x2270=IKPowWithIntegerCheck(((((-25000.0)*gconst30*new_r10))+(((25000.00002)*gconst31*new_r00))),-1); |
| 20241 | if(!x2270.valid){ |
| 20242 | continue; |
| 20243 | } |
| 20244 | CheckValue<IkReal> x2271=IKPowWithIntegerCheck(x2261,-2); |
| 20245 | if(!x2271.valid){ |
| 20246 | continue; |
| 20247 | } |
| 20248 | if( IKabs(((((-1.0)*x2261*x2262*x2263*(x2269.value)))+((new_r00*x2263*(x2270.value)))+(((-1.0)*gconst30*x2261)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x2265*((x2264+(((-25000.0)*(x2271.value))))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*x2261*x2262*x2263*(x2269.value)))+((new_r00*x2263*(x2270.value)))+(((-1.0)*gconst30*x2261))))+IKsqr((x2265*((x2264+(((-25000.0)*(x2271.value)))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 20249 | continue; |
| 20250 | j5array[0]=IKatan2(((((-1.0)*x2261*x2262*x2263*(x2269.value)))+((new_r00*x2263*(x2270.value)))+(((-1.0)*gconst30*x2261))), (x2265*((x2264+(((-25000.0)*(x2271.value))))))); |
| 20251 | sj5array[0]=IKsin(j5array[0]); |
| 20252 | cj5array[0]=IKcos(j5array[0]); |
| 20253 | if( j5array[0] > IKPI ) |
| 20254 | { |
| 20255 | j5array[0]-=IK2PI; |
| 20256 | } |
| 20257 | else if( j5array[0] < -IKPI ) |
| 20258 | { j5array[0]+=IK2PI; |
| 20259 | } |
| 20260 | j5valid[0] = true; |
| 20261 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 20262 | { |
| 20263 | if( !j5valid[ij5] ) |
| 20264 | { |
| 20265 | continue; |
| 20266 | } |
| 20267 | _ij5[0] = ij5; _ij5[1] = -1; |
| 20268 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 20269 | { |
| 20270 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 20271 | { |
| 20272 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 20273 | } |
| 20274 | } |
| 20275 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 20276 | { |
| 20277 | IkReal evalcond[10]; |
| 20278 | IkReal x2272=IKcos(j5); |
| 20279 | IkReal x2273=IKsin(j5); |
| 20280 | IkReal x2274=((1.0)*gconst31); |
| 20281 | IkReal x2275=((1.0000000008)*gconst31); |
| 20282 | IkReal x2276=(gconst30*x2273); |
| 20283 | IkReal x2277=(gconst30*x2272); |
| 20284 | IkReal x2278=(new_r11*x2273); |
| 20285 | IkReal x2279=(new_r01*x2272); |
| 20286 | IkReal x2280=(new_r00*x2272); |
| 20287 | IkReal x2281=(new_r10*x2273); |
| 20288 | evalcond[0]=(((new_r10*x2272))+((new_r00*x2273))+gconst30); |
| 20289 | evalcond[1]=(((new_r11*x2272))+((new_r01*x2273))+(((-1.0)*x2274))); |
| 20290 | evalcond[2]=(x2276+((x2272*x2275))+new_r00); |
| 20291 | evalcond[3]=(x2277+(((-1.0)*x2273*x2275))+new_r10); |
| 20292 | evalcond[4]=((((-1.0)*x2273*x2274))+(((1.0000000008)*x2277))+new_r01); |
| 20293 | evalcond[5]=((((-1.0000000008)*x2276))+new_r11+(((-1.0)*x2272*x2274))); |
| 20294 | evalcond[6]=(x2280+x2275+(((-1.0)*x2281))); |
| 20295 | evalcond[7]=(x2279+(((1.0000000008)*gconst30))+(((-1.0)*x2278))); |
| 20296 | evalcond[8]=((((-1.0000000008)*x2280))+(((-1.0)*x2274))+(((1.0000000008)*x2281))); |
| 20297 | evalcond[9]=((((1.0000000008)*x2278))+(((-1.0000000008)*x2279))+(((-1.0)*gconst30))); |
| 20298 | if( 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 ) |
| 20299 | { |
| 20300 | continue; |
| 20301 | } |
| 20302 | } |
| 20303 | |
| 20304 | { |
| 20305 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 20306 | vinfos[0].jointtype = 1; |
| 20307 | vinfos[0].foffset = j0; |
| 20308 | vinfos[0].indices[0] = _ij0[0]; |
| 20309 | vinfos[0].indices[1] = _ij0[1]; |
| 20310 | vinfos[0].maxsolutions = _nj0; |
| 20311 | vinfos[1].jointtype = 1; |
| 20312 | vinfos[1].foffset = j1; |
| 20313 | vinfos[1].indices[0] = _ij1[0]; |
| 20314 | vinfos[1].indices[1] = _ij1[1]; |
| 20315 | vinfos[1].maxsolutions = _nj1; |
| 20316 | vinfos[2].jointtype = 1; |
| 20317 | vinfos[2].foffset = j2; |
| 20318 | vinfos[2].indices[0] = _ij2[0]; |
| 20319 | vinfos[2].indices[1] = _ij2[1]; |
| 20320 | vinfos[2].maxsolutions = _nj2; |
| 20321 | vinfos[3].jointtype = 1; |
| 20322 | vinfos[3].foffset = j3; |
| 20323 | vinfos[3].indices[0] = _ij3[0]; |
| 20324 | vinfos[3].indices[1] = _ij3[1]; |
| 20325 | vinfos[3].maxsolutions = _nj3; |
| 20326 | vinfos[4].jointtype = 1; |
| 20327 | vinfos[4].foffset = j4; |
| 20328 | vinfos[4].indices[0] = _ij4[0]; |
| 20329 | vinfos[4].indices[1] = _ij4[1]; |
| 20330 | vinfos[4].maxsolutions = _nj4; |
| 20331 | vinfos[5].jointtype = 1; |
| 20332 | vinfos[5].foffset = j5; |
| 20333 | vinfos[5].indices[0] = _ij5[0]; |
| 20334 | vinfos[5].indices[1] = _ij5[1]; |
| 20335 | vinfos[5].maxsolutions = _nj5; |
| 20336 | std::vector<int> vfree(0); |
| 20337 | solutions.AddSolution(vinfos,vfree); |
| 20338 | } |
| 20339 | } |
| 20340 | } |
| 20341 | |
| 20342 | } |
| 20343 | |
| 20344 | } |
| 20345 | |
| 20346 | } else |
| 20347 | { |
| 20348 | { |
| 20349 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 20350 | bool j5valid[1]={false}; |
| 20351 | _nj5 = 1; |
| 20352 | IkReal x2282=((1.0)*new_r00); |
| 20353 | CheckValue<IkReal> x2283 = IKatan2WithCheck(IkReal((((gconst30*new_r11))+((gconst31*new_r10)))),IkReal(((((-1.0)*gconst30*new_r01))+(((-1.0)*gconst31*x2282)))),IKFAST_ATAN2_MAGTHRESH); |
| 20354 | if(!x2283.valid){ |
| 20355 | continue; |
| 20356 | } |
| 20357 | CheckValue<IkReal> x2284=IKPowWithIntegerCheck(IKsign((((new_r01*new_r10))+(((-1.0)*new_r11*x2282)))),-1); |
| 20358 | if(!x2284.valid){ |
| 20359 | continue; |
| 20360 | } |
| 20361 | j5array[0]=((-1.5707963267949)+(x2283.value)+(((1.5707963267949)*(x2284.value)))); |
| 20362 | sj5array[0]=IKsin(j5array[0]); |
| 20363 | cj5array[0]=IKcos(j5array[0]); |
| 20364 | if( j5array[0] > IKPI ) |
| 20365 | { |
| 20366 | j5array[0]-=IK2PI; |
| 20367 | } |
| 20368 | else if( j5array[0] < -IKPI ) |
| 20369 | { j5array[0]+=IK2PI; |
| 20370 | } |
| 20371 | j5valid[0] = true; |
| 20372 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 20373 | { |
| 20374 | if( !j5valid[ij5] ) |
| 20375 | { |
| 20376 | continue; |
| 20377 | } |
| 20378 | _ij5[0] = ij5; _ij5[1] = -1; |
| 20379 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 20380 | { |
| 20381 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 20382 | { |
| 20383 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 20384 | } |
| 20385 | } |
| 20386 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 20387 | { |
| 20388 | IkReal evalcond[10]; |
| 20389 | IkReal x2285=IKcos(j5); |
| 20390 | IkReal x2286=IKsin(j5); |
| 20391 | IkReal x2287=((1.0)*gconst31); |
| 20392 | IkReal x2288=((1.0000000008)*gconst31); |
| 20393 | IkReal x2289=(gconst30*x2286); |
| 20394 | IkReal x2290=(gconst30*x2285); |
| 20395 | IkReal x2291=(new_r11*x2286); |
| 20396 | IkReal x2292=(new_r01*x2285); |
| 20397 | IkReal x2293=(new_r00*x2285); |
| 20398 | IkReal x2294=(new_r10*x2286); |
| 20399 | evalcond[0]=(gconst30+((new_r10*x2285))+((new_r00*x2286))); |
| 20400 | evalcond[1]=((((-1.0)*x2287))+((new_r11*x2285))+((new_r01*x2286))); |
| 20401 | evalcond[2]=(x2289+new_r00+((x2285*x2288))); |
| 20402 | evalcond[3]=(x2290+(((-1.0)*x2286*x2288))+new_r10); |
| 20403 | evalcond[4]=((((-1.0)*x2286*x2287))+new_r01+(((1.0000000008)*x2290))); |
| 20404 | evalcond[5]=((((-1.0000000008)*x2289))+(((-1.0)*x2285*x2287))+new_r11); |
| 20405 | evalcond[6]=(x2288+x2293+(((-1.0)*x2294))); |
| 20406 | evalcond[7]=(x2292+(((-1.0)*x2291))+(((1.0000000008)*gconst30))); |
| 20407 | evalcond[8]=((((-1.0000000008)*x2293))+(((-1.0)*x2287))+(((1.0000000008)*x2294))); |
| 20408 | evalcond[9]=((((-1.0000000008)*x2292))+(((-1.0)*gconst30))+(((1.0000000008)*x2291))); |
| 20409 | if( 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 ) |
| 20410 | { |
| 20411 | continue; |
| 20412 | } |
| 20413 | } |
| 20414 | |
| 20415 | { |
| 20416 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 20417 | vinfos[0].jointtype = 1; |
| 20418 | vinfos[0].foffset = j0; |
| 20419 | vinfos[0].indices[0] = _ij0[0]; |
| 20420 | vinfos[0].indices[1] = _ij0[1]; |
| 20421 | vinfos[0].maxsolutions = _nj0; |
| 20422 | vinfos[1].jointtype = 1; |
| 20423 | vinfos[1].foffset = j1; |
| 20424 | vinfos[1].indices[0] = _ij1[0]; |
| 20425 | vinfos[1].indices[1] = _ij1[1]; |
| 20426 | vinfos[1].maxsolutions = _nj1; |
| 20427 | vinfos[2].jointtype = 1; |
| 20428 | vinfos[2].foffset = j2; |
| 20429 | vinfos[2].indices[0] = _ij2[0]; |
| 20430 | vinfos[2].indices[1] = _ij2[1]; |
| 20431 | vinfos[2].maxsolutions = _nj2; |
| 20432 | vinfos[3].jointtype = 1; |
| 20433 | vinfos[3].foffset = j3; |
| 20434 | vinfos[3].indices[0] = _ij3[0]; |
| 20435 | vinfos[3].indices[1] = _ij3[1]; |
| 20436 | vinfos[3].maxsolutions = _nj3; |
| 20437 | vinfos[4].jointtype = 1; |
| 20438 | vinfos[4].foffset = j4; |
| 20439 | vinfos[4].indices[0] = _ij4[0]; |
| 20440 | vinfos[4].indices[1] = _ij4[1]; |
| 20441 | vinfos[4].maxsolutions = _nj4; |
| 20442 | vinfos[5].jointtype = 1; |
| 20443 | vinfos[5].foffset = j5; |
| 20444 | vinfos[5].indices[0] = _ij5[0]; |
| 20445 | vinfos[5].indices[1] = _ij5[1]; |
| 20446 | vinfos[5].maxsolutions = _nj5; |
| 20447 | std::vector<int> vfree(0); |
| 20448 | solutions.AddSolution(vinfos,vfree); |
| 20449 | } |
| 20450 | } |
| 20451 | } |
| 20452 | |
| 20453 | } |
| 20454 | |
| 20455 | } |
| 20456 | |
| 20457 | } |
| 20458 | } while(0); |
| 20459 | if( bgotonextstatement ) |
| 20460 | { |
| 20461 | bool bgotonextstatement = true; |
| 20462 | do |
| 20463 | { |
| 20464 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 20465 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 20466 | { |
| 20467 | bgotonextstatement=false; |
| 20468 | { |
| 20469 | IkReal j5eval[1]; |
| 20470 | sj4=-4.0e-5; |
| 20471 | cj4=-1.0; |
| 20472 | j4=3.14163265; |
| 20473 | new_r11=0; |
| 20474 | new_r01=0; |
| 20475 | new_r22=0; |
| 20476 | new_r20=0; |
| 20477 | j5eval[0]=((IKabs(new_r10))+(IKabs(new_r00))); |
| 20478 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 20479 | { |
| 20480 | { |
| 20481 | IkReal j5eval[1]; |
| 20482 | sj4=-4.0e-5; |
| 20483 | cj4=-1.0; |
| 20484 | j4=3.14163265; |
| 20485 | new_r11=0; |
| 20486 | new_r01=0; |
| 20487 | new_r22=0; |
| 20488 | new_r20=0; |
| 20489 | j5eval[0]=1.0; |
| 20490 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 20491 | { |
| 20492 | continue; // no branches [j5] |
| 20493 | |
| 20494 | } else |
| 20495 | { |
| 20496 | { |
| 20497 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 20498 | bool j5valid[2]={false}; |
| 20499 | _nj5 = 2; |
| 20500 | CheckValue<IkReal> x2296 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r00)),IkReal(((1.0000000008)*new_r10)),IKFAST_ATAN2_MAGTHRESH); |
| 20501 | if(!x2296.valid){ |
| 20502 | continue; |
| 20503 | } |
| 20504 | IkReal x2295=x2296.value; |
| 20505 | j5array[0]=((-1.0)*x2295); |
| 20506 | sj5array[0]=IKsin(j5array[0]); |
| 20507 | cj5array[0]=IKcos(j5array[0]); |
| 20508 | j5array[1]=((3.14159265358979)+(((-1.0)*x2295))); |
| 20509 | sj5array[1]=IKsin(j5array[1]); |
| 20510 | cj5array[1]=IKcos(j5array[1]); |
| 20511 | if( j5array[0] > IKPI ) |
| 20512 | { |
| 20513 | j5array[0]-=IK2PI; |
| 20514 | } |
| 20515 | else if( j5array[0] < -IKPI ) |
| 20516 | { j5array[0]+=IK2PI; |
| 20517 | } |
| 20518 | j5valid[0] = true; |
| 20519 | if( j5array[1] > IKPI ) |
| 20520 | { |
| 20521 | j5array[1]-=IK2PI; |
| 20522 | } |
| 20523 | else if( j5array[1] < -IKPI ) |
| 20524 | { j5array[1]+=IK2PI; |
| 20525 | } |
| 20526 | j5valid[1] = true; |
| 20527 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 20528 | { |
| 20529 | if( !j5valid[ij5] ) |
| 20530 | { |
| 20531 | continue; |
| 20532 | } |
| 20533 | _ij5[0] = ij5; _ij5[1] = -1; |
| 20534 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 20535 | { |
| 20536 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 20537 | { |
| 20538 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 20539 | } |
| 20540 | } |
| 20541 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 20542 | { |
| 20543 | IkReal evalcond[2]; |
| 20544 | IkReal x2297=IKcos(j5); |
| 20545 | IkReal x2298=IKsin(j5); |
| 20546 | evalcond[0]=(((new_r00*x2298))+((new_r10*x2297))); |
| 20547 | evalcond[1]=(((new_r00*x2297))+(((-1.0)*new_r10*x2298))); |
| 20548 | if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH ) |
| 20549 | { |
| 20550 | continue; |
| 20551 | } |
| 20552 | } |
| 20553 | |
| 20554 | { |
| 20555 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 20556 | vinfos[0].jointtype = 1; |
| 20557 | vinfos[0].foffset = j0; |
| 20558 | vinfos[0].indices[0] = _ij0[0]; |
| 20559 | vinfos[0].indices[1] = _ij0[1]; |
| 20560 | vinfos[0].maxsolutions = _nj0; |
| 20561 | vinfos[1].jointtype = 1; |
| 20562 | vinfos[1].foffset = j1; |
| 20563 | vinfos[1].indices[0] = _ij1[0]; |
| 20564 | vinfos[1].indices[1] = _ij1[1]; |
| 20565 | vinfos[1].maxsolutions = _nj1; |
| 20566 | vinfos[2].jointtype = 1; |
| 20567 | vinfos[2].foffset = j2; |
| 20568 | vinfos[2].indices[0] = _ij2[0]; |
| 20569 | vinfos[2].indices[1] = _ij2[1]; |
| 20570 | vinfos[2].maxsolutions = _nj2; |
| 20571 | vinfos[3].jointtype = 1; |
| 20572 | vinfos[3].foffset = j3; |
| 20573 | vinfos[3].indices[0] = _ij3[0]; |
| 20574 | vinfos[3].indices[1] = _ij3[1]; |
| 20575 | vinfos[3].maxsolutions = _nj3; |
| 20576 | vinfos[4].jointtype = 1; |
| 20577 | vinfos[4].foffset = j4; |
| 20578 | vinfos[4].indices[0] = _ij4[0]; |
| 20579 | vinfos[4].indices[1] = _ij4[1]; |
| 20580 | vinfos[4].maxsolutions = _nj4; |
| 20581 | vinfos[5].jointtype = 1; |
| 20582 | vinfos[5].foffset = j5; |
| 20583 | vinfos[5].indices[0] = _ij5[0]; |
| 20584 | vinfos[5].indices[1] = _ij5[1]; |
| 20585 | vinfos[5].maxsolutions = _nj5; |
| 20586 | std::vector<int> vfree(0); |
| 20587 | solutions.AddSolution(vinfos,vfree); |
| 20588 | } |
| 20589 | } |
| 20590 | } |
| 20591 | |
| 20592 | } |
| 20593 | |
| 20594 | } |
| 20595 | |
| 20596 | } else |
| 20597 | { |
| 20598 | { |
| 20599 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 20600 | bool j5valid[2]={false}; |
| 20601 | _nj5 = 2; |
| 20602 | CheckValue<IkReal> x2300 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 20603 | if(!x2300.valid){ |
| 20604 | continue; |
| 20605 | } |
| 20606 | IkReal x2299=x2300.value; |
| 20607 | j5array[0]=((-1.0)*x2299); |
| 20608 | sj5array[0]=IKsin(j5array[0]); |
| 20609 | cj5array[0]=IKcos(j5array[0]); |
| 20610 | j5array[1]=((3.14159265358979)+(((-1.0)*x2299))); |
| 20611 | sj5array[1]=IKsin(j5array[1]); |
| 20612 | cj5array[1]=IKcos(j5array[1]); |
| 20613 | if( j5array[0] > IKPI ) |
| 20614 | { |
| 20615 | j5array[0]-=IK2PI; |
| 20616 | } |
| 20617 | else if( j5array[0] < -IKPI ) |
| 20618 | { j5array[0]+=IK2PI; |
| 20619 | } |
| 20620 | j5valid[0] = true; |
| 20621 | if( j5array[1] > IKPI ) |
| 20622 | { |
| 20623 | j5array[1]-=IK2PI; |
| 20624 | } |
| 20625 | else if( j5array[1] < -IKPI ) |
| 20626 | { j5array[1]+=IK2PI; |
| 20627 | } |
| 20628 | j5valid[1] = true; |
| 20629 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 20630 | { |
| 20631 | if( !j5valid[ij5] ) |
| 20632 | { |
| 20633 | continue; |
| 20634 | } |
| 20635 | _ij5[0] = ij5; _ij5[1] = -1; |
| 20636 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 20637 | { |
| 20638 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 20639 | { |
| 20640 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 20641 | } |
| 20642 | } |
| 20643 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 20644 | { |
| 20645 | IkReal evalcond[2]; |
| 20646 | IkReal x2301=IKsin(j5); |
| 20647 | IkReal x2302=IKcos(j5); |
| 20648 | IkReal x2303=(new_r00*x2302); |
| 20649 | IkReal x2304=(new_r10*x2301); |
| 20650 | evalcond[0]=((((-1.0)*x2304))+x2303); |
| 20651 | evalcond[1]=((((1.0000000008)*x2304))+(((-1.0000000008)*x2303))); |
| 20652 | if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH ) |
| 20653 | { |
| 20654 | continue; |
| 20655 | } |
| 20656 | } |
| 20657 | |
| 20658 | { |
| 20659 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 20660 | vinfos[0].jointtype = 1; |
| 20661 | vinfos[0].foffset = j0; |
| 20662 | vinfos[0].indices[0] = _ij0[0]; |
| 20663 | vinfos[0].indices[1] = _ij0[1]; |
| 20664 | vinfos[0].maxsolutions = _nj0; |
| 20665 | vinfos[1].jointtype = 1; |
| 20666 | vinfos[1].foffset = j1; |
| 20667 | vinfos[1].indices[0] = _ij1[0]; |
| 20668 | vinfos[1].indices[1] = _ij1[1]; |
| 20669 | vinfos[1].maxsolutions = _nj1; |
| 20670 | vinfos[2].jointtype = 1; |
| 20671 | vinfos[2].foffset = j2; |
| 20672 | vinfos[2].indices[0] = _ij2[0]; |
| 20673 | vinfos[2].indices[1] = _ij2[1]; |
| 20674 | vinfos[2].maxsolutions = _nj2; |
| 20675 | vinfos[3].jointtype = 1; |
| 20676 | vinfos[3].foffset = j3; |
| 20677 | vinfos[3].indices[0] = _ij3[0]; |
| 20678 | vinfos[3].indices[1] = _ij3[1]; |
| 20679 | vinfos[3].maxsolutions = _nj3; |
| 20680 | vinfos[4].jointtype = 1; |
| 20681 | vinfos[4].foffset = j4; |
| 20682 | vinfos[4].indices[0] = _ij4[0]; |
| 20683 | vinfos[4].indices[1] = _ij4[1]; |
| 20684 | vinfos[4].maxsolutions = _nj4; |
| 20685 | vinfos[5].jointtype = 1; |
| 20686 | vinfos[5].foffset = j5; |
| 20687 | vinfos[5].indices[0] = _ij5[0]; |
| 20688 | vinfos[5].indices[1] = _ij5[1]; |
| 20689 | vinfos[5].maxsolutions = _nj5; |
| 20690 | std::vector<int> vfree(0); |
| 20691 | solutions.AddSolution(vinfos,vfree); |
| 20692 | } |
| 20693 | } |
| 20694 | } |
| 20695 | |
| 20696 | } |
| 20697 | |
| 20698 | } |
| 20699 | |
| 20700 | } |
| 20701 | } while(0); |
| 20702 | if( bgotonextstatement ) |
| 20703 | { |
| 20704 | bool bgotonextstatement = true; |
| 20705 | do |
| 20706 | { |
| 20707 | evalcond[0]=((IKabs(new_r11))+(IKabs(new_r10))); |
| 20708 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 20709 | { |
| 20710 | bgotonextstatement=false; |
| 20711 | { |
| 20712 | IkReal j5eval[1]; |
| 20713 | sj4=-4.0e-5; |
| 20714 | cj4=-1.0; |
| 20715 | j4=3.14163265; |
| 20716 | new_r11=0; |
| 20717 | new_r10=0; |
| 20718 | new_r22=0; |
| 20719 | new_r02=0; |
| 20720 | j5eval[0]=new_r00; |
| 20721 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 20722 | { |
| 20723 | { |
| 20724 | IkReal j5eval[2]; |
| 20725 | sj4=-4.0e-5; |
| 20726 | cj4=-1.0; |
| 20727 | j4=3.14163265; |
| 20728 | new_r11=0; |
| 20729 | new_r10=0; |
| 20730 | new_r22=0; |
| 20731 | new_r02=0; |
| 20732 | j5eval[0]=new_r00; |
| 20733 | j5eval[1]=new_r01; |
| 20734 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 20735 | { |
| 20736 | continue; // no branches [j5] |
| 20737 | |
| 20738 | } else |
| 20739 | { |
| 20740 | { |
| 20741 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 20742 | bool j5valid[1]={false}; |
| 20743 | _nj5 = 1; |
| 20744 | CheckValue<IkReal> x2305=IKPowWithIntegerCheck(new_r00,-1); |
| 20745 | if(!x2305.valid){ |
| 20746 | continue; |
| 20747 | } |
| 20748 | CheckValue<IkReal> x2306=IKPowWithIntegerCheck(new_r01,-1); |
| 20749 | if(!x2306.valid){ |
| 20750 | continue; |
| 20751 | } |
| 20752 | if( IKabs(((-1.0)*sj3*(x2305.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0000000008)*sj3*(x2306.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*sj3*(x2305.value)))+IKsqr(((-1.0000000008)*sj3*(x2306.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 20753 | continue; |
| 20754 | j5array[0]=IKatan2(((-1.0)*sj3*(x2305.value)), ((-1.0000000008)*sj3*(x2306.value))); |
| 20755 | sj5array[0]=IKsin(j5array[0]); |
| 20756 | cj5array[0]=IKcos(j5array[0]); |
| 20757 | if( j5array[0] > IKPI ) |
| 20758 | { |
| 20759 | j5array[0]-=IK2PI; |
| 20760 | } |
| 20761 | else if( j5array[0] < -IKPI ) |
| 20762 | { j5array[0]+=IK2PI; |
| 20763 | } |
| 20764 | j5valid[0] = true; |
| 20765 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 20766 | { |
| 20767 | if( !j5valid[ij5] ) |
| 20768 | { |
| 20769 | continue; |
| 20770 | } |
| 20771 | _ij5[0] = ij5; _ij5[1] = -1; |
| 20772 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 20773 | { |
| 20774 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 20775 | { |
| 20776 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 20777 | } |
| 20778 | } |
| 20779 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 20780 | { |
| 20781 | IkReal evalcond[10]; |
| 20782 | IkReal x2307=IKsin(j5); |
| 20783 | IkReal x2308=IKcos(j5); |
| 20784 | IkReal x2309=((1.0)*cj3); |
| 20785 | IkReal x2310=((1.0000000008)*cj3); |
| 20786 | IkReal x2311=((1.0000000008)*sj3); |
| 20787 | IkReal x2312=(new_r00*x2308); |
| 20788 | IkReal x2313=(sj3*x2308); |
| 20789 | IkReal x2314=(new_r01*x2308); |
| 20790 | evalcond[0]=(((new_r00*x2307))+sj3); |
| 20791 | evalcond[1]=((((-1.0)*x2309))+((new_r01*x2307))); |
| 20792 | evalcond[2]=(x2312+x2310); |
| 20793 | evalcond[3]=(x2314+x2311); |
| 20794 | evalcond[4]=((((-1.0000000008)*x2312))+(((-1.0)*x2309))); |
| 20795 | evalcond[5]=((((-1.0)*sj3))+(((-1.0000000008)*x2314))); |
| 20796 | evalcond[6]=(x2313+(((-1.0)*x2307*x2310))); |
| 20797 | evalcond[7]=(((x2308*x2310))+((sj3*x2307))+new_r00); |
| 20798 | evalcond[8]=((((-1.0)*x2308*x2309))+(((-1.0)*x2307*x2311))); |
| 20799 | evalcond[9]=(((x2308*x2311))+new_r01+(((-1.0)*x2307*x2309))); |
| 20800 | if( 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 ) |
| 20801 | { |
| 20802 | continue; |
| 20803 | } |
| 20804 | } |
| 20805 | |
| 20806 | { |
| 20807 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 20808 | vinfos[0].jointtype = 1; |
| 20809 | vinfos[0].foffset = j0; |
| 20810 | vinfos[0].indices[0] = _ij0[0]; |
| 20811 | vinfos[0].indices[1] = _ij0[1]; |
| 20812 | vinfos[0].maxsolutions = _nj0; |
| 20813 | vinfos[1].jointtype = 1; |
| 20814 | vinfos[1].foffset = j1; |
| 20815 | vinfos[1].indices[0] = _ij1[0]; |
| 20816 | vinfos[1].indices[1] = _ij1[1]; |
| 20817 | vinfos[1].maxsolutions = _nj1; |
| 20818 | vinfos[2].jointtype = 1; |
| 20819 | vinfos[2].foffset = j2; |
| 20820 | vinfos[2].indices[0] = _ij2[0]; |
| 20821 | vinfos[2].indices[1] = _ij2[1]; |
| 20822 | vinfos[2].maxsolutions = _nj2; |
| 20823 | vinfos[3].jointtype = 1; |
| 20824 | vinfos[3].foffset = j3; |
| 20825 | vinfos[3].indices[0] = _ij3[0]; |
| 20826 | vinfos[3].indices[1] = _ij3[1]; |
| 20827 | vinfos[3].maxsolutions = _nj3; |
| 20828 | vinfos[4].jointtype = 1; |
| 20829 | vinfos[4].foffset = j4; |
| 20830 | vinfos[4].indices[0] = _ij4[0]; |
| 20831 | vinfos[4].indices[1] = _ij4[1]; |
| 20832 | vinfos[4].maxsolutions = _nj4; |
| 20833 | vinfos[5].jointtype = 1; |
| 20834 | vinfos[5].foffset = j5; |
| 20835 | vinfos[5].indices[0] = _ij5[0]; |
| 20836 | vinfos[5].indices[1] = _ij5[1]; |
| 20837 | vinfos[5].maxsolutions = _nj5; |
| 20838 | std::vector<int> vfree(0); |
| 20839 | solutions.AddSolution(vinfos,vfree); |
| 20840 | } |
| 20841 | } |
| 20842 | } |
| 20843 | |
| 20844 | } |
| 20845 | |
| 20846 | } |
| 20847 | |
| 20848 | } else |
| 20849 | { |
| 20850 | { |
| 20851 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 20852 | bool j5valid[1]={false}; |
| 20853 | _nj5 = 1; |
| 20854 | CheckValue<IkReal> x2316=IKPowWithIntegerCheck(new_r00,-1); |
| 20855 | if(!x2316.valid){ |
| 20856 | continue; |
| 20857 | } |
| 20858 | IkReal x2315=x2316.value; |
| 20859 | if( IKabs(((-1.0)*sj3*x2315)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0000000008)*cj3*x2315)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*sj3*x2315))+IKsqr(((-1.0000000008)*cj3*x2315))-1) <= IKFAST_SINCOS_THRESH ) |
| 20860 | continue; |
| 20861 | j5array[0]=IKatan2(((-1.0)*sj3*x2315), ((-1.0000000008)*cj3*x2315)); |
| 20862 | sj5array[0]=IKsin(j5array[0]); |
| 20863 | cj5array[0]=IKcos(j5array[0]); |
| 20864 | if( j5array[0] > IKPI ) |
| 20865 | { |
| 20866 | j5array[0]-=IK2PI; |
| 20867 | } |
| 20868 | else if( j5array[0] < -IKPI ) |
| 20869 | { j5array[0]+=IK2PI; |
| 20870 | } |
| 20871 | j5valid[0] = true; |
| 20872 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 20873 | { |
| 20874 | if( !j5valid[ij5] ) |
| 20875 | { |
| 20876 | continue; |
| 20877 | } |
| 20878 | _ij5[0] = ij5; _ij5[1] = -1; |
| 20879 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 20880 | { |
| 20881 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 20882 | { |
| 20883 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 20884 | } |
| 20885 | } |
| 20886 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 20887 | { |
| 20888 | IkReal evalcond[10]; |
| 20889 | IkReal x2317=IKsin(j5); |
| 20890 | IkReal x2318=IKcos(j5); |
| 20891 | IkReal x2319=((1.0)*cj3); |
| 20892 | IkReal x2320=((1.0000000008)*cj3); |
| 20893 | IkReal x2321=((1.0000000008)*sj3); |
| 20894 | IkReal x2322=(new_r00*x2318); |
| 20895 | IkReal x2323=(sj3*x2318); |
| 20896 | IkReal x2324=(new_r01*x2318); |
| 20897 | evalcond[0]=(sj3+((new_r00*x2317))); |
| 20898 | evalcond[1]=(((new_r01*x2317))+(((-1.0)*x2319))); |
| 20899 | evalcond[2]=(x2322+x2320); |
| 20900 | evalcond[3]=(x2321+x2324); |
| 20901 | evalcond[4]=((((-1.0000000008)*x2322))+(((-1.0)*x2319))); |
| 20902 | evalcond[5]=((((-1.0)*sj3))+(((-1.0000000008)*x2324))); |
| 20903 | evalcond[6]=(x2323+(((-1.0)*x2317*x2320))); |
| 20904 | evalcond[7]=(((sj3*x2317))+((x2318*x2320))+new_r00); |
| 20905 | evalcond[8]=((((-1.0)*x2318*x2319))+(((-1.0)*x2317*x2321))); |
| 20906 | evalcond[9]=(((x2318*x2321))+(((-1.0)*x2317*x2319))+new_r01); |
| 20907 | if( 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 ) |
| 20908 | { |
| 20909 | continue; |
| 20910 | } |
| 20911 | } |
| 20912 | |
| 20913 | { |
| 20914 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 20915 | vinfos[0].jointtype = 1; |
| 20916 | vinfos[0].foffset = j0; |
| 20917 | vinfos[0].indices[0] = _ij0[0]; |
| 20918 | vinfos[0].indices[1] = _ij0[1]; |
| 20919 | vinfos[0].maxsolutions = _nj0; |
| 20920 | vinfos[1].jointtype = 1; |
| 20921 | vinfos[1].foffset = j1; |
| 20922 | vinfos[1].indices[0] = _ij1[0]; |
| 20923 | vinfos[1].indices[1] = _ij1[1]; |
| 20924 | vinfos[1].maxsolutions = _nj1; |
| 20925 | vinfos[2].jointtype = 1; |
| 20926 | vinfos[2].foffset = j2; |
| 20927 | vinfos[2].indices[0] = _ij2[0]; |
| 20928 | vinfos[2].indices[1] = _ij2[1]; |
| 20929 | vinfos[2].maxsolutions = _nj2; |
| 20930 | vinfos[3].jointtype = 1; |
| 20931 | vinfos[3].foffset = j3; |
| 20932 | vinfos[3].indices[0] = _ij3[0]; |
| 20933 | vinfos[3].indices[1] = _ij3[1]; |
| 20934 | vinfos[3].maxsolutions = _nj3; |
| 20935 | vinfos[4].jointtype = 1; |
| 20936 | vinfos[4].foffset = j4; |
| 20937 | vinfos[4].indices[0] = _ij4[0]; |
| 20938 | vinfos[4].indices[1] = _ij4[1]; |
| 20939 | vinfos[4].maxsolutions = _nj4; |
| 20940 | vinfos[5].jointtype = 1; |
| 20941 | vinfos[5].foffset = j5; |
| 20942 | vinfos[5].indices[0] = _ij5[0]; |
| 20943 | vinfos[5].indices[1] = _ij5[1]; |
| 20944 | vinfos[5].maxsolutions = _nj5; |
| 20945 | std::vector<int> vfree(0); |
| 20946 | solutions.AddSolution(vinfos,vfree); |
| 20947 | } |
| 20948 | } |
| 20949 | } |
| 20950 | |
| 20951 | } |
| 20952 | |
| 20953 | } |
| 20954 | |
| 20955 | } |
| 20956 | } while(0); |
| 20957 | if( bgotonextstatement ) |
| 20958 | { |
| 20959 | bool bgotonextstatement = true; |
| 20960 | do |
| 20961 | { |
| 20962 | evalcond[0]=((IKabs(new_r00))+(IKabs(new_r01))); |
| 20963 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 20964 | { |
| 20965 | bgotonextstatement=false; |
| 20966 | { |
| 20967 | IkReal j5eval[1]; |
| 20968 | sj4=-4.0e-5; |
| 20969 | cj4=-1.0; |
| 20970 | j4=3.14163265; |
| 20971 | new_r00=0; |
| 20972 | new_r01=0; |
| 20973 | new_r12=0; |
| 20974 | new_r22=0; |
| 20975 | j5eval[0]=new_r10; |
| 20976 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 20977 | { |
| 20978 | { |
| 20979 | IkReal j5eval[2]; |
| 20980 | sj4=-4.0e-5; |
| 20981 | cj4=-1.0; |
| 20982 | j4=3.14163265; |
| 20983 | new_r00=0; |
| 20984 | new_r01=0; |
| 20985 | new_r12=0; |
| 20986 | new_r22=0; |
| 20987 | j5eval[0]=new_r11; |
| 20988 | j5eval[1]=new_r10; |
| 20989 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 20990 | { |
| 20991 | continue; // no branches [j5] |
| 20992 | |
| 20993 | } else |
| 20994 | { |
| 20995 | { |
| 20996 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 20997 | bool j5valid[1]={false}; |
| 20998 | _nj5 = 1; |
| 20999 | CheckValue<IkReal> x2325=IKPowWithIntegerCheck(new_r11,-1); |
| 21000 | if(!x2325.valid){ |
| 21001 | continue; |
| 21002 | } |
| 21003 | CheckValue<IkReal> x2326=IKPowWithIntegerCheck(new_r10,-1); |
| 21004 | if(!x2326.valid){ |
| 21005 | continue; |
| 21006 | } |
| 21007 | if( IKabs(((1.0000000008)*sj3*(x2325.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*sj3*(x2326.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((1.0000000008)*sj3*(x2325.value)))+IKsqr(((-1.0)*sj3*(x2326.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 21008 | continue; |
| 21009 | j5array[0]=IKatan2(((1.0000000008)*sj3*(x2325.value)), ((-1.0)*sj3*(x2326.value))); |
| 21010 | sj5array[0]=IKsin(j5array[0]); |
| 21011 | cj5array[0]=IKcos(j5array[0]); |
| 21012 | if( j5array[0] > IKPI ) |
| 21013 | { |
| 21014 | j5array[0]-=IK2PI; |
| 21015 | } |
| 21016 | else if( j5array[0] < -IKPI ) |
| 21017 | { j5array[0]+=IK2PI; |
| 21018 | } |
| 21019 | j5valid[0] = true; |
| 21020 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 21021 | { |
| 21022 | if( !j5valid[ij5] ) |
| 21023 | { |
| 21024 | continue; |
| 21025 | } |
| 21026 | _ij5[0] = ij5; _ij5[1] = -1; |
| 21027 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 21028 | { |
| 21029 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 21030 | { |
| 21031 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 21032 | } |
| 21033 | } |
| 21034 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 21035 | { |
| 21036 | IkReal evalcond[10]; |
| 21037 | IkReal x2327=IKcos(j5); |
| 21038 | IkReal x2328=IKsin(j5); |
| 21039 | IkReal x2329=((1.0)*cj3); |
| 21040 | IkReal x2330=((1.0000000008)*cj3); |
| 21041 | IkReal x2331=((1.0000000008)*sj3); |
| 21042 | IkReal x2332=(sj3*x2327); |
| 21043 | IkReal x2333=(new_r10*x2328); |
| 21044 | IkReal x2334=(new_r11*x2328); |
| 21045 | evalcond[0]=(sj3+((new_r10*x2327))); |
| 21046 | evalcond[1]=(((new_r11*x2327))+(((-1.0)*x2329))); |
| 21047 | evalcond[2]=(x2330+(((-1.0)*x2333))); |
| 21048 | evalcond[3]=(x2331+(((-1.0)*x2334))); |
| 21049 | evalcond[4]=((((1.0000000008)*x2333))+(((-1.0)*x2329))); |
| 21050 | evalcond[5]=((((-1.0)*sj3))+(((1.0000000008)*x2334))); |
| 21051 | evalcond[6]=(((sj3*x2328))+((x2327*x2330))); |
| 21052 | evalcond[7]=((((-1.0)*x2328*x2330))+x2332+new_r10); |
| 21053 | evalcond[8]=((((-1.0)*x2328*x2329))+((x2327*x2331))); |
| 21054 | evalcond[9]=((((-1.0)*x2328*x2331))+(((-1.0)*x2327*x2329))+new_r11); |
| 21055 | if( 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 ) |
| 21056 | { |
| 21057 | continue; |
| 21058 | } |
| 21059 | } |
| 21060 | |
| 21061 | { |
| 21062 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 21063 | vinfos[0].jointtype = 1; |
| 21064 | vinfos[0].foffset = j0; |
| 21065 | vinfos[0].indices[0] = _ij0[0]; |
| 21066 | vinfos[0].indices[1] = _ij0[1]; |
| 21067 | vinfos[0].maxsolutions = _nj0; |
| 21068 | vinfos[1].jointtype = 1; |
| 21069 | vinfos[1].foffset = j1; |
| 21070 | vinfos[1].indices[0] = _ij1[0]; |
| 21071 | vinfos[1].indices[1] = _ij1[1]; |
| 21072 | vinfos[1].maxsolutions = _nj1; |
| 21073 | vinfos[2].jointtype = 1; |
| 21074 | vinfos[2].foffset = j2; |
| 21075 | vinfos[2].indices[0] = _ij2[0]; |
| 21076 | vinfos[2].indices[1] = _ij2[1]; |
| 21077 | vinfos[2].maxsolutions = _nj2; |
| 21078 | vinfos[3].jointtype = 1; |
| 21079 | vinfos[3].foffset = j3; |
| 21080 | vinfos[3].indices[0] = _ij3[0]; |
| 21081 | vinfos[3].indices[1] = _ij3[1]; |
| 21082 | vinfos[3].maxsolutions = _nj3; |
| 21083 | vinfos[4].jointtype = 1; |
| 21084 | vinfos[4].foffset = j4; |
| 21085 | vinfos[4].indices[0] = _ij4[0]; |
| 21086 | vinfos[4].indices[1] = _ij4[1]; |
| 21087 | vinfos[4].maxsolutions = _nj4; |
| 21088 | vinfos[5].jointtype = 1; |
| 21089 | vinfos[5].foffset = j5; |
| 21090 | vinfos[5].indices[0] = _ij5[0]; |
| 21091 | vinfos[5].indices[1] = _ij5[1]; |
| 21092 | vinfos[5].maxsolutions = _nj5; |
| 21093 | std::vector<int> vfree(0); |
| 21094 | solutions.AddSolution(vinfos,vfree); |
| 21095 | } |
| 21096 | } |
| 21097 | } |
| 21098 | |
| 21099 | } |
| 21100 | |
| 21101 | } |
| 21102 | |
| 21103 | } else |
| 21104 | { |
| 21105 | { |
| 21106 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 21107 | bool j5valid[1]={false}; |
| 21108 | _nj5 = 1; |
| 21109 | CheckValue<IkReal> x2336=IKPowWithIntegerCheck(new_r10,-1); |
| 21110 | if(!x2336.valid){ |
| 21111 | continue; |
| 21112 | } |
| 21113 | IkReal x2335=x2336.value; |
| 21114 | if( IKabs(((1.0000000008)*cj3*x2335)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*sj3*x2335)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((1.0000000008)*cj3*x2335))+IKsqr(((-1.0)*sj3*x2335))-1) <= IKFAST_SINCOS_THRESH ) |
| 21115 | continue; |
| 21116 | j5array[0]=IKatan2(((1.0000000008)*cj3*x2335), ((-1.0)*sj3*x2335)); |
| 21117 | sj5array[0]=IKsin(j5array[0]); |
| 21118 | cj5array[0]=IKcos(j5array[0]); |
| 21119 | if( j5array[0] > IKPI ) |
| 21120 | { |
| 21121 | j5array[0]-=IK2PI; |
| 21122 | } |
| 21123 | else if( j5array[0] < -IKPI ) |
| 21124 | { j5array[0]+=IK2PI; |
| 21125 | } |
| 21126 | j5valid[0] = true; |
| 21127 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 21128 | { |
| 21129 | if( !j5valid[ij5] ) |
| 21130 | { |
| 21131 | continue; |
| 21132 | } |
| 21133 | _ij5[0] = ij5; _ij5[1] = -1; |
| 21134 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 21135 | { |
| 21136 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 21137 | { |
| 21138 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 21139 | } |
| 21140 | } |
| 21141 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 21142 | { |
| 21143 | IkReal evalcond[10]; |
| 21144 | IkReal x2337=IKcos(j5); |
| 21145 | IkReal x2338=IKsin(j5); |
| 21146 | IkReal x2339=((1.0)*cj3); |
| 21147 | IkReal x2340=((1.0000000008)*cj3); |
| 21148 | IkReal x2341=((1.0000000008)*sj3); |
| 21149 | IkReal x2342=(sj3*x2337); |
| 21150 | IkReal x2343=(new_r10*x2338); |
| 21151 | IkReal x2344=(new_r11*x2338); |
| 21152 | evalcond[0]=(sj3+((new_r10*x2337))); |
| 21153 | evalcond[1]=((((-1.0)*x2339))+((new_r11*x2337))); |
| 21154 | evalcond[2]=(x2340+(((-1.0)*x2343))); |
| 21155 | evalcond[3]=(x2341+(((-1.0)*x2344))); |
| 21156 | evalcond[4]=((((-1.0)*x2339))+(((1.0000000008)*x2343))); |
| 21157 | evalcond[5]=((((-1.0)*sj3))+(((1.0000000008)*x2344))); |
| 21158 | evalcond[6]=(((sj3*x2338))+((x2337*x2340))); |
| 21159 | evalcond[7]=(x2342+new_r10+(((-1.0)*x2338*x2340))); |
| 21160 | evalcond[8]=((((-1.0)*x2338*x2339))+((x2337*x2341))); |
| 21161 | evalcond[9]=((((-1.0)*x2337*x2339))+new_r11+(((-1.0)*x2338*x2341))); |
| 21162 | if( 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 ) |
| 21163 | { |
| 21164 | continue; |
| 21165 | } |
| 21166 | } |
| 21167 | |
| 21168 | { |
| 21169 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 21170 | vinfos[0].jointtype = 1; |
| 21171 | vinfos[0].foffset = j0; |
| 21172 | vinfos[0].indices[0] = _ij0[0]; |
| 21173 | vinfos[0].indices[1] = _ij0[1]; |
| 21174 | vinfos[0].maxsolutions = _nj0; |
| 21175 | vinfos[1].jointtype = 1; |
| 21176 | vinfos[1].foffset = j1; |
| 21177 | vinfos[1].indices[0] = _ij1[0]; |
| 21178 | vinfos[1].indices[1] = _ij1[1]; |
| 21179 | vinfos[1].maxsolutions = _nj1; |
| 21180 | vinfos[2].jointtype = 1; |
| 21181 | vinfos[2].foffset = j2; |
| 21182 | vinfos[2].indices[0] = _ij2[0]; |
| 21183 | vinfos[2].indices[1] = _ij2[1]; |
| 21184 | vinfos[2].maxsolutions = _nj2; |
| 21185 | vinfos[3].jointtype = 1; |
| 21186 | vinfos[3].foffset = j3; |
| 21187 | vinfos[3].indices[0] = _ij3[0]; |
| 21188 | vinfos[3].indices[1] = _ij3[1]; |
| 21189 | vinfos[3].maxsolutions = _nj3; |
| 21190 | vinfos[4].jointtype = 1; |
| 21191 | vinfos[4].foffset = j4; |
| 21192 | vinfos[4].indices[0] = _ij4[0]; |
| 21193 | vinfos[4].indices[1] = _ij4[1]; |
| 21194 | vinfos[4].maxsolutions = _nj4; |
| 21195 | vinfos[5].jointtype = 1; |
| 21196 | vinfos[5].foffset = j5; |
| 21197 | vinfos[5].indices[0] = _ij5[0]; |
| 21198 | vinfos[5].indices[1] = _ij5[1]; |
| 21199 | vinfos[5].maxsolutions = _nj5; |
| 21200 | std::vector<int> vfree(0); |
| 21201 | solutions.AddSolution(vinfos,vfree); |
| 21202 | } |
| 21203 | } |
| 21204 | } |
| 21205 | |
| 21206 | } |
| 21207 | |
| 21208 | } |
| 21209 | |
| 21210 | } |
| 21211 | } while(0); |
| 21212 | if( bgotonextstatement ) |
| 21213 | { |
| 21214 | bool bgotonextstatement = true; |
| 21215 | do |
| 21216 | { |
| 21217 | evalcond[0]=((IKabs(new_r10))+(IKabs(new_r00))); |
| 21218 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 21219 | { |
| 21220 | bgotonextstatement=false; |
| 21221 | { |
| 21222 | IkReal j5eval[1]; |
| 21223 | sj4=-4.0e-5; |
| 21224 | cj4=-1.0; |
| 21225 | j4=3.14163265; |
| 21226 | new_r00=0; |
| 21227 | new_r10=0; |
| 21228 | new_r21=0; |
| 21229 | new_r22=0; |
| 21230 | j5eval[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 21231 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 21232 | { |
| 21233 | { |
| 21234 | IkReal j5eval[1]; |
| 21235 | sj4=-4.0e-5; |
| 21236 | cj4=-1.0; |
| 21237 | j4=3.14163265; |
| 21238 | new_r00=0; |
| 21239 | new_r10=0; |
| 21240 | new_r21=0; |
| 21241 | new_r22=0; |
| 21242 | j5eval[0]=1.0; |
| 21243 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 21244 | { |
| 21245 | continue; // no branches [j5] |
| 21246 | |
| 21247 | } else |
| 21248 | { |
| 21249 | { |
| 21250 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 21251 | bool j5valid[2]={false}; |
| 21252 | _nj5 = 2; |
| 21253 | CheckValue<IkReal> x2346 = IKatan2WithCheck(IkReal(((-1.0000000008)*new_r01)),IkReal(((1.0000000008)*new_r11)),IKFAST_ATAN2_MAGTHRESH); |
| 21254 | if(!x2346.valid){ |
| 21255 | continue; |
| 21256 | } |
| 21257 | IkReal x2345=x2346.value; |
| 21258 | j5array[0]=((-1.0)*x2345); |
| 21259 | sj5array[0]=IKsin(j5array[0]); |
| 21260 | cj5array[0]=IKcos(j5array[0]); |
| 21261 | j5array[1]=((3.14159265358979)+(((-1.0)*x2345))); |
| 21262 | sj5array[1]=IKsin(j5array[1]); |
| 21263 | cj5array[1]=IKcos(j5array[1]); |
| 21264 | if( j5array[0] > IKPI ) |
| 21265 | { |
| 21266 | j5array[0]-=IK2PI; |
| 21267 | } |
| 21268 | else if( j5array[0] < -IKPI ) |
| 21269 | { j5array[0]+=IK2PI; |
| 21270 | } |
| 21271 | j5valid[0] = true; |
| 21272 | if( j5array[1] > IKPI ) |
| 21273 | { |
| 21274 | j5array[1]-=IK2PI; |
| 21275 | } |
| 21276 | else if( j5array[1] < -IKPI ) |
| 21277 | { j5array[1]+=IK2PI; |
| 21278 | } |
| 21279 | j5valid[1] = true; |
| 21280 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 21281 | { |
| 21282 | if( !j5valid[ij5] ) |
| 21283 | { |
| 21284 | continue; |
| 21285 | } |
| 21286 | _ij5[0] = ij5; _ij5[1] = -1; |
| 21287 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 21288 | { |
| 21289 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 21290 | { |
| 21291 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 21292 | } |
| 21293 | } |
| 21294 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 21295 | { |
| 21296 | IkReal evalcond[2]; |
| 21297 | IkReal x2347=IKcos(j5); |
| 21298 | IkReal x2348=IKsin(j5); |
| 21299 | evalcond[0]=(((new_r11*x2347))+((new_r01*x2348))); |
| 21300 | evalcond[1]=((((-1.0)*new_r11*x2348))+((new_r01*x2347))); |
| 21301 | if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH ) |
| 21302 | { |
| 21303 | continue; |
| 21304 | } |
| 21305 | } |
| 21306 | |
| 21307 | { |
| 21308 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 21309 | vinfos[0].jointtype = 1; |
| 21310 | vinfos[0].foffset = j0; |
| 21311 | vinfos[0].indices[0] = _ij0[0]; |
| 21312 | vinfos[0].indices[1] = _ij0[1]; |
| 21313 | vinfos[0].maxsolutions = _nj0; |
| 21314 | vinfos[1].jointtype = 1; |
| 21315 | vinfos[1].foffset = j1; |
| 21316 | vinfos[1].indices[0] = _ij1[0]; |
| 21317 | vinfos[1].indices[1] = _ij1[1]; |
| 21318 | vinfos[1].maxsolutions = _nj1; |
| 21319 | vinfos[2].jointtype = 1; |
| 21320 | vinfos[2].foffset = j2; |
| 21321 | vinfos[2].indices[0] = _ij2[0]; |
| 21322 | vinfos[2].indices[1] = _ij2[1]; |
| 21323 | vinfos[2].maxsolutions = _nj2; |
| 21324 | vinfos[3].jointtype = 1; |
| 21325 | vinfos[3].foffset = j3; |
| 21326 | vinfos[3].indices[0] = _ij3[0]; |
| 21327 | vinfos[3].indices[1] = _ij3[1]; |
| 21328 | vinfos[3].maxsolutions = _nj3; |
| 21329 | vinfos[4].jointtype = 1; |
| 21330 | vinfos[4].foffset = j4; |
| 21331 | vinfos[4].indices[0] = _ij4[0]; |
| 21332 | vinfos[4].indices[1] = _ij4[1]; |
| 21333 | vinfos[4].maxsolutions = _nj4; |
| 21334 | vinfos[5].jointtype = 1; |
| 21335 | vinfos[5].foffset = j5; |
| 21336 | vinfos[5].indices[0] = _ij5[0]; |
| 21337 | vinfos[5].indices[1] = _ij5[1]; |
| 21338 | vinfos[5].maxsolutions = _nj5; |
| 21339 | std::vector<int> vfree(0); |
| 21340 | solutions.AddSolution(vinfos,vfree); |
| 21341 | } |
| 21342 | } |
| 21343 | } |
| 21344 | |
| 21345 | } |
| 21346 | |
| 21347 | } |
| 21348 | |
| 21349 | } else |
| 21350 | { |
| 21351 | { |
| 21352 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 21353 | bool j5valid[2]={false}; |
| 21354 | _nj5 = 2; |
| 21355 | CheckValue<IkReal> x2350 = IKatan2WithCheck(IkReal(new_r11),IkReal(new_r01),IKFAST_ATAN2_MAGTHRESH); |
| 21356 | if(!x2350.valid){ |
| 21357 | continue; |
| 21358 | } |
| 21359 | IkReal x2349=x2350.value; |
| 21360 | j5array[0]=((-1.0)*x2349); |
| 21361 | sj5array[0]=IKsin(j5array[0]); |
| 21362 | cj5array[0]=IKcos(j5array[0]); |
| 21363 | j5array[1]=((3.14159265358979)+(((-1.0)*x2349))); |
| 21364 | sj5array[1]=IKsin(j5array[1]); |
| 21365 | cj5array[1]=IKcos(j5array[1]); |
| 21366 | if( j5array[0] > IKPI ) |
| 21367 | { |
| 21368 | j5array[0]-=IK2PI; |
| 21369 | } |
| 21370 | else if( j5array[0] < -IKPI ) |
| 21371 | { j5array[0]+=IK2PI; |
| 21372 | } |
| 21373 | j5valid[0] = true; |
| 21374 | if( j5array[1] > IKPI ) |
| 21375 | { |
| 21376 | j5array[1]-=IK2PI; |
| 21377 | } |
| 21378 | else if( j5array[1] < -IKPI ) |
| 21379 | { j5array[1]+=IK2PI; |
| 21380 | } |
| 21381 | j5valid[1] = true; |
| 21382 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 21383 | { |
| 21384 | if( !j5valid[ij5] ) |
| 21385 | { |
| 21386 | continue; |
| 21387 | } |
| 21388 | _ij5[0] = ij5; _ij5[1] = -1; |
| 21389 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 21390 | { |
| 21391 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 21392 | { |
| 21393 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 21394 | } |
| 21395 | } |
| 21396 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 21397 | { |
| 21398 | IkReal evalcond[2]; |
| 21399 | IkReal x2351=IKsin(j5); |
| 21400 | IkReal x2352=IKcos(j5); |
| 21401 | IkReal x2353=(new_r11*x2351); |
| 21402 | IkReal x2354=(new_r01*x2352); |
| 21403 | evalcond[0]=(x2354+(((-1.0)*x2353))); |
| 21404 | evalcond[1]=((((-1.0000000008)*x2354))+(((1.0000000008)*x2353))); |
| 21405 | if( IKabs(evalcond[0]) > IKFAST_EVALCOND_THRESH || IKabs(evalcond[1]) > IKFAST_EVALCOND_THRESH ) |
| 21406 | { |
| 21407 | continue; |
| 21408 | } |
| 21409 | } |
| 21410 | |
| 21411 | { |
| 21412 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 21413 | vinfos[0].jointtype = 1; |
| 21414 | vinfos[0].foffset = j0; |
| 21415 | vinfos[0].indices[0] = _ij0[0]; |
| 21416 | vinfos[0].indices[1] = _ij0[1]; |
| 21417 | vinfos[0].maxsolutions = _nj0; |
| 21418 | vinfos[1].jointtype = 1; |
| 21419 | vinfos[1].foffset = j1; |
| 21420 | vinfos[1].indices[0] = _ij1[0]; |
| 21421 | vinfos[1].indices[1] = _ij1[1]; |
| 21422 | vinfos[1].maxsolutions = _nj1; |
| 21423 | vinfos[2].jointtype = 1; |
| 21424 | vinfos[2].foffset = j2; |
| 21425 | vinfos[2].indices[0] = _ij2[0]; |
| 21426 | vinfos[2].indices[1] = _ij2[1]; |
| 21427 | vinfos[2].maxsolutions = _nj2; |
| 21428 | vinfos[3].jointtype = 1; |
| 21429 | vinfos[3].foffset = j3; |
| 21430 | vinfos[3].indices[0] = _ij3[0]; |
| 21431 | vinfos[3].indices[1] = _ij3[1]; |
| 21432 | vinfos[3].maxsolutions = _nj3; |
| 21433 | vinfos[4].jointtype = 1; |
| 21434 | vinfos[4].foffset = j4; |
| 21435 | vinfos[4].indices[0] = _ij4[0]; |
| 21436 | vinfos[4].indices[1] = _ij4[1]; |
| 21437 | vinfos[4].maxsolutions = _nj4; |
| 21438 | vinfos[5].jointtype = 1; |
| 21439 | vinfos[5].foffset = j5; |
| 21440 | vinfos[5].indices[0] = _ij5[0]; |
| 21441 | vinfos[5].indices[1] = _ij5[1]; |
| 21442 | vinfos[5].maxsolutions = _nj5; |
| 21443 | std::vector<int> vfree(0); |
| 21444 | solutions.AddSolution(vinfos,vfree); |
| 21445 | } |
| 21446 | } |
| 21447 | } |
| 21448 | |
| 21449 | } |
| 21450 | |
| 21451 | } |
| 21452 | |
| 21453 | } |
| 21454 | } while(0); |
| 21455 | if( bgotonextstatement ) |
| 21456 | { |
| 21457 | bool bgotonextstatement = true; |
| 21458 | do |
| 21459 | { |
| 21460 | if( 1 ) |
| 21461 | { |
| 21462 | bgotonextstatement=false; |
| 21463 | continue; // branch miss [j5] |
| 21464 | |
| 21465 | } |
| 21466 | } while(0); |
| 21467 | if( bgotonextstatement ) |
| 21468 | { |
| 21469 | } |
| 21470 | } |
| 21471 | } |
| 21472 | } |
| 21473 | } |
| 21474 | } |
| 21475 | } |
| 21476 | } |
| 21477 | } |
| 21478 | } |
| 21479 | |
| 21480 | } else |
| 21481 | { |
| 21482 | { |
| 21483 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 21484 | bool j5valid[1]={false}; |
| 21485 | _nj5 = 1; |
| 21486 | CheckValue<IkReal> x2360=IKPowWithIntegerCheck(new_r00,-1); |
| 21487 | if(!x2360.valid){ |
| 21488 | continue; |
| 21489 | } |
| 21490 | IkReal x2355=x2360.value; |
| 21491 | IkReal x2356=(sj3*x2355); |
| 21492 | IkReal x2357=((25000.0)*new_r00); |
| 21493 | IkReal x2358=((25000.00002)*cj3*new_r10); |
| 21494 | CheckValue<IkReal> x2361=IKPowWithIntegerCheck((x2358+((sj3*x2357))),-1); |
| 21495 | if(!x2361.valid){ |
| 21496 | continue; |
| 21497 | } |
| 21498 | IkReal x2359=x2361.value; |
| 21499 | if( IKabs((((x2356*x2358*x2359))+(((25000.0)*x2359*(new_r10*new_r10)))+(((-1.0)*x2356)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x2359*(((((-1.0)*new_r10*x2357))+(((-25000.00002)*cj3*sj3)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((x2356*x2358*x2359))+(((25000.0)*x2359*(new_r10*new_r10)))+(((-1.0)*x2356))))+IKsqr((x2359*(((((-1.0)*new_r10*x2357))+(((-25000.00002)*cj3*sj3))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 21500 | continue; |
| 21501 | j5array[0]=IKatan2((((x2356*x2358*x2359))+(((25000.0)*x2359*(new_r10*new_r10)))+(((-1.0)*x2356))), (x2359*(((((-1.0)*new_r10*x2357))+(((-25000.00002)*cj3*sj3)))))); |
| 21502 | sj5array[0]=IKsin(j5array[0]); |
| 21503 | cj5array[0]=IKcos(j5array[0]); |
| 21504 | if( j5array[0] > IKPI ) |
| 21505 | { |
| 21506 | j5array[0]-=IK2PI; |
| 21507 | } |
| 21508 | else if( j5array[0] < -IKPI ) |
| 21509 | { j5array[0]+=IK2PI; |
| 21510 | } |
| 21511 | j5valid[0] = true; |
| 21512 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 21513 | { |
| 21514 | if( !j5valid[ij5] ) |
| 21515 | { |
| 21516 | continue; |
| 21517 | } |
| 21518 | _ij5[0] = ij5; _ij5[1] = -1; |
| 21519 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 21520 | { |
| 21521 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 21522 | { |
| 21523 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 21524 | } |
| 21525 | } |
| 21526 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 21527 | { |
| 21528 | IkReal evalcond[10]; |
| 21529 | IkReal x2362=IKcos(j5); |
| 21530 | IkReal x2363=IKsin(j5); |
| 21531 | IkReal x2364=((1.0)*cj3); |
| 21532 | IkReal x2365=((1.0000000008)*cj3); |
| 21533 | IkReal x2366=(cj3*x2362); |
| 21534 | IkReal x2367=(new_r11*x2363); |
| 21535 | IkReal x2368=(sj3*x2363); |
| 21536 | IkReal x2369=(new_r01*x2362); |
| 21537 | IkReal x2370=(new_r00*x2362); |
| 21538 | IkReal x2371=(sj3*x2362); |
| 21539 | IkReal x2372=(new_r10*x2363); |
| 21540 | evalcond[0]=(((new_r00*x2363))+sj3+((new_r10*x2362))); |
| 21541 | evalcond[1]=(((new_r01*x2363))+(((-1.0)*x2364))+((new_r11*x2362))); |
| 21542 | evalcond[2]=(x2368+((x2362*x2365))+new_r00); |
| 21543 | evalcond[3]=(x2371+new_r10+(((-1.0)*x2363*x2365))); |
| 21544 | evalcond[4]=((((1.0000000008)*x2371))+new_r01+(((-1.0)*x2363*x2364))); |
| 21545 | evalcond[5]=((((-1.0000000008)*x2368))+new_r11+(((-1.0)*x2362*x2364))); |
| 21546 | evalcond[6]=(x2370+x2365+(((-1.0)*x2372))); |
| 21547 | evalcond[7]=(x2369+(((-1.0)*x2367))+(((1.0000000008)*sj3))); |
| 21548 | evalcond[8]=((((-1.0000000008)*x2370))+(((1.0000000008)*x2372))+(((-1.0)*x2364))); |
| 21549 | evalcond[9]=((((-1.0000000008)*x2369))+(((-1.0)*sj3))+(((1.0000000008)*x2367))); |
| 21550 | if( 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 ) |
| 21551 | { |
| 21552 | continue; |
| 21553 | } |
| 21554 | } |
| 21555 | |
| 21556 | { |
| 21557 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 21558 | vinfos[0].jointtype = 1; |
| 21559 | vinfos[0].foffset = j0; |
| 21560 | vinfos[0].indices[0] = _ij0[0]; |
| 21561 | vinfos[0].indices[1] = _ij0[1]; |
| 21562 | vinfos[0].maxsolutions = _nj0; |
| 21563 | vinfos[1].jointtype = 1; |
| 21564 | vinfos[1].foffset = j1; |
| 21565 | vinfos[1].indices[0] = _ij1[0]; |
| 21566 | vinfos[1].indices[1] = _ij1[1]; |
| 21567 | vinfos[1].maxsolutions = _nj1; |
| 21568 | vinfos[2].jointtype = 1; |
| 21569 | vinfos[2].foffset = j2; |
| 21570 | vinfos[2].indices[0] = _ij2[0]; |
| 21571 | vinfos[2].indices[1] = _ij2[1]; |
| 21572 | vinfos[2].maxsolutions = _nj2; |
| 21573 | vinfos[3].jointtype = 1; |
| 21574 | vinfos[3].foffset = j3; |
| 21575 | vinfos[3].indices[0] = _ij3[0]; |
| 21576 | vinfos[3].indices[1] = _ij3[1]; |
| 21577 | vinfos[3].maxsolutions = _nj3; |
| 21578 | vinfos[4].jointtype = 1; |
| 21579 | vinfos[4].foffset = j4; |
| 21580 | vinfos[4].indices[0] = _ij4[0]; |
| 21581 | vinfos[4].indices[1] = _ij4[1]; |
| 21582 | vinfos[4].maxsolutions = _nj4; |
| 21583 | vinfos[5].jointtype = 1; |
| 21584 | vinfos[5].foffset = j5; |
| 21585 | vinfos[5].indices[0] = _ij5[0]; |
| 21586 | vinfos[5].indices[1] = _ij5[1]; |
| 21587 | vinfos[5].maxsolutions = _nj5; |
| 21588 | std::vector<int> vfree(0); |
| 21589 | solutions.AddSolution(vinfos,vfree); |
| 21590 | } |
| 21591 | } |
| 21592 | } |
| 21593 | |
| 21594 | } |
| 21595 | |
| 21596 | } |
| 21597 | |
| 21598 | } else |
| 21599 | { |
| 21600 | { |
| 21601 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 21602 | bool j5valid[1]={false}; |
| 21603 | _nj5 = 1; |
| 21604 | CheckValue<IkReal> x2379=IKPowWithIntegerCheck(new_r00,-1); |
| 21605 | if(!x2379.valid){ |
| 21606 | continue; |
| 21607 | } |
| 21608 | IkReal x2373=x2379.value; |
| 21609 | IkReal x2374=((25000.0)*cj3); |
| 21610 | IkReal x2375=((25000.0)*new_r01); |
| 21611 | IkReal x2376=(sj3*x2373); |
| 21612 | CheckValue<IkReal> x2380=IKPowWithIntegerCheck((((new_r10*x2374))+(((25000.00002)*new_r00*sj3))),-1); |
| 21613 | if(!x2380.valid){ |
| 21614 | continue; |
| 21615 | } |
| 21616 | IkReal x2377=x2380.value; |
| 21617 | IkReal x2378=(new_r10*x2377); |
| 21618 | if( IKabs((((x2375*x2378))+((x2374*x2376*x2378))+(((-1.0)*x2376)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((x2377*(((((-1.0)*new_r00*x2375))+(((-1.0)*sj3*x2374)))))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr((((x2375*x2378))+((x2374*x2376*x2378))+(((-1.0)*x2376))))+IKsqr((x2377*(((((-1.0)*new_r00*x2375))+(((-1.0)*sj3*x2374))))))-1) <= IKFAST_SINCOS_THRESH ) |
| 21619 | continue; |
| 21620 | j5array[0]=IKatan2((((x2375*x2378))+((x2374*x2376*x2378))+(((-1.0)*x2376))), (x2377*(((((-1.0)*new_r00*x2375))+(((-1.0)*sj3*x2374)))))); |
| 21621 | sj5array[0]=IKsin(j5array[0]); |
| 21622 | cj5array[0]=IKcos(j5array[0]); |
| 21623 | if( j5array[0] > IKPI ) |
| 21624 | { |
| 21625 | j5array[0]-=IK2PI; |
| 21626 | } |
| 21627 | else if( j5array[0] < -IKPI ) |
| 21628 | { j5array[0]+=IK2PI; |
| 21629 | } |
| 21630 | j5valid[0] = true; |
| 21631 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 21632 | { |
| 21633 | if( !j5valid[ij5] ) |
| 21634 | { |
| 21635 | continue; |
| 21636 | } |
| 21637 | _ij5[0] = ij5; _ij5[1] = -1; |
| 21638 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 21639 | { |
| 21640 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 21641 | { |
| 21642 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 21643 | } |
| 21644 | } |
| 21645 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 21646 | { |
| 21647 | IkReal evalcond[10]; |
| 21648 | IkReal x2381=IKcos(j5); |
| 21649 | IkReal x2382=IKsin(j5); |
| 21650 | IkReal x2383=((1.0)*cj3); |
| 21651 | IkReal x2384=((1.0000000008)*cj3); |
| 21652 | IkReal x2385=(cj3*x2381); |
| 21653 | IkReal x2386=(new_r11*x2382); |
| 21654 | IkReal x2387=(sj3*x2382); |
| 21655 | IkReal x2388=(new_r01*x2381); |
| 21656 | IkReal x2389=(new_r00*x2381); |
| 21657 | IkReal x2390=(sj3*x2381); |
| 21658 | IkReal x2391=(new_r10*x2382); |
| 21659 | evalcond[0]=(((new_r10*x2381))+sj3+((new_r00*x2382))); |
| 21660 | evalcond[1]=(((new_r11*x2381))+((new_r01*x2382))+(((-1.0)*x2383))); |
| 21661 | evalcond[2]=(((x2381*x2384))+x2387+new_r00); |
| 21662 | evalcond[3]=(x2390+(((-1.0)*x2382*x2384))+new_r10); |
| 21663 | evalcond[4]=((((-1.0)*x2382*x2383))+(((1.0000000008)*x2390))+new_r01); |
| 21664 | evalcond[5]=((((-1.0)*x2381*x2383))+(((-1.0000000008)*x2387))+new_r11); |
| 21665 | evalcond[6]=(x2384+x2389+(((-1.0)*x2391))); |
| 21666 | evalcond[7]=(x2388+(((-1.0)*x2386))+(((1.0000000008)*sj3))); |
| 21667 | evalcond[8]=((((-1.0)*x2383))+(((1.0000000008)*x2391))+(((-1.0000000008)*x2389))); |
| 21668 | evalcond[9]=((((-1.0)*sj3))+(((1.0000000008)*x2386))+(((-1.0000000008)*x2388))); |
| 21669 | if( 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 ) |
| 21670 | { |
| 21671 | continue; |
| 21672 | } |
| 21673 | } |
| 21674 | |
| 21675 | { |
| 21676 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 21677 | vinfos[0].jointtype = 1; |
| 21678 | vinfos[0].foffset = j0; |
| 21679 | vinfos[0].indices[0] = _ij0[0]; |
| 21680 | vinfos[0].indices[1] = _ij0[1]; |
| 21681 | vinfos[0].maxsolutions = _nj0; |
| 21682 | vinfos[1].jointtype = 1; |
| 21683 | vinfos[1].foffset = j1; |
| 21684 | vinfos[1].indices[0] = _ij1[0]; |
| 21685 | vinfos[1].indices[1] = _ij1[1]; |
| 21686 | vinfos[1].maxsolutions = _nj1; |
| 21687 | vinfos[2].jointtype = 1; |
| 21688 | vinfos[2].foffset = j2; |
| 21689 | vinfos[2].indices[0] = _ij2[0]; |
| 21690 | vinfos[2].indices[1] = _ij2[1]; |
| 21691 | vinfos[2].maxsolutions = _nj2; |
| 21692 | vinfos[3].jointtype = 1; |
| 21693 | vinfos[3].foffset = j3; |
| 21694 | vinfos[3].indices[0] = _ij3[0]; |
| 21695 | vinfos[3].indices[1] = _ij3[1]; |
| 21696 | vinfos[3].maxsolutions = _nj3; |
| 21697 | vinfos[4].jointtype = 1; |
| 21698 | vinfos[4].foffset = j4; |
| 21699 | vinfos[4].indices[0] = _ij4[0]; |
| 21700 | vinfos[4].indices[1] = _ij4[1]; |
| 21701 | vinfos[4].maxsolutions = _nj4; |
| 21702 | vinfos[5].jointtype = 1; |
| 21703 | vinfos[5].foffset = j5; |
| 21704 | vinfos[5].indices[0] = _ij5[0]; |
| 21705 | vinfos[5].indices[1] = _ij5[1]; |
| 21706 | vinfos[5].maxsolutions = _nj5; |
| 21707 | std::vector<int> vfree(0); |
| 21708 | solutions.AddSolution(vinfos,vfree); |
| 21709 | } |
| 21710 | } |
| 21711 | } |
| 21712 | |
| 21713 | } |
| 21714 | |
| 21715 | } |
| 21716 | |
| 21717 | } else |
| 21718 | { |
| 21719 | { |
| 21720 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 21721 | bool j5valid[1]={false}; |
| 21722 | _nj5 = 1; |
| 21723 | IkReal x2392=((1.0)*new_r00); |
| 21724 | CheckValue<IkReal> x2393 = IKatan2WithCheck(IkReal((((new_r11*sj3))+((cj3*new_r10)))),IkReal(((((-1.0)*new_r01*sj3))+(((-1.0)*cj3*x2392)))),IKFAST_ATAN2_MAGTHRESH); |
| 21725 | if(!x2393.valid){ |
| 21726 | continue; |
| 21727 | } |
| 21728 | CheckValue<IkReal> x2394=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r11*x2392))+((new_r01*new_r10)))),-1); |
| 21729 | if(!x2394.valid){ |
| 21730 | continue; |
| 21731 | } |
| 21732 | j5array[0]=((-1.5707963267949)+(x2393.value)+(((1.5707963267949)*(x2394.value)))); |
| 21733 | sj5array[0]=IKsin(j5array[0]); |
| 21734 | cj5array[0]=IKcos(j5array[0]); |
| 21735 | if( j5array[0] > IKPI ) |
| 21736 | { |
| 21737 | j5array[0]-=IK2PI; |
| 21738 | } |
| 21739 | else if( j5array[0] < -IKPI ) |
| 21740 | { j5array[0]+=IK2PI; |
| 21741 | } |
| 21742 | j5valid[0] = true; |
| 21743 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 21744 | { |
| 21745 | if( !j5valid[ij5] ) |
| 21746 | { |
| 21747 | continue; |
| 21748 | } |
| 21749 | _ij5[0] = ij5; _ij5[1] = -1; |
| 21750 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 21751 | { |
| 21752 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 21753 | { |
| 21754 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 21755 | } |
| 21756 | } |
| 21757 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 21758 | { |
| 21759 | IkReal evalcond[10]; |
| 21760 | IkReal x2395=IKcos(j5); |
| 21761 | IkReal x2396=IKsin(j5); |
| 21762 | IkReal x2397=((1.0)*cj3); |
| 21763 | IkReal x2398=((1.0000000008)*cj3); |
| 21764 | IkReal x2399=(cj3*x2395); |
| 21765 | IkReal x2400=(new_r11*x2396); |
| 21766 | IkReal x2401=(sj3*x2396); |
| 21767 | IkReal x2402=(new_r01*x2395); |
| 21768 | IkReal x2403=(new_r00*x2395); |
| 21769 | IkReal x2404=(sj3*x2395); |
| 21770 | IkReal x2405=(new_r10*x2396); |
| 21771 | evalcond[0]=(((new_r10*x2395))+sj3+((new_r00*x2396))); |
| 21772 | evalcond[1]=(((new_r11*x2395))+((new_r01*x2396))+(((-1.0)*x2397))); |
| 21773 | evalcond[2]=(x2401+new_r00+((x2395*x2398))); |
| 21774 | evalcond[3]=(x2404+(((-1.0)*x2396*x2398))+new_r10); |
| 21775 | evalcond[4]=((((-1.0)*x2396*x2397))+(((1.0000000008)*x2404))+new_r01); |
| 21776 | evalcond[5]=((((-1.0000000008)*x2401))+new_r11+(((-1.0)*x2395*x2397))); |
| 21777 | evalcond[6]=((((-1.0)*x2405))+x2403+x2398); |
| 21778 | evalcond[7]=((((-1.0)*x2400))+x2402+(((1.0000000008)*sj3))); |
| 21779 | evalcond[8]=((((-1.0000000008)*x2403))+(((1.0000000008)*x2405))+(((-1.0)*x2397))); |
| 21780 | evalcond[9]=((((-1.0)*sj3))+(((-1.0000000008)*x2402))+(((1.0000000008)*x2400))); |
| 21781 | if( 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 ) |
| 21782 | { |
| 21783 | continue; |
| 21784 | } |
| 21785 | } |
| 21786 | |
| 21787 | { |
| 21788 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 21789 | vinfos[0].jointtype = 1; |
| 21790 | vinfos[0].foffset = j0; |
| 21791 | vinfos[0].indices[0] = _ij0[0]; |
| 21792 | vinfos[0].indices[1] = _ij0[1]; |
| 21793 | vinfos[0].maxsolutions = _nj0; |
| 21794 | vinfos[1].jointtype = 1; |
| 21795 | vinfos[1].foffset = j1; |
| 21796 | vinfos[1].indices[0] = _ij1[0]; |
| 21797 | vinfos[1].indices[1] = _ij1[1]; |
| 21798 | vinfos[1].maxsolutions = _nj1; |
| 21799 | vinfos[2].jointtype = 1; |
| 21800 | vinfos[2].foffset = j2; |
| 21801 | vinfos[2].indices[0] = _ij2[0]; |
| 21802 | vinfos[2].indices[1] = _ij2[1]; |
| 21803 | vinfos[2].maxsolutions = _nj2; |
| 21804 | vinfos[3].jointtype = 1; |
| 21805 | vinfos[3].foffset = j3; |
| 21806 | vinfos[3].indices[0] = _ij3[0]; |
| 21807 | vinfos[3].indices[1] = _ij3[1]; |
| 21808 | vinfos[3].maxsolutions = _nj3; |
| 21809 | vinfos[4].jointtype = 1; |
| 21810 | vinfos[4].foffset = j4; |
| 21811 | vinfos[4].indices[0] = _ij4[0]; |
| 21812 | vinfos[4].indices[1] = _ij4[1]; |
| 21813 | vinfos[4].maxsolutions = _nj4; |
| 21814 | vinfos[5].jointtype = 1; |
| 21815 | vinfos[5].foffset = j5; |
| 21816 | vinfos[5].indices[0] = _ij5[0]; |
| 21817 | vinfos[5].indices[1] = _ij5[1]; |
| 21818 | vinfos[5].maxsolutions = _nj5; |
| 21819 | std::vector<int> vfree(0); |
| 21820 | solutions.AddSolution(vinfos,vfree); |
| 21821 | } |
| 21822 | } |
| 21823 | } |
| 21824 | |
| 21825 | } |
| 21826 | |
| 21827 | } |
| 21828 | |
| 21829 | } |
| 21830 | } while(0); |
| 21831 | if( bgotonextstatement ) |
| 21832 | { |
| 21833 | bool bgotonextstatement = true; |
| 21834 | do |
| 21835 | { |
| 21836 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j3)))), 6.28318530717959))); |
| 21837 | evalcond[1]=new_r20; |
| 21838 | if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 ) |
| 21839 | { |
| 21840 | bgotonextstatement=false; |
| 21841 | { |
| 21842 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 21843 | bool j5valid[1]={false}; |
| 21844 | _nj5 = 1; |
| 21845 | if( IKabs(((-1.0)*new_r00)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r10)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r00))+IKsqr(((-1.0)*new_r10))-1) <= IKFAST_SINCOS_THRESH ) |
| 21846 | continue; |
| 21847 | j5array[0]=IKatan2(((-1.0)*new_r00), ((-1.0)*new_r10)); |
| 21848 | sj5array[0]=IKsin(j5array[0]); |
| 21849 | cj5array[0]=IKcos(j5array[0]); |
| 21850 | if( j5array[0] > IKPI ) |
| 21851 | { |
| 21852 | j5array[0]-=IK2PI; |
| 21853 | } |
| 21854 | else if( j5array[0] < -IKPI ) |
| 21855 | { j5array[0]+=IK2PI; |
| 21856 | } |
| 21857 | j5valid[0] = true; |
| 21858 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 21859 | { |
| 21860 | if( !j5valid[ij5] ) |
| 21861 | { |
| 21862 | continue; |
| 21863 | } |
| 21864 | _ij5[0] = ij5; _ij5[1] = -1; |
| 21865 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 21866 | { |
| 21867 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 21868 | { |
| 21869 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 21870 | } |
| 21871 | } |
| 21872 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 21873 | { |
| 21874 | IkReal evalcond[18]; |
| 21875 | IkReal x2406=IKsin(j5); |
| 21876 | IkReal x2407=IKcos(j5); |
| 21877 | IkReal x2408=((0.9999999992)*cj4); |
| 21878 | IkReal x2409=((4.0e-5)*new_r22); |
| 21879 | IkReal x2410=((1.0000000008)*sj4); |
| 21880 | IkReal x2411=((3.9999999968e-5)*sj4); |
| 21881 | IkReal x2412=((3.9999999968e-5)*cj4); |
| 21882 | IkReal x2413=((0.9999999992)*sj4); |
| 21883 | IkReal x2414=((1.0)*new_r22); |
| 21884 | IkReal x2415=(new_r22*x2413); |
| 21885 | IkReal x2416=(new_r22*x2412); |
| 21886 | IkReal x2417=(new_r22*x2411); |
| 21887 | IkReal x2418=(new_r12*x2406); |
| 21888 | IkReal x2419=(new_r02*x2407); |
| 21889 | IkReal x2420=(new_r01*x2407); |
| 21890 | IkReal x2421=(new_r00*x2407); |
| 21891 | IkReal x2422=(new_r11*x2406); |
| 21892 | IkReal x2423=(new_r10*x2406); |
| 21893 | evalcond[0]=(x2406+new_r00); |
| 21894 | evalcond[1]=(x2407+new_r10); |
| 21895 | evalcond[2]=(((new_r22*x2406))+new_r11); |
| 21896 | evalcond[3]=((((-1.0)*x2407*x2414))+new_r01); |
| 21897 | evalcond[4]=(((new_r12*x2407))+((new_r02*x2406))); |
| 21898 | evalcond[5]=(((new_r01*x2406))+((new_r11*x2407))); |
| 21899 | evalcond[6]=((1.0)+((new_r00*x2406))+((new_r10*x2407))); |
| 21900 | evalcond[7]=(x2421+(((-1.0)*x2423))); |
| 21901 | evalcond[8]=(((new_r22*x2421))+(((-1.0)*x2414*x2423))); |
| 21902 | evalcond[9]=(x2420+(((-1.0)*x2414))+(((-1.0)*x2422))); |
| 21903 | evalcond[10]=((((-1.0)*x2407*x2409))+((x2407*x2410))+new_r02); |
| 21904 | evalcond[11]=((((-1.0)*x2406*x2410))+new_r12+((x2406*x2409))); |
| 21905 | evalcond[12]=(x2410+x2419+(((-1.0)*x2409))+(((-1.0)*x2418))); |
| 21906 | evalcond[13]=((((-1.0)*x2409*x2423))+(((-1.0)*x2410*x2421))+((x2409*x2421))+((x2410*x2423))); |
| 21907 | evalcond[14]=((-1.0)+(((-4.0e-5)*cj4*sj4))+(((1.59999999872e-9)*cj4*new_r22))+(sj4*sj4)+((new_r22*x2420))+(((-1.0)*x2417))+(((-1.0)*x2414*x2422))); |
| 21908 | evalcond[15]=((((-1.0)*x2409*x2422))+x2415+(((-1.0)*x2410*x2420))+((x2409*x2420))+(((-1.0)*x2416))+((x2410*x2422))); |
| 21909 | evalcond[16]=(x2415+(((-1.0)*x2408*x2418))+((x2408*x2419))+(((-1.0)*x2411*x2418))+(((-1.0)*x2416))+((x2411*x2419))); |
| 21910 | evalcond[17]=((-1.0)+x2417+((new_r22*x2408))+((x2413*x2418))+(((-1.0)*x2412*x2418))+(((-1.0)*x2413*x2419))+((x2412*x2419))); |
| 21911 | if( 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 ) |
| 21912 | { |
| 21913 | continue; |
| 21914 | } |
| 21915 | } |
| 21916 | |
| 21917 | { |
| 21918 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 21919 | vinfos[0].jointtype = 1; |
| 21920 | vinfos[0].foffset = j0; |
| 21921 | vinfos[0].indices[0] = _ij0[0]; |
| 21922 | vinfos[0].indices[1] = _ij0[1]; |
| 21923 | vinfos[0].maxsolutions = _nj0; |
| 21924 | vinfos[1].jointtype = 1; |
| 21925 | vinfos[1].foffset = j1; |
| 21926 | vinfos[1].indices[0] = _ij1[0]; |
| 21927 | vinfos[1].indices[1] = _ij1[1]; |
| 21928 | vinfos[1].maxsolutions = _nj1; |
| 21929 | vinfos[2].jointtype = 1; |
| 21930 | vinfos[2].foffset = j2; |
| 21931 | vinfos[2].indices[0] = _ij2[0]; |
| 21932 | vinfos[2].indices[1] = _ij2[1]; |
| 21933 | vinfos[2].maxsolutions = _nj2; |
| 21934 | vinfos[3].jointtype = 1; |
| 21935 | vinfos[3].foffset = j3; |
| 21936 | vinfos[3].indices[0] = _ij3[0]; |
| 21937 | vinfos[3].indices[1] = _ij3[1]; |
| 21938 | vinfos[3].maxsolutions = _nj3; |
| 21939 | vinfos[4].jointtype = 1; |
| 21940 | vinfos[4].foffset = j4; |
| 21941 | vinfos[4].indices[0] = _ij4[0]; |
| 21942 | vinfos[4].indices[1] = _ij4[1]; |
| 21943 | vinfos[4].maxsolutions = _nj4; |
| 21944 | vinfos[5].jointtype = 1; |
| 21945 | vinfos[5].foffset = j5; |
| 21946 | vinfos[5].indices[0] = _ij5[0]; |
| 21947 | vinfos[5].indices[1] = _ij5[1]; |
| 21948 | vinfos[5].maxsolutions = _nj5; |
| 21949 | std::vector<int> vfree(0); |
| 21950 | solutions.AddSolution(vinfos,vfree); |
| 21951 | } |
| 21952 | } |
| 21953 | } |
| 21954 | |
| 21955 | } |
| 21956 | } while(0); |
| 21957 | if( bgotonextstatement ) |
| 21958 | { |
| 21959 | bool bgotonextstatement = true; |
| 21960 | do |
| 21961 | { |
| 21962 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j3)))), 6.28318530717959))); |
| 21963 | evalcond[1]=new_r20; |
| 21964 | if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 ) |
| 21965 | { |
| 21966 | bgotonextstatement=false; |
| 21967 | { |
| 21968 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 21969 | bool j5valid[1]={false}; |
| 21970 | _nj5 = 1; |
| 21971 | if( IKabs(new_r00) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r10) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r00)+IKsqr(new_r10)-1) <= IKFAST_SINCOS_THRESH ) |
| 21972 | continue; |
| 21973 | j5array[0]=IKatan2(new_r00, new_r10); |
| 21974 | sj5array[0]=IKsin(j5array[0]); |
| 21975 | cj5array[0]=IKcos(j5array[0]); |
| 21976 | if( j5array[0] > IKPI ) |
| 21977 | { |
| 21978 | j5array[0]-=IK2PI; |
| 21979 | } |
| 21980 | else if( j5array[0] < -IKPI ) |
| 21981 | { j5array[0]+=IK2PI; |
| 21982 | } |
| 21983 | j5valid[0] = true; |
| 21984 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 21985 | { |
| 21986 | if( !j5valid[ij5] ) |
| 21987 | { |
| 21988 | continue; |
| 21989 | } |
| 21990 | _ij5[0] = ij5; _ij5[1] = -1; |
| 21991 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 21992 | { |
| 21993 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 21994 | { |
| 21995 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 21996 | } |
| 21997 | } |
| 21998 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 21999 | { |
| 22000 | IkReal evalcond[18]; |
| 22001 | IkReal x2424=IKcos(j5); |
| 22002 | IkReal x2425=IKsin(j5); |
| 22003 | IkReal x2426=((0.9999999992)*cj4); |
| 22004 | IkReal x2427=((3.9999999968e-5)*cj4); |
| 22005 | IkReal x2428=((3.9999999968e-5)*sj4); |
| 22006 | IkReal x2429=((0.9999999992)*sj4); |
| 22007 | IkReal x2430=(new_r12*x2425); |
| 22008 | IkReal x2431=(new_r02*x2424); |
| 22009 | IkReal x2432=(new_r01*x2424); |
| 22010 | IkReal x2433=(new_r11*x2425); |
| 22011 | IkReal x2434=(new_r10*x2425); |
| 22012 | IkReal x2435=(new_r00*x2424); |
| 22013 | evalcond[0]=((((-1.0)*x2425))+new_r00); |
| 22014 | evalcond[1]=((((-1.0)*x2424))+new_r10); |
| 22015 | evalcond[2]=(((new_r12*x2424))+((new_r02*x2425))); |
| 22016 | evalcond[3]=(((new_r11*x2424))+((new_r01*x2425))); |
| 22017 | evalcond[4]=((-1.0)+((new_r10*x2424))+((new_r00*x2425))); |
| 22018 | evalcond[5]=((((-1.0)*x2434))+x2435); |
| 22019 | evalcond[6]=((((-1.0)*x2424*x2427))+((x2424*x2429))+new_r02); |
| 22020 | evalcond[7]=((((-1.0)*x2425*x2429))+((x2425*x2427))+new_r12); |
| 22021 | evalcond[8]=(((x2424*x2426))+((x2424*x2428))+new_r01); |
| 22022 | evalcond[9]=((((-1.0)*x2425*x2428))+(((-1.0)*x2425*x2426))+new_r11); |
| 22023 | evalcond[10]=((((-1.0)*x2430))+x2431+x2429+(((-1.0)*x2427))); |
| 22024 | evalcond[11]=((((-1.0)*x2433))+x2432+x2428+x2426); |
| 22025 | evalcond[12]=(((x2429*x2434))+(((-1.0)*x2427*x2434))+(((-1.0)*x2429*x2435))+((x2427*x2435))); |
| 22026 | evalcond[13]=(((x2428*x2435))+(((-1.0)*x2426*x2434))+(((-1.0)*x2428*x2434))+((x2426*x2435))); |
| 22027 | evalcond[14]=(((x2429*x2433))+((new_r21*x2426))+((new_r21*x2428))+(((-1.0)*x2427*x2433))+(((-1.0)*x2429*x2432))+((x2427*x2432))); |
| 22028 | evalcond[15]=(((x2428*x2431))+(((-1.0)*x2426*x2430))+((new_r22*x2429))+(((-1.0)*x2428*x2430))+((x2426*x2431))+(((-1.0)*new_r22*x2427))); |
| 22029 | evalcond[16]=((-1.0)+((x2429*x2430))+(((-1.0)*x2427*x2430))+((new_r22*x2426))+((new_r22*x2428))+(((-1.0)*x2429*x2431))+((x2427*x2431))); |
| 22030 | evalcond[17]=((1.0)+((x2428*x2432))+((new_r21*x2429))+(((-1.0)*x2426*x2433))+(((-1.0)*new_r21*x2427))+(((-1.0)*x2428*x2433))+((x2426*x2432))); |
| 22031 | if( 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 ) |
| 22032 | { |
| 22033 | continue; |
| 22034 | } |
| 22035 | } |
| 22036 | |
| 22037 | { |
| 22038 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 22039 | vinfos[0].jointtype = 1; |
| 22040 | vinfos[0].foffset = j0; |
| 22041 | vinfos[0].indices[0] = _ij0[0]; |
| 22042 | vinfos[0].indices[1] = _ij0[1]; |
| 22043 | vinfos[0].maxsolutions = _nj0; |
| 22044 | vinfos[1].jointtype = 1; |
| 22045 | vinfos[1].foffset = j1; |
| 22046 | vinfos[1].indices[0] = _ij1[0]; |
| 22047 | vinfos[1].indices[1] = _ij1[1]; |
| 22048 | vinfos[1].maxsolutions = _nj1; |
| 22049 | vinfos[2].jointtype = 1; |
| 22050 | vinfos[2].foffset = j2; |
| 22051 | vinfos[2].indices[0] = _ij2[0]; |
| 22052 | vinfos[2].indices[1] = _ij2[1]; |
| 22053 | vinfos[2].maxsolutions = _nj2; |
| 22054 | vinfos[3].jointtype = 1; |
| 22055 | vinfos[3].foffset = j3; |
| 22056 | vinfos[3].indices[0] = _ij3[0]; |
| 22057 | vinfos[3].indices[1] = _ij3[1]; |
| 22058 | vinfos[3].maxsolutions = _nj3; |
| 22059 | vinfos[4].jointtype = 1; |
| 22060 | vinfos[4].foffset = j4; |
| 22061 | vinfos[4].indices[0] = _ij4[0]; |
| 22062 | vinfos[4].indices[1] = _ij4[1]; |
| 22063 | vinfos[4].maxsolutions = _nj4; |
| 22064 | vinfos[5].jointtype = 1; |
| 22065 | vinfos[5].foffset = j5; |
| 22066 | vinfos[5].indices[0] = _ij5[0]; |
| 22067 | vinfos[5].indices[1] = _ij5[1]; |
| 22068 | vinfos[5].maxsolutions = _nj5; |
| 22069 | std::vector<int> vfree(0); |
| 22070 | solutions.AddSolution(vinfos,vfree); |
| 22071 | } |
| 22072 | } |
| 22073 | } |
| 22074 | |
| 22075 | } |
| 22076 | } while(0); |
| 22077 | if( bgotonextstatement ) |
| 22078 | { |
| 22079 | bool bgotonextstatement = true; |
| 22080 | do |
| 22081 | { |
| 22082 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j3))), 6.28318530717959))); |
| 22083 | evalcond[1]=new_r21; |
| 22084 | if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 ) |
| 22085 | { |
| 22086 | bgotonextstatement=false; |
| 22087 | { |
| 22088 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 22089 | bool j5valid[1]={false}; |
| 22090 | _nj5 = 1; |
| 22091 | if( IKabs(new_r01) < IKFAST_ATAN2_MAGTHRESH && IKabs(new_r11) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(new_r01)+IKsqr(new_r11)-1) <= IKFAST_SINCOS_THRESH ) |
| 22092 | continue; |
| 22093 | j5array[0]=IKatan2(new_r01, new_r11); |
| 22094 | sj5array[0]=IKsin(j5array[0]); |
| 22095 | cj5array[0]=IKcos(j5array[0]); |
| 22096 | if( j5array[0] > IKPI ) |
| 22097 | { |
| 22098 | j5array[0]-=IK2PI; |
| 22099 | } |
| 22100 | else if( j5array[0] < -IKPI ) |
| 22101 | { j5array[0]+=IK2PI; |
| 22102 | } |
| 22103 | j5valid[0] = true; |
| 22104 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 22105 | { |
| 22106 | if( !j5valid[ij5] ) |
| 22107 | { |
| 22108 | continue; |
| 22109 | } |
| 22110 | _ij5[0] = ij5; _ij5[1] = -1; |
| 22111 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 22112 | { |
| 22113 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 22114 | { |
| 22115 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 22116 | } |
| 22117 | } |
| 22118 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 22119 | { |
| 22120 | IkReal evalcond[18]; |
| 22121 | IkReal x2436=IKsin(j5); |
| 22122 | IkReal x2437=IKcos(j5); |
| 22123 | IkReal x2438=((0.9999999992)*cj4); |
| 22124 | IkReal x2439=((0.9999999992)*sj4); |
| 22125 | IkReal x2440=((4.0e-5)*new_r22); |
| 22126 | IkReal x2441=((3.9999999968e-5)*sj4); |
| 22127 | IkReal x2442=((3.9999999968e-5)*cj4); |
| 22128 | IkReal x2443=((1.0000000008)*sj4); |
| 22129 | IkReal x2444=((1.0)*new_r22); |
| 22130 | IkReal x2445=(new_r12*x2436); |
| 22131 | IkReal x2446=(new_r02*x2437); |
| 22132 | IkReal x2447=(new_r01*x2437); |
| 22133 | IkReal x2448=(new_r11*x2436); |
| 22134 | IkReal x2449=(new_r00*x2437); |
| 22135 | IkReal x2450=(new_r10*x2436); |
| 22136 | evalcond[0]=(((new_r22*x2436))+new_r10); |
| 22137 | evalcond[1]=((((-1.0)*x2436))+new_r01); |
| 22138 | evalcond[2]=((((-1.0)*x2437))+new_r11); |
| 22139 | evalcond[3]=((((-1.0)*x2437*x2444))+new_r00); |
| 22140 | evalcond[4]=(((new_r12*x2437))+((new_r02*x2436))); |
| 22141 | evalcond[5]=(((new_r00*x2436))+((new_r10*x2437))); |
| 22142 | evalcond[6]=((-1.0)+((new_r01*x2436))+((new_r11*x2437))); |
| 22143 | evalcond[7]=(x2447+(((-1.0)*x2448))); |
| 22144 | evalcond[8]=((((-1.0)*x2444*x2448))+((new_r22*x2447))); |
| 22145 | evalcond[9]=(x2449+(((-1.0)*x2450))+(((-1.0)*x2444))); |
| 22146 | evalcond[10]=((((-1.0)*x2437*x2440))+((x2437*x2443))+new_r02); |
| 22147 | evalcond[11]=((((-1.0)*x2436*x2443))+new_r12+((x2436*x2440))); |
| 22148 | evalcond[12]=(x2443+x2446+(((-1.0)*x2445))+(((-1.0)*x2440))); |
| 22149 | evalcond[13]=((((-1.0)*x2443*x2447))+((x2443*x2448))+((x2440*x2447))+(((-1.0)*x2440*x2448))); |
| 22150 | evalcond[14]=((((-1.0)*x2442*x2450))+((x2442*x2449))+((new_r20*x2441))+(((-1.0)*x2439*x2449))+((x2439*x2450))+((new_r20*x2438))); |
| 22151 | evalcond[15]=(((new_r22*x2439))+(((-1.0)*x2441*x2445))+(((-1.0)*x2438*x2445))+((x2441*x2446))+(((-1.0)*new_r22*x2442))+((x2438*x2446))); |
| 22152 | evalcond[16]=((-1.0)+((new_r22*x2438))+((x2442*x2446))+(((-1.0)*x2439*x2446))+((new_r22*x2441))+((x2439*x2445))+(((-1.0)*x2442*x2445))); |
| 22153 | evalcond[17]=((-1.0)+(((-1.0)*new_r20*x2442))+(((-1.0)*x2441*x2450))+(((-1.0)*x2438*x2450))+((x2441*x2449))+((x2438*x2449))+((new_r20*x2439))); |
| 22154 | if( 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 ) |
| 22155 | { |
| 22156 | continue; |
| 22157 | } |
| 22158 | } |
| 22159 | |
| 22160 | { |
| 22161 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 22162 | vinfos[0].jointtype = 1; |
| 22163 | vinfos[0].foffset = j0; |
| 22164 | vinfos[0].indices[0] = _ij0[0]; |
| 22165 | vinfos[0].indices[1] = _ij0[1]; |
| 22166 | vinfos[0].maxsolutions = _nj0; |
| 22167 | vinfos[1].jointtype = 1; |
| 22168 | vinfos[1].foffset = j1; |
| 22169 | vinfos[1].indices[0] = _ij1[0]; |
| 22170 | vinfos[1].indices[1] = _ij1[1]; |
| 22171 | vinfos[1].maxsolutions = _nj1; |
| 22172 | vinfos[2].jointtype = 1; |
| 22173 | vinfos[2].foffset = j2; |
| 22174 | vinfos[2].indices[0] = _ij2[0]; |
| 22175 | vinfos[2].indices[1] = _ij2[1]; |
| 22176 | vinfos[2].maxsolutions = _nj2; |
| 22177 | vinfos[3].jointtype = 1; |
| 22178 | vinfos[3].foffset = j3; |
| 22179 | vinfos[3].indices[0] = _ij3[0]; |
| 22180 | vinfos[3].indices[1] = _ij3[1]; |
| 22181 | vinfos[3].maxsolutions = _nj3; |
| 22182 | vinfos[4].jointtype = 1; |
| 22183 | vinfos[4].foffset = j4; |
| 22184 | vinfos[4].indices[0] = _ij4[0]; |
| 22185 | vinfos[4].indices[1] = _ij4[1]; |
| 22186 | vinfos[4].maxsolutions = _nj4; |
| 22187 | vinfos[5].jointtype = 1; |
| 22188 | vinfos[5].foffset = j5; |
| 22189 | vinfos[5].indices[0] = _ij5[0]; |
| 22190 | vinfos[5].indices[1] = _ij5[1]; |
| 22191 | vinfos[5].maxsolutions = _nj5; |
| 22192 | std::vector<int> vfree(0); |
| 22193 | solutions.AddSolution(vinfos,vfree); |
| 22194 | } |
| 22195 | } |
| 22196 | } |
| 22197 | |
| 22198 | } |
| 22199 | } while(0); |
| 22200 | if( bgotonextstatement ) |
| 22201 | { |
| 22202 | bool bgotonextstatement = true; |
| 22203 | do |
| 22204 | { |
| 22205 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j3)))), 6.28318530717959))); |
| 22206 | evalcond[1]=new_r21; |
| 22207 | if( IKabs(evalcond[0]) < 0.0000050000000000 && IKabs(evalcond[1]) < 0.0000050000000000 ) |
| 22208 | { |
| 22209 | bgotonextstatement=false; |
| 22210 | { |
| 22211 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 22212 | bool j5valid[1]={false}; |
| 22213 | _nj5 = 1; |
| 22214 | if( IKabs(((-1.0)*new_r01)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-1.0)*new_r11)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((-1.0)*new_r01))+IKsqr(((-1.0)*new_r11))-1) <= IKFAST_SINCOS_THRESH ) |
| 22215 | continue; |
| 22216 | j5array[0]=IKatan2(((-1.0)*new_r01), ((-1.0)*new_r11)); |
| 22217 | sj5array[0]=IKsin(j5array[0]); |
| 22218 | cj5array[0]=IKcos(j5array[0]); |
| 22219 | if( j5array[0] > IKPI ) |
| 22220 | { |
| 22221 | j5array[0]-=IK2PI; |
| 22222 | } |
| 22223 | else if( j5array[0] < -IKPI ) |
| 22224 | { j5array[0]+=IK2PI; |
| 22225 | } |
| 22226 | j5valid[0] = true; |
| 22227 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 22228 | { |
| 22229 | if( !j5valid[ij5] ) |
| 22230 | { |
| 22231 | continue; |
| 22232 | } |
| 22233 | _ij5[0] = ij5; _ij5[1] = -1; |
| 22234 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 22235 | { |
| 22236 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 22237 | { |
| 22238 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 22239 | } |
| 22240 | } |
| 22241 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 22242 | { |
| 22243 | IkReal evalcond[18]; |
| 22244 | IkReal x2451=IKcos(j5); |
| 22245 | IkReal x2452=IKsin(j5); |
| 22246 | IkReal x2453=((0.9999999992)*cj4); |
| 22247 | IkReal x2454=((0.9999999992)*sj4); |
| 22248 | IkReal x2455=((3.9999999968e-5)*cj4); |
| 22249 | IkReal x2456=((3.9999999968e-5)*sj4); |
| 22250 | IkReal x2457=((1.0)*new_r22); |
| 22251 | IkReal x2458=(new_r12*x2452); |
| 22252 | IkReal x2459=(new_r02*x2451); |
| 22253 | IkReal x2460=(new_r01*x2451); |
| 22254 | IkReal x2461=(new_r11*x2452); |
| 22255 | IkReal x2462=(new_r00*x2451); |
| 22256 | IkReal x2463=(new_r10*x2452); |
| 22257 | evalcond[0]=(x2452+new_r01); |
| 22258 | evalcond[1]=(x2451+new_r11); |
| 22259 | evalcond[2]=(((new_r22*x2451))+new_r00); |
| 22260 | evalcond[3]=((((-1.0)*x2452*x2457))+new_r10); |
| 22261 | evalcond[4]=(((new_r12*x2451))+((new_r02*x2452))); |
| 22262 | evalcond[5]=(((new_r10*x2451))+((new_r00*x2452))); |
| 22263 | evalcond[6]=((1.0)+((new_r11*x2451))+((new_r01*x2452))); |
| 22264 | evalcond[7]=(x2460+(((-1.0)*x2461))); |
| 22265 | evalcond[8]=(x2462+(((-1.0)*x2463))+new_r22); |
| 22266 | evalcond[9]=((((-1.0)*x2457*x2461))+((new_r22*x2460))); |
| 22267 | evalcond[10]=((((-1.0)*x2451*x2455))+((x2451*x2454))+new_r02); |
| 22268 | evalcond[11]=((((-1.0)*x2452*x2454))+((x2452*x2455))+new_r12); |
| 22269 | evalcond[12]=(x2459+(((25000.0)*new_r22))+(((-625000001.0)*new_r20))+(((-625000000.5)*sj4))+(((-1.0)*x2458))); |
| 22270 | evalcond[13]=((((-1.0)*x2454*x2460))+(((-1.0)*x2455*x2461))+((x2454*x2461))+((x2455*x2460))); |
| 22271 | evalcond[14]=((((-1.0)*x2454*x2462))+((new_r20*x2456))+((new_r20*x2453))+(((-1.0)*x2455*x2463))+((x2454*x2463))+((x2455*x2462))); |
| 22272 | evalcond[15]=((((-1.0)*x2453*x2458))+((x2453*x2459))+(((-1.0)*x2456*x2458))+((x2456*x2459))+((new_r22*x2454))+(((-1.0)*new_r22*x2455))); |
| 22273 | evalcond[16]=((-1.0)+(((-1.0)*x2454*x2459))+((x2454*x2458))+((new_r22*x2453))+((new_r22*x2456))+((x2455*x2459))+(((-1.0)*x2455*x2458))); |
| 22274 | evalcond[17]=((1.0)+((new_r20*x2454))+(((-1.0)*new_r20*x2455))+(((-1.0)*x2456*x2463))+((x2453*x2462))+((x2456*x2462))+(((-1.0)*x2453*x2463))); |
| 22275 | if( 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 ) |
| 22276 | { |
| 22277 | continue; |
| 22278 | } |
| 22279 | } |
| 22280 | |
| 22281 | { |
| 22282 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 22283 | vinfos[0].jointtype = 1; |
| 22284 | vinfos[0].foffset = j0; |
| 22285 | vinfos[0].indices[0] = _ij0[0]; |
| 22286 | vinfos[0].indices[1] = _ij0[1]; |
| 22287 | vinfos[0].maxsolutions = _nj0; |
| 22288 | vinfos[1].jointtype = 1; |
| 22289 | vinfos[1].foffset = j1; |
| 22290 | vinfos[1].indices[0] = _ij1[0]; |
| 22291 | vinfos[1].indices[1] = _ij1[1]; |
| 22292 | vinfos[1].maxsolutions = _nj1; |
| 22293 | vinfos[2].jointtype = 1; |
| 22294 | vinfos[2].foffset = j2; |
| 22295 | vinfos[2].indices[0] = _ij2[0]; |
| 22296 | vinfos[2].indices[1] = _ij2[1]; |
| 22297 | vinfos[2].maxsolutions = _nj2; |
| 22298 | vinfos[3].jointtype = 1; |
| 22299 | vinfos[3].foffset = j3; |
| 22300 | vinfos[3].indices[0] = _ij3[0]; |
| 22301 | vinfos[3].indices[1] = _ij3[1]; |
| 22302 | vinfos[3].maxsolutions = _nj3; |
| 22303 | vinfos[4].jointtype = 1; |
| 22304 | vinfos[4].foffset = j4; |
| 22305 | vinfos[4].indices[0] = _ij4[0]; |
| 22306 | vinfos[4].indices[1] = _ij4[1]; |
| 22307 | vinfos[4].maxsolutions = _nj4; |
| 22308 | vinfos[5].jointtype = 1; |
| 22309 | vinfos[5].foffset = j5; |
| 22310 | vinfos[5].indices[0] = _ij5[0]; |
| 22311 | vinfos[5].indices[1] = _ij5[1]; |
| 22312 | vinfos[5].maxsolutions = _nj5; |
| 22313 | std::vector<int> vfree(0); |
| 22314 | solutions.AddSolution(vinfos,vfree); |
| 22315 | } |
| 22316 | } |
| 22317 | } |
| 22318 | |
| 22319 | } |
| 22320 | } while(0); |
| 22321 | if( bgotonextstatement ) |
| 22322 | { |
| 22323 | bool bgotonextstatement = true; |
| 22324 | do |
| 22325 | { |
| 22326 | evalcond[0]=((IKabs(new_r10))+(IKabs(new_r00))); |
| 22327 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 22328 | { |
| 22329 | bgotonextstatement=false; |
| 22330 | { |
| 22331 | IkReal j5eval[3]; |
| 22332 | new_r00=0; |
| 22333 | new_r10=0; |
| 22334 | new_r21=0; |
| 22335 | new_r22=0; |
| 22336 | j5eval[0]=sj4; |
| 22337 | j5eval[1]=IKsign(sj4); |
| 22338 | j5eval[2]=((1.0)+(new_r12*new_r12)+(((-1.0)*(new_r01*new_r01)))); |
| 22339 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 22340 | { |
| 22341 | { |
| 22342 | IkReal j5eval[2]; |
| 22343 | new_r00=0; |
| 22344 | new_r10=0; |
| 22345 | new_r21=0; |
| 22346 | new_r22=0; |
| 22347 | j5eval[0]=new_r01; |
| 22348 | j5eval[1]=sj4; |
| 22349 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 22350 | { |
| 22351 | { |
| 22352 | IkReal j5eval[2]; |
| 22353 | new_r00=0; |
| 22354 | new_r10=0; |
| 22355 | new_r21=0; |
| 22356 | new_r22=0; |
| 22357 | j5eval[0]=sj4; |
| 22358 | j5eval[1]=new_r11; |
| 22359 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 ) |
| 22360 | { |
| 22361 | { |
| 22362 | IkReal evalcond[5]; |
| 22363 | bool bgotonextstatement = true; |
| 22364 | do |
| 22365 | { |
| 22366 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j4))), 6.28318530717959))); |
| 22367 | evalcond[1]=new_r02; |
| 22368 | evalcond[2]=new_r12; |
| 22369 | evalcond[3]=new_r01; |
| 22370 | evalcond[4]=new_r11; |
| 22371 | if( 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 ) |
| 22372 | { |
| 22373 | bgotonextstatement=false; |
| 22374 | { |
| 22375 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 22376 | bool j5valid[1]={false}; |
| 22377 | _nj5 = 1; |
| 22378 | j5array[0]=0; |
| 22379 | sj5array[0]=IKsin(j5array[0]); |
| 22380 | cj5array[0]=IKcos(j5array[0]); |
| 22381 | if( j5array[0] > IKPI ) |
| 22382 | { |
| 22383 | j5array[0]-=IK2PI; |
| 22384 | } |
| 22385 | else if( j5array[0] < -IKPI ) |
| 22386 | { j5array[0]+=IK2PI; |
| 22387 | } |
| 22388 | j5valid[0] = true; |
| 22389 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 22390 | { |
| 22391 | if( !j5valid[ij5] ) |
| 22392 | { |
| 22393 | continue; |
| 22394 | } |
| 22395 | _ij5[0] = ij5; _ij5[1] = -1; |
| 22396 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 22397 | { |
| 22398 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 22399 | { |
| 22400 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 22401 | } |
| 22402 | } |
| 22403 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 22404 | |
| 22405 | { |
| 22406 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 22407 | vinfos[0].jointtype = 1; |
| 22408 | vinfos[0].foffset = j0; |
| 22409 | vinfos[0].indices[0] = _ij0[0]; |
| 22410 | vinfos[0].indices[1] = _ij0[1]; |
| 22411 | vinfos[0].maxsolutions = _nj0; |
| 22412 | vinfos[1].jointtype = 1; |
| 22413 | vinfos[1].foffset = j1; |
| 22414 | vinfos[1].indices[0] = _ij1[0]; |
| 22415 | vinfos[1].indices[1] = _ij1[1]; |
| 22416 | vinfos[1].maxsolutions = _nj1; |
| 22417 | vinfos[2].jointtype = 1; |
| 22418 | vinfos[2].foffset = j2; |
| 22419 | vinfos[2].indices[0] = _ij2[0]; |
| 22420 | vinfos[2].indices[1] = _ij2[1]; |
| 22421 | vinfos[2].maxsolutions = _nj2; |
| 22422 | vinfos[3].jointtype = 1; |
| 22423 | vinfos[3].foffset = j3; |
| 22424 | vinfos[3].indices[0] = _ij3[0]; |
| 22425 | vinfos[3].indices[1] = _ij3[1]; |
| 22426 | vinfos[3].maxsolutions = _nj3; |
| 22427 | vinfos[4].jointtype = 1; |
| 22428 | vinfos[4].foffset = j4; |
| 22429 | vinfos[4].indices[0] = _ij4[0]; |
| 22430 | vinfos[4].indices[1] = _ij4[1]; |
| 22431 | vinfos[4].maxsolutions = _nj4; |
| 22432 | vinfos[5].jointtype = 1; |
| 22433 | vinfos[5].foffset = j5; |
| 22434 | vinfos[5].indices[0] = _ij5[0]; |
| 22435 | vinfos[5].indices[1] = _ij5[1]; |
| 22436 | vinfos[5].maxsolutions = _nj5; |
| 22437 | std::vector<int> vfree(0); |
| 22438 | solutions.AddSolution(vinfos,vfree); |
| 22439 | } |
| 22440 | } |
| 22441 | } |
| 22442 | |
| 22443 | } |
| 22444 | } while(0); |
| 22445 | if( bgotonextstatement ) |
| 22446 | { |
| 22447 | bool bgotonextstatement = true; |
| 22448 | do |
| 22449 | { |
| 22450 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j4)))), 6.28318530717959))); |
| 22451 | evalcond[1]=new_r02; |
| 22452 | evalcond[2]=new_r12; |
| 22453 | evalcond[3]=new_r01; |
| 22454 | evalcond[4]=new_r11; |
| 22455 | if( 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 ) |
| 22456 | { |
| 22457 | bgotonextstatement=false; |
| 22458 | { |
| 22459 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 22460 | bool j5valid[1]={false}; |
| 22461 | _nj5 = 1; |
| 22462 | j5array[0]=0; |
| 22463 | sj5array[0]=IKsin(j5array[0]); |
| 22464 | cj5array[0]=IKcos(j5array[0]); |
| 22465 | if( j5array[0] > IKPI ) |
| 22466 | { |
| 22467 | j5array[0]-=IK2PI; |
| 22468 | } |
| 22469 | else if( j5array[0] < -IKPI ) |
| 22470 | { j5array[0]+=IK2PI; |
| 22471 | } |
| 22472 | j5valid[0] = true; |
| 22473 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 22474 | { |
| 22475 | if( !j5valid[ij5] ) |
| 22476 | { |
| 22477 | continue; |
| 22478 | } |
| 22479 | _ij5[0] = ij5; _ij5[1] = -1; |
| 22480 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 22481 | { |
| 22482 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 22483 | { |
| 22484 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 22485 | } |
| 22486 | } |
| 22487 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 22488 | |
| 22489 | { |
| 22490 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 22491 | vinfos[0].jointtype = 1; |
| 22492 | vinfos[0].foffset = j0; |
| 22493 | vinfos[0].indices[0] = _ij0[0]; |
| 22494 | vinfos[0].indices[1] = _ij0[1]; |
| 22495 | vinfos[0].maxsolutions = _nj0; |
| 22496 | vinfos[1].jointtype = 1; |
| 22497 | vinfos[1].foffset = j1; |
| 22498 | vinfos[1].indices[0] = _ij1[0]; |
| 22499 | vinfos[1].indices[1] = _ij1[1]; |
| 22500 | vinfos[1].maxsolutions = _nj1; |
| 22501 | vinfos[2].jointtype = 1; |
| 22502 | vinfos[2].foffset = j2; |
| 22503 | vinfos[2].indices[0] = _ij2[0]; |
| 22504 | vinfos[2].indices[1] = _ij2[1]; |
| 22505 | vinfos[2].maxsolutions = _nj2; |
| 22506 | vinfos[3].jointtype = 1; |
| 22507 | vinfos[3].foffset = j3; |
| 22508 | vinfos[3].indices[0] = _ij3[0]; |
| 22509 | vinfos[3].indices[1] = _ij3[1]; |
| 22510 | vinfos[3].maxsolutions = _nj3; |
| 22511 | vinfos[4].jointtype = 1; |
| 22512 | vinfos[4].foffset = j4; |
| 22513 | vinfos[4].indices[0] = _ij4[0]; |
| 22514 | vinfos[4].indices[1] = _ij4[1]; |
| 22515 | vinfos[4].maxsolutions = _nj4; |
| 22516 | vinfos[5].jointtype = 1; |
| 22517 | vinfos[5].foffset = j5; |
| 22518 | vinfos[5].indices[0] = _ij5[0]; |
| 22519 | vinfos[5].indices[1] = _ij5[1]; |
| 22520 | vinfos[5].maxsolutions = _nj5; |
| 22521 | std::vector<int> vfree(0); |
| 22522 | solutions.AddSolution(vinfos,vfree); |
| 22523 | } |
| 22524 | } |
| 22525 | } |
| 22526 | |
| 22527 | } |
| 22528 | } while(0); |
| 22529 | if( bgotonextstatement ) |
| 22530 | { |
| 22531 | bool bgotonextstatement = true; |
| 22532 | do |
| 22533 | { |
| 22534 | if( 1 ) |
| 22535 | { |
| 22536 | bgotonextstatement=false; |
| 22537 | continue; // branch miss [j5] |
| 22538 | |
| 22539 | } |
| 22540 | } while(0); |
| 22541 | if( bgotonextstatement ) |
| 22542 | { |
| 22543 | } |
| 22544 | } |
| 22545 | } |
| 22546 | } |
| 22547 | |
| 22548 | } else |
| 22549 | { |
| 22550 | { |
| 22551 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 22552 | bool j5valid[1]={false}; |
| 22553 | _nj5 = 1; |
| 22554 | CheckValue<IkReal> x2466=IKPowWithIntegerCheck(sj4,-1); |
| 22555 | if(!x2466.valid){ |
| 22556 | continue; |
| 22557 | } |
| 22558 | IkReal x2464=x2466.value; |
| 22559 | IkReal x2465=(new_r12*x2464); |
| 22560 | CheckValue<IkReal> x2467=IKPowWithIntegerCheck(new_r11,-1); |
| 22561 | if(!x2467.valid){ |
| 22562 | continue; |
| 22563 | } |
| 22564 | if( IKabs(((0.9999999992)*x2465)) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.9999999992)*new_r01*x2465*(x2467.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*x2465))+IKsqr(((-0.9999999992)*new_r01*x2465*(x2467.value)))-1) <= IKFAST_SINCOS_THRESH ) |
| 22565 | continue; |
| 22566 | j5array[0]=IKatan2(((0.9999999992)*x2465), ((-0.9999999992)*new_r01*x2465*(x2467.value))); |
| 22567 | sj5array[0]=IKsin(j5array[0]); |
| 22568 | cj5array[0]=IKcos(j5array[0]); |
| 22569 | if( j5array[0] > IKPI ) |
| 22570 | { |
| 22571 | j5array[0]-=IK2PI; |
| 22572 | } |
| 22573 | else if( j5array[0] < -IKPI ) |
| 22574 | { j5array[0]+=IK2PI; |
| 22575 | } |
| 22576 | j5valid[0] = true; |
| 22577 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 22578 | { |
| 22579 | if( !j5valid[ij5] ) |
| 22580 | { |
| 22581 | continue; |
| 22582 | } |
| 22583 | _ij5[0] = ij5; _ij5[1] = -1; |
| 22584 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 22585 | { |
| 22586 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 22587 | { |
| 22588 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 22589 | } |
| 22590 | } |
| 22591 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 22592 | { |
| 22593 | IkReal evalcond[10]; |
| 22594 | IkReal x2468=IKcos(j5); |
| 22595 | IkReal x2469=IKsin(j5); |
| 22596 | IkReal x2470=((0.9999999992)*cj4); |
| 22597 | IkReal x2471=((3.9999999968e-5)*sj4); |
| 22598 | IkReal x2472=((1.0000000008)*sj4); |
| 22599 | IkReal x2473=(new_r12*x2469); |
| 22600 | IkReal x2474=(new_r02*x2468); |
| 22601 | IkReal x2475=(new_r11*x2469); |
| 22602 | IkReal x2476=(new_r01*x2468); |
| 22603 | evalcond[0]=(((new_r02*x2469))+((new_r12*x2468))); |
| 22604 | evalcond[1]=(((new_r01*x2469))+((new_r11*x2468))); |
| 22605 | evalcond[2]=(((x2468*x2472))+new_r02); |
| 22606 | evalcond[3]=((((-1.0)*x2469*x2472))+new_r12); |
| 22607 | evalcond[4]=(x2476+(((-1.0)*x2475))); |
| 22608 | evalcond[5]=(x2474+x2472+(((-1.0)*x2473))); |
| 22609 | evalcond[6]=((((-1.0)*x2472*x2476))+((x2472*x2475))); |
| 22610 | evalcond[7]=((-1.0)+(((-1.0)*x2472*x2474))+((x2472*x2473))); |
| 22611 | evalcond[8]=(((x2471*x2474))+(((-1.0)*x2470*x2473))+(((-1.0)*x2471*x2473))+((x2470*x2474))); |
| 22612 | evalcond[9]=(((x2471*x2476))+(((-1.0)*x2470*x2475))+(((-1.0)*x2471*x2475))+((x2470*x2476))); |
| 22613 | if( 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 ) |
| 22614 | { |
| 22615 | continue; |
| 22616 | } |
| 22617 | } |
| 22618 | |
| 22619 | { |
| 22620 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 22621 | vinfos[0].jointtype = 1; |
| 22622 | vinfos[0].foffset = j0; |
| 22623 | vinfos[0].indices[0] = _ij0[0]; |
| 22624 | vinfos[0].indices[1] = _ij0[1]; |
| 22625 | vinfos[0].maxsolutions = _nj0; |
| 22626 | vinfos[1].jointtype = 1; |
| 22627 | vinfos[1].foffset = j1; |
| 22628 | vinfos[1].indices[0] = _ij1[0]; |
| 22629 | vinfos[1].indices[1] = _ij1[1]; |
| 22630 | vinfos[1].maxsolutions = _nj1; |
| 22631 | vinfos[2].jointtype = 1; |
| 22632 | vinfos[2].foffset = j2; |
| 22633 | vinfos[2].indices[0] = _ij2[0]; |
| 22634 | vinfos[2].indices[1] = _ij2[1]; |
| 22635 | vinfos[2].maxsolutions = _nj2; |
| 22636 | vinfos[3].jointtype = 1; |
| 22637 | vinfos[3].foffset = j3; |
| 22638 | vinfos[3].indices[0] = _ij3[0]; |
| 22639 | vinfos[3].indices[1] = _ij3[1]; |
| 22640 | vinfos[3].maxsolutions = _nj3; |
| 22641 | vinfos[4].jointtype = 1; |
| 22642 | vinfos[4].foffset = j4; |
| 22643 | vinfos[4].indices[0] = _ij4[0]; |
| 22644 | vinfos[4].indices[1] = _ij4[1]; |
| 22645 | vinfos[4].maxsolutions = _nj4; |
| 22646 | vinfos[5].jointtype = 1; |
| 22647 | vinfos[5].foffset = j5; |
| 22648 | vinfos[5].indices[0] = _ij5[0]; |
| 22649 | vinfos[5].indices[1] = _ij5[1]; |
| 22650 | vinfos[5].maxsolutions = _nj5; |
| 22651 | std::vector<int> vfree(0); |
| 22652 | solutions.AddSolution(vinfos,vfree); |
| 22653 | } |
| 22654 | } |
| 22655 | } |
| 22656 | |
| 22657 | } |
| 22658 | |
| 22659 | } |
| 22660 | |
| 22661 | } else |
| 22662 | { |
| 22663 | { |
| 22664 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 22665 | bool j5valid[1]={false}; |
| 22666 | _nj5 = 1; |
| 22667 | CheckValue<IkReal> x2479=IKPowWithIntegerCheck(sj4,-1); |
| 22668 | if(!x2479.valid){ |
| 22669 | continue; |
| 22670 | } |
| 22671 | IkReal x2477=x2479.value; |
| 22672 | IkReal x2478=(new_r02*x2477); |
| 22673 | CheckValue<IkReal> x2480=IKPowWithIntegerCheck(new_r01,-1); |
| 22674 | if(!x2480.valid){ |
| 22675 | continue; |
| 22676 | } |
| 22677 | if( IKabs(((0.9999999992)*new_r11*x2478*(x2480.value))) < IKFAST_ATAN2_MAGTHRESH && IKabs(((-0.9999999992)*x2478)) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((0.9999999992)*new_r11*x2478*(x2480.value)))+IKsqr(((-0.9999999992)*x2478))-1) <= IKFAST_SINCOS_THRESH ) |
| 22678 | continue; |
| 22679 | j5array[0]=IKatan2(((0.9999999992)*new_r11*x2478*(x2480.value)), ((-0.9999999992)*x2478)); |
| 22680 | sj5array[0]=IKsin(j5array[0]); |
| 22681 | cj5array[0]=IKcos(j5array[0]); |
| 22682 | if( j5array[0] > IKPI ) |
| 22683 | { |
| 22684 | j5array[0]-=IK2PI; |
| 22685 | } |
| 22686 | else if( j5array[0] < -IKPI ) |
| 22687 | { j5array[0]+=IK2PI; |
| 22688 | } |
| 22689 | j5valid[0] = true; |
| 22690 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 22691 | { |
| 22692 | if( !j5valid[ij5] ) |
| 22693 | { |
| 22694 | continue; |
| 22695 | } |
| 22696 | _ij5[0] = ij5; _ij5[1] = -1; |
| 22697 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 22698 | { |
| 22699 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 22700 | { |
| 22701 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 22702 | } |
| 22703 | } |
| 22704 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 22705 | { |
| 22706 | IkReal evalcond[10]; |
| 22707 | IkReal x2481=IKcos(j5); |
| 22708 | IkReal x2482=IKsin(j5); |
| 22709 | IkReal x2483=((0.9999999992)*cj4); |
| 22710 | IkReal x2484=((3.9999999968e-5)*sj4); |
| 22711 | IkReal x2485=((1.0000000008)*sj4); |
| 22712 | IkReal x2486=(new_r12*x2482); |
| 22713 | IkReal x2487=(new_r02*x2481); |
| 22714 | IkReal x2488=(new_r11*x2482); |
| 22715 | IkReal x2489=(new_r01*x2481); |
| 22716 | evalcond[0]=(((new_r02*x2482))+((new_r12*x2481))); |
| 22717 | evalcond[1]=(((new_r01*x2482))+((new_r11*x2481))); |
| 22718 | evalcond[2]=(((x2481*x2485))+new_r02); |
| 22719 | evalcond[3]=((((-1.0)*x2482*x2485))+new_r12); |
| 22720 | evalcond[4]=(x2489+(((-1.0)*x2488))); |
| 22721 | evalcond[5]=(x2487+x2485+(((-1.0)*x2486))); |
| 22722 | evalcond[6]=(((x2485*x2488))+(((-1.0)*x2485*x2489))); |
| 22723 | evalcond[7]=((-1.0)+((x2485*x2486))+(((-1.0)*x2485*x2487))); |
| 22724 | evalcond[8]=(((x2483*x2487))+((x2484*x2487))+(((-1.0)*x2484*x2486))+(((-1.0)*x2483*x2486))); |
| 22725 | evalcond[9]=(((x2483*x2489))+((x2484*x2489))+(((-1.0)*x2484*x2488))+(((-1.0)*x2483*x2488))); |
| 22726 | if( 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 ) |
| 22727 | { |
| 22728 | continue; |
| 22729 | } |
| 22730 | } |
| 22731 | |
| 22732 | { |
| 22733 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 22734 | vinfos[0].jointtype = 1; |
| 22735 | vinfos[0].foffset = j0; |
| 22736 | vinfos[0].indices[0] = _ij0[0]; |
| 22737 | vinfos[0].indices[1] = _ij0[1]; |
| 22738 | vinfos[0].maxsolutions = _nj0; |
| 22739 | vinfos[1].jointtype = 1; |
| 22740 | vinfos[1].foffset = j1; |
| 22741 | vinfos[1].indices[0] = _ij1[0]; |
| 22742 | vinfos[1].indices[1] = _ij1[1]; |
| 22743 | vinfos[1].maxsolutions = _nj1; |
| 22744 | vinfos[2].jointtype = 1; |
| 22745 | vinfos[2].foffset = j2; |
| 22746 | vinfos[2].indices[0] = _ij2[0]; |
| 22747 | vinfos[2].indices[1] = _ij2[1]; |
| 22748 | vinfos[2].maxsolutions = _nj2; |
| 22749 | vinfos[3].jointtype = 1; |
| 22750 | vinfos[3].foffset = j3; |
| 22751 | vinfos[3].indices[0] = _ij3[0]; |
| 22752 | vinfos[3].indices[1] = _ij3[1]; |
| 22753 | vinfos[3].maxsolutions = _nj3; |
| 22754 | vinfos[4].jointtype = 1; |
| 22755 | vinfos[4].foffset = j4; |
| 22756 | vinfos[4].indices[0] = _ij4[0]; |
| 22757 | vinfos[4].indices[1] = _ij4[1]; |
| 22758 | vinfos[4].maxsolutions = _nj4; |
| 22759 | vinfos[5].jointtype = 1; |
| 22760 | vinfos[5].foffset = j5; |
| 22761 | vinfos[5].indices[0] = _ij5[0]; |
| 22762 | vinfos[5].indices[1] = _ij5[1]; |
| 22763 | vinfos[5].maxsolutions = _nj5; |
| 22764 | std::vector<int> vfree(0); |
| 22765 | solutions.AddSolution(vinfos,vfree); |
| 22766 | } |
| 22767 | } |
| 22768 | } |
| 22769 | |
| 22770 | } |
| 22771 | |
| 22772 | } |
| 22773 | |
| 22774 | } else |
| 22775 | { |
| 22776 | { |
| 22777 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 22778 | bool j5valid[1]={false}; |
| 22779 | _nj5 = 1; |
| 22780 | CheckValue<IkReal> x2490 = IKatan2WithCheck(IkReal(((625000000.5)*new_r12)),IkReal(((-625000000.5)*new_r02)),IKFAST_ATAN2_MAGTHRESH); |
| 22781 | if(!x2490.valid){ |
| 22782 | continue; |
| 22783 | } |
| 22784 | CheckValue<IkReal> x2491=IKPowWithIntegerCheck(IKsign(sj4),-1); |
| 22785 | if(!x2491.valid){ |
| 22786 | continue; |
| 22787 | } |
| 22788 | j5array[0]=((-1.5707963267949)+(x2490.value)+(((1.5707963267949)*(x2491.value)))); |
| 22789 | sj5array[0]=IKsin(j5array[0]); |
| 22790 | cj5array[0]=IKcos(j5array[0]); |
| 22791 | if( j5array[0] > IKPI ) |
| 22792 | { |
| 22793 | j5array[0]-=IK2PI; |
| 22794 | } |
| 22795 | else if( j5array[0] < -IKPI ) |
| 22796 | { j5array[0]+=IK2PI; |
| 22797 | } |
| 22798 | j5valid[0] = true; |
| 22799 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 22800 | { |
| 22801 | if( !j5valid[ij5] ) |
| 22802 | { |
| 22803 | continue; |
| 22804 | } |
| 22805 | _ij5[0] = ij5; _ij5[1] = -1; |
| 22806 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 22807 | { |
| 22808 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 22809 | { |
| 22810 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 22811 | } |
| 22812 | } |
| 22813 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 22814 | { |
| 22815 | IkReal evalcond[10]; |
| 22816 | IkReal x2492=IKcos(j5); |
| 22817 | IkReal x2493=IKsin(j5); |
| 22818 | IkReal x2494=((0.9999999992)*cj4); |
| 22819 | IkReal x2495=((3.9999999968e-5)*sj4); |
| 22820 | IkReal x2496=((1.0000000008)*sj4); |
| 22821 | IkReal x2497=(new_r12*x2493); |
| 22822 | IkReal x2498=(new_r02*x2492); |
| 22823 | IkReal x2499=(new_r11*x2493); |
| 22824 | IkReal x2500=(new_r01*x2492); |
| 22825 | evalcond[0]=(((new_r02*x2493))+((new_r12*x2492))); |
| 22826 | evalcond[1]=(((new_r01*x2493))+((new_r11*x2492))); |
| 22827 | evalcond[2]=(((x2492*x2496))+new_r02); |
| 22828 | evalcond[3]=((((-1.0)*x2493*x2496))+new_r12); |
| 22829 | evalcond[4]=(x2500+(((-1.0)*x2499))); |
| 22830 | evalcond[5]=(x2498+x2496+(((-1.0)*x2497))); |
| 22831 | evalcond[6]=(((x2496*x2499))+(((-1.0)*x2496*x2500))); |
| 22832 | evalcond[7]=((-1.0)+(((-1.0)*x2496*x2498))+((x2496*x2497))); |
| 22833 | evalcond[8]=((((-1.0)*x2495*x2497))+((x2494*x2498))+(((-1.0)*x2494*x2497))+((x2495*x2498))); |
| 22834 | evalcond[9]=((((-1.0)*x2495*x2499))+((x2494*x2500))+(((-1.0)*x2494*x2499))+((x2495*x2500))); |
| 22835 | if( 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 ) |
| 22836 | { |
| 22837 | continue; |
| 22838 | } |
| 22839 | } |
| 22840 | |
| 22841 | { |
| 22842 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 22843 | vinfos[0].jointtype = 1; |
| 22844 | vinfos[0].foffset = j0; |
| 22845 | vinfos[0].indices[0] = _ij0[0]; |
| 22846 | vinfos[0].indices[1] = _ij0[1]; |
| 22847 | vinfos[0].maxsolutions = _nj0; |
| 22848 | vinfos[1].jointtype = 1; |
| 22849 | vinfos[1].foffset = j1; |
| 22850 | vinfos[1].indices[0] = _ij1[0]; |
| 22851 | vinfos[1].indices[1] = _ij1[1]; |
| 22852 | vinfos[1].maxsolutions = _nj1; |
| 22853 | vinfos[2].jointtype = 1; |
| 22854 | vinfos[2].foffset = j2; |
| 22855 | vinfos[2].indices[0] = _ij2[0]; |
| 22856 | vinfos[2].indices[1] = _ij2[1]; |
| 22857 | vinfos[2].maxsolutions = _nj2; |
| 22858 | vinfos[3].jointtype = 1; |
| 22859 | vinfos[3].foffset = j3; |
| 22860 | vinfos[3].indices[0] = _ij3[0]; |
| 22861 | vinfos[3].indices[1] = _ij3[1]; |
| 22862 | vinfos[3].maxsolutions = _nj3; |
| 22863 | vinfos[4].jointtype = 1; |
| 22864 | vinfos[4].foffset = j4; |
| 22865 | vinfos[4].indices[0] = _ij4[0]; |
| 22866 | vinfos[4].indices[1] = _ij4[1]; |
| 22867 | vinfos[4].maxsolutions = _nj4; |
| 22868 | vinfos[5].jointtype = 1; |
| 22869 | vinfos[5].foffset = j5; |
| 22870 | vinfos[5].indices[0] = _ij5[0]; |
| 22871 | vinfos[5].indices[1] = _ij5[1]; |
| 22872 | vinfos[5].maxsolutions = _nj5; |
| 22873 | std::vector<int> vfree(0); |
| 22874 | solutions.AddSolution(vinfos,vfree); |
| 22875 | } |
| 22876 | } |
| 22877 | } |
| 22878 | |
| 22879 | } |
| 22880 | |
| 22881 | } |
| 22882 | |
| 22883 | } |
| 22884 | } while(0); |
| 22885 | if( bgotonextstatement ) |
| 22886 | { |
| 22887 | bool bgotonextstatement = true; |
| 22888 | do |
| 22889 | { |
| 22890 | evalcond[0]=((IKabs(new_r00))+(IKabs(new_r02))); |
| 22891 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 22892 | { |
| 22893 | bgotonextstatement=false; |
| 22894 | { |
| 22895 | IkReal j5eval[1]; |
| 22896 | new_r00=0; |
| 22897 | new_r02=0; |
| 22898 | new_r11=0; |
| 22899 | new_r21=0; |
| 22900 | j5eval[0]=cj3; |
| 22901 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 22902 | { |
| 22903 | { |
| 22904 | IkReal j5eval[1]; |
| 22905 | new_r00=0; |
| 22906 | new_r02=0; |
| 22907 | new_r11=0; |
| 22908 | new_r21=0; |
| 22909 | j5eval[0]=new_r01; |
| 22910 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 22911 | { |
| 22912 | { |
| 22913 | IkReal j5eval[1]; |
| 22914 | new_r00=0; |
| 22915 | new_r02=0; |
| 22916 | new_r11=0; |
| 22917 | new_r21=0; |
| 22918 | j5eval[0]=((((25000.0)*cj3*cj4))+((cj3*sj4))); |
| 22919 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 22920 | { |
| 22921 | { |
| 22922 | IkReal evalcond[5]; |
| 22923 | bool bgotonextstatement = true; |
| 22924 | do |
| 22925 | { |
| 22926 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j3)))), 6.28318530717959))); |
| 22927 | evalcond[1]=new_r12; |
| 22928 | evalcond[2]=new_r20; |
| 22929 | evalcond[3]=new_r10; |
| 22930 | evalcond[4]=new_r01; |
| 22931 | if( 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 ) |
| 22932 | { |
| 22933 | bgotonextstatement=false; |
| 22934 | { |
| 22935 | IkReal j5eval[1]; |
| 22936 | new_r00=0; |
| 22937 | new_r02=0; |
| 22938 | new_r11=0; |
| 22939 | new_r21=0; |
| 22940 | sj3=1.0; |
| 22941 | cj3=0; |
| 22942 | j3=1.5707963267949; |
| 22943 | j5eval[0]=IKabs(((((-25000.0)*sj4))+cj4)); |
| 22944 | if( IKabs(j5eval[0]) < 0.0000000100000000 ) |
| 22945 | { |
| 22946 | continue; // no branches [j5] |
| 22947 | |
| 22948 | } else |
| 22949 | { |
| 22950 | IkReal op[2+1], zeror[2]; |
| 22951 | int numroots; |
| 22952 | IkReal x2501=((25000.0)*sj4); |
| 22953 | op[0]=((((-1.0)*x2501))+cj4); |
| 22954 | op[1]=0; |
| 22955 | op[2]=(x2501+(((-1.0)*cj4))); |
| 22956 | polyroots2(op,zeror,numroots); |
| 22957 | IkReal j5array[2], cj5array[2], sj5array[2], tempj5array[1]; |
| 22958 | int numsolutions = 0; |
| 22959 | for(int ij5 = 0; ij5 < numroots; ++ij5) |
| 22960 | { |
| 22961 | IkReal htj5 = zeror[ij5]; |
| 22962 | tempj5array[0]=((2.0)*(atan(htj5))); |
| 22963 | for(int kj5 = 0; kj5 < 1; ++kj5) |
| 22964 | { |
| 22965 | j5array[numsolutions] = tempj5array[kj5]; |
| 22966 | if( j5array[numsolutions] > IKPI ) |
| 22967 | { |
| 22968 | j5array[numsolutions]-=IK2PI; |
| 22969 | } |
| 22970 | else if( j5array[numsolutions] < -IKPI ) |
| 22971 | { |
| 22972 | j5array[numsolutions]+=IK2PI; |
| 22973 | } |
| 22974 | sj5array[numsolutions] = IKsin(j5array[numsolutions]); |
| 22975 | cj5array[numsolutions] = IKcos(j5array[numsolutions]); |
| 22976 | numsolutions++; |
| 22977 | } |
| 22978 | } |
| 22979 | bool j5valid[2]={true,true}; |
| 22980 | _nj5 = 2; |
| 22981 | for(int ij5 = 0; ij5 < numsolutions; ++ij5) |
| 22982 | { |
| 22983 | if( !j5valid[ij5] ) |
| 22984 | { |
| 22985 | continue; |
| 22986 | } |
| 22987 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 22988 | htj5 = IKtan(j5/2); |
| 22989 | |
| 22990 | _ij5[0] = ij5; _ij5[1] = -1; |
| 22991 | for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5) |
| 22992 | { |
| 22993 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 22994 | { |
| 22995 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 22996 | } |
| 22997 | } |
| 22998 | { |
| 22999 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 23000 | vinfos[0].jointtype = 1; |
| 23001 | vinfos[0].foffset = j0; |
| 23002 | vinfos[0].indices[0] = _ij0[0]; |
| 23003 | vinfos[0].indices[1] = _ij0[1]; |
| 23004 | vinfos[0].maxsolutions = _nj0; |
| 23005 | vinfos[1].jointtype = 1; |
| 23006 | vinfos[1].foffset = j1; |
| 23007 | vinfos[1].indices[0] = _ij1[0]; |
| 23008 | vinfos[1].indices[1] = _ij1[1]; |
| 23009 | vinfos[1].maxsolutions = _nj1; |
| 23010 | vinfos[2].jointtype = 1; |
| 23011 | vinfos[2].foffset = j2; |
| 23012 | vinfos[2].indices[0] = _ij2[0]; |
| 23013 | vinfos[2].indices[1] = _ij2[1]; |
| 23014 | vinfos[2].maxsolutions = _nj2; |
| 23015 | vinfos[3].jointtype = 1; |
| 23016 | vinfos[3].foffset = j3; |
| 23017 | vinfos[3].indices[0] = _ij3[0]; |
| 23018 | vinfos[3].indices[1] = _ij3[1]; |
| 23019 | vinfos[3].maxsolutions = _nj3; |
| 23020 | vinfos[4].jointtype = 1; |
| 23021 | vinfos[4].foffset = j4; |
| 23022 | vinfos[4].indices[0] = _ij4[0]; |
| 23023 | vinfos[4].indices[1] = _ij4[1]; |
| 23024 | vinfos[4].maxsolutions = _nj4; |
| 23025 | vinfos[5].jointtype = 1; |
| 23026 | vinfos[5].foffset = j5; |
| 23027 | vinfos[5].indices[0] = _ij5[0]; |
| 23028 | vinfos[5].indices[1] = _ij5[1]; |
| 23029 | vinfos[5].maxsolutions = _nj5; |
| 23030 | std::vector<int> vfree(0); |
| 23031 | solutions.AddSolution(vinfos,vfree); |
| 23032 | } |
| 23033 | } |
| 23034 | |
| 23035 | } |
| 23036 | |
| 23037 | } |
| 23038 | |
| 23039 | } |
| 23040 | } while(0); |
| 23041 | if( bgotonextstatement ) |
| 23042 | { |
| 23043 | bool bgotonextstatement = true; |
| 23044 | do |
| 23045 | { |
| 23046 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j3)))), 6.28318530717959))); |
| 23047 | evalcond[1]=new_r12; |
| 23048 | evalcond[2]=new_r20; |
| 23049 | evalcond[3]=new_r10; |
| 23050 | evalcond[4]=new_r01; |
| 23051 | if( 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 ) |
| 23052 | { |
| 23053 | bgotonextstatement=false; |
| 23054 | { |
| 23055 | IkReal j5eval[1]; |
| 23056 | new_r00=0; |
| 23057 | new_r02=0; |
| 23058 | new_r11=0; |
| 23059 | new_r21=0; |
| 23060 | sj3=-1.0; |
| 23061 | cj3=0; |
| 23062 | j3=-1.5707963267949; |
| 23063 | j5eval[0]=IKabs(((((-25000.0)*sj4))+cj4)); |
| 23064 | if( IKabs(j5eval[0]) < 0.0000000100000000 ) |
| 23065 | { |
| 23066 | continue; // no branches [j5] |
| 23067 | |
| 23068 | } else |
| 23069 | { |
| 23070 | IkReal op[2+1], zeror[2]; |
| 23071 | int numroots; |
| 23072 | IkReal x2502=((25000.0)*sj4); |
| 23073 | op[0]=((((-1.0)*x2502))+cj4); |
| 23074 | op[1]=0; |
| 23075 | op[2]=(x2502+(((-1.0)*cj4))); |
| 23076 | polyroots2(op,zeror,numroots); |
| 23077 | IkReal j5array[2], cj5array[2], sj5array[2], tempj5array[1]; |
| 23078 | int numsolutions = 0; |
| 23079 | for(int ij5 = 0; ij5 < numroots; ++ij5) |
| 23080 | { |
| 23081 | IkReal htj5 = zeror[ij5]; |
| 23082 | tempj5array[0]=((2.0)*(atan(htj5))); |
| 23083 | for(int kj5 = 0; kj5 < 1; ++kj5) |
| 23084 | { |
| 23085 | j5array[numsolutions] = tempj5array[kj5]; |
| 23086 | if( j5array[numsolutions] > IKPI ) |
| 23087 | { |
| 23088 | j5array[numsolutions]-=IK2PI; |
| 23089 | } |
| 23090 | else if( j5array[numsolutions] < -IKPI ) |
| 23091 | { |
| 23092 | j5array[numsolutions]+=IK2PI; |
| 23093 | } |
| 23094 | sj5array[numsolutions] = IKsin(j5array[numsolutions]); |
| 23095 | cj5array[numsolutions] = IKcos(j5array[numsolutions]); |
| 23096 | numsolutions++; |
| 23097 | } |
| 23098 | } |
| 23099 | bool j5valid[2]={true,true}; |
| 23100 | _nj5 = 2; |
| 23101 | for(int ij5 = 0; ij5 < numsolutions; ++ij5) |
| 23102 | { |
| 23103 | if( !j5valid[ij5] ) |
| 23104 | { |
| 23105 | continue; |
| 23106 | } |
| 23107 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 23108 | htj5 = IKtan(j5/2); |
| 23109 | |
| 23110 | _ij5[0] = ij5; _ij5[1] = -1; |
| 23111 | for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5) |
| 23112 | { |
| 23113 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 23114 | { |
| 23115 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 23116 | } |
| 23117 | } |
| 23118 | { |
| 23119 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 23120 | vinfos[0].jointtype = 1; |
| 23121 | vinfos[0].foffset = j0; |
| 23122 | vinfos[0].indices[0] = _ij0[0]; |
| 23123 | vinfos[0].indices[1] = _ij0[1]; |
| 23124 | vinfos[0].maxsolutions = _nj0; |
| 23125 | vinfos[1].jointtype = 1; |
| 23126 | vinfos[1].foffset = j1; |
| 23127 | vinfos[1].indices[0] = _ij1[0]; |
| 23128 | vinfos[1].indices[1] = _ij1[1]; |
| 23129 | vinfos[1].maxsolutions = _nj1; |
| 23130 | vinfos[2].jointtype = 1; |
| 23131 | vinfos[2].foffset = j2; |
| 23132 | vinfos[2].indices[0] = _ij2[0]; |
| 23133 | vinfos[2].indices[1] = _ij2[1]; |
| 23134 | vinfos[2].maxsolutions = _nj2; |
| 23135 | vinfos[3].jointtype = 1; |
| 23136 | vinfos[3].foffset = j3; |
| 23137 | vinfos[3].indices[0] = _ij3[0]; |
| 23138 | vinfos[3].indices[1] = _ij3[1]; |
| 23139 | vinfos[3].maxsolutions = _nj3; |
| 23140 | vinfos[4].jointtype = 1; |
| 23141 | vinfos[4].foffset = j4; |
| 23142 | vinfos[4].indices[0] = _ij4[0]; |
| 23143 | vinfos[4].indices[1] = _ij4[1]; |
| 23144 | vinfos[4].maxsolutions = _nj4; |
| 23145 | vinfos[5].jointtype = 1; |
| 23146 | vinfos[5].foffset = j5; |
| 23147 | vinfos[5].indices[0] = _ij5[0]; |
| 23148 | vinfos[5].indices[1] = _ij5[1]; |
| 23149 | vinfos[5].maxsolutions = _nj5; |
| 23150 | std::vector<int> vfree(0); |
| 23151 | solutions.AddSolution(vinfos,vfree); |
| 23152 | } |
| 23153 | } |
| 23154 | |
| 23155 | } |
| 23156 | |
| 23157 | } |
| 23158 | |
| 23159 | } |
| 23160 | } while(0); |
| 23161 | if( bgotonextstatement ) |
| 23162 | { |
| 23163 | bool bgotonextstatement = true; |
| 23164 | do |
| 23165 | { |
| 23166 | if( 1 ) |
| 23167 | { |
| 23168 | bgotonextstatement=false; |
| 23169 | continue; // branch miss [j5] |
| 23170 | |
| 23171 | } |
| 23172 | } while(0); |
| 23173 | if( bgotonextstatement ) |
| 23174 | { |
| 23175 | } |
| 23176 | } |
| 23177 | } |
| 23178 | } |
| 23179 | |
| 23180 | } else |
| 23181 | { |
| 23182 | { |
| 23183 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 23184 | bool j5valid[2]={false}; |
| 23185 | _nj5 = 2; |
| 23186 | CheckValue<IkReal> x2503=IKPowWithIntegerCheck(((((0.9999999992)*cj3*cj4))+(((3.9999999968e-5)*cj3*sj4))),-1); |
| 23187 | if(!x2503.valid){ |
| 23188 | continue; |
| 23189 | } |
| 23190 | sj5array[0]=((-1.0)*new_r10*(x2503.value)); |
| 23191 | if( sj5array[0] >= -1-IKFAST_SINCOS_THRESH && sj5array[0] <= 1+IKFAST_SINCOS_THRESH ) |
| 23192 | { |
| 23193 | j5valid[0] = j5valid[1] = true; |
| 23194 | j5array[0] = IKasin(sj5array[0]); |
| 23195 | cj5array[0] = IKcos(j5array[0]); |
| 23196 | sj5array[1] = sj5array[0]; |
| 23197 | j5array[1] = j5array[0] > 0 ? (IKPI-j5array[0]) : (-IKPI-j5array[0]); |
| 23198 | cj5array[1] = -cj5array[0]; |
| 23199 | } |
| 23200 | else if( isnan(sj5array[0]) ) |
| 23201 | { |
| 23202 | // probably any value will work |
| 23203 | j5valid[0] = true; |
| 23204 | cj5array[0] = 1; sj5array[0] = 0; j5array[0] = 0; |
| 23205 | } |
| 23206 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 23207 | { |
| 23208 | if( !j5valid[ij5] ) |
| 23209 | { |
| 23210 | continue; |
| 23211 | } |
| 23212 | _ij5[0] = ij5; _ij5[1] = -1; |
| 23213 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 23214 | { |
| 23215 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 23216 | { |
| 23217 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 23218 | } |
| 23219 | } |
| 23220 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 23221 | { |
| 23222 | IkReal evalcond[15]; |
| 23223 | IkReal x2504=IKcos(j5); |
| 23224 | IkReal x2505=IKsin(j5); |
| 23225 | IkReal x2506=((3.9999999968e-5)*cj4); |
| 23226 | IkReal x2507=((1.0)*cj3); |
| 23227 | IkReal x2508=(cj3*cj4); |
| 23228 | IkReal x2509=((25000.00002)*sj4); |
| 23229 | IkReal x2510=((0.9999999992)*sj4); |
| 23230 | IkReal x2511=((3.9999999968e-5)*sj4); |
| 23231 | IkReal x2512=(new_r01*x2504); |
| 23232 | IkReal x2513=((0.9999999992)*x2504); |
| 23233 | IkReal x2514=(new_r12*x2505); |
| 23234 | IkReal x2515=(new_r10*x2505); |
| 23235 | IkReal x2516=(cj3*x2504); |
| 23236 | evalcond[0]=(new_r12*x2504); |
| 23237 | evalcond[1]=(new_r10*x2504); |
| 23238 | evalcond[2]=x2512; |
| 23239 | evalcond[3]=((-1.0)*x2514); |
| 23240 | evalcond[4]=((-1.0)*x2516); |
| 23241 | evalcond[5]=(new_r01+(((-1.0)*x2505*x2507))); |
| 23242 | evalcond[6]=(((new_r01*x2505))+(((-1.0)*x2507))); |
| 23243 | evalcond[7]=(x2509*x2512); |
| 23244 | evalcond[8]=((-25000.00002)*sj4*x2514); |
| 23245 | evalcond[9]=(((x2504*x2510))+(((-1.0)*x2504*x2506))); |
| 23246 | evalcond[10]=((((-1.0)*cj3*x2511))+(((-1.0)*x2515))+(((-0.9999999992)*x2508))); |
| 23247 | evalcond[11]=((((-1.0)*x2508*x2513))+(((-1.0)*x2511*x2516))); |
| 23248 | evalcond[12]=((((-1.0)*x2510*x2512))+((x2506*x2512))); |
| 23249 | CheckValue<IkReal> x2517=IKPowWithIntegerCheck(((((25000.00002)*cj4))+(((-625000000.5)*sj4))),-1); |
| 23250 | if(!x2517.valid){ |
| 23251 | continue; |
| 23252 | } |
| 23253 | evalcond[13]=((((625000001.0)*new_r20*(x2517.value)))+(((-1.0)*x2509*x2515))); |
| 23254 | evalcond[14]=((((0.9999999992)*cj4*new_r20))+(((-1.0)*x2506*x2515))+((x2510*x2515))+((new_r20*x2511))); |
| 23255 | if( 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 ) |
| 23256 | { |
| 23257 | continue; |
| 23258 | } |
| 23259 | } |
| 23260 | |
| 23261 | { |
| 23262 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 23263 | vinfos[0].jointtype = 1; |
| 23264 | vinfos[0].foffset = j0; |
| 23265 | vinfos[0].indices[0] = _ij0[0]; |
| 23266 | vinfos[0].indices[1] = _ij0[1]; |
| 23267 | vinfos[0].maxsolutions = _nj0; |
| 23268 | vinfos[1].jointtype = 1; |
| 23269 | vinfos[1].foffset = j1; |
| 23270 | vinfos[1].indices[0] = _ij1[0]; |
| 23271 | vinfos[1].indices[1] = _ij1[1]; |
| 23272 | vinfos[1].maxsolutions = _nj1; |
| 23273 | vinfos[2].jointtype = 1; |
| 23274 | vinfos[2].foffset = j2; |
| 23275 | vinfos[2].indices[0] = _ij2[0]; |
| 23276 | vinfos[2].indices[1] = _ij2[1]; |
| 23277 | vinfos[2].maxsolutions = _nj2; |
| 23278 | vinfos[3].jointtype = 1; |
| 23279 | vinfos[3].foffset = j3; |
| 23280 | vinfos[3].indices[0] = _ij3[0]; |
| 23281 | vinfos[3].indices[1] = _ij3[1]; |
| 23282 | vinfos[3].maxsolutions = _nj3; |
| 23283 | vinfos[4].jointtype = 1; |
| 23284 | vinfos[4].foffset = j4; |
| 23285 | vinfos[4].indices[0] = _ij4[0]; |
| 23286 | vinfos[4].indices[1] = _ij4[1]; |
| 23287 | vinfos[4].maxsolutions = _nj4; |
| 23288 | vinfos[5].jointtype = 1; |
| 23289 | vinfos[5].foffset = j5; |
| 23290 | vinfos[5].indices[0] = _ij5[0]; |
| 23291 | vinfos[5].indices[1] = _ij5[1]; |
| 23292 | vinfos[5].maxsolutions = _nj5; |
| 23293 | std::vector<int> vfree(0); |
| 23294 | solutions.AddSolution(vinfos,vfree); |
| 23295 | } |
| 23296 | } |
| 23297 | } |
| 23298 | |
| 23299 | } |
| 23300 | |
| 23301 | } |
| 23302 | |
| 23303 | } else |
| 23304 | { |
| 23305 | { |
| 23306 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 23307 | bool j5valid[2]={false}; |
| 23308 | _nj5 = 2; |
| 23309 | CheckValue<IkReal> x2518=IKPowWithIntegerCheck(new_r01,-1); |
| 23310 | if(!x2518.valid){ |
| 23311 | continue; |
| 23312 | } |
| 23313 | sj5array[0]=(cj3*(x2518.value)); |
| 23314 | if( sj5array[0] >= -1-IKFAST_SINCOS_THRESH && sj5array[0] <= 1+IKFAST_SINCOS_THRESH ) |
| 23315 | { |
| 23316 | j5valid[0] = j5valid[1] = true; |
| 23317 | j5array[0] = IKasin(sj5array[0]); |
| 23318 | cj5array[0] = IKcos(j5array[0]); |
| 23319 | sj5array[1] = sj5array[0]; |
| 23320 | j5array[1] = j5array[0] > 0 ? (IKPI-j5array[0]) : (-IKPI-j5array[0]); |
| 23321 | cj5array[1] = -cj5array[0]; |
| 23322 | } |
| 23323 | else if( isnan(sj5array[0]) ) |
| 23324 | { |
| 23325 | // probably any value will work |
| 23326 | j5valid[0] = true; |
| 23327 | cj5array[0] = 1; sj5array[0] = 0; j5array[0] = 0; |
| 23328 | } |
| 23329 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 23330 | { |
| 23331 | if( !j5valid[ij5] ) |
| 23332 | { |
| 23333 | continue; |
| 23334 | } |
| 23335 | _ij5[0] = ij5; _ij5[1] = -1; |
| 23336 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 23337 | { |
| 23338 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 23339 | { |
| 23340 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 23341 | } |
| 23342 | } |
| 23343 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 23344 | { |
| 23345 | IkReal evalcond[15]; |
| 23346 | IkReal x2519=IKcos(j5); |
| 23347 | IkReal x2520=IKsin(j5); |
| 23348 | IkReal x2521=((3.9999999968e-5)*cj4); |
| 23349 | IkReal x2522=(cj3*cj4); |
| 23350 | IkReal x2523=((3.9999999968e-5)*cj3); |
| 23351 | IkReal x2524=(new_r01*x2519); |
| 23352 | IkReal x2525=((0.9999999992)*x2519); |
| 23353 | IkReal x2526=(new_r12*x2520); |
| 23354 | IkReal x2527=(sj4*x2520); |
| 23355 | IkReal x2528=(new_r10*x2520); |
| 23356 | evalcond[0]=(new_r12*x2519); |
| 23357 | evalcond[1]=(new_r10*x2519); |
| 23358 | evalcond[2]=x2524; |
| 23359 | evalcond[3]=((-1.0)*x2526); |
| 23360 | evalcond[4]=((-1.0)*cj3*x2519); |
| 23361 | evalcond[5]=((((-1.0)*cj3*x2520))+new_r01); |
| 23362 | evalcond[6]=((25000.00002)*sj4*x2524); |
| 23363 | evalcond[7]=((-25000.00002)*sj4*x2526); |
| 23364 | evalcond[8]=(((sj4*x2525))+(((-1.0)*x2519*x2521))); |
| 23365 | evalcond[9]=((((-1.0)*sj4*x2523))+(((-1.0)*x2528))+(((-0.9999999992)*x2522))); |
| 23366 | evalcond[10]=((((-1.0)*x2522*x2525))+(((-1.0)*sj4*x2519*x2523))); |
| 23367 | evalcond[11]=((((-0.9999999992)*sj4*x2524))+((x2521*x2524))); |
| 23368 | evalcond[12]=((((0.9999999992)*x2520*x2522))+new_r10+((x2523*x2527))); |
| 23369 | CheckValue<IkReal> x2529=IKPowWithIntegerCheck(((((25000.00002)*cj4))+(((-625000000.5)*sj4))),-1); |
| 23370 | if(!x2529.valid){ |
| 23371 | continue; |
| 23372 | } |
| 23373 | evalcond[13]=((((625000001.0)*new_r20*(x2529.value)))+(((-25000.00002)*new_r10*x2527))); |
| 23374 | evalcond[14]=((((0.9999999992)*cj4*new_r20))+(((0.9999999992)*new_r10*x2527))+(((3.9999999968e-5)*new_r20*sj4))+(((-1.0)*x2521*x2528))); |
| 23375 | if( 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 ) |
| 23376 | { |
| 23377 | continue; |
| 23378 | } |
| 23379 | } |
| 23380 | |
| 23381 | { |
| 23382 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 23383 | vinfos[0].jointtype = 1; |
| 23384 | vinfos[0].foffset = j0; |
| 23385 | vinfos[0].indices[0] = _ij0[0]; |
| 23386 | vinfos[0].indices[1] = _ij0[1]; |
| 23387 | vinfos[0].maxsolutions = _nj0; |
| 23388 | vinfos[1].jointtype = 1; |
| 23389 | vinfos[1].foffset = j1; |
| 23390 | vinfos[1].indices[0] = _ij1[0]; |
| 23391 | vinfos[1].indices[1] = _ij1[1]; |
| 23392 | vinfos[1].maxsolutions = _nj1; |
| 23393 | vinfos[2].jointtype = 1; |
| 23394 | vinfos[2].foffset = j2; |
| 23395 | vinfos[2].indices[0] = _ij2[0]; |
| 23396 | vinfos[2].indices[1] = _ij2[1]; |
| 23397 | vinfos[2].maxsolutions = _nj2; |
| 23398 | vinfos[3].jointtype = 1; |
| 23399 | vinfos[3].foffset = j3; |
| 23400 | vinfos[3].indices[0] = _ij3[0]; |
| 23401 | vinfos[3].indices[1] = _ij3[1]; |
| 23402 | vinfos[3].maxsolutions = _nj3; |
| 23403 | vinfos[4].jointtype = 1; |
| 23404 | vinfos[4].foffset = j4; |
| 23405 | vinfos[4].indices[0] = _ij4[0]; |
| 23406 | vinfos[4].indices[1] = _ij4[1]; |
| 23407 | vinfos[4].maxsolutions = _nj4; |
| 23408 | vinfos[5].jointtype = 1; |
| 23409 | vinfos[5].foffset = j5; |
| 23410 | vinfos[5].indices[0] = _ij5[0]; |
| 23411 | vinfos[5].indices[1] = _ij5[1]; |
| 23412 | vinfos[5].maxsolutions = _nj5; |
| 23413 | std::vector<int> vfree(0); |
| 23414 | solutions.AddSolution(vinfos,vfree); |
| 23415 | } |
| 23416 | } |
| 23417 | } |
| 23418 | |
| 23419 | } |
| 23420 | |
| 23421 | } |
| 23422 | |
| 23423 | } else |
| 23424 | { |
| 23425 | { |
| 23426 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 23427 | bool j5valid[2]={false}; |
| 23428 | _nj5 = 2; |
| 23429 | CheckValue<IkReal> x2530=IKPowWithIntegerCheck(cj3,-1); |
| 23430 | if(!x2530.valid){ |
| 23431 | continue; |
| 23432 | } |
| 23433 | sj5array[0]=(new_r01*(x2530.value)); |
| 23434 | if( sj5array[0] >= -1-IKFAST_SINCOS_THRESH && sj5array[0] <= 1+IKFAST_SINCOS_THRESH ) |
| 23435 | { |
| 23436 | j5valid[0] = j5valid[1] = true; |
| 23437 | j5array[0] = IKasin(sj5array[0]); |
| 23438 | cj5array[0] = IKcos(j5array[0]); |
| 23439 | sj5array[1] = sj5array[0]; |
| 23440 | j5array[1] = j5array[0] > 0 ? (IKPI-j5array[0]) : (-IKPI-j5array[0]); |
| 23441 | cj5array[1] = -cj5array[0]; |
| 23442 | } |
| 23443 | else if( isnan(sj5array[0]) ) |
| 23444 | { |
| 23445 | // probably any value will work |
| 23446 | j5valid[0] = true; |
| 23447 | cj5array[0] = 1; sj5array[0] = 0; j5array[0] = 0; |
| 23448 | } |
| 23449 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 23450 | { |
| 23451 | if( !j5valid[ij5] ) |
| 23452 | { |
| 23453 | continue; |
| 23454 | } |
| 23455 | _ij5[0] = ij5; _ij5[1] = -1; |
| 23456 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 23457 | { |
| 23458 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 23459 | { |
| 23460 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 23461 | } |
| 23462 | } |
| 23463 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 23464 | { |
| 23465 | IkReal evalcond[15]; |
| 23466 | IkReal x2531=IKcos(j5); |
| 23467 | IkReal x2532=IKsin(j5); |
| 23468 | IkReal x2533=((3.9999999968e-5)*cj4); |
| 23469 | IkReal x2534=(cj3*cj4); |
| 23470 | IkReal x2535=((3.9999999968e-5)*cj3); |
| 23471 | IkReal x2536=(new_r01*x2531); |
| 23472 | IkReal x2537=((0.9999999992)*x2531); |
| 23473 | IkReal x2538=(new_r12*x2532); |
| 23474 | IkReal x2539=(sj4*x2532); |
| 23475 | IkReal x2540=(new_r10*x2532); |
| 23476 | evalcond[0]=(new_r12*x2531); |
| 23477 | evalcond[1]=(new_r10*x2531); |
| 23478 | evalcond[2]=x2536; |
| 23479 | evalcond[3]=((-1.0)*x2538); |
| 23480 | evalcond[4]=((-1.0)*cj3*x2531); |
| 23481 | evalcond[5]=(((new_r01*x2532))+(((-1.0)*cj3))); |
| 23482 | evalcond[6]=((25000.00002)*sj4*x2536); |
| 23483 | evalcond[7]=((-25000.00002)*sj4*x2538); |
| 23484 | evalcond[8]=(((sj4*x2537))+(((-1.0)*x2531*x2533))); |
| 23485 | evalcond[9]=((((-1.0)*x2540))+(((-1.0)*sj4*x2535))+(((-0.9999999992)*x2534))); |
| 23486 | evalcond[10]=((((-1.0)*x2534*x2537))+(((-1.0)*sj4*x2531*x2535))); |
| 23487 | evalcond[11]=((((-0.9999999992)*sj4*x2536))+((x2533*x2536))); |
| 23488 | evalcond[12]=((((0.9999999992)*x2532*x2534))+new_r10+((x2535*x2539))); |
| 23489 | CheckValue<IkReal> x2541=IKPowWithIntegerCheck(((((25000.00002)*cj4))+(((-625000000.5)*sj4))),-1); |
| 23490 | if(!x2541.valid){ |
| 23491 | continue; |
| 23492 | } |
| 23493 | evalcond[13]=((((-25000.00002)*new_r10*x2539))+(((625000001.0)*new_r20*(x2541.value)))); |
| 23494 | evalcond[14]=((((0.9999999992)*cj4*new_r20))+(((0.9999999992)*new_r10*x2539))+(((-1.0)*x2533*x2540))+(((3.9999999968e-5)*new_r20*sj4))); |
| 23495 | if( 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 ) |
| 23496 | { |
| 23497 | continue; |
| 23498 | } |
| 23499 | } |
| 23500 | |
| 23501 | { |
| 23502 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 23503 | vinfos[0].jointtype = 1; |
| 23504 | vinfos[0].foffset = j0; |
| 23505 | vinfos[0].indices[0] = _ij0[0]; |
| 23506 | vinfos[0].indices[1] = _ij0[1]; |
| 23507 | vinfos[0].maxsolutions = _nj0; |
| 23508 | vinfos[1].jointtype = 1; |
| 23509 | vinfos[1].foffset = j1; |
| 23510 | vinfos[1].indices[0] = _ij1[0]; |
| 23511 | vinfos[1].indices[1] = _ij1[1]; |
| 23512 | vinfos[1].maxsolutions = _nj1; |
| 23513 | vinfos[2].jointtype = 1; |
| 23514 | vinfos[2].foffset = j2; |
| 23515 | vinfos[2].indices[0] = _ij2[0]; |
| 23516 | vinfos[2].indices[1] = _ij2[1]; |
| 23517 | vinfos[2].maxsolutions = _nj2; |
| 23518 | vinfos[3].jointtype = 1; |
| 23519 | vinfos[3].foffset = j3; |
| 23520 | vinfos[3].indices[0] = _ij3[0]; |
| 23521 | vinfos[3].indices[1] = _ij3[1]; |
| 23522 | vinfos[3].maxsolutions = _nj3; |
| 23523 | vinfos[4].jointtype = 1; |
| 23524 | vinfos[4].foffset = j4; |
| 23525 | vinfos[4].indices[0] = _ij4[0]; |
| 23526 | vinfos[4].indices[1] = _ij4[1]; |
| 23527 | vinfos[4].maxsolutions = _nj4; |
| 23528 | vinfos[5].jointtype = 1; |
| 23529 | vinfos[5].foffset = j5; |
| 23530 | vinfos[5].indices[0] = _ij5[0]; |
| 23531 | vinfos[5].indices[1] = _ij5[1]; |
| 23532 | vinfos[5].maxsolutions = _nj5; |
| 23533 | std::vector<int> vfree(0); |
| 23534 | solutions.AddSolution(vinfos,vfree); |
| 23535 | } |
| 23536 | } |
| 23537 | } |
| 23538 | |
| 23539 | } |
| 23540 | |
| 23541 | } |
| 23542 | |
| 23543 | } |
| 23544 | } while(0); |
| 23545 | if( bgotonextstatement ) |
| 23546 | { |
| 23547 | bool bgotonextstatement = true; |
| 23548 | do |
| 23549 | { |
| 23550 | evalcond[0]=((IKabs(new_r12))+(IKabs(new_r10))); |
| 23551 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 23552 | { |
| 23553 | bgotonextstatement=false; |
| 23554 | { |
| 23555 | IkReal j5eval[1]; |
| 23556 | new_r10=0; |
| 23557 | new_r12=0; |
| 23558 | new_r21=0; |
| 23559 | new_r01=0; |
| 23560 | j5eval[0]=cj3; |
| 23561 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 23562 | { |
| 23563 | { |
| 23564 | IkReal j5eval[1]; |
| 23565 | new_r10=0; |
| 23566 | new_r12=0; |
| 23567 | new_r21=0; |
| 23568 | new_r01=0; |
| 23569 | j5eval[0]=new_r11; |
| 23570 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 23571 | { |
| 23572 | { |
| 23573 | IkReal j5eval[1]; |
| 23574 | new_r10=0; |
| 23575 | new_r12=0; |
| 23576 | new_r21=0; |
| 23577 | new_r01=0; |
| 23578 | j5eval[0]=((((-25000.0)*cj3*cj4))+(((-1.0)*cj3*sj4))); |
| 23579 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 23580 | { |
| 23581 | { |
| 23582 | IkReal evalcond[5]; |
| 23583 | bool bgotonextstatement = true; |
| 23584 | do |
| 23585 | { |
| 23586 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-1.5707963267949)+j3)))), 6.28318530717959))); |
| 23587 | evalcond[1]=new_r02; |
| 23588 | evalcond[2]=new_r20; |
| 23589 | evalcond[3]=new_r00; |
| 23590 | evalcond[4]=new_r11; |
| 23591 | if( 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 ) |
| 23592 | { |
| 23593 | bgotonextstatement=false; |
| 23594 | { |
| 23595 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 23596 | bool j5valid[1]={false}; |
| 23597 | _nj5 = 1; |
| 23598 | j5array[0]=0; |
| 23599 | sj5array[0]=IKsin(j5array[0]); |
| 23600 | cj5array[0]=IKcos(j5array[0]); |
| 23601 | if( j5array[0] > IKPI ) |
| 23602 | { |
| 23603 | j5array[0]-=IK2PI; |
| 23604 | } |
| 23605 | else if( j5array[0] < -IKPI ) |
| 23606 | { j5array[0]+=IK2PI; |
| 23607 | } |
| 23608 | j5valid[0] = true; |
| 23609 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 23610 | { |
| 23611 | if( !j5valid[ij5] ) |
| 23612 | { |
| 23613 | continue; |
| 23614 | } |
| 23615 | _ij5[0] = ij5; _ij5[1] = -1; |
| 23616 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 23617 | { |
| 23618 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 23619 | { |
| 23620 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 23621 | } |
| 23622 | } |
| 23623 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 23624 | |
| 23625 | { |
| 23626 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 23627 | vinfos[0].jointtype = 1; |
| 23628 | vinfos[0].foffset = j0; |
| 23629 | vinfos[0].indices[0] = _ij0[0]; |
| 23630 | vinfos[0].indices[1] = _ij0[1]; |
| 23631 | vinfos[0].maxsolutions = _nj0; |
| 23632 | vinfos[1].jointtype = 1; |
| 23633 | vinfos[1].foffset = j1; |
| 23634 | vinfos[1].indices[0] = _ij1[0]; |
| 23635 | vinfos[1].indices[1] = _ij1[1]; |
| 23636 | vinfos[1].maxsolutions = _nj1; |
| 23637 | vinfos[2].jointtype = 1; |
| 23638 | vinfos[2].foffset = j2; |
| 23639 | vinfos[2].indices[0] = _ij2[0]; |
| 23640 | vinfos[2].indices[1] = _ij2[1]; |
| 23641 | vinfos[2].maxsolutions = _nj2; |
| 23642 | vinfos[3].jointtype = 1; |
| 23643 | vinfos[3].foffset = j3; |
| 23644 | vinfos[3].indices[0] = _ij3[0]; |
| 23645 | vinfos[3].indices[1] = _ij3[1]; |
| 23646 | vinfos[3].maxsolutions = _nj3; |
| 23647 | vinfos[4].jointtype = 1; |
| 23648 | vinfos[4].foffset = j4; |
| 23649 | vinfos[4].indices[0] = _ij4[0]; |
| 23650 | vinfos[4].indices[1] = _ij4[1]; |
| 23651 | vinfos[4].maxsolutions = _nj4; |
| 23652 | vinfos[5].jointtype = 1; |
| 23653 | vinfos[5].foffset = j5; |
| 23654 | vinfos[5].indices[0] = _ij5[0]; |
| 23655 | vinfos[5].indices[1] = _ij5[1]; |
| 23656 | vinfos[5].maxsolutions = _nj5; |
| 23657 | std::vector<int> vfree(0); |
| 23658 | solutions.AddSolution(vinfos,vfree); |
| 23659 | } |
| 23660 | } |
| 23661 | } |
| 23662 | |
| 23663 | } |
| 23664 | } while(0); |
| 23665 | if( bgotonextstatement ) |
| 23666 | { |
| 23667 | bool bgotonextstatement = true; |
| 23668 | do |
| 23669 | { |
| 23670 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((1.5707963267949)+j3)))), 6.28318530717959))); |
| 23671 | evalcond[1]=new_r02; |
| 23672 | evalcond[2]=new_r20; |
| 23673 | evalcond[3]=new_r00; |
| 23674 | evalcond[4]=new_r11; |
| 23675 | if( 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 ) |
| 23676 | { |
| 23677 | bgotonextstatement=false; |
| 23678 | { |
| 23679 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 23680 | bool j5valid[1]={false}; |
| 23681 | _nj5 = 1; |
| 23682 | j5array[0]=0; |
| 23683 | sj5array[0]=IKsin(j5array[0]); |
| 23684 | cj5array[0]=IKcos(j5array[0]); |
| 23685 | if( j5array[0] > IKPI ) |
| 23686 | { |
| 23687 | j5array[0]-=IK2PI; |
| 23688 | } |
| 23689 | else if( j5array[0] < -IKPI ) |
| 23690 | { j5array[0]+=IK2PI; |
| 23691 | } |
| 23692 | j5valid[0] = true; |
| 23693 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 23694 | { |
| 23695 | if( !j5valid[ij5] ) |
| 23696 | { |
| 23697 | continue; |
| 23698 | } |
| 23699 | _ij5[0] = ij5; _ij5[1] = -1; |
| 23700 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 23701 | { |
| 23702 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 23703 | { |
| 23704 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 23705 | } |
| 23706 | } |
| 23707 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 23708 | |
| 23709 | { |
| 23710 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 23711 | vinfos[0].jointtype = 1; |
| 23712 | vinfos[0].foffset = j0; |
| 23713 | vinfos[0].indices[0] = _ij0[0]; |
| 23714 | vinfos[0].indices[1] = _ij0[1]; |
| 23715 | vinfos[0].maxsolutions = _nj0; |
| 23716 | vinfos[1].jointtype = 1; |
| 23717 | vinfos[1].foffset = j1; |
| 23718 | vinfos[1].indices[0] = _ij1[0]; |
| 23719 | vinfos[1].indices[1] = _ij1[1]; |
| 23720 | vinfos[1].maxsolutions = _nj1; |
| 23721 | vinfos[2].jointtype = 1; |
| 23722 | vinfos[2].foffset = j2; |
| 23723 | vinfos[2].indices[0] = _ij2[0]; |
| 23724 | vinfos[2].indices[1] = _ij2[1]; |
| 23725 | vinfos[2].maxsolutions = _nj2; |
| 23726 | vinfos[3].jointtype = 1; |
| 23727 | vinfos[3].foffset = j3; |
| 23728 | vinfos[3].indices[0] = _ij3[0]; |
| 23729 | vinfos[3].indices[1] = _ij3[1]; |
| 23730 | vinfos[3].maxsolutions = _nj3; |
| 23731 | vinfos[4].jointtype = 1; |
| 23732 | vinfos[4].foffset = j4; |
| 23733 | vinfos[4].indices[0] = _ij4[0]; |
| 23734 | vinfos[4].indices[1] = _ij4[1]; |
| 23735 | vinfos[4].maxsolutions = _nj4; |
| 23736 | vinfos[5].jointtype = 1; |
| 23737 | vinfos[5].foffset = j5; |
| 23738 | vinfos[5].indices[0] = _ij5[0]; |
| 23739 | vinfos[5].indices[1] = _ij5[1]; |
| 23740 | vinfos[5].maxsolutions = _nj5; |
| 23741 | std::vector<int> vfree(0); |
| 23742 | solutions.AddSolution(vinfos,vfree); |
| 23743 | } |
| 23744 | } |
| 23745 | } |
| 23746 | |
| 23747 | } |
| 23748 | } while(0); |
| 23749 | if( bgotonextstatement ) |
| 23750 | { |
| 23751 | bool bgotonextstatement = true; |
| 23752 | do |
| 23753 | { |
| 23754 | if( 1 ) |
| 23755 | { |
| 23756 | bgotonextstatement=false; |
| 23757 | continue; // branch miss [j5] |
| 23758 | |
| 23759 | } |
| 23760 | } while(0); |
| 23761 | if( bgotonextstatement ) |
| 23762 | { |
| 23763 | } |
| 23764 | } |
| 23765 | } |
| 23766 | } |
| 23767 | |
| 23768 | } else |
| 23769 | { |
| 23770 | { |
| 23771 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 23772 | bool j5valid[2]={false}; |
| 23773 | _nj5 = 2; |
| 23774 | CheckValue<IkReal> x2542=IKPowWithIntegerCheck(((((-0.9999999992)*cj3*cj4))+(((-3.9999999968e-5)*cj3*sj4))),-1); |
| 23775 | if(!x2542.valid){ |
| 23776 | continue; |
| 23777 | } |
| 23778 | cj5array[0]=((-1.0)*new_r00*(x2542.value)); |
| 23779 | if( cj5array[0] >= -1-IKFAST_SINCOS_THRESH && cj5array[0] <= 1+IKFAST_SINCOS_THRESH ) |
| 23780 | { |
| 23781 | j5valid[0] = j5valid[1] = true; |
| 23782 | j5array[0] = IKacos(cj5array[0]); |
| 23783 | sj5array[0] = IKsin(j5array[0]); |
| 23784 | cj5array[1] = cj5array[0]; |
| 23785 | j5array[1] = -j5array[0]; |
| 23786 | sj5array[1] = -sj5array[0]; |
| 23787 | } |
| 23788 | else if( isnan(cj5array[0]) ) |
| 23789 | { |
| 23790 | // probably any value will work |
| 23791 | j5valid[0] = true; |
| 23792 | cj5array[0] = 1; sj5array[0] = 0; j5array[0] = 0; |
| 23793 | } |
| 23794 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 23795 | { |
| 23796 | if( !j5valid[ij5] ) |
| 23797 | { |
| 23798 | continue; |
| 23799 | } |
| 23800 | _ij5[0] = ij5; _ij5[1] = -1; |
| 23801 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 23802 | { |
| 23803 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 23804 | { |
| 23805 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 23806 | } |
| 23807 | } |
| 23808 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 23809 | { |
| 23810 | IkReal evalcond[15]; |
| 23811 | IkReal x2543=IKsin(j5); |
| 23812 | IkReal x2544=IKcos(j5); |
| 23813 | IkReal x2545=((3.9999999968e-5)*sj4); |
| 23814 | IkReal x2546=((1.0)*cj3); |
| 23815 | IkReal x2547=((0.9999999992)*cj4); |
| 23816 | IkReal x2548=((25000.00002)*sj4); |
| 23817 | IkReal x2549=((0.9999999992)*sj4); |
| 23818 | IkReal x2550=(cj3*x2543); |
| 23819 | IkReal x2551=(new_r00*x2544); |
| 23820 | IkReal x2552=(new_r02*x2544); |
| 23821 | IkReal x2553=((3.9999999968e-5)*cj4*x2543); |
| 23822 | IkReal x2554=(new_r11*sj4*x2543); |
| 23823 | evalcond[0]=(new_r02*x2543); |
| 23824 | evalcond[1]=(new_r00*x2543); |
| 23825 | evalcond[2]=x2552; |
| 23826 | evalcond[3]=((-1.0)*new_r11*x2543); |
| 23827 | evalcond[4]=((-1.0)*x2550); |
| 23828 | evalcond[5]=((((-1.0)*x2544*x2546))+new_r11); |
| 23829 | evalcond[6]=((((-1.0)*x2546))+((new_r11*x2544))); |
| 23830 | evalcond[7]=(x2548*x2552); |
| 23831 | evalcond[8]=((-25000.00002)*x2554); |
| 23832 | evalcond[9]=(x2553+(((-1.0)*x2543*x2549))); |
| 23833 | evalcond[10]=(x2551+(((-1.0)*cj3*x2547))+(((-1.0)*cj3*x2545))); |
| 23834 | evalcond[11]=(((x2547*x2550))+((x2545*x2550))); |
| 23835 | evalcond[12]=((((-1.0)*new_r11*x2553))+((new_r11*x2543*x2549))); |
| 23836 | CheckValue<IkReal> x2555=IKPowWithIntegerCheck(((((25000.00002)*cj4))+(((-625000000.5)*sj4))),-1); |
| 23837 | if(!x2555.valid){ |
| 23838 | continue; |
| 23839 | } |
| 23840 | evalcond[13]=((((625000001.0)*new_r20*(x2555.value)))+((x2548*x2551))); |
| 23841 | evalcond[14]=((((-1.0)*x2549*x2551))+((new_r20*x2547))+((new_r20*x2545))+(((3.9999999968e-5)*cj4*x2551))); |
| 23842 | if( 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 ) |
| 23843 | { |
| 23844 | continue; |
| 23845 | } |
| 23846 | } |
| 23847 | |
| 23848 | { |
| 23849 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 23850 | vinfos[0].jointtype = 1; |
| 23851 | vinfos[0].foffset = j0; |
| 23852 | vinfos[0].indices[0] = _ij0[0]; |
| 23853 | vinfos[0].indices[1] = _ij0[1]; |
| 23854 | vinfos[0].maxsolutions = _nj0; |
| 23855 | vinfos[1].jointtype = 1; |
| 23856 | vinfos[1].foffset = j1; |
| 23857 | vinfos[1].indices[0] = _ij1[0]; |
| 23858 | vinfos[1].indices[1] = _ij1[1]; |
| 23859 | vinfos[1].maxsolutions = _nj1; |
| 23860 | vinfos[2].jointtype = 1; |
| 23861 | vinfos[2].foffset = j2; |
| 23862 | vinfos[2].indices[0] = _ij2[0]; |
| 23863 | vinfos[2].indices[1] = _ij2[1]; |
| 23864 | vinfos[2].maxsolutions = _nj2; |
| 23865 | vinfos[3].jointtype = 1; |
| 23866 | vinfos[3].foffset = j3; |
| 23867 | vinfos[3].indices[0] = _ij3[0]; |
| 23868 | vinfos[3].indices[1] = _ij3[1]; |
| 23869 | vinfos[3].maxsolutions = _nj3; |
| 23870 | vinfos[4].jointtype = 1; |
| 23871 | vinfos[4].foffset = j4; |
| 23872 | vinfos[4].indices[0] = _ij4[0]; |
| 23873 | vinfos[4].indices[1] = _ij4[1]; |
| 23874 | vinfos[4].maxsolutions = _nj4; |
| 23875 | vinfos[5].jointtype = 1; |
| 23876 | vinfos[5].foffset = j5; |
| 23877 | vinfos[5].indices[0] = _ij5[0]; |
| 23878 | vinfos[5].indices[1] = _ij5[1]; |
| 23879 | vinfos[5].maxsolutions = _nj5; |
| 23880 | std::vector<int> vfree(0); |
| 23881 | solutions.AddSolution(vinfos,vfree); |
| 23882 | } |
| 23883 | } |
| 23884 | } |
| 23885 | |
| 23886 | } |
| 23887 | |
| 23888 | } |
| 23889 | |
| 23890 | } else |
| 23891 | { |
| 23892 | { |
| 23893 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 23894 | bool j5valid[2]={false}; |
| 23895 | _nj5 = 2; |
| 23896 | CheckValue<IkReal> x2556=IKPowWithIntegerCheck(new_r11,-1); |
| 23897 | if(!x2556.valid){ |
| 23898 | continue; |
| 23899 | } |
| 23900 | cj5array[0]=(cj3*(x2556.value)); |
| 23901 | if( cj5array[0] >= -1-IKFAST_SINCOS_THRESH && cj5array[0] <= 1+IKFAST_SINCOS_THRESH ) |
| 23902 | { |
| 23903 | j5valid[0] = j5valid[1] = true; |
| 23904 | j5array[0] = IKacos(cj5array[0]); |
| 23905 | sj5array[0] = IKsin(j5array[0]); |
| 23906 | cj5array[1] = cj5array[0]; |
| 23907 | j5array[1] = -j5array[0]; |
| 23908 | sj5array[1] = -sj5array[0]; |
| 23909 | } |
| 23910 | else if( isnan(cj5array[0]) ) |
| 23911 | { |
| 23912 | // probably any value will work |
| 23913 | j5valid[0] = true; |
| 23914 | cj5array[0] = 1; sj5array[0] = 0; j5array[0] = 0; |
| 23915 | } |
| 23916 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 23917 | { |
| 23918 | if( !j5valid[ij5] ) |
| 23919 | { |
| 23920 | continue; |
| 23921 | } |
| 23922 | _ij5[0] = ij5; _ij5[1] = -1; |
| 23923 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 23924 | { |
| 23925 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 23926 | { |
| 23927 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 23928 | } |
| 23929 | } |
| 23930 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 23931 | { |
| 23932 | IkReal evalcond[15]; |
| 23933 | IkReal x2557=IKsin(j5); |
| 23934 | IkReal x2558=IKcos(j5); |
| 23935 | IkReal x2559=((3.9999999968e-5)*sj4); |
| 23936 | IkReal x2560=((0.9999999992)*cj4); |
| 23937 | IkReal x2561=((25000.00002)*sj4); |
| 23938 | IkReal x2562=((0.9999999992)*sj4); |
| 23939 | IkReal x2563=(cj3*x2557); |
| 23940 | IkReal x2564=(cj3*x2558); |
| 23941 | IkReal x2565=(new_r00*x2558); |
| 23942 | IkReal x2566=(new_r02*x2558); |
| 23943 | IkReal x2567=((3.9999999968e-5)*cj4*x2557); |
| 23944 | IkReal x2568=(new_r11*sj4*x2557); |
| 23945 | evalcond[0]=(new_r02*x2557); |
| 23946 | evalcond[1]=(new_r00*x2557); |
| 23947 | evalcond[2]=x2566; |
| 23948 | evalcond[3]=((-1.0)*new_r11*x2557); |
| 23949 | evalcond[4]=((-1.0)*x2563); |
| 23950 | evalcond[5]=((((-1.0)*x2564))+new_r11); |
| 23951 | evalcond[6]=(x2561*x2566); |
| 23952 | evalcond[7]=((-25000.00002)*x2568); |
| 23953 | evalcond[8]=(x2567+(((-1.0)*x2557*x2562))); |
| 23954 | evalcond[9]=(x2565+(((-1.0)*cj3*x2559))+(((-1.0)*cj3*x2560))); |
| 23955 | evalcond[10]=(((x2560*x2563))+((x2559*x2563))); |
| 23956 | evalcond[11]=((((-1.0)*new_r11*x2567))+((new_r11*x2557*x2562))); |
| 23957 | evalcond[12]=((((-1.0)*x2560*x2564))+(((-1.0)*x2559*x2564))+new_r00); |
| 23958 | CheckValue<IkReal> x2569=IKPowWithIntegerCheck(((((25000.00002)*cj4))+(((-625000000.5)*sj4))),-1); |
| 23959 | if(!x2569.valid){ |
| 23960 | continue; |
| 23961 | } |
| 23962 | evalcond[13]=((((625000001.0)*new_r20*(x2569.value)))+((x2561*x2565))); |
| 23963 | evalcond[14]=((((3.9999999968e-5)*cj4*x2565))+(((-1.0)*x2562*x2565))+((new_r20*x2559))+((new_r20*x2560))); |
| 23964 | if( 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 ) |
| 23965 | { |
| 23966 | continue; |
| 23967 | } |
| 23968 | } |
| 23969 | |
| 23970 | { |
| 23971 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 23972 | vinfos[0].jointtype = 1; |
| 23973 | vinfos[0].foffset = j0; |
| 23974 | vinfos[0].indices[0] = _ij0[0]; |
| 23975 | vinfos[0].indices[1] = _ij0[1]; |
| 23976 | vinfos[0].maxsolutions = _nj0; |
| 23977 | vinfos[1].jointtype = 1; |
| 23978 | vinfos[1].foffset = j1; |
| 23979 | vinfos[1].indices[0] = _ij1[0]; |
| 23980 | vinfos[1].indices[1] = _ij1[1]; |
| 23981 | vinfos[1].maxsolutions = _nj1; |
| 23982 | vinfos[2].jointtype = 1; |
| 23983 | vinfos[2].foffset = j2; |
| 23984 | vinfos[2].indices[0] = _ij2[0]; |
| 23985 | vinfos[2].indices[1] = _ij2[1]; |
| 23986 | vinfos[2].maxsolutions = _nj2; |
| 23987 | vinfos[3].jointtype = 1; |
| 23988 | vinfos[3].foffset = j3; |
| 23989 | vinfos[3].indices[0] = _ij3[0]; |
| 23990 | vinfos[3].indices[1] = _ij3[1]; |
| 23991 | vinfos[3].maxsolutions = _nj3; |
| 23992 | vinfos[4].jointtype = 1; |
| 23993 | vinfos[4].foffset = j4; |
| 23994 | vinfos[4].indices[0] = _ij4[0]; |
| 23995 | vinfos[4].indices[1] = _ij4[1]; |
| 23996 | vinfos[4].maxsolutions = _nj4; |
| 23997 | vinfos[5].jointtype = 1; |
| 23998 | vinfos[5].foffset = j5; |
| 23999 | vinfos[5].indices[0] = _ij5[0]; |
| 24000 | vinfos[5].indices[1] = _ij5[1]; |
| 24001 | vinfos[5].maxsolutions = _nj5; |
| 24002 | std::vector<int> vfree(0); |
| 24003 | solutions.AddSolution(vinfos,vfree); |
| 24004 | } |
| 24005 | } |
| 24006 | } |
| 24007 | |
| 24008 | } |
| 24009 | |
| 24010 | } |
| 24011 | |
| 24012 | } else |
| 24013 | { |
| 24014 | { |
| 24015 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 24016 | bool j5valid[2]={false}; |
| 24017 | _nj5 = 2; |
| 24018 | CheckValue<IkReal> x2570=IKPowWithIntegerCheck(cj3,-1); |
| 24019 | if(!x2570.valid){ |
| 24020 | continue; |
| 24021 | } |
| 24022 | cj5array[0]=(new_r11*(x2570.value)); |
| 24023 | if( cj5array[0] >= -1-IKFAST_SINCOS_THRESH && cj5array[0] <= 1+IKFAST_SINCOS_THRESH ) |
| 24024 | { |
| 24025 | j5valid[0] = j5valid[1] = true; |
| 24026 | j5array[0] = IKacos(cj5array[0]); |
| 24027 | sj5array[0] = IKsin(j5array[0]); |
| 24028 | cj5array[1] = cj5array[0]; |
| 24029 | j5array[1] = -j5array[0]; |
| 24030 | sj5array[1] = -sj5array[0]; |
| 24031 | } |
| 24032 | else if( isnan(cj5array[0]) ) |
| 24033 | { |
| 24034 | // probably any value will work |
| 24035 | j5valid[0] = true; |
| 24036 | cj5array[0] = 1; sj5array[0] = 0; j5array[0] = 0; |
| 24037 | } |
| 24038 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 24039 | { |
| 24040 | if( !j5valid[ij5] ) |
| 24041 | { |
| 24042 | continue; |
| 24043 | } |
| 24044 | _ij5[0] = ij5; _ij5[1] = -1; |
| 24045 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 24046 | { |
| 24047 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 24048 | { |
| 24049 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 24050 | } |
| 24051 | } |
| 24052 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 24053 | { |
| 24054 | IkReal evalcond[15]; |
| 24055 | IkReal x2571=IKsin(j5); |
| 24056 | IkReal x2572=IKcos(j5); |
| 24057 | IkReal x2573=((3.9999999968e-5)*sj4); |
| 24058 | IkReal x2574=((0.9999999992)*cj3); |
| 24059 | IkReal x2575=((0.9999999992)*cj4); |
| 24060 | IkReal x2576=((25000.00002)*sj4); |
| 24061 | IkReal x2577=((0.9999999992)*sj4); |
| 24062 | IkReal x2578=(cj3*x2571); |
| 24063 | IkReal x2579=(cj4*x2572); |
| 24064 | IkReal x2580=(new_r00*x2572); |
| 24065 | IkReal x2581=(new_r02*x2572); |
| 24066 | IkReal x2582=((3.9999999968e-5)*cj4*x2571); |
| 24067 | IkReal x2583=(new_r11*sj4*x2571); |
| 24068 | evalcond[0]=(new_r02*x2571); |
| 24069 | evalcond[1]=(new_r00*x2571); |
| 24070 | evalcond[2]=x2581; |
| 24071 | evalcond[3]=((-1.0)*new_r11*x2571); |
| 24072 | evalcond[4]=((-1.0)*x2578); |
| 24073 | evalcond[5]=(((new_r11*x2572))+(((-1.0)*cj3))); |
| 24074 | evalcond[6]=(x2576*x2581); |
| 24075 | evalcond[7]=((-25000.00002)*x2583); |
| 24076 | evalcond[8]=(x2582+(((-1.0)*x2571*x2577))); |
| 24077 | evalcond[9]=(x2580+(((-1.0)*cj3*x2573))+(((-1.0)*cj4*x2574))); |
| 24078 | evalcond[10]=(((x2573*x2578))+((cj4*x2571*x2574))); |
| 24079 | evalcond[11]=(((new_r11*x2571*x2577))+(((-1.0)*new_r11*x2582))); |
| 24080 | evalcond[12]=((((-1.0)*cj3*x2572*x2573))+new_r00+(((-1.0)*x2574*x2579))); |
| 24081 | CheckValue<IkReal> x2584=IKPowWithIntegerCheck(((((25000.00002)*cj4))+(((-625000000.5)*sj4))),-1); |
| 24082 | if(!x2584.valid){ |
| 24083 | continue; |
| 24084 | } |
| 24085 | evalcond[13]=((((625000001.0)*new_r20*(x2584.value)))+((x2576*x2580))); |
| 24086 | evalcond[14]=((((3.9999999968e-5)*new_r00*x2579))+((new_r20*x2575))+((new_r20*x2573))+(((-1.0)*x2577*x2580))); |
| 24087 | if( 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 ) |
| 24088 | { |
| 24089 | continue; |
| 24090 | } |
| 24091 | } |
| 24092 | |
| 24093 | { |
| 24094 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 24095 | vinfos[0].jointtype = 1; |
| 24096 | vinfos[0].foffset = j0; |
| 24097 | vinfos[0].indices[0] = _ij0[0]; |
| 24098 | vinfos[0].indices[1] = _ij0[1]; |
| 24099 | vinfos[0].maxsolutions = _nj0; |
| 24100 | vinfos[1].jointtype = 1; |
| 24101 | vinfos[1].foffset = j1; |
| 24102 | vinfos[1].indices[0] = _ij1[0]; |
| 24103 | vinfos[1].indices[1] = _ij1[1]; |
| 24104 | vinfos[1].maxsolutions = _nj1; |
| 24105 | vinfos[2].jointtype = 1; |
| 24106 | vinfos[2].foffset = j2; |
| 24107 | vinfos[2].indices[0] = _ij2[0]; |
| 24108 | vinfos[2].indices[1] = _ij2[1]; |
| 24109 | vinfos[2].maxsolutions = _nj2; |
| 24110 | vinfos[3].jointtype = 1; |
| 24111 | vinfos[3].foffset = j3; |
| 24112 | vinfos[3].indices[0] = _ij3[0]; |
| 24113 | vinfos[3].indices[1] = _ij3[1]; |
| 24114 | vinfos[3].maxsolutions = _nj3; |
| 24115 | vinfos[4].jointtype = 1; |
| 24116 | vinfos[4].foffset = j4; |
| 24117 | vinfos[4].indices[0] = _ij4[0]; |
| 24118 | vinfos[4].indices[1] = _ij4[1]; |
| 24119 | vinfos[4].maxsolutions = _nj4; |
| 24120 | vinfos[5].jointtype = 1; |
| 24121 | vinfos[5].foffset = j5; |
| 24122 | vinfos[5].indices[0] = _ij5[0]; |
| 24123 | vinfos[5].indices[1] = _ij5[1]; |
| 24124 | vinfos[5].maxsolutions = _nj5; |
| 24125 | std::vector<int> vfree(0); |
| 24126 | solutions.AddSolution(vinfos,vfree); |
| 24127 | } |
| 24128 | } |
| 24129 | } |
| 24130 | |
| 24131 | } |
| 24132 | |
| 24133 | } |
| 24134 | |
| 24135 | } |
| 24136 | } while(0); |
| 24137 | if( bgotonextstatement ) |
| 24138 | { |
| 24139 | bool bgotonextstatement = true; |
| 24140 | do |
| 24141 | { |
| 24142 | evalcond[0]=((IKabs(new_r12))+(IKabs(new_r02))); |
| 24143 | if( IKabs(evalcond[0]) < 0.0000050000000000 ) |
| 24144 | { |
| 24145 | bgotonextstatement=false; |
| 24146 | { |
| 24147 | IkReal j5eval[1]; |
| 24148 | new_r02=0; |
| 24149 | new_r12=0; |
| 24150 | new_r20=0; |
| 24151 | new_r21=0; |
| 24152 | j5eval[0]=((IKabs(new_r10))+(IKabs(new_r00))); |
| 24153 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 24154 | { |
| 24155 | { |
| 24156 | IkReal j5eval[1]; |
| 24157 | new_r02=0; |
| 24158 | new_r12=0; |
| 24159 | new_r20=0; |
| 24160 | new_r21=0; |
| 24161 | j5eval[0]=((IKabs(new_r11))+(IKabs(new_r01))); |
| 24162 | if( IKabs(j5eval[0]) < 0.0000010000000000 ) |
| 24163 | { |
| 24164 | { |
| 24165 | IkReal j5eval[3]; |
| 24166 | new_r02=0; |
| 24167 | new_r12=0; |
| 24168 | new_r20=0; |
| 24169 | new_r21=0; |
| 24170 | j5eval[0]=625000001.0; |
| 24171 | j5eval[1]=sj4; |
| 24172 | j5eval[2]=1.0; |
| 24173 | if( IKabs(j5eval[0]) < 0.0000010000000000 || IKabs(j5eval[1]) < 0.0000010000000000 || IKabs(j5eval[2]) < 0.0000010000000000 ) |
| 24174 | { |
| 24175 | { |
| 24176 | IkReal evalcond[5]; |
| 24177 | bool bgotonextstatement = true; |
| 24178 | do |
| 24179 | { |
| 24180 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(j4))), 6.28318530717959))); |
| 24181 | evalcond[1]=new_r00; |
| 24182 | evalcond[2]=new_r10; |
| 24183 | evalcond[3]=new_r01; |
| 24184 | evalcond[4]=new_r11; |
| 24185 | if( 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 ) |
| 24186 | { |
| 24187 | bgotonextstatement=false; |
| 24188 | { |
| 24189 | IkReal j5eval[1]; |
| 24190 | new_r02=0; |
| 24191 | new_r12=0; |
| 24192 | new_r20=0; |
| 24193 | new_r21=0; |
| 24194 | sj4=0; |
| 24195 | cj4=1.0; |
| 24196 | j4=0; |
| 24197 | j5eval[0]=1.0; |
| 24198 | if( IKabs(j5eval[0]) < 0.0000000100000000 ) |
| 24199 | { |
| 24200 | continue; // no branches [j5] |
| 24201 | |
| 24202 | } else |
| 24203 | { |
| 24204 | IkReal op[2+1], zeror[2]; |
| 24205 | int numroots; |
| 24206 | op[0]=1.0; |
| 24207 | op[1]=0; |
| 24208 | op[2]=-1.0; |
| 24209 | polyroots2(op,zeror,numroots); |
| 24210 | IkReal j5array[2], cj5array[2], sj5array[2], tempj5array[1]; |
| 24211 | int numsolutions = 0; |
| 24212 | for(int ij5 = 0; ij5 < numroots; ++ij5) |
| 24213 | { |
| 24214 | IkReal htj5 = zeror[ij5]; |
| 24215 | tempj5array[0]=((2.0)*(atan(htj5))); |
| 24216 | for(int kj5 = 0; kj5 < 1; ++kj5) |
| 24217 | { |
| 24218 | j5array[numsolutions] = tempj5array[kj5]; |
| 24219 | if( j5array[numsolutions] > IKPI ) |
| 24220 | { |
| 24221 | j5array[numsolutions]-=IK2PI; |
| 24222 | } |
| 24223 | else if( j5array[numsolutions] < -IKPI ) |
| 24224 | { |
| 24225 | j5array[numsolutions]+=IK2PI; |
| 24226 | } |
| 24227 | sj5array[numsolutions] = IKsin(j5array[numsolutions]); |
| 24228 | cj5array[numsolutions] = IKcos(j5array[numsolutions]); |
| 24229 | numsolutions++; |
| 24230 | } |
| 24231 | } |
| 24232 | bool j5valid[2]={true,true}; |
| 24233 | _nj5 = 2; |
| 24234 | for(int ij5 = 0; ij5 < numsolutions; ++ij5) |
| 24235 | { |
| 24236 | if( !j5valid[ij5] ) |
| 24237 | { |
| 24238 | continue; |
| 24239 | } |
| 24240 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 24241 | htj5 = IKtan(j5/2); |
| 24242 | |
| 24243 | _ij5[0] = ij5; _ij5[1] = -1; |
| 24244 | for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5) |
| 24245 | { |
| 24246 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 24247 | { |
| 24248 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 24249 | } |
| 24250 | } |
| 24251 | { |
| 24252 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 24253 | vinfos[0].jointtype = 1; |
| 24254 | vinfos[0].foffset = j0; |
| 24255 | vinfos[0].indices[0] = _ij0[0]; |
| 24256 | vinfos[0].indices[1] = _ij0[1]; |
| 24257 | vinfos[0].maxsolutions = _nj0; |
| 24258 | vinfos[1].jointtype = 1; |
| 24259 | vinfos[1].foffset = j1; |
| 24260 | vinfos[1].indices[0] = _ij1[0]; |
| 24261 | vinfos[1].indices[1] = _ij1[1]; |
| 24262 | vinfos[1].maxsolutions = _nj1; |
| 24263 | vinfos[2].jointtype = 1; |
| 24264 | vinfos[2].foffset = j2; |
| 24265 | vinfos[2].indices[0] = _ij2[0]; |
| 24266 | vinfos[2].indices[1] = _ij2[1]; |
| 24267 | vinfos[2].maxsolutions = _nj2; |
| 24268 | vinfos[3].jointtype = 1; |
| 24269 | vinfos[3].foffset = j3; |
| 24270 | vinfos[3].indices[0] = _ij3[0]; |
| 24271 | vinfos[3].indices[1] = _ij3[1]; |
| 24272 | vinfos[3].maxsolutions = _nj3; |
| 24273 | vinfos[4].jointtype = 1; |
| 24274 | vinfos[4].foffset = j4; |
| 24275 | vinfos[4].indices[0] = _ij4[0]; |
| 24276 | vinfos[4].indices[1] = _ij4[1]; |
| 24277 | vinfos[4].maxsolutions = _nj4; |
| 24278 | vinfos[5].jointtype = 1; |
| 24279 | vinfos[5].foffset = j5; |
| 24280 | vinfos[5].indices[0] = _ij5[0]; |
| 24281 | vinfos[5].indices[1] = _ij5[1]; |
| 24282 | vinfos[5].maxsolutions = _nj5; |
| 24283 | std::vector<int> vfree(0); |
| 24284 | solutions.AddSolution(vinfos,vfree); |
| 24285 | } |
| 24286 | } |
| 24287 | |
| 24288 | } |
| 24289 | |
| 24290 | } |
| 24291 | |
| 24292 | } |
| 24293 | } while(0); |
| 24294 | if( bgotonextstatement ) |
| 24295 | { |
| 24296 | bool bgotonextstatement = true; |
| 24297 | do |
| 24298 | { |
| 24299 | evalcond[0]=((-3.14159265358979)+(IKfmod(((3.14159265358979)+(IKabs(((-3.14159265358979)+j4)))), 6.28318530717959))); |
| 24300 | evalcond[1]=new_r00; |
| 24301 | evalcond[2]=new_r10; |
| 24302 | evalcond[3]=new_r01; |
| 24303 | evalcond[4]=new_r11; |
| 24304 | if( 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 ) |
| 24305 | { |
| 24306 | bgotonextstatement=false; |
| 24307 | { |
| 24308 | IkReal j5eval[1]; |
| 24309 | new_r02=0; |
| 24310 | new_r12=0; |
| 24311 | new_r20=0; |
| 24312 | new_r21=0; |
| 24313 | sj4=0; |
| 24314 | cj4=-1.0; |
| 24315 | j4=3.14159265358979; |
| 24316 | j5eval[0]=1.0; |
| 24317 | if( IKabs(j5eval[0]) < 0.0000000100000000 ) |
| 24318 | { |
| 24319 | continue; // no branches [j5] |
| 24320 | |
| 24321 | } else |
| 24322 | { |
| 24323 | IkReal op[2+1], zeror[2]; |
| 24324 | int numroots; |
| 24325 | op[0]=-1.0; |
| 24326 | op[1]=0; |
| 24327 | op[2]=1.0; |
| 24328 | polyroots2(op,zeror,numroots); |
| 24329 | IkReal j5array[2], cj5array[2], sj5array[2], tempj5array[1]; |
| 24330 | int numsolutions = 0; |
| 24331 | for(int ij5 = 0; ij5 < numroots; ++ij5) |
| 24332 | { |
| 24333 | IkReal htj5 = zeror[ij5]; |
| 24334 | tempj5array[0]=((2.0)*(atan(htj5))); |
| 24335 | for(int kj5 = 0; kj5 < 1; ++kj5) |
| 24336 | { |
| 24337 | j5array[numsolutions] = tempj5array[kj5]; |
| 24338 | if( j5array[numsolutions] > IKPI ) |
| 24339 | { |
| 24340 | j5array[numsolutions]-=IK2PI; |
| 24341 | } |
| 24342 | else if( j5array[numsolutions] < -IKPI ) |
| 24343 | { |
| 24344 | j5array[numsolutions]+=IK2PI; |
| 24345 | } |
| 24346 | sj5array[numsolutions] = IKsin(j5array[numsolutions]); |
| 24347 | cj5array[numsolutions] = IKcos(j5array[numsolutions]); |
| 24348 | numsolutions++; |
| 24349 | } |
| 24350 | } |
| 24351 | bool j5valid[2]={true,true}; |
| 24352 | _nj5 = 2; |
| 24353 | for(int ij5 = 0; ij5 < numsolutions; ++ij5) |
| 24354 | { |
| 24355 | if( !j5valid[ij5] ) |
| 24356 | { |
| 24357 | continue; |
| 24358 | } |
| 24359 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 24360 | htj5 = IKtan(j5/2); |
| 24361 | |
| 24362 | _ij5[0] = ij5; _ij5[1] = -1; |
| 24363 | for(int iij5 = ij5+1; iij5 < numsolutions; ++iij5) |
| 24364 | { |
| 24365 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 24366 | { |
| 24367 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 24368 | } |
| 24369 | } |
| 24370 | { |
| 24371 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 24372 | vinfos[0].jointtype = 1; |
| 24373 | vinfos[0].foffset = j0; |
| 24374 | vinfos[0].indices[0] = _ij0[0]; |
| 24375 | vinfos[0].indices[1] = _ij0[1]; |
| 24376 | vinfos[0].maxsolutions = _nj0; |
| 24377 | vinfos[1].jointtype = 1; |
| 24378 | vinfos[1].foffset = j1; |
| 24379 | vinfos[1].indices[0] = _ij1[0]; |
| 24380 | vinfos[1].indices[1] = _ij1[1]; |
| 24381 | vinfos[1].maxsolutions = _nj1; |
| 24382 | vinfos[2].jointtype = 1; |
| 24383 | vinfos[2].foffset = j2; |
| 24384 | vinfos[2].indices[0] = _ij2[0]; |
| 24385 | vinfos[2].indices[1] = _ij2[1]; |
| 24386 | vinfos[2].maxsolutions = _nj2; |
| 24387 | vinfos[3].jointtype = 1; |
| 24388 | vinfos[3].foffset = j3; |
| 24389 | vinfos[3].indices[0] = _ij3[0]; |
| 24390 | vinfos[3].indices[1] = _ij3[1]; |
| 24391 | vinfos[3].maxsolutions = _nj3; |
| 24392 | vinfos[4].jointtype = 1; |
| 24393 | vinfos[4].foffset = j4; |
| 24394 | vinfos[4].indices[0] = _ij4[0]; |
| 24395 | vinfos[4].indices[1] = _ij4[1]; |
| 24396 | vinfos[4].maxsolutions = _nj4; |
| 24397 | vinfos[5].jointtype = 1; |
| 24398 | vinfos[5].foffset = j5; |
| 24399 | vinfos[5].indices[0] = _ij5[0]; |
| 24400 | vinfos[5].indices[1] = _ij5[1]; |
| 24401 | vinfos[5].maxsolutions = _nj5; |
| 24402 | std::vector<int> vfree(0); |
| 24403 | solutions.AddSolution(vinfos,vfree); |
| 24404 | } |
| 24405 | } |
| 24406 | |
| 24407 | } |
| 24408 | |
| 24409 | } |
| 24410 | |
| 24411 | } |
| 24412 | } while(0); |
| 24413 | if( bgotonextstatement ) |
| 24414 | { |
| 24415 | bool bgotonextstatement = true; |
| 24416 | do |
| 24417 | { |
| 24418 | if( 1 ) |
| 24419 | { |
| 24420 | bgotonextstatement=false; |
| 24421 | continue; // branch miss [j5] |
| 24422 | |
| 24423 | } |
| 24424 | } while(0); |
| 24425 | if( bgotonextstatement ) |
| 24426 | { |
| 24427 | } |
| 24428 | } |
| 24429 | } |
| 24430 | } |
| 24431 | |
| 24432 | } else |
| 24433 | { |
| 24434 | { |
| 24435 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 24436 | bool j5valid[2]={false}; |
| 24437 | _nj5 = 2; |
| 24438 | CheckValue<IkReal> x2586 = IKatan2WithCheck(IkReal(((25000.00002)*new_r00*sj4)),IkReal(((-25000.00002)*new_r10*sj4)),IKFAST_ATAN2_MAGTHRESH); |
| 24439 | if(!x2586.valid){ |
| 24440 | continue; |
| 24441 | } |
| 24442 | IkReal x2585=x2586.value; |
| 24443 | j5array[0]=((-1.0)*x2585); |
| 24444 | sj5array[0]=IKsin(j5array[0]); |
| 24445 | cj5array[0]=IKcos(j5array[0]); |
| 24446 | j5array[1]=((3.14159265358979)+(((-1.0)*x2585))); |
| 24447 | sj5array[1]=IKsin(j5array[1]); |
| 24448 | cj5array[1]=IKcos(j5array[1]); |
| 24449 | if( j5array[0] > IKPI ) |
| 24450 | { |
| 24451 | j5array[0]-=IK2PI; |
| 24452 | } |
| 24453 | else if( j5array[0] < -IKPI ) |
| 24454 | { j5array[0]+=IK2PI; |
| 24455 | } |
| 24456 | j5valid[0] = true; |
| 24457 | if( j5array[1] > IKPI ) |
| 24458 | { |
| 24459 | j5array[1]-=IK2PI; |
| 24460 | } |
| 24461 | else if( j5array[1] < -IKPI ) |
| 24462 | { j5array[1]+=IK2PI; |
| 24463 | } |
| 24464 | j5valid[1] = true; |
| 24465 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 24466 | { |
| 24467 | if( !j5valid[ij5] ) |
| 24468 | { |
| 24469 | continue; |
| 24470 | } |
| 24471 | _ij5[0] = ij5; _ij5[1] = -1; |
| 24472 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 24473 | { |
| 24474 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 24475 | { |
| 24476 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 24477 | } |
| 24478 | } |
| 24479 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 24480 | { |
| 24481 | IkReal evalcond[9]; |
| 24482 | IkReal x2587=IKcos(j5); |
| 24483 | IkReal x2588=IKsin(j5); |
| 24484 | IkReal x2589=((3.9999999968e-5)*cj4); |
| 24485 | IkReal x2590=((0.9999999992)*sj4); |
| 24486 | IkReal x2591=((25000.00002)*sj4); |
| 24487 | IkReal x2592=(new_r01*x2587); |
| 24488 | IkReal x2593=(new_r11*x2588); |
| 24489 | IkReal x2594=(new_r00*x2587); |
| 24490 | IkReal x2595=(new_r10*x2588); |
| 24491 | evalcond[0]=(((new_r00*x2588))+((new_r10*x2587))); |
| 24492 | evalcond[1]=(((new_r11*x2587))+((new_r01*x2588))); |
| 24493 | evalcond[2]=(x2594+(((-1.0)*x2595))); |
| 24494 | evalcond[3]=(x2592+(((-1.0)*x2593))); |
| 24495 | evalcond[4]=((((-1.0)*x2587*x2589))+((x2587*x2590))); |
| 24496 | evalcond[5]=((((-1.0)*x2588*x2590))+((x2588*x2589))); |
| 24497 | evalcond[6]=(((x2591*x2592))+(((-1.0)*x2591*x2593))); |
| 24498 | evalcond[7]=((((-1.0)*x2590*x2594))+(((-1.0)*x2589*x2595))+((x2589*x2594))+((x2590*x2595))); |
| 24499 | evalcond[8]=((((-1.0)*x2590*x2592))+(((-1.0)*x2589*x2593))+((x2589*x2592))+((x2590*x2593))); |
| 24500 | if( 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 ) |
| 24501 | { |
| 24502 | continue; |
| 24503 | } |
| 24504 | } |
| 24505 | |
| 24506 | { |
| 24507 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 24508 | vinfos[0].jointtype = 1; |
| 24509 | vinfos[0].foffset = j0; |
| 24510 | vinfos[0].indices[0] = _ij0[0]; |
| 24511 | vinfos[0].indices[1] = _ij0[1]; |
| 24512 | vinfos[0].maxsolutions = _nj0; |
| 24513 | vinfos[1].jointtype = 1; |
| 24514 | vinfos[1].foffset = j1; |
| 24515 | vinfos[1].indices[0] = _ij1[0]; |
| 24516 | vinfos[1].indices[1] = _ij1[1]; |
| 24517 | vinfos[1].maxsolutions = _nj1; |
| 24518 | vinfos[2].jointtype = 1; |
| 24519 | vinfos[2].foffset = j2; |
| 24520 | vinfos[2].indices[0] = _ij2[0]; |
| 24521 | vinfos[2].indices[1] = _ij2[1]; |
| 24522 | vinfos[2].maxsolutions = _nj2; |
| 24523 | vinfos[3].jointtype = 1; |
| 24524 | vinfos[3].foffset = j3; |
| 24525 | vinfos[3].indices[0] = _ij3[0]; |
| 24526 | vinfos[3].indices[1] = _ij3[1]; |
| 24527 | vinfos[3].maxsolutions = _nj3; |
| 24528 | vinfos[4].jointtype = 1; |
| 24529 | vinfos[4].foffset = j4; |
| 24530 | vinfos[4].indices[0] = _ij4[0]; |
| 24531 | vinfos[4].indices[1] = _ij4[1]; |
| 24532 | vinfos[4].maxsolutions = _nj4; |
| 24533 | vinfos[5].jointtype = 1; |
| 24534 | vinfos[5].foffset = j5; |
| 24535 | vinfos[5].indices[0] = _ij5[0]; |
| 24536 | vinfos[5].indices[1] = _ij5[1]; |
| 24537 | vinfos[5].maxsolutions = _nj5; |
| 24538 | std::vector<int> vfree(0); |
| 24539 | solutions.AddSolution(vinfos,vfree); |
| 24540 | } |
| 24541 | } |
| 24542 | } |
| 24543 | |
| 24544 | } |
| 24545 | |
| 24546 | } |
| 24547 | |
| 24548 | } else |
| 24549 | { |
| 24550 | { |
| 24551 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 24552 | bool j5valid[2]={false}; |
| 24553 | _nj5 = 2; |
| 24554 | CheckValue<IkReal> x2597 = IKatan2WithCheck(IkReal(new_r11),IkReal(new_r01),IKFAST_ATAN2_MAGTHRESH); |
| 24555 | if(!x2597.valid){ |
| 24556 | continue; |
| 24557 | } |
| 24558 | IkReal x2596=x2597.value; |
| 24559 | j5array[0]=((-1.0)*x2596); |
| 24560 | sj5array[0]=IKsin(j5array[0]); |
| 24561 | cj5array[0]=IKcos(j5array[0]); |
| 24562 | j5array[1]=((3.14159265358979)+(((-1.0)*x2596))); |
| 24563 | sj5array[1]=IKsin(j5array[1]); |
| 24564 | cj5array[1]=IKcos(j5array[1]); |
| 24565 | if( j5array[0] > IKPI ) |
| 24566 | { |
| 24567 | j5array[0]-=IK2PI; |
| 24568 | } |
| 24569 | else if( j5array[0] < -IKPI ) |
| 24570 | { j5array[0]+=IK2PI; |
| 24571 | } |
| 24572 | j5valid[0] = true; |
| 24573 | if( j5array[1] > IKPI ) |
| 24574 | { |
| 24575 | j5array[1]-=IK2PI; |
| 24576 | } |
| 24577 | else if( j5array[1] < -IKPI ) |
| 24578 | { j5array[1]+=IK2PI; |
| 24579 | } |
| 24580 | j5valid[1] = true; |
| 24581 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 24582 | { |
| 24583 | if( !j5valid[ij5] ) |
| 24584 | { |
| 24585 | continue; |
| 24586 | } |
| 24587 | _ij5[0] = ij5; _ij5[1] = -1; |
| 24588 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 24589 | { |
| 24590 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 24591 | { |
| 24592 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 24593 | } |
| 24594 | } |
| 24595 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 24596 | { |
| 24597 | IkReal evalcond[9]; |
| 24598 | IkReal x2598=IKcos(j5); |
| 24599 | IkReal x2599=IKsin(j5); |
| 24600 | IkReal x2600=((3.9999999968e-5)*cj4); |
| 24601 | IkReal x2601=((25000.00002)*sj4); |
| 24602 | IkReal x2602=((0.9999999992)*sj4); |
| 24603 | IkReal x2603=(new_r01*x2598); |
| 24604 | IkReal x2604=(new_r11*x2599); |
| 24605 | IkReal x2605=(sj4*x2598); |
| 24606 | IkReal x2606=(new_r00*x2598); |
| 24607 | IkReal x2607=(new_r10*x2599); |
| 24608 | evalcond[0]=(((new_r10*x2598))+((new_r00*x2599))); |
| 24609 | evalcond[1]=((((-1.0)*x2607))+x2606); |
| 24610 | evalcond[2]=((((-1.0)*x2604))+x2603); |
| 24611 | evalcond[3]=(((x2598*x2602))+(((-1.0)*x2598*x2600))); |
| 24612 | evalcond[4]=(((x2599*x2600))+(((-1.0)*x2599*x2602))); |
| 24613 | evalcond[5]=((((-1.0)*x2601*x2607))+((x2601*x2606))); |
| 24614 | evalcond[6]=((((-1.0)*x2601*x2604))+((x2601*x2603))); |
| 24615 | evalcond[7]=(((x2602*x2607))+(((-1.0)*x2600*x2607))+((x2600*x2606))+(((-1.0)*x2602*x2606))); |
| 24616 | evalcond[8]=(((x2602*x2604))+(((-1.0)*x2600*x2604))+((x2600*x2603))+(((-1.0)*x2602*x2603))); |
| 24617 | if( 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 ) |
| 24618 | { |
| 24619 | continue; |
| 24620 | } |
| 24621 | } |
| 24622 | |
| 24623 | { |
| 24624 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 24625 | vinfos[0].jointtype = 1; |
| 24626 | vinfos[0].foffset = j0; |
| 24627 | vinfos[0].indices[0] = _ij0[0]; |
| 24628 | vinfos[0].indices[1] = _ij0[1]; |
| 24629 | vinfos[0].maxsolutions = _nj0; |
| 24630 | vinfos[1].jointtype = 1; |
| 24631 | vinfos[1].foffset = j1; |
| 24632 | vinfos[1].indices[0] = _ij1[0]; |
| 24633 | vinfos[1].indices[1] = _ij1[1]; |
| 24634 | vinfos[1].maxsolutions = _nj1; |
| 24635 | vinfos[2].jointtype = 1; |
| 24636 | vinfos[2].foffset = j2; |
| 24637 | vinfos[2].indices[0] = _ij2[0]; |
| 24638 | vinfos[2].indices[1] = _ij2[1]; |
| 24639 | vinfos[2].maxsolutions = _nj2; |
| 24640 | vinfos[3].jointtype = 1; |
| 24641 | vinfos[3].foffset = j3; |
| 24642 | vinfos[3].indices[0] = _ij3[0]; |
| 24643 | vinfos[3].indices[1] = _ij3[1]; |
| 24644 | vinfos[3].maxsolutions = _nj3; |
| 24645 | vinfos[4].jointtype = 1; |
| 24646 | vinfos[4].foffset = j4; |
| 24647 | vinfos[4].indices[0] = _ij4[0]; |
| 24648 | vinfos[4].indices[1] = _ij4[1]; |
| 24649 | vinfos[4].maxsolutions = _nj4; |
| 24650 | vinfos[5].jointtype = 1; |
| 24651 | vinfos[5].foffset = j5; |
| 24652 | vinfos[5].indices[0] = _ij5[0]; |
| 24653 | vinfos[5].indices[1] = _ij5[1]; |
| 24654 | vinfos[5].maxsolutions = _nj5; |
| 24655 | std::vector<int> vfree(0); |
| 24656 | solutions.AddSolution(vinfos,vfree); |
| 24657 | } |
| 24658 | } |
| 24659 | } |
| 24660 | |
| 24661 | } |
| 24662 | |
| 24663 | } |
| 24664 | |
| 24665 | } else |
| 24666 | { |
| 24667 | { |
| 24668 | IkReal j5array[2], cj5array[2], sj5array[2]; |
| 24669 | bool j5valid[2]={false}; |
| 24670 | _nj5 = 2; |
| 24671 | CheckValue<IkReal> x2609 = IKatan2WithCheck(IkReal(new_r10),IkReal(new_r00),IKFAST_ATAN2_MAGTHRESH); |
| 24672 | if(!x2609.valid){ |
| 24673 | continue; |
| 24674 | } |
| 24675 | IkReal x2608=x2609.value; |
| 24676 | j5array[0]=((-1.0)*x2608); |
| 24677 | sj5array[0]=IKsin(j5array[0]); |
| 24678 | cj5array[0]=IKcos(j5array[0]); |
| 24679 | j5array[1]=((3.14159265358979)+(((-1.0)*x2608))); |
| 24680 | sj5array[1]=IKsin(j5array[1]); |
| 24681 | cj5array[1]=IKcos(j5array[1]); |
| 24682 | if( j5array[0] > IKPI ) |
| 24683 | { |
| 24684 | j5array[0]-=IK2PI; |
| 24685 | } |
| 24686 | else if( j5array[0] < -IKPI ) |
| 24687 | { j5array[0]+=IK2PI; |
| 24688 | } |
| 24689 | j5valid[0] = true; |
| 24690 | if( j5array[1] > IKPI ) |
| 24691 | { |
| 24692 | j5array[1]-=IK2PI; |
| 24693 | } |
| 24694 | else if( j5array[1] < -IKPI ) |
| 24695 | { j5array[1]+=IK2PI; |
| 24696 | } |
| 24697 | j5valid[1] = true; |
| 24698 | for(int ij5 = 0; ij5 < 2; ++ij5) |
| 24699 | { |
| 24700 | if( !j5valid[ij5] ) |
| 24701 | { |
| 24702 | continue; |
| 24703 | } |
| 24704 | _ij5[0] = ij5; _ij5[1] = -1; |
| 24705 | for(int iij5 = ij5+1; iij5 < 2; ++iij5) |
| 24706 | { |
| 24707 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 24708 | { |
| 24709 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 24710 | } |
| 24711 | } |
| 24712 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 24713 | { |
| 24714 | IkReal evalcond[9]; |
| 24715 | IkReal x2610=IKcos(j5); |
| 24716 | IkReal x2611=IKsin(j5); |
| 24717 | IkReal x2612=((3.9999999968e-5)*cj4); |
| 24718 | IkReal x2613=((25000.00002)*sj4); |
| 24719 | IkReal x2614=((0.9999999992)*sj4); |
| 24720 | IkReal x2615=(new_r01*x2610); |
| 24721 | IkReal x2616=(new_r11*x2611); |
| 24722 | IkReal x2617=(sj4*x2610); |
| 24723 | IkReal x2618=(new_r00*x2610); |
| 24724 | IkReal x2619=(new_r10*x2611); |
| 24725 | evalcond[0]=(((new_r11*x2610))+((new_r01*x2611))); |
| 24726 | evalcond[1]=((((-1.0)*x2619))+x2618); |
| 24727 | evalcond[2]=((((-1.0)*x2616))+x2615); |
| 24728 | evalcond[3]=((((-1.0)*x2610*x2612))+((x2610*x2614))); |
| 24729 | evalcond[4]=((((-1.0)*x2611*x2614))+((x2611*x2612))); |
| 24730 | evalcond[5]=(((x2613*x2618))+(((-1.0)*x2613*x2619))); |
| 24731 | evalcond[6]=(((x2613*x2615))+(((-1.0)*x2613*x2616))); |
| 24732 | evalcond[7]=((((-1.0)*x2612*x2619))+((x2614*x2619))+((x2612*x2618))+(((-1.0)*x2614*x2618))); |
| 24733 | evalcond[8]=((((-1.0)*x2612*x2616))+((x2614*x2616))+((x2612*x2615))+(((-1.0)*x2614*x2615))); |
| 24734 | if( 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 ) |
| 24735 | { |
| 24736 | continue; |
| 24737 | } |
| 24738 | } |
| 24739 | |
| 24740 | { |
| 24741 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 24742 | vinfos[0].jointtype = 1; |
| 24743 | vinfos[0].foffset = j0; |
| 24744 | vinfos[0].indices[0] = _ij0[0]; |
| 24745 | vinfos[0].indices[1] = _ij0[1]; |
| 24746 | vinfos[0].maxsolutions = _nj0; |
| 24747 | vinfos[1].jointtype = 1; |
| 24748 | vinfos[1].foffset = j1; |
| 24749 | vinfos[1].indices[0] = _ij1[0]; |
| 24750 | vinfos[1].indices[1] = _ij1[1]; |
| 24751 | vinfos[1].maxsolutions = _nj1; |
| 24752 | vinfos[2].jointtype = 1; |
| 24753 | vinfos[2].foffset = j2; |
| 24754 | vinfos[2].indices[0] = _ij2[0]; |
| 24755 | vinfos[2].indices[1] = _ij2[1]; |
| 24756 | vinfos[2].maxsolutions = _nj2; |
| 24757 | vinfos[3].jointtype = 1; |
| 24758 | vinfos[3].foffset = j3; |
| 24759 | vinfos[3].indices[0] = _ij3[0]; |
| 24760 | vinfos[3].indices[1] = _ij3[1]; |
| 24761 | vinfos[3].maxsolutions = _nj3; |
| 24762 | vinfos[4].jointtype = 1; |
| 24763 | vinfos[4].foffset = j4; |
| 24764 | vinfos[4].indices[0] = _ij4[0]; |
| 24765 | vinfos[4].indices[1] = _ij4[1]; |
| 24766 | vinfos[4].maxsolutions = _nj4; |
| 24767 | vinfos[5].jointtype = 1; |
| 24768 | vinfos[5].foffset = j5; |
| 24769 | vinfos[5].indices[0] = _ij5[0]; |
| 24770 | vinfos[5].indices[1] = _ij5[1]; |
| 24771 | vinfos[5].maxsolutions = _nj5; |
| 24772 | std::vector<int> vfree(0); |
| 24773 | solutions.AddSolution(vinfos,vfree); |
| 24774 | } |
| 24775 | } |
| 24776 | } |
| 24777 | |
| 24778 | } |
| 24779 | |
| 24780 | } |
| 24781 | |
| 24782 | } |
| 24783 | } while(0); |
| 24784 | if( bgotonextstatement ) |
| 24785 | { |
| 24786 | bool bgotonextstatement = true; |
| 24787 | do |
| 24788 | { |
| 24789 | if( 1 ) |
| 24790 | { |
| 24791 | bgotonextstatement=false; |
| 24792 | continue; // branch miss [j5] |
| 24793 | |
| 24794 | } |
| 24795 | } while(0); |
| 24796 | if( bgotonextstatement ) |
| 24797 | { |
| 24798 | } |
| 24799 | } |
| 24800 | } |
| 24801 | } |
| 24802 | } |
| 24803 | } |
| 24804 | } |
| 24805 | } |
| 24806 | } |
| 24807 | } |
| 24808 | } |
| 24809 | } |
| 24810 | |
| 24811 | } else |
| 24812 | { |
| 24813 | { |
| 24814 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 24815 | bool j5valid[1]={false}; |
| 24816 | _nj5 = 1; |
| 24817 | CheckValue<IkReal> x2620 = IKatan2WithCheck(IkReal(new_r12),IkReal(((-1.0)*new_r02)),IKFAST_ATAN2_MAGTHRESH); |
| 24818 | if(!x2620.valid){ |
| 24819 | continue; |
| 24820 | } |
| 24821 | CheckValue<IkReal> x2621=IKPowWithIntegerCheck(IKsign(((((-3.9999999968e-5)*cj4))+(((0.9999999992)*sj4)))),-1); |
| 24822 | if(!x2621.valid){ |
| 24823 | continue; |
| 24824 | } |
| 24825 | j5array[0]=((-1.5707963267949)+(x2620.value)+(((1.5707963267949)*(x2621.value)))); |
| 24826 | sj5array[0]=IKsin(j5array[0]); |
| 24827 | cj5array[0]=IKcos(j5array[0]); |
| 24828 | if( j5array[0] > IKPI ) |
| 24829 | { |
| 24830 | j5array[0]-=IK2PI; |
| 24831 | } |
| 24832 | else if( j5array[0] < -IKPI ) |
| 24833 | { j5array[0]+=IK2PI; |
| 24834 | } |
| 24835 | j5valid[0] = true; |
| 24836 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 24837 | { |
| 24838 | if( !j5valid[ij5] ) |
| 24839 | { |
| 24840 | continue; |
| 24841 | } |
| 24842 | _ij5[0] = ij5; _ij5[1] = -1; |
| 24843 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 24844 | { |
| 24845 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 24846 | { |
| 24847 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 24848 | } |
| 24849 | } |
| 24850 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 24851 | { |
| 24852 | IkReal evalcond[18]; |
| 24853 | IkReal x2622=IKcos(j5); |
| 24854 | IkReal x2623=IKsin(j5); |
| 24855 | IkReal x2624=((1.0)*cj3); |
| 24856 | IkReal x2625=((0.9999999992)*cj4); |
| 24857 | IkReal x2626=((0.9999999992)*sj4); |
| 24858 | IkReal x2627=((3.9999999968e-5)*cj4); |
| 24859 | IkReal x2628=((3.9999999968e-5)*sj4); |
| 24860 | IkReal x2629=(new_r12*x2623); |
| 24861 | IkReal x2630=(new_r02*x2622); |
| 24862 | IkReal x2631=(new_r01*x2622); |
| 24863 | IkReal x2632=(new_r11*x2623); |
| 24864 | IkReal x2633=(sj3*x2623); |
| 24865 | IkReal x2634=(sj3*x2622); |
| 24866 | IkReal x2635=(new_r00*x2622); |
| 24867 | IkReal x2636=(cj3*x2622); |
| 24868 | IkReal x2637=(cj3*x2623); |
| 24869 | IkReal x2638=(new_r10*x2623); |
| 24870 | evalcond[0]=(((new_r12*x2622))+((new_r02*x2623))); |
| 24871 | evalcond[1]=(sj3+((new_r10*x2622))+((new_r00*x2623))); |
| 24872 | evalcond[2]=(((new_r11*x2622))+(((-1.0)*x2624))+((new_r01*x2623))); |
| 24873 | evalcond[3]=((((-1.0)*x2622*x2627))+((x2622*x2626))+new_r02); |
| 24874 | evalcond[4]=((((-1.0)*x2623*x2626))+((x2623*x2627))+new_r12); |
| 24875 | evalcond[5]=((((-1.0)*x2629))+(((-1.0)*x2627))+x2630+x2626); |
| 24876 | evalcond[6]=((((-1.0)*x2638))+(((-1.0)*cj3*x2628))+(((-1.0)*cj3*x2625))+x2635); |
| 24877 | evalcond[7]=((((-1.0)*sj3*x2628))+(((-1.0)*sj3*x2625))+(((-1.0)*x2632))+x2631); |
| 24878 | evalcond[8]=((((-1.0)*x2628*x2636))+new_r00+(((-1.0)*x2625*x2636))+x2633); |
| 24879 | evalcond[9]=(((x2625*x2637))+((x2628*x2637))+new_r10+x2634); |
| 24880 | evalcond[10]=((((-1.0)*x2623*x2624))+(((-1.0)*x2628*x2634))+new_r01+(((-1.0)*x2625*x2634))); |
| 24881 | evalcond[11]=((((-1.0)*x2622*x2624))+((x2625*x2633))+((x2628*x2633))+new_r11); |
| 24882 | evalcond[12]=(((new_r20*x2625))+((new_r20*x2628))+((x2627*x2635))+(((-1.0)*x2626*x2635))+((x2626*x2638))+(((-1.0)*x2627*x2638))); |
| 24883 | evalcond[13]=(((new_r21*x2625))+((new_r21*x2628))+((x2627*x2631))+(((-1.0)*x2626*x2631))+((x2626*x2632))+(((-1.0)*x2627*x2632))); |
| 24884 | evalcond[14]=((((-1.0)*x2625*x2629))+((x2625*x2630))+((new_r22*x2626))+(((-1.0)*new_r22*x2627))+((x2628*x2630))+(((-1.0)*x2628*x2629))); |
| 24885 | evalcond[15]=((-1.0)+((x2626*x2629))+(((-1.0)*x2627*x2629))+((new_r22*x2628))+((new_r22*x2625))+((x2627*x2630))+(((-1.0)*x2626*x2630))); |
| 24886 | evalcond[16]=(((new_r20*x2626))+(((-1.0)*x2628*x2638))+((x2625*x2635))+((x2628*x2635))+(((-1.0)*new_r20*x2627))+(((-1.0)*x2624))+(((-1.0)*x2625*x2638))); |
| 24887 | evalcond[17]=((((-1.0)*sj3))+((new_r21*x2626))+(((-1.0)*x2628*x2632))+((x2625*x2631))+((x2628*x2631))+(((-1.0)*new_r21*x2627))+(((-1.0)*x2625*x2632))); |
| 24888 | if( 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 ) |
| 24889 | { |
| 24890 | continue; |
| 24891 | } |
| 24892 | } |
| 24893 | |
| 24894 | { |
| 24895 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 24896 | vinfos[0].jointtype = 1; |
| 24897 | vinfos[0].foffset = j0; |
| 24898 | vinfos[0].indices[0] = _ij0[0]; |
| 24899 | vinfos[0].indices[1] = _ij0[1]; |
| 24900 | vinfos[0].maxsolutions = _nj0; |
| 24901 | vinfos[1].jointtype = 1; |
| 24902 | vinfos[1].foffset = j1; |
| 24903 | vinfos[1].indices[0] = _ij1[0]; |
| 24904 | vinfos[1].indices[1] = _ij1[1]; |
| 24905 | vinfos[1].maxsolutions = _nj1; |
| 24906 | vinfos[2].jointtype = 1; |
| 24907 | vinfos[2].foffset = j2; |
| 24908 | vinfos[2].indices[0] = _ij2[0]; |
| 24909 | vinfos[2].indices[1] = _ij2[1]; |
| 24910 | vinfos[2].maxsolutions = _nj2; |
| 24911 | vinfos[3].jointtype = 1; |
| 24912 | vinfos[3].foffset = j3; |
| 24913 | vinfos[3].indices[0] = _ij3[0]; |
| 24914 | vinfos[3].indices[1] = _ij3[1]; |
| 24915 | vinfos[3].maxsolutions = _nj3; |
| 24916 | vinfos[4].jointtype = 1; |
| 24917 | vinfos[4].foffset = j4; |
| 24918 | vinfos[4].indices[0] = _ij4[0]; |
| 24919 | vinfos[4].indices[1] = _ij4[1]; |
| 24920 | vinfos[4].maxsolutions = _nj4; |
| 24921 | vinfos[5].jointtype = 1; |
| 24922 | vinfos[5].foffset = j5; |
| 24923 | vinfos[5].indices[0] = _ij5[0]; |
| 24924 | vinfos[5].indices[1] = _ij5[1]; |
| 24925 | vinfos[5].maxsolutions = _nj5; |
| 24926 | std::vector<int> vfree(0); |
| 24927 | solutions.AddSolution(vinfos,vfree); |
| 24928 | } |
| 24929 | } |
| 24930 | } |
| 24931 | |
| 24932 | } |
| 24933 | |
| 24934 | } |
| 24935 | |
| 24936 | } else |
| 24937 | { |
| 24938 | { |
| 24939 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 24940 | bool j5valid[1]={false}; |
| 24941 | _nj5 = 1; |
| 24942 | CheckValue<IkReal> x2639=IKPowWithIntegerCheck(IKsign((((new_r01*new_r12))+(((-1.0)*new_r02*new_r11)))),-1); |
| 24943 | if(!x2639.valid){ |
| 24944 | continue; |
| 24945 | } |
| 24946 | CheckValue<IkReal> x2640 = IKatan2WithCheck(IkReal((cj3*new_r12)),IkReal(((-1.0)*cj3*new_r02)),IKFAST_ATAN2_MAGTHRESH); |
| 24947 | if(!x2640.valid){ |
| 24948 | continue; |
| 24949 | } |
| 24950 | j5array[0]=((-1.5707963267949)+(((1.5707963267949)*(x2639.value)))+(x2640.value)); |
| 24951 | sj5array[0]=IKsin(j5array[0]); |
| 24952 | cj5array[0]=IKcos(j5array[0]); |
| 24953 | if( j5array[0] > IKPI ) |
| 24954 | { |
| 24955 | j5array[0]-=IK2PI; |
| 24956 | } |
| 24957 | else if( j5array[0] < -IKPI ) |
| 24958 | { j5array[0]+=IK2PI; |
| 24959 | } |
| 24960 | j5valid[0] = true; |
| 24961 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 24962 | { |
| 24963 | if( !j5valid[ij5] ) |
| 24964 | { |
| 24965 | continue; |
| 24966 | } |
| 24967 | _ij5[0] = ij5; _ij5[1] = -1; |
| 24968 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 24969 | { |
| 24970 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 24971 | { |
| 24972 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 24973 | } |
| 24974 | } |
| 24975 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 24976 | { |
| 24977 | IkReal evalcond[18]; |
| 24978 | IkReal x2641=IKcos(j5); |
| 24979 | IkReal x2642=IKsin(j5); |
| 24980 | IkReal x2643=((1.0)*cj3); |
| 24981 | IkReal x2644=((0.9999999992)*cj4); |
| 24982 | IkReal x2645=((0.9999999992)*sj4); |
| 24983 | IkReal x2646=((3.9999999968e-5)*cj4); |
| 24984 | IkReal x2647=((3.9999999968e-5)*sj4); |
| 24985 | IkReal x2648=(new_r12*x2642); |
| 24986 | IkReal x2649=(new_r02*x2641); |
| 24987 | IkReal x2650=(new_r01*x2641); |
| 24988 | IkReal x2651=(new_r11*x2642); |
| 24989 | IkReal x2652=(sj3*x2642); |
| 24990 | IkReal x2653=(sj3*x2641); |
| 24991 | IkReal x2654=(new_r00*x2641); |
| 24992 | IkReal x2655=(cj3*x2641); |
| 24993 | IkReal x2656=(cj3*x2642); |
| 24994 | IkReal x2657=(new_r10*x2642); |
| 24995 | evalcond[0]=(((new_r02*x2642))+((new_r12*x2641))); |
| 24996 | evalcond[1]=(sj3+((new_r10*x2641))+((new_r00*x2642))); |
| 24997 | evalcond[2]=(((new_r11*x2641))+((new_r01*x2642))+(((-1.0)*x2643))); |
| 24998 | evalcond[3]=((((-1.0)*x2641*x2646))+new_r02+((x2641*x2645))); |
| 24999 | evalcond[4]=((((-1.0)*x2642*x2645))+new_r12+((x2642*x2646))); |
| 25000 | evalcond[5]=((((-1.0)*x2646))+(((-1.0)*x2648))+x2649+x2645); |
| 25001 | evalcond[6]=((((-1.0)*cj3*x2644))+(((-1.0)*cj3*x2647))+(((-1.0)*x2657))+x2654); |
| 25002 | evalcond[7]=((((-1.0)*sj3*x2647))+(((-1.0)*sj3*x2644))+(((-1.0)*x2651))+x2650); |
| 25003 | evalcond[8]=((((-1.0)*x2644*x2655))+(((-1.0)*x2647*x2655))+new_r00+x2652); |
| 25004 | evalcond[9]=(((x2644*x2656))+new_r10+((x2647*x2656))+x2653); |
| 25005 | evalcond[10]=((((-1.0)*x2644*x2653))+(((-1.0)*x2647*x2653))+(((-1.0)*x2642*x2643))+new_r01); |
| 25006 | evalcond[11]=(((x2644*x2652))+(((-1.0)*x2641*x2643))+new_r11+((x2647*x2652))); |
| 25007 | evalcond[12]=((((-1.0)*x2645*x2654))+(((-1.0)*x2646*x2657))+((new_r20*x2647))+((new_r20*x2644))+((x2645*x2657))+((x2646*x2654))); |
| 25008 | evalcond[13]=(((new_r21*x2644))+((new_r21*x2647))+(((-1.0)*x2645*x2650))+(((-1.0)*x2646*x2651))+((x2645*x2651))+((x2646*x2650))); |
| 25009 | evalcond[14]=((((-1.0)*x2644*x2648))+(((-1.0)*x2647*x2648))+(((-1.0)*new_r22*x2646))+((x2644*x2649))+((x2647*x2649))+((new_r22*x2645))); |
| 25010 | evalcond[15]=((-1.0)+(((-1.0)*x2646*x2648))+(((-1.0)*x2645*x2649))+((x2645*x2648))+((x2646*x2649))+((new_r22*x2647))+((new_r22*x2644))); |
| 25011 | evalcond[16]=((((-1.0)*x2644*x2657))+((new_r20*x2645))+(((-1.0)*x2647*x2657))+((x2644*x2654))+(((-1.0)*new_r20*x2646))+(((-1.0)*x2643))+((x2647*x2654))); |
| 25012 | evalcond[17]=((((-1.0)*sj3))+((new_r21*x2645))+(((-1.0)*x2644*x2651))+(((-1.0)*x2647*x2651))+(((-1.0)*new_r21*x2646))+((x2644*x2650))+((x2647*x2650))); |
| 25013 | if( 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 ) |
| 25014 | { |
| 25015 | continue; |
| 25016 | } |
| 25017 | } |
| 25018 | |
| 25019 | { |
| 25020 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 25021 | vinfos[0].jointtype = 1; |
| 25022 | vinfos[0].foffset = j0; |
| 25023 | vinfos[0].indices[0] = _ij0[0]; |
| 25024 | vinfos[0].indices[1] = _ij0[1]; |
| 25025 | vinfos[0].maxsolutions = _nj0; |
| 25026 | vinfos[1].jointtype = 1; |
| 25027 | vinfos[1].foffset = j1; |
| 25028 | vinfos[1].indices[0] = _ij1[0]; |
| 25029 | vinfos[1].indices[1] = _ij1[1]; |
| 25030 | vinfos[1].maxsolutions = _nj1; |
| 25031 | vinfos[2].jointtype = 1; |
| 25032 | vinfos[2].foffset = j2; |
| 25033 | vinfos[2].indices[0] = _ij2[0]; |
| 25034 | vinfos[2].indices[1] = _ij2[1]; |
| 25035 | vinfos[2].maxsolutions = _nj2; |
| 25036 | vinfos[3].jointtype = 1; |
| 25037 | vinfos[3].foffset = j3; |
| 25038 | vinfos[3].indices[0] = _ij3[0]; |
| 25039 | vinfos[3].indices[1] = _ij3[1]; |
| 25040 | vinfos[3].maxsolutions = _nj3; |
| 25041 | vinfos[4].jointtype = 1; |
| 25042 | vinfos[4].foffset = j4; |
| 25043 | vinfos[4].indices[0] = _ij4[0]; |
| 25044 | vinfos[4].indices[1] = _ij4[1]; |
| 25045 | vinfos[4].maxsolutions = _nj4; |
| 25046 | vinfos[5].jointtype = 1; |
| 25047 | vinfos[5].foffset = j5; |
| 25048 | vinfos[5].indices[0] = _ij5[0]; |
| 25049 | vinfos[5].indices[1] = _ij5[1]; |
| 25050 | vinfos[5].maxsolutions = _nj5; |
| 25051 | std::vector<int> vfree(0); |
| 25052 | solutions.AddSolution(vinfos,vfree); |
| 25053 | } |
| 25054 | } |
| 25055 | } |
| 25056 | |
| 25057 | } |
| 25058 | |
| 25059 | } |
| 25060 | |
| 25061 | } else |
| 25062 | { |
| 25063 | { |
| 25064 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 25065 | bool j5valid[1]={false}; |
| 25066 | _nj5 = 1; |
| 25067 | CheckValue<IkReal> x2658 = IKatan2WithCheck(IkReal((new_r12*sj3)),IkReal(((-1.0)*new_r02*sj3)),IKFAST_ATAN2_MAGTHRESH); |
| 25068 | if(!x2658.valid){ |
| 25069 | continue; |
| 25070 | } |
| 25071 | CheckValue<IkReal> x2659=IKPowWithIntegerCheck(IKsign(((((-1.0)*new_r00*new_r12))+((new_r02*new_r10)))),-1); |
| 25072 | if(!x2659.valid){ |
| 25073 | continue; |
| 25074 | } |
| 25075 | j5array[0]=((-1.5707963267949)+(x2658.value)+(((1.5707963267949)*(x2659.value)))); |
| 25076 | sj5array[0]=IKsin(j5array[0]); |
| 25077 | cj5array[0]=IKcos(j5array[0]); |
| 25078 | if( j5array[0] > IKPI ) |
| 25079 | { |
| 25080 | j5array[0]-=IK2PI; |
| 25081 | } |
| 25082 | else if( j5array[0] < -IKPI ) |
| 25083 | { j5array[0]+=IK2PI; |
| 25084 | } |
| 25085 | j5valid[0] = true; |
| 25086 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 25087 | { |
| 25088 | if( !j5valid[ij5] ) |
| 25089 | { |
| 25090 | continue; |
| 25091 | } |
| 25092 | _ij5[0] = ij5; _ij5[1] = -1; |
| 25093 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 25094 | { |
| 25095 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 25096 | { |
| 25097 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 25098 | } |
| 25099 | } |
| 25100 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 25101 | { |
| 25102 | IkReal evalcond[18]; |
| 25103 | IkReal x2660=IKcos(j5); |
| 25104 | IkReal x2661=IKsin(j5); |
| 25105 | IkReal x2662=((1.0)*cj3); |
| 25106 | IkReal x2663=((0.9999999992)*cj4); |
| 25107 | IkReal x2664=((0.9999999992)*sj4); |
| 25108 | IkReal x2665=((3.9999999968e-5)*cj4); |
| 25109 | IkReal x2666=((3.9999999968e-5)*sj4); |
| 25110 | IkReal x2667=(new_r12*x2661); |
| 25111 | IkReal x2668=(new_r02*x2660); |
| 25112 | IkReal x2669=(new_r01*x2660); |
| 25113 | IkReal x2670=(new_r11*x2661); |
| 25114 | IkReal x2671=(sj3*x2661); |
| 25115 | IkReal x2672=(sj3*x2660); |
| 25116 | IkReal x2673=(new_r00*x2660); |
| 25117 | IkReal x2674=(cj3*x2660); |
| 25118 | IkReal x2675=(cj3*x2661); |
| 25119 | IkReal x2676=(new_r10*x2661); |
| 25120 | evalcond[0]=(((new_r02*x2661))+((new_r12*x2660))); |
| 25121 | evalcond[1]=(sj3+((new_r10*x2660))+((new_r00*x2661))); |
| 25122 | evalcond[2]=((((-1.0)*x2662))+((new_r11*x2660))+((new_r01*x2661))); |
| 25123 | evalcond[3]=((((-1.0)*x2660*x2665))+((x2660*x2664))+new_r02); |
| 25124 | evalcond[4]=(((x2661*x2665))+new_r12+(((-1.0)*x2661*x2664))); |
| 25125 | evalcond[5]=((((-1.0)*x2667))+(((-1.0)*x2665))+x2664+x2668); |
| 25126 | evalcond[6]=((((-1.0)*x2676))+(((-1.0)*cj3*x2663))+(((-1.0)*cj3*x2666))+x2673); |
| 25127 | evalcond[7]=((((-1.0)*x2670))+(((-1.0)*sj3*x2663))+(((-1.0)*sj3*x2666))+x2669); |
| 25128 | evalcond[8]=((((-1.0)*x2663*x2674))+(((-1.0)*x2666*x2674))+new_r00+x2671); |
| 25129 | evalcond[9]=(((x2663*x2675))+((x2666*x2675))+new_r10+x2672); |
| 25130 | evalcond[10]=((((-1.0)*x2663*x2672))+(((-1.0)*x2666*x2672))+new_r01+(((-1.0)*x2661*x2662))); |
| 25131 | evalcond[11]=((((-1.0)*x2660*x2662))+((x2663*x2671))+((x2666*x2671))+new_r11); |
| 25132 | evalcond[12]=(((new_r20*x2666))+((new_r20*x2663))+((x2664*x2676))+(((-1.0)*x2664*x2673))+(((-1.0)*x2665*x2676))+((x2665*x2673))); |
| 25133 | evalcond[13]=(((x2664*x2670))+(((-1.0)*x2665*x2670))+(((-1.0)*x2664*x2669))+((x2665*x2669))+((new_r21*x2666))+((new_r21*x2663))); |
| 25134 | evalcond[14]=(((x2663*x2668))+(((-1.0)*new_r22*x2665))+((x2666*x2668))+(((-1.0)*x2663*x2667))+((new_r22*x2664))+(((-1.0)*x2666*x2667))); |
| 25135 | evalcond[15]=((-1.0)+((x2664*x2667))+(((-1.0)*x2664*x2668))+(((-1.0)*x2665*x2667))+((new_r22*x2663))+((new_r22*x2666))+((x2665*x2668))); |
| 25136 | evalcond[16]=(((x2663*x2673))+(((-1.0)*new_r20*x2665))+((new_r20*x2664))+((x2666*x2673))+(((-1.0)*x2663*x2676))+(((-1.0)*x2662))+(((-1.0)*x2666*x2676))); |
| 25137 | evalcond[17]=((((-1.0)*sj3))+((x2663*x2669))+((x2666*x2669))+(((-1.0)*new_r21*x2665))+(((-1.0)*x2663*x2670))+(((-1.0)*x2666*x2670))+((new_r21*x2664))); |
| 25138 | if( 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 ) |
| 25139 | { |
| 25140 | continue; |
| 25141 | } |
| 25142 | } |
| 25143 | |
| 25144 | { |
| 25145 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 25146 | vinfos[0].jointtype = 1; |
| 25147 | vinfos[0].foffset = j0; |
| 25148 | vinfos[0].indices[0] = _ij0[0]; |
| 25149 | vinfos[0].indices[1] = _ij0[1]; |
| 25150 | vinfos[0].maxsolutions = _nj0; |
| 25151 | vinfos[1].jointtype = 1; |
| 25152 | vinfos[1].foffset = j1; |
| 25153 | vinfos[1].indices[0] = _ij1[0]; |
| 25154 | vinfos[1].indices[1] = _ij1[1]; |
| 25155 | vinfos[1].maxsolutions = _nj1; |
| 25156 | vinfos[2].jointtype = 1; |
| 25157 | vinfos[2].foffset = j2; |
| 25158 | vinfos[2].indices[0] = _ij2[0]; |
| 25159 | vinfos[2].indices[1] = _ij2[1]; |
| 25160 | vinfos[2].maxsolutions = _nj2; |
| 25161 | vinfos[3].jointtype = 1; |
| 25162 | vinfos[3].foffset = j3; |
| 25163 | vinfos[3].indices[0] = _ij3[0]; |
| 25164 | vinfos[3].indices[1] = _ij3[1]; |
| 25165 | vinfos[3].maxsolutions = _nj3; |
| 25166 | vinfos[4].jointtype = 1; |
| 25167 | vinfos[4].foffset = j4; |
| 25168 | vinfos[4].indices[0] = _ij4[0]; |
| 25169 | vinfos[4].indices[1] = _ij4[1]; |
| 25170 | vinfos[4].maxsolutions = _nj4; |
| 25171 | vinfos[5].jointtype = 1; |
| 25172 | vinfos[5].foffset = j5; |
| 25173 | vinfos[5].indices[0] = _ij5[0]; |
| 25174 | vinfos[5].indices[1] = _ij5[1]; |
| 25175 | vinfos[5].maxsolutions = _nj5; |
| 25176 | std::vector<int> vfree(0); |
| 25177 | solutions.AddSolution(vinfos,vfree); |
| 25178 | } |
| 25179 | } |
| 25180 | } |
| 25181 | |
| 25182 | } |
| 25183 | |
| 25184 | } |
| 25185 | } |
| 25186 | } |
| 25187 | |
| 25188 | } |
| 25189 | |
| 25190 | } |
| 25191 | |
| 25192 | } else |
| 25193 | { |
| 25194 | { |
| 25195 | IkReal j5array[1], cj5array[1], sj5array[1]; |
| 25196 | bool j5valid[1]={false}; |
| 25197 | _nj5 = 1; |
| 25198 | CheckValue<IkReal> x2677 = IKatan2WithCheck(IkReal(new_r12),IkReal(((-1.0)*new_r02)),IKFAST_ATAN2_MAGTHRESH); |
| 25199 | if(!x2677.valid){ |
| 25200 | continue; |
| 25201 | } |
| 25202 | CheckValue<IkReal> x2678=IKPowWithIntegerCheck(IKsign(((((-3.9999999968e-5)*cj4))+(((0.9999999992)*sj4)))),-1); |
| 25203 | if(!x2678.valid){ |
| 25204 | continue; |
| 25205 | } |
| 25206 | j5array[0]=((-1.5707963267949)+(x2677.value)+(((1.5707963267949)*(x2678.value)))); |
| 25207 | sj5array[0]=IKsin(j5array[0]); |
| 25208 | cj5array[0]=IKcos(j5array[0]); |
| 25209 | if( j5array[0] > IKPI ) |
| 25210 | { |
| 25211 | j5array[0]-=IK2PI; |
| 25212 | } |
| 25213 | else if( j5array[0] < -IKPI ) |
| 25214 | { j5array[0]+=IK2PI; |
| 25215 | } |
| 25216 | j5valid[0] = true; |
| 25217 | for(int ij5 = 0; ij5 < 1; ++ij5) |
| 25218 | { |
| 25219 | if( !j5valid[ij5] ) |
| 25220 | { |
| 25221 | continue; |
| 25222 | } |
| 25223 | _ij5[0] = ij5; _ij5[1] = -1; |
| 25224 | for(int iij5 = ij5+1; iij5 < 1; ++iij5) |
| 25225 | { |
| 25226 | if( j5valid[iij5] && IKabs(cj5array[ij5]-cj5array[iij5]) < IKFAST_SOLUTION_THRESH && IKabs(sj5array[ij5]-sj5array[iij5]) < IKFAST_SOLUTION_THRESH ) |
| 25227 | { |
| 25228 | j5valid[iij5]=false; _ij5[1] = iij5; break; |
| 25229 | } |
| 25230 | } |
| 25231 | j5 = j5array[ij5]; cj5 = cj5array[ij5]; sj5 = sj5array[ij5]; |
| 25232 | { |
| 25233 | IkReal evalcond[8]; |
| 25234 | IkReal x2679=IKcos(j5); |
| 25235 | IkReal x2680=IKsin(j5); |
| 25236 | IkReal x2681=((0.9999999992)*cj4); |
| 25237 | IkReal x2682=((3.9999999968e-5)*cj4); |
| 25238 | IkReal x2683=((0.9999999992)*sj4); |
| 25239 | IkReal x2684=((3.9999999968e-5)*sj4); |
| 25240 | IkReal x2685=(new_r12*x2680); |
| 25241 | IkReal x2686=(new_r02*x2679); |
| 25242 | IkReal x2687=(new_r01*x2679); |
| 25243 | IkReal x2688=(new_r11*x2680); |
| 25244 | IkReal x2689=(new_r00*x2679); |
| 25245 | IkReal x2690=(new_r10*x2680); |
| 25246 | evalcond[0]=(((new_r12*x2679))+((new_r02*x2680))); |
| 25247 | evalcond[1]=((((-1.0)*x2679*x2682))+((x2679*x2683))+new_r02); |
| 25248 | evalcond[2]=((((-1.0)*x2680*x2683))+new_r12+((x2680*x2682))); |
| 25249 | evalcond[3]=((((-1.0)*x2682))+(((-1.0)*x2685))+x2686+x2683); |
| 25250 | evalcond[4]=((((-1.0)*x2683*x2689))+(((-1.0)*x2682*x2690))+((new_r20*x2681))+((new_r20*x2684))+((x2683*x2690))+((x2682*x2689))); |
| 25251 | evalcond[5]=((((-1.0)*x2683*x2687))+((x2683*x2688))+(((-1.0)*x2682*x2688))+((x2682*x2687))+((new_r21*x2684))+((new_r21*x2681))); |
| 25252 | evalcond[6]=(((new_r22*x2683))+(((-1.0)*x2684*x2685))+(((-1.0)*new_r22*x2682))+((x2684*x2686))+(((-1.0)*x2681*x2685))+((x2681*x2686))); |
| 25253 | evalcond[7]=((-1.0)+((new_r22*x2681))+((new_r22*x2684))+(((-1.0)*x2683*x2686))+((x2683*x2685))+(((-1.0)*x2682*x2685))+((x2682*x2686))); |
| 25254 | if( 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 ) |
| 25255 | { |
| 25256 | continue; |
| 25257 | } |
| 25258 | } |
| 25259 | |
| 25260 | { |
| 25261 | IkReal j3array[1], cj3array[1], sj3array[1]; |
| 25262 | bool j3valid[1]={false}; |
| 25263 | _nj3 = 1; |
| 25264 | if( IKabs(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10)))) < IKFAST_ATAN2_MAGTHRESH && IKabs((((cj5*new_r11))+((new_r01*sj5)))) < IKFAST_ATAN2_MAGTHRESH && IKabs(IKsqr(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))))+IKsqr((((cj5*new_r11))+((new_r01*sj5))))-1) <= IKFAST_SINCOS_THRESH ) |
| 25265 | continue; |
| 25266 | j3array[0]=IKatan2(((((-1.0)*new_r00*sj5))+(((-1.0)*cj5*new_r10))), (((cj5*new_r11))+((new_r01*sj5)))); |
| 25267 | sj3array[0]=IKsin(j3array[0]); |
| 25268 | cj3array[0]=IKcos(j3array[0]); |
| 25269 | if( j3array[0] > IKPI ) |
| 25270 | { |
| 25271 | j3array[0]-=IK2PI; |
| 25272 | } |
| 25273 | else if( j3array[0] < -IKPI ) |
| 25274 | { j3array[0]+=IK2PI; |
| 25275 | } |
| 25276 | j3valid[0] = true; |
| 25277 | for(int ij3 = 0; ij3 < 1; ++ij3) |
| 25278 | { |
| 25279 | if( !j3valid[ij3] ) |
| 25280 | { |
| 25281 | continue; |
| 25282 | } |
| 25283 | _ij3[0] = ij3; _ij3[1] = -1; |
| 25284 | for(int iij3 = ij3+1; iij3 < 1; ++iij3) |
| 25285 | { |
| 25286 | if( j3valid[iij3] && IKabs(cj3array[ij3]-cj3array[iij3]) < IKFAST_SOLUTION_THRESH && IKabs(sj3array[ij3]-sj3array[iij3]) < IKFAST_SOLUTION_THRESH ) |
| 25287 | { |
| 25288 | j3valid[iij3]=false; _ij3[1] = iij3; break; |
| 25289 | } |
| 25290 | } |
| 25291 | j3 = j3array[ij3]; cj3 = cj3array[ij3]; sj3 = sj3array[ij3]; |
| 25292 | { |
| 25293 | IkReal evalcond[12]; |
| 25294 | IkReal x2691=IKcos(j3); |
| 25295 | IkReal x2692=IKsin(j3); |
| 25296 | IkReal x2693=((0.9999999992)*cj4); |
| 25297 | IkReal x2694=((3.9999999968e-5)*cj4); |
| 25298 | IkReal x2695=(cj5*new_r01); |
| 25299 | IkReal x2696=((0.9999999992)*sj4); |
| 25300 | IkReal x2697=(cj5*new_r00); |
| 25301 | IkReal x2698=((3.9999999968e-5)*sj4); |
| 25302 | IkReal x2699=(new_r10*sj5); |
| 25303 | IkReal x2700=(new_r11*sj5); |
| 25304 | IkReal x2701=((1.0)*x2691); |
| 25305 | IkReal x2702=(cj5*x2692); |
| 25306 | IkReal x2703=(sj5*x2691); |
| 25307 | IkReal x2704=(sj5*x2692); |
| 25308 | IkReal x2705=(cj5*x2691); |
| 25309 | IkReal x2706=(x2691*x2698); |
| 25310 | evalcond[0]=(((cj5*new_r10))+((new_r00*sj5))+x2692); |
| 25311 | evalcond[1]=(((cj5*new_r11))+((new_r01*sj5))+(((-1.0)*x2701))); |
| 25312 | evalcond[2]=(((x2691*x2694))+(((-1.0)*x2691*x2696))+new_r20); |
| 25313 | evalcond[3]=((((-1.0)*x2692*x2696))+new_r21+((x2692*x2694))); |
| 25314 | evalcond[4]=((((-1.0)*x2691*x2693))+(((-1.0)*x2706))+(((-1.0)*x2699))+x2697); |
| 25315 | evalcond[5]=((((-1.0)*x2692*x2693))+(((-1.0)*x2692*x2698))+(((-1.0)*x2700))+x2695); |
| 25316 | evalcond[6]=(x2704+new_r00+(((-1.0)*x2693*x2705))+(((-1.0)*x2698*x2705))); |
| 25317 | evalcond[7]=(x2702+((x2693*x2703))+((x2698*x2703))+new_r10); |
| 25318 | evalcond[8]=((((-1.0)*sj5*x2701))+new_r01+(((-1.0)*x2693*x2702))+(((-1.0)*x2698*x2702))); |
| 25319 | evalcond[9]=((((-1.0)*cj5*x2701))+((x2693*x2704))+((x2698*x2704))+new_r11); |
| 25320 | evalcond[10]=(((x2697*x2698))+(((-1.0)*new_r20*x2694))+((x2693*x2697))+(((-1.0)*x2698*x2699))+(((-1.0)*x2701))+((new_r20*x2696))+(((-1.0)*x2693*x2699))); |
| 25321 | evalcond[11]=(((x2693*x2695))+((x2695*x2698))+(((-1.0)*x2692))+((new_r21*x2696))+(((-1.0)*new_r21*x2694))+(((-1.0)*x2693*x2700))+(((-1.0)*x2698*x2700))); |
| 25322 | if( 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 ) |
| 25323 | { |
| 25324 | continue; |
| 25325 | } |
| 25326 | } |
| 25327 | |
| 25328 | { |
| 25329 | std::vector<IkSingleDOFSolutionBase<IkReal> > vinfos(6); |
| 25330 | vinfos[0].jointtype = 1; |
| 25331 | vinfos[0].foffset = j0; |
| 25332 | vinfos[0].indices[0] = _ij0[0]; |
| 25333 | vinfos[0].indices[1] = _ij0[1]; |
| 25334 | vinfos[0].maxsolutions = _nj0; |
| 25335 | vinfos[1].jointtype = 1; |
| 25336 | vinfos[1].foffset = j1; |
| 25337 | vinfos[1].indices[0] = _ij1[0]; |
| 25338 | vinfos[1].indices[1] = _ij1[1]; |
| 25339 | vinfos[1].maxsolutions = _nj1; |
| 25340 | vinfos[2].jointtype = 1; |
| 25341 | vinfos[2].foffset = j2; |
| 25342 | vinfos[2].indices[0] = _ij2[0]; |
| 25343 | vinfos[2].indices[1] = _ij2[1]; |
| 25344 | vinfos[2].maxsolutions = _nj2; |
| 25345 | vinfos[3].jointtype = 1; |
| 25346 | vinfos[3].foffset = j3; |
| 25347 | vinfos[3].indices[0] = _ij3[0]; |
| 25348 | vinfos[3].indices[1] = _ij3[1]; |
| 25349 | vinfos[3].maxsolutions = _nj3; |
| 25350 | vinfos[4].jointtype = 1; |
| 25351 | vinfos[4].foffset = j4; |
| 25352 | vinfos[4].indices[0] = _ij4[0]; |
| 25353 | vinfos[4].indices[1] = _ij4[1]; |
| 25354 | vinfos[4].maxsolutions = _nj4; |
| 25355 | vinfos[5].jointtype = 1; |
| 25356 | vinfos[5].foffset = j5; |
| 25357 | vinfos[5].indices[0] = _ij5[0]; |
| 25358 | vinfos[5].indices[1] = _ij5[1]; |
| 25359 | vinfos[5].maxsolutions = _nj5; |
| 25360 | std::vector<int> vfree(0); |
| 25361 | solutions.AddSolution(vinfos,vfree); |
| 25362 | } |
| 25363 | } |
| 25364 | } |
| 25365 | } |
| 25366 | } |
| 25367 | |
| 25368 | } |
| 25369 | |
| 25370 | } |
| 25371 | } |
| 25372 | } |
| 25373 | } |
| 25374 | }static inline void polyroots3(IkReal rawcoeffs[3+1], IkReal rawroots[3], int& numroots) |
| 25375 | { |
| 25376 | using std::complex; |
| 25377 | if( rawcoeffs[0] == 0 ) { |
| 25378 | // solve with one reduced degree |
| 25379 | polyroots2(&rawcoeffs[1], &rawroots[0], numroots); |
| 25380 | return; |
| 25381 | } |
| 25382 | IKFAST_ASSERT(rawcoeffs[0] != 0); |
| 25383 | const IkReal tol = 128.0*std::numeric_limits<IkReal>::epsilon(); |
| 25384 | const IkReal tolsqrt = sqrt(std::numeric_limits<IkReal>::epsilon()); |
| 25385 | complex<IkReal> coeffs[3]; |
| 25386 | const int maxsteps = 110; |
| 25387 | for(int i = 0; i < 3; ++i) { |
| 25388 | coeffs[i] = complex<IkReal>(rawcoeffs[i+1]/rawcoeffs[0]); |
| 25389 | } |
| 25390 | complex<IkReal> roots[3]; |
| 25391 | IkReal err[3]; |
| 25392 | roots[0] = complex<IkReal>(1,0); |
| 25393 | roots[1] = complex<IkReal>(0.4,0.9); // any complex number not a root of unity works |
| 25394 | err[0] = 1.0; |
| 25395 | err[1] = 1.0; |
| 25396 | for(int i = 2; i < 3; ++i) { |
| 25397 | roots[i] = roots[i-1]*roots[1]; |
| 25398 | err[i] = 1.0; |
| 25399 | } |
| 25400 | for(int step = 0; step < maxsteps; ++step) { |
| 25401 | bool changed = false; |
| 25402 | for(int i = 0; i < 3; ++i) { |
| 25403 | if ( err[i] >= tol ) { |
| 25404 | changed = true; |
| 25405 | // evaluate |
| 25406 | complex<IkReal> x = roots[i] + coeffs[0]; |
| 25407 | for(int j = 1; j < 3; ++j) { |
| 25408 | x = roots[i] * x + coeffs[j]; |
| 25409 | } |
| 25410 | for(int j = 0; j < 3; ++j) { |
| 25411 | if( i != j ) { |
| 25412 | if( roots[i] != roots[j] ) { |
| 25413 | x /= (roots[i] - roots[j]); |
| 25414 | } |
| 25415 | } |
| 25416 | } |
| 25417 | roots[i] -= x; |
| 25418 | err[i] = abs(x); |
| 25419 | } |
| 25420 | } |
| 25421 | if( !changed ) { |
| 25422 | break; |
| 25423 | } |
| 25424 | } |
| 25425 | |
| 25426 | numroots = 0; |
| 25427 | bool visited[3] = {false}; |
| 25428 | for(int i = 0; i < 3; ++i) { |
| 25429 | if( !visited[i] ) { |
| 25430 | // might be a multiple root, in which case it will have more error than the other roots |
| 25431 | // find any neighboring roots, and take the average |
| 25432 | complex<IkReal> newroot=roots[i]; |
| 25433 | int n = 1; |
| 25434 | for(int j = i+1; j < 3; ++j) { |
| 25435 | // care about error in real much more than imaginary |
| 25436 | if( abs(real(roots[i])-real(roots[j])) < tolsqrt && abs(imag(roots[i])-imag(roots[j])) < 0.002 ) { |
| 25437 | newroot += roots[j]; |
| 25438 | n += 1; |
| 25439 | visited[j] = true; |
| 25440 | } |
| 25441 | } |
| 25442 | if( n > 1 ) { |
| 25443 | newroot /= n; |
| 25444 | } |
| 25445 | // 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 |
| 25446 | if( IKabs(imag(newroot)) < tolsqrt ) { |
| 25447 | rawroots[numroots++] = real(newroot); |
| 25448 | } |
| 25449 | } |
| 25450 | } |
| 25451 | } |
| 25452 | static inline void polyroots2(IkReal rawcoeffs[2+1], IkReal rawroots[2], int& numroots) { |
| 25453 | IkReal det = rawcoeffs[1]*rawcoeffs[1]-4*rawcoeffs[0]*rawcoeffs[2]; |
| 25454 | if( det < 0 ) { |
| 25455 | numroots=0; |
| 25456 | } |
| 25457 | else if( det == 0 ) { |
| 25458 | rawroots[0] = -0.5*rawcoeffs[1]/rawcoeffs[0]; |
| 25459 | numroots = 1; |
| 25460 | } |
| 25461 | else { |
| 25462 | det = IKsqrt(det); |
| 25463 | rawroots[0] = (-rawcoeffs[1]+det)/(2*rawcoeffs[0]); |
| 25464 | rawroots[1] = (-rawcoeffs[1]-det)/(2*rawcoeffs[0]);//rawcoeffs[2]/(rawcoeffs[0]*rawroots[0]); |
| 25465 | numroots = 2; |
| 25466 | } |
| 25467 | } |
| 25468 | static inline void polyroots4(IkReal rawcoeffs[4+1], IkReal rawroots[4], int& numroots) |
| 25469 | { |
| 25470 | using std::complex; |
| 25471 | if( rawcoeffs[0] == 0 ) { |
| 25472 | // solve with one reduced degree |
| 25473 | polyroots3(&rawcoeffs[1], &rawroots[0], numroots); |
| 25474 | return; |
| 25475 | } |
| 25476 | IKFAST_ASSERT(rawcoeffs[0] != 0); |
| 25477 | const IkReal tol = 128.0*std::numeric_limits<IkReal>::epsilon(); |
| 25478 | const IkReal tolsqrt = sqrt(std::numeric_limits<IkReal>::epsilon()); |
| 25479 | complex<IkReal> coeffs[4]; |
| 25480 | const int maxsteps = 110; |
| 25481 | for(int i = 0; i < 4; ++i) { |
| 25482 | coeffs[i] = complex<IkReal>(rawcoeffs[i+1]/rawcoeffs[0]); |
| 25483 | } |
| 25484 | complex<IkReal> roots[4]; |
| 25485 | IkReal err[4]; |
| 25486 | roots[0] = complex<IkReal>(1,0); |
| 25487 | roots[1] = complex<IkReal>(0.4,0.9); // any complex number not a root of unity works |
| 25488 | err[0] = 1.0; |
| 25489 | err[1] = 1.0; |
| 25490 | for(int i = 2; i < 4; ++i) { |
| 25491 | roots[i] = roots[i-1]*roots[1]; |
| 25492 | err[i] = 1.0; |
| 25493 | } |
| 25494 | for(int step = 0; step < maxsteps; ++step) { |
| 25495 | bool changed = false; |
| 25496 | for(int i = 0; i < 4; ++i) { |
| 25497 | if ( err[i] >= tol ) { |
| 25498 | changed = true; |
| 25499 | // evaluate |
| 25500 | complex<IkReal> x = roots[i] + coeffs[0]; |
| 25501 | for(int j = 1; j < 4; ++j) { |
| 25502 | x = roots[i] * x + coeffs[j]; |
| 25503 | } |
| 25504 | for(int j = 0; j < 4; ++j) { |
| 25505 | if( i != j ) { |
| 25506 | if( roots[i] != roots[j] ) { |
| 25507 | x /= (roots[i] - roots[j]); |
| 25508 | } |
| 25509 | } |
| 25510 | } |
| 25511 | roots[i] -= x; |
| 25512 | err[i] = abs(x); |
| 25513 | } |
| 25514 | } |
| 25515 | if( !changed ) { |
| 25516 | break; |
| 25517 | } |
| 25518 | } |
| 25519 | |
| 25520 | numroots = 0; |
| 25521 | bool visited[4] = {false}; |
| 25522 | for(int i = 0; i < 4; ++i) { |
| 25523 | if( !visited[i] ) { |
| 25524 | // might be a multiple root, in which case it will have more error than the other roots |
| 25525 | // find any neighboring roots, and take the average |
| 25526 | complex<IkReal> newroot=roots[i]; |
| 25527 | int n = 1; |
| 25528 | for(int j = i+1; j < 4; ++j) { |
| 25529 | // care about error in real much more than imaginary |
| 25530 | if( abs(real(roots[i])-real(roots[j])) < tolsqrt && abs(imag(roots[i])-imag(roots[j])) < 0.002 ) { |
| 25531 | newroot += roots[j]; |
| 25532 | n += 1; |
| 25533 | visited[j] = true; |
| 25534 | } |
| 25535 | } |
| 25536 | if( n > 1 ) { |
| 25537 | newroot /= n; |
| 25538 | } |
| 25539 | // 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 |
| 25540 | if( IKabs(imag(newroot)) < tolsqrt ) { |
| 25541 | rawroots[numroots++] = real(newroot); |
| 25542 | } |
| 25543 | } |
| 25544 | } |
| 25545 | } |
| 25546 | }; |
| 25547 | |
| 25548 | |
| 25549 | /// solves the inverse kinematics equations. |
| 25550 | /// \param pfree is an array specifying the free joints of the chain. |
| 25551 | IKFAST_API bool ComputeIk(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions) { |
| 25552 | IKSolver solver; |
| 25553 | return solver.ComputeIk(eetrans,eerot,pfree,solutions); |
| 25554 | } |
| 25555 | |
| 25556 | IKFAST_API bool ComputeIk2(const IkReal* eetrans, const IkReal* eerot, const IkReal* pfree, IkSolutionListBase<IkReal>& solutions, void* pOpenRAVEManip) { |
| 25557 | IKSolver solver; |
| 25558 | return solver.ComputeIk(eetrans,eerot,pfree,solutions); |
| 25559 | } |
| 25560 | |
| 25561 | IKFAST_API const char* GetKinematicsHash() { return "<robot:GenericRobot - irb4600 (cf95c00c17c4b2b3fc4659a63b598d9c)>"; } |
| 25562 | |
| 25563 | IKFAST_API const char* GetIkFastVersion() { return "0x1000004a"; } |
| 25564 | |
| 25565 | #ifdef IKFAST_NAMESPACE |
| 25566 | } // end namespace |
| 25567 | #endif |
| 25568 | |
| 25569 | #ifndef IKFAST_NO_MAIN |
| 25570 | #include <stdio.h> |
| 25571 | #include <stdlib.h> |
| 25572 | #ifdef IKFAST_NAMESPACE |
| 25573 | using namespace IKFAST_NAMESPACE; |
| 25574 | #endif |
| 25575 | int main(int argc, char** argv) |
| 25576 | { |
| 25577 | if( argc != 12+GetNumFreeParameters()+1 ) { |
| 25578 | printf("\nUsage: ./ik r00 r01 r02 t0 r10 r11 r12 t1 r20 r21 r22 t2 free0 ...\n\n" |
| 25579 | "Returns the ik solutions given the transformation of the end effector specified by\n" |
| 25580 | "a 3x3 rotation R (rXX), and a 3x1 translation (tX).\n" |
| 25581 | "There are %d free parameters that have to be specified.\n\n",GetNumFreeParameters()); |
| 25582 | return 1; |
| 25583 | } |
| 25584 | |
| 25585 | IkSolutionList<IkReal> solutions; |
| 25586 | std::vector<IkReal> vfree(GetNumFreeParameters()); |
| 25587 | IkReal eerot[9],eetrans[3]; |
| 25588 | eerot[0] = atof(argv[1]); eerot[1] = atof(argv[2]); eerot[2] = atof(argv[3]); eetrans[0] = atof(argv[4]); |
| 25589 | eerot[3] = atof(argv[5]); eerot[4] = atof(argv[6]); eerot[5] = atof(argv[7]); eetrans[1] = atof(argv[8]); |
| 25590 | eerot[6] = atof(argv[9]); eerot[7] = atof(argv[10]); eerot[8] = atof(argv[11]); eetrans[2] = atof(argv[12]); |
| 25591 | for(std::size_t i = 0; i < vfree.size(); ++i) |
| 25592 | vfree[i] = atof(argv[13+i]); |
| 25593 | bool bSuccess = ComputeIk(eetrans, eerot, vfree.size() > 0 ? &vfree[0] : NULL, solutions); |
| 25594 | |
| 25595 | if( !bSuccess ) { |
| 25596 | fprintf(stderr,"Failed to get ik solution\n"); |
| 25597 | return -1; |
| 25598 | } |
| 25599 | |
| 25600 | printf("Found %d ik solutions:\n", (int)solutions.GetNumSolutions()); |
| 25601 | std::vector<IkReal> solvalues(GetNumJoints()); |
| 25602 | for(std::size_t i = 0; i < solutions.GetNumSolutions(); ++i) { |
| 25603 | const IkSolutionBase<IkReal>& sol = solutions.GetSolution(i); |
| 25604 | printf("sol%d (free=%d): ", (int)i, (int)sol.GetFree().size()); |
| 25605 | std::vector<IkReal> vsolfree(sol.GetFree().size()); |
| 25606 | sol.GetSolution(&solvalues[0],vsolfree.size()>0?&vsolfree[0]:NULL); |
| 25607 | for( std::size_t j = 0; j < solvalues.size(); ++j) |
| 25608 | printf("%.15f, ", solvalues[j]); |
| 25609 | printf("\n"); |
| 25610 | } |
| 25611 | return 0; |
| 25612 | } |
| 25613 | |
| 25614 | #endif |