petercorke / robotics-toolbox-matlab

Robotics Toolbox for MATLAB
GNU Lesser General Public License v2.1
1.26k stars 440 forks source link

Forward kinematics symbolic (fkine) computes different notation when compared to actual research paper #134

Open anshul-hri opened 5 months ago

anshul-hri commented 5 months ago

Hi,

I was working on creating a 4DOF anthromorphic exoskeleton model using the DH Link. I have attached the arm model below. I face discrepancy between what robotic tool box symbolically computes the forward kinematics for end effector using fkine to that of the analytic equations as provided by the paper Link . Below the code, I have compared both the symbolic expressions for forward kinematics as computed by (a) robotics tool box fkine method (b) analytical from paper

       # Dynamic Parameters:
        mass = [1.38, 0.88]
        I = [0.015, 0.013]
        length = [0.33, 0.37]

        L = [
            RevoluteDH(
                d = 0,
                a = 0,
                alpha = pi/2,
                offset = pi/2,
                flip = True,
            ),

            RevoluteDH(
                d = length[0],
                a = 0,
                alpha = pi/2,
                offset = pi,
            ),

            RevoluteDH(
                d = 0,
                a = 0,
                alpha = -pi/2,
            ),

            RevoluteDH(
                d = length[1],
                a = 0,
                alpha = 0,

            ),

        ]

        super().__init__(
            L,
            name="human_arm_4DOF",
            manufacturer="",
            keywords=("dynamics", "symbolic", "mesh"),
            symbolic=symbolic,
            meshdir="",
        )

Robotics tool box fkine:

 1st rotation term : T[0] = (sin(q_0)*cos(q_1)*cos(q_2) + sin(q_2)*cos(q_0))*cos(q_3) - sin(q_0)*sin(q_1)*sin(q_3)

Analytical paper equation:

cos(q3) * (sin(q0) * sin(q2) + cos(q0) * cos(q1) * cos(q2)) − cos(q0) * sin(q1) * sin(q3)  

can anyone help me with this query, Do I need to modify the D-H table from what the paper presents when I use that in roboticstoolbox, because I have faced similar issues with other models as well ?

Regards Anshul