2011. gada 19. aprīlis 22:10 Viesturs Lācis <[email protected]> rakstīja:
> 2011/4/19 andy pugh <[email protected]>:
>> On 19 April 2011 08:12, Viesturs Lācis <[email protected]> wrote:
>>>>>    b) I have set scale parameter for joint 0 and it is ok in joint
>>>>> mode, but not ok in world mode. Basically, there is huge difference in
>>>>> movement amount between joint and world modes, when movement happens
>>>>> in joint 0. It makes me feel that there is something wrong in the
>>>>> kinematics module.
>>>>>
>>>> There is a spurious conversion from linear mm to radians. You need to
>>>> move the joint 360mm to move Y or Z by pi mm.
>>>> line 444 in genserkins looks like one likely culprit.
>>>
>>> Line 521 converts them back to degrees.
>>
>> But the linear axes should never be converted, nor be converted back.
>
> Yes, I agree, it should not do that.


I have an update on this matter:
As I reported on the other thread, 500 mm in joint mode corresponds to
the same travel distance as ~8,5 mm in teleop mode. I thought that it
is some inconsistent deviance with no reasonable explanation.

Today I somehow imagined to open calculator and convert 500 degrees
into radians.
Now try to guess, what is the answer?
No, it is not 8,5...

..it is 8,72. So I tried to find all the places, which convert degrees
to radians and vice versa.

I am suspicious about this place in the beginning of forward kinematics:

/* main function called by emc2 for forward Kins */
int kinematicsForward(const double *joint,
                      EmcPose * world,
                      const KINEMATICS_FORWARD_FLAGS * fflags,
                      KINEMATICS_INVERSE_FLAGS * iflags) {

    go_pose *pos;
    go_rpy rpy;
    go_real jcopy[GENSER_MAX_JOINTS]; // will hold the radian
conversion of joints
    int ret = 0;
    int i, changed=0;

    for (i=0; i< 6; i++)  {
        // FIXME - debug hack
        if (!GO_ROT_CLOSE(j[i],joint[i])) changed = 1;
        // convert to radians to pass to genser_kin_fwd
        jcopy[i] = joint[i] * PM_PI / 180;
    }


I mean the last 6 lines.
I would like to change it, but I do not know, how to do it correctly.
I see 2 ways:

1) I suspect that go_rot_small or go_tran_small determines, if linear
or angular joints are meant, so:

    for (i=0; i< 6; i++)  {
        // FIXME - debug hack
        if (!GO_TRAN_CLOSE(j[i],joint[i])) changed = 1;
        // do not convert linear joints
        jcopy[i] = joint[i];
        else if (!GO_ROT_CLOSE(j[i],joint[i])) changed = 1;
        // convert to radians to pass to genser_kin_fwd
        jcopy[i] = joint[i] * PM_PI / 180;
    }

I have a feeling that I am missing these symbols somewhere { }

2) add the good old TYPE == 0 condition

 for (i=0; i< 6; i++)  {
        if(TYPE(t) == 0) {
        // FIXME - debug hack
        if (!GO_ROT_CLOSE(j[i],joint[i])) changed = 1;
        jcopy[i] = joint[i];
        } else {
        if (!GO_ROT_CLOSE(j[i],joint[i])) changed = 1;
        // convert to radians to pass to genser_kin_fwd
        jcopy[i] = joint[i] * PM_PI / 180;
        }
    }

But I feel that go_rot_small should be changed to go_tran_small for
linear joints anyway.
Is that correct?

Thanks in advance for any suggestions or comments!

Viesturs

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to