Jmeyer1292 / opw_kinematics

Closed form IK for parallel base, spherical wrist industrial manipulators
Apache License 2.0
69 stars 26 forks source link

How can I get the offset of "FanucR2000iB_200R"? #72

Closed msnh2012 closed 1 year ago

msnh2012 commented 1 year ago

https://github.com/Jmeyer1292/opw_kinematics/blob/0faf74269d1b8c3358f65356ea45feb2046a993e/include/opw_kinematics/opw_parameters_examples.h#L40

Levi-Armstrong commented 1 year ago

The parameters are usually derived from the product specification which shows the link dimensions. Usually the offset you have highlighted is +/- 90 degrees.

msnh2012 commented 1 year ago

I made a test with RoboDK. Robot " FanucR2000iB_210F" image

MDH Table image

Parameters

template <typename T>
Parameters<T> makeFanucR2000iB_210F()
{
    Parameters<T> p;
    p.a1 = T(0.312);
    p.a2 = T(-0.225);
    p.b = T(0.000);
    p.c1 = T(0.670);
    p.c2 = T(1.075);
    p.c3 = T(1.280);
    p.c4 = T(0.235);

    p.offsets[2] = static_cast<T>(-M_PI / 2.0);
    p.offsets[5] = static_cast<T>(-M_PI);
    p.sign_corrections[2] = -1;
    p.sign_corrections[3] = -1;
    p.sign_corrections[4] = -1;
    p.sign_corrections[5] = -1;
    return p;
}

And FK:

    const auto fanuc = opw_kinematics::makeFanucR2000iB_210F<double>();
    std::array<double, 6> joints{};
    joints[0] = deg2rad(10);
    joints[1] = deg2rad(10);
    joints[2] = deg2rad(10);
    joints[3] = deg2rad(10);
    joints[4] = deg2rad(10);
    joints[5] = deg2rad(10);
    auto pose = opw_kinematics::forward(fanuc, joints);
    std::cout << pose.matrix() << std::endl;

The result (opw with z-offset 0.67m):

[ ================ OK =============== ] Joint: [0 0 0 0 0 0] deg. opw:

 4.70103e-10  4.41995e-19            1        1.827
 9.40207e-10           -1            0            0
           1  9.40207e-10 -4.70103e-10         1.97
           0            0            0            1

RoboDK

[     0.000000,     0.000000,     1.000000,  1827.000000 ;
     -0.000000,    -1.000000,     0.000000,     0.000000 ;
      1.000000,    -0.000000,    -0.000000,  1300.000000 ;
      0.000000,     0.000000,     0.000000,     1.000000 ];

[ ================ NOT OK =============== ] Joint: [10 10 10 10 10 10] deg. opw:

-0.227352   0.13356   0.96461   1.97833
  0.30457 -0.931104  0.200706  0.356029
 0.924958  0.339422   0.17101   1.99386
        0         0         0         1

RoboDK

[    -0.382971,     0.075966,     0.920632,  1910.370280 ;
      0.277130,    -0.941259,     0.192951,   344.045255 ;
      0.881211,     0.329029,     0.339422,  1582.283944 ;
      0.000000,     0.000000,     0.000000,     1.000000 ];

Is anything wrong with my code?

msnh2012 commented 1 year ago

I also tested the "ABB IRB 2400 10". Same with "FanucR2000iB_210F".

They both are "2-3" coupled.

Levi-Armstrong commented 1 year ago

The opw kinematics deals in absolute joint values.

msnh2012 commented 1 year ago

I got it, Thanks!