<snip>

> Since my impression is that the TYPE(t) value cannot be set to
> GO_QUANTITY_LENGTH or GO_QUANTITY_ANGLE, but rather it will be either
> 1 or 0, determining, if joint is angular or linear, I would like to
> ask, if anyone could comment, which of the following examples of code
> is correct to set value of genser->links[t].quantity to be
> GO_QUANTITY_LENGTH or GO_QUANTITY_ANGLE, depending on TYPE(t) value (I
> am not sure, if the syntax is correct. Please, someone with knowledge
> in programming, step in and point me into direction of correct code,
> if I have made some mistakes.):

I would write it like this:

for (t = 0; t < GENSER_MAX_JOINTS; t++) {
    genser->links[t].u.dh.a = A(t);
    genser->links[t].u.dh.alpha = ALPHA(t);
    genser->links[t].type = GO_LINK_DH;
    if (TYPE(t) == 0) {
        genser->links[t].u.dh.d = 0;
        genser->links[t].u.dh.theta = THETA(t);
        genser->links[t].quantity = GO_QUANTITY_LENGTH;
    } else {
        genser->links[t].u.dh.d = D(t);
        genser->links[t].u.dh.theta = 0;
        genser->links[t].quantity = GO_QUANTITY_ANGLE;
    }
}

> This is the reason, why in the previous examples of the code I removed
> the lines, related to a, alpha and theta values.

a and alpha are still used (for any case). They define the rotation and 
translation between the previous and current joint.
Imagine you want to construct a genserkins for a regular XYZ machine.

> Or should I leave them and assign some value to theta, or even create
> HAL pins to add also theta value for linear joints and add default
> theta value in genserkins.h file?

Yes, that is the right way.

Btw, all this talk should be moved to the emc-developers list...

Regards,
Alex


------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to