Institut de Robòtica i Informàtica Industrial
KRD Group

The CuikSuite Project

varnames.h File Reference

Definition of variable names. More...

#include <stdio.h>

Go to the source code of this file.

Defines

#define LINK_ROT(vname, linkName, vn, cn)   sprintf(vname,"_%s_%s_%s",linkName,(vn==0?"u":(vn==1?"v":"w")),(cn==0?"x":(cn==1?"y":"z")))
 Frame of reference for a link.
#define LINK_ROT2(vname, linkName, vn, cn)   (vn<3?LINK_ROT(vname,linkName,vn,cn):sprintf(vname,"_%s_wp_%s",linkName,(cn==0?"x":(cn==1?"y":"z"))))
 Frame of reference for a link.
#define LINK_ROT3_E(vname, linkName, rn, cn)   (rn==cn?sprintf(vname,"_%s_qq_%u",linkName,rn):sprintf(vname,"_%s_qq_%u_%u",linkName,rn,cn))
 Frame of reference for a link using quaternions.
#define LINK_ROT3_Q(vname, linkName, j)   sprintf(vname,"_%s_q_%u",linkName,j)
 System variables for a rotation matrix using quaternions.
#define LINK_TRANS(vname, linkName, cn)   sprintf(vname,"_%s_r_%s",linkName,(cn==0?"x":(cn==1?"y":"z")))
 Translation part of the homogeneous transform defining the position of a link in global coordinates.
#define FREE_JOINT_VAR(vname, id, id1, ln1, id2, ln2, k)   (id1==0?LINK_TRANS(vname,ln2,k):(id2==0?LINK_TRANS(vname,ln1,k):sprintf(vname,"_%s_%s_%s_%u",ln1,ln2,(k==0?"x":(k==1?"y":"z")),id)))
 Variables for a free joint.
#define PRS_JOINT_VAR(vname, id, ln1, ln2)   sprintf(vname,"_d_%s_%s_%u",ln1,ln2,id)
 One variable for each prismatic joint.
#define UNV_JOINT_VAR(vname, id, ln1, ln2, i, k)   sprintf(vname,"_uni_%s_%s_%s_%s_%u",(i==0?"u":"v"),ln1,ln2,(k==0?"x":(k==1?"y":"z")),id)
 Two vectors for each universal joint.
#define SPH_SPH_JOINT_VAR(vname, id, ln1, ln2, i)   sprintf(vname,"_sph_sph_%s_%s_%s_%u",ln1,ln2,(i==0?"x":(i==1?"y":"z")),id)
 A vector for each spherical-spherical composite joint.
#define IN_PATCH_JOINT_CTRL_VAR(vname, id, ln1, ln2, i)   sprintf(vname,"_in_patch_%s_%s_%s_%u",ln1,ln2,(i==0?"u":(i==1?"v":"w")),id)
 Control variables defining a first order Bezier patch.
#define IN_PATCH_JOINT_SCALE_VAR(vname, id, ln1, ln2)   sprintf(vname,"_in_patch_%s_%s_l_%u",ln1,ln2,id)
 Scale factor for the normal vector to a first order Bezier patch.
#define ROT_JOINT_VAR_REF(vname, id, k, ln1, ln2, i)   sprintf(vname,"_%s_%s_%s_%s_%u",(k==0?"w1":"w2"),ln1,ln2,(i==0?"x":(i==1?"y":"z")),id)
 Two vectors to define the angle in a revolute joint.
#define UNV_JOINT_VAR_REF(vname, id, k, ln1, ln2, i)   sprintf(vname,"_%s_%s_%s_%s_%u",(k==0?"w1":"w2"),ln1,ln2,(i==0?"x":(i==1?"y":"z")),id)
 Two vectors to define the angle in a universal joint.
#define COS_VAR(vname, id, ln1, ln2)   sprintf(vname,"_cos_%s_%s_%u",ln1,ln2,id)
 Cosinus between two links for rotation/spherical joints.
#define COS_VAR_UNI(vname, id, ln1, ln2, k)   sprintf(vname,"_cos_%u_%s_%s_%u",k,ln1,ln2,id)
 Cosinus between two links for universal joints.
#define SPH_JOINT_VAR_REF(vname, id, v, ln1, ln2, k)   sprintf(vname,"_sph_%s_%s_%s_%s_%u",(v==0?"w1":"w2"),ln1,ln2,(k==0?"x":(k==1?"y":"z")),id)
 Two vectors defined for when limiting the movement of a spherical joints.
#define BODY_VERTEX(vname, linkName, bID, vID, k)   sprintf(vname,"_%s_b%u_v%u_%s",linkName,bID,vID,(k==0?"x":(k==1?"y":"z")))
 Vertex of a convex part of a link.
#define SPHERE_CENTER(vname, linkName, bID, k)   sprintf(vname,"_center_%s_b%u_%s",linkName,bID,(k==0?"x":(k==1?"y":"z")))
 Center of a sphere.
#define DIF_CENTERS_LL(vname, linkName1, bID1, linkName2, bID2, k)   sprintf(vname,"_diff_%s_b%u_%s_b%u_%s",linkName1,bID1,linkName2,bID2,(k==0?"x":(k==1?"y":"z")))
 Difference between centers of two spheres.
#define DIF_CENTERS_LO(vname, linkName1, bID1, oID, k)   sprintf(vname,"_diff_%s_b%u_o%u_%s",linkName1,bID1,oID,(k==0?"x":(k==1?"y":"z")))
 Difference between center of one sphere and an spheric obstacle.
#define SP_BB_PREFIX(prefix, ln1, b1, ln2, b2)   sprintf(prefix,"spbb_%s_b%u_%s_b%u",ln1,b1,ln2,b2)
 Prefix for the variables of the separating plane between two convex bodies (i.e., between parts of links).
#define SP_BO_PREFIX(prefix, ln1, b1, on)   sprintf(prefix,"spbo_%s_b%u_%s",ln1,b1,on)
 Prefix for the variables of the separating plane between two convex bodies (i.e., between parts of links).
#define SP_VAR(vname, prefix, k)   sprintf(vname,"_%s_%s",prefix,(k==0?"a":(k==1?"b":(k==2?"c":"d"))))
 Generates one of the variables used to define separating planes.

Detailed Description

Definition of macros to unify the name of the variables included in the cuiksystems.

Ensuring names are always the same, we can query the identifier of a variable by constructing its name and querying the corresponding cuiksystem.

Definition in file varnames.h.


Define Documentation

#define LINK_ROT ( vname,
linkName,
vn,
cn   )     sprintf(vname,"_%s_%s_%s",linkName,(vn==0?"u":(vn==1?"v":"w")),(cn==0?"x":(cn==1?"y":"z")))

Three vectors (u,v,w) defining (in global coordinates) the frame of reference for a given link.

Note that this in only one of the ways to parametrize the rotation matrix. See LINK_ROT2 and LINK_ROT3_E for alternative ways.

Parameters:
vname String where to store the variable name.
linkName Name of the link.
vn Vector identifier (0 for u, 1 for v, and 2 for w).
cn The component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 33 of file varnames.h.

Referenced by ApplyLinkRot(), GenerateLinkRot(), and GetTransform2Link().

#define LINK_ROT2 ( vname,
linkName,
vn,
cn   )     (vn<3?LINK_ROT(vname,linkName,vn,cn):sprintf(vname,"_%s_wp_%s",linkName,(cn==0?"x":(cn==1?"y":"z"))))

Three vectors in the form of (u,v,w-wp) defining (in global coordinates) the frame of reference for a given link.

The third vector w-wp are dummified forms of the cross product of u and v.

Note that this in only one of the ways to parametrize the rotation matrix. See LINK_ROT and LINK_ROT3_E for alternative ways.

Parameters:
vname String where to store the variable name.
linkName Name of the link.
vn Vector identifier (0 for u, 1 for v, and 2 for w, and 3 for w_b).
cn The component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 51 of file varnames.h.

#define LINK_ROT3_E ( vname,
linkName,
rn,
cn   )     (rn==cn?sprintf(vname,"_%s_qq_%u",linkName,rn):sprintf(vname,"_%s_qq_%u_%u",linkName,rn,cn))

Rotation matrix represented using quaternions.

This macro only gives the name the qq_ij variables (i,j=0..3) derived from the q_i, i=0..3, quaternion variables. If i=j then only one sub-index is used.

Note that this in only one of the ways to parametrize the rotation matrix. See LINK_ROT and LINK_ROT2 for alternative ways.

Parameters:
vname String where to store the variable name.
linkName Name of the link.
rn Row number.
cn Column number.

Definition at line 71 of file varnames.h.

#define LINK_ROT3_Q ( vname,
linkName,
 )     sprintf(vname,"_%s_q_%u",linkName,j)

LINK_ROT3_E give the name for the variables used in the rotation matrics when using quaternions as a representation tool. However, these variables are not the basic varaiables of the quaternion but combinations of them.

This macro gives the name of the original quaternion variables q_i (i=0..3)

The variables defined with LINK_ROT3_E are related with the q_i variables by

e_ij=q_i*q_j

These relations appear in the form of dummy equations in the quaternion-based systems.

Definition at line 86 of file varnames.h.

#define LINK_TRANS ( vname,
linkName,
cn   )     sprintf(vname,"_%s_r_%s",linkName,(cn==0?"x":(cn==1?"y":"z")))

The vectors defined in LINK_ROT define the rotatin of a link in global coordinates. These variables define the translation part of the homogenous transform placing the link in the global frame of reference.

Parameters:
vname String where to store the variable name.
linkName Name of the link.
cn The component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 101 of file varnames.h.

Referenced by GenerateEquationsFromBranch().

#define FREE_JOINT_VAR ( vname,
id,
id1,
ln1,
id2,
ln2,
 )     (id1==0?LINK_TRANS(vname,ln2,k):(id2==0?LINK_TRANS(vname,ln1,k):sprintf(vname,"_%s_%s_%s_%u",ln1,ln2,(k==0?"x":(k==1?"y":"z")),id)))

A free vector defining a generic the translation from link 1 to link 2.

Note that the name of the variables generated for a free joint when one of the links involved is the ground link is the same as the name generated for the translation component of this link (see LINK_TRANS).

Parameters:
vname String where to store the variable name.
id Unique identifier for the joint.
id1 Identifier of the first link involved in the joint.
ln1 Name of the first link involved in the joint.
id2 Identifier of the first link involved in the joint.
ln2 Name of the second link involved in the joint.
k Component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 120 of file varnames.h.

Referenced by GenerateJointEquations(), GenerateJointEquationsInBranch(), and GenerateJointRangeEquations().

#define PRS_JOINT_VAR ( vname,
id,
ln1,
ln2   )     sprintf(vname,"_d_%s_%s_%u",ln1,ln2,id)

One variable for each prismatic joint: the displacement along the sliding axis.

Parameters:
vname String where to store the variable name.
id Unique identifier for the joint.
ln1 Identifier of the first link involved in the joint.
ln2 Identifier of the second link involved in the joint.

Definition at line 133 of file varnames.h.

Referenced by GenerateJointEquationsInBranch(), and GenerateJointRangeEquations().

#define UNV_JOINT_VAR ( vname,
id,
ln1,
ln2,
i,
 )     sprintf(vname,"_uni_%s_%s_%s_%s_%u",(i==0?"u":"v"),ln1,ln2,(k==0?"x":(k==1?"y":"z")),id)

Two vectors for each universal joint defining the copunctual orthogonal rotation axis that define the universal joint.

Parameters:
vname String where to store the variable name.
id Unique identifier for the joint.
ln1 Identifier of the first link involved in the joint.
ln2 Identifier of the second link involved in the joint.
i 0 for the first axis of the universal joint and 1 for the second.
k Component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 148 of file varnames.h.

Referenced by GenerateJointEquations(), and GenerateJointRangeEquations().

#define SPH_SPH_JOINT_VAR ( vname,
id,
ln1,
ln2,
 )     sprintf(vname,"_sph_sph_%s_%s_%s_%u",ln1,ln2,(i==0?"x":(i==1?"y":"z")),id)

A vector (x,y,z components) for each spherical-spherical composite joint.

Parameters:
vname String where to store the variable name.
id Unique identifier for the joint.
ln1 Identifier of the first link involved in the joint.
ln2 Identifier of the second link involved in the joint.
i Component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 161 of file varnames.h.

Referenced by GenerateJointEquations(), and GenerateJointEquationsInBranch().

#define IN_PATCH_JOINT_CTRL_VAR ( vname,
id,
ln1,
ln2,
 )     sprintf(vname,"_in_patch_%s_%s_%s_%u",ln1,ln2,(i==0?"u":(i==1?"v":"w")),id)

A first order Bezier is defined with two variables (u,v). Here we additionally define a third variable w that is u*v so that all equations remain linear or bilinear.

Parameters:
vname String where to store the variable name.
id Unique identifier for the joint.
ln1 Identifier of the first link involved in the joint.
ln2 Identifier of the second link involved in the joint.
i The control variable (0 for u, 1 for v and 2 for w).

Definition at line 176 of file varnames.h.

Referenced by GenerateJointEquations(), GenerateJointEquationsInBranch(), GenerateJointRangeEquations(), and RegenerateJointSolution().

#define IN_PATCH_JOINT_SCALE_VAR ( vname,
id,
ln1,
ln2   )     sprintf(vname,"_in_patch_%s_%s_l_%u",ln1,ln2,id)

When defining a IN_PATCH joint, the normal vectors at the two links in contact at the contact point are equated. In the first link this vector is constant but in the second link it is variable (depends on the control points defining the patch). This scale variable is used to make the two vectors equal.

Parameters:
vname String where to store the variable name.
id Unique identifier for the joint.
ln1 Identifier of the first link involved in the joint.
ln2 Identifier of the second link involved in the joint.

Definition at line 191 of file varnames.h.

Referenced by GenerateJointEquations().

#define ROT_JOINT_VAR_REF ( vname,
id,
k,
ln1,
ln2,
 )     sprintf(vname,"_%s_%s_%s_%s_%u",(k==0?"w1":"w2"),ln1,ln2,(i==0?"x":(i==1?"y":"z")),id)

Two vectors (x-y-z variables) orthogonal to the rotation axis one attached to the 1st link and the another to the 2nd link.

A third vector aligned with the rotation axis used to define the cross product between the two first vectors.

Parameters:
vname String where to store the variable name.
id Unique identifier for the joint.
k Number of the vector to which to variable is referred (0,1). The varible for 0 is named *_w1_* and for 1 we get *_w2_*
ln1 Identifier of the first link involved in the joint.
ln2 Identifier of the second link involved in the joint.
i Component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 212 of file varnames.h.

Referenced by GenerateJointRangeEquations().

#define UNV_JOINT_VAR_REF ( vname,
id,
k,
ln1,
ln2,
 )     sprintf(vname,"_%s_%s_%s_%s_%u",(k==0?"w1":"w2"),ln1,ln2,(i==0?"x":(i==1?"y":"z")),id)

Two vectors (x-y-z variables) to define the angle in a universal joint. The first vector defines the first angle w.r.t. the second rotation axis of the universal joint. The second vector defines the first angle w.r.t. the first rotation axis of the universal joint.

Parameters:
vname String where to store the variable name.
id Unique identifier for the joint.
k Number of the vector to which to variable is referred (0,1). The varible for 0 is named *_w1_* and for 1 we get *_w2_*
ln1 Identifier of the first link involved in the joint.
ln2 Identifier of the second link involved in the joint.
i Component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 233 of file varnames.h.

Referenced by GenerateJointRangeEquations().

#define COS_VAR ( vname,
id,
ln1,
ln2   )     sprintf(vname,"_cos_%s_%s_%u",ln1,ln2,id)

Cosinus between two links articulated by a rotation/spherical joint (actually, cosinus between two vectors rigidly attached to two links).

In revolute/spherical joints only one angle is possible between two links for a give joint

Parameters:
vname String where to store the variable name.
id Unique identifier for the joint.
ln1 Identifier of the first link involved in the joint.
ln2 Identifier of the second link involved in the joint.

Definition at line 250 of file varnames.h.

Referenced by GenerateJointRangeEquations().

#define COS_VAR_UNI ( vname,
id,
ln1,
ln2,
 )     sprintf(vname,"_cos_%u_%s_%s_%u",k,ln1,ln2,id)

Cosinus between two links articulated by a universal joint. Two cosinus are defined, one for the first rotation and another for the second rotation of the universal joint.

Parameters:
vname String where to store the variable name.
id Unique identifier for the joint.
ln1 Identifier of the first link involved in the joint.
ln2 Identifier of the second link involved in the joint.
k Identifier of the universal joint rotation (0 for the first rotation and 1 for the second one).

Definition at line 268 of file varnames.h.

Referenced by GenerateJointRangeEquations().

#define SPH_JOINT_VAR_REF ( vname,
id,
v,
ln1,
ln2,
 )     sprintf(vname,"_sph_%s_%s_%s_%s_%u",(v==0?"w1":"w2"),ln1,ln2,(k==0?"x":(k==1?"y":"z")),id)

We define two vectors, the first attached to link1 and the second to link2, that must coincide for angle 0.

Parameters:
vname String where to store the variable name.
id Unique identifier for the joint.
v Vector identifier (0 for w1, 1 for w2).
ln1 Identifier of the first link involved in the joint.
ln2 Identifier of the second link involved in the joint.
k Component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 283 of file varnames.h.

Referenced by GenerateJointRangeEquations().

#define BODY_VERTEX ( vname,
linkName,
bID,
vID,
 )     sprintf(vname,"_%s_b%u_v%u_%s",linkName,bID,vID,(k==0?"x":(k==1?"y":"z")))

3D vector corresponding to a vertex in a convex part of a link.

Parameters:
vname String where to store the variable name.
linkName Name of the link.
bID Identifier of the convex body (i.e., number of convex body in the link).
vID Vertex identifier (i.e., number of bertex in the convex body).
k The component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 297 of file varnames.h.

#define SPHERE_CENTER ( vname,
linkName,
bID,
 )     sprintf(vname,"_center_%s_b%u_%s",linkName,bID,(k==0?"x":(k==1?"y":"z")))

3D vector corresponding to the center of a sphere defining a body in a link. This is used only when all bodies are spheres and a particular collision detection is implemented.

Parameters:
vname String where to store the variable name.
linkName Name of the link.
bID Identifier of the convex body (i.e., number of convex body in the link).
k The component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 311 of file varnames.h.

#define DIF_CENTERS_LL ( vname,
linkName1,
bID1,
linkName2,
bID2,
 )     sprintf(vname,"_diff_%s_b%u_%s_b%u_%s",linkName1,bID1,linkName2,bID2,(k==0?"x":(k==1?"y":"z")))

Substraction between two sphere centers corresponding to particular bodies in two different links.

Parameters:
vname String where to store the variable name.
linkName1 Name of the first link.
bID1 Identifier of the convex body in the first link.
linkName2 Name of the second link.
bID2 Identifier of the convex body in the second link.
k The component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 326 of file varnames.h.

#define DIF_CENTERS_LO ( vname,
linkName1,
bID1,
oID,
 )     sprintf(vname,"_diff_%s_b%u_o%u_%s",linkName1,bID1,oID,(k==0?"x":(k==1?"y":"z")))

Substraction between a sphere center corresponding to particular body in a given link and a sphere center corresponding to an obstacle (and, thus, with constant coordinates)

Parameters:
vname String where to store the variable name.
linkName1 Name of the first link.
bID1 Identifier of the convex body in the first link.
oID Identifier of the convex body in the environment (i.e., the obstacle).
k The component of the vector (0 for x, 1 for y and 2 for z).

Definition at line 340 of file varnames.h.

#define SP_BB_PREFIX ( prefix,
ln1,
b1,
ln2,
b2   )     sprintf(prefix,"spbb_%s_b%u_%s_b%u",ln1,b1,ln2,b2)

Four variables (a,b,c,d) for each body-body possible collision.

This is only the prefix for this variables. The variable name is completed in SP_VAR.

Parameters:
prefix String where to store the prefix.
ln1 Identifier of the first link involved in the possible collision.
b1 Identifier of the first convex body (i.e., number of convex body in the first link).
ln2 Identifier of the second link involved in the possible collision.
b2 Identifier of the second convex body (i.e., number of convex body in the second link).

Definition at line 359 of file varnames.h.

#define SP_BO_PREFIX ( prefix,
ln1,
b1,
on   )     sprintf(prefix,"spbo_%s_b%u_%s",ln1,b1,on)

Four variables (a,b,c,d) for each body-obstacle possible collision.

This is only the prefix for this variables. The variable name is completed in SP_VAR.

Parameters:
prefix String where to store the prefix.
ln1 Identifier of the first link involved in the possible collision.
b1 Identifier of the first convex body (i.e., number of convex body in the first link).
on Identifier of the obstacle involved in the possible collision.

Definition at line 377 of file varnames.h.

#define SP_VAR ( vname,
prefix,
 )     sprintf(vname,"_%s_%s",prefix,(k==0?"a":(k==1?"b":(k==2?"c":"d"))))

Generates one of the variables used to define separating planes.

Parameters:
vname String where to store the variable name.
prefix Prefix generated with SP_BB_PREFIX or SP_BO_PREFIX.
k Number of the variable to generate (0 for 'a', 1 for 'b', 2 for 'c', and 3 for 'd')

Definition at line 388 of file varnames.h.