Skip to content

expressiongraph_ops

Erwin Aertbelien edited this page Nov 25, 2014 · 1 revision

Expression graphs for geometric types

Each of the types double, Vector, Rotation, Frame, Twist, Wrench have a series of nodes (and corresponding functions) defined.

For the Expression<double>, the following is defined( d,d1,d2,x and y are of type Expression<double>::Ptr), L and H are of type double :

Description Node Type Function/operator
Summation of two double values. Addition_DoubleDouble d1 + d2
Subtraction of two double values Subtraction_DoubleDouble d1 - d2
Multiplication of two double values Multiplication_DoubleDouble d1 * d2
Division of two double values Division_DoubleDouble d1 / d2
Negation of a double value Negate_Double - d
Sine Sin_Double sin(d)
Cosine Cos_Double cos(d)
Tangent Tan_Double tan(d)
Arctangent with two input arguments and returning angles from -pi to pi. Atan2_Double atan2(y,x)
Arctangent with one input argument and returning angles from -pi/2 to pi/2. Atan_Double atan(d)
Arcsine Asin_Double asin(d)
Arccosine Acos_Double acos(d)
Exponential Exp_Double exp(d)
Logarithm Log_Double log(d)
Square root Sqrt_Double sqrt(d)
Absolute value Abs_Double abs(d)
Minimum minimum(d1,d2)
Maximum maximum(d1,d2)
Saturate between lower L and upper H saturate(d1,L,H)

For the Expression<Vector> types, the following operators and functions are defined ( in the table below v, v1 and v2 are of type Expression<Vector>::Ptr, x,y,z and s are of type Expression<double>::Ptr:

Description Node Type Function
Construction of a Vector expression out of three scalar expressions Vector_DoubleDoubleDouble vector(x,y,z)
Dot product between two Vector expressions Dot_VectorVector dot(v1,v2)
Cross product between two Vector expressions CrossProduct_VectorVector v1 * v2
Addition of two Vector expressions Addition_VectorVector v1 + v2
Subtraction of two Vector expressions Subtraction_VectorVector v1 - v2
Negation of a Vector expression Negation_Vector - v
Squared norm of a Vector SquaredNorm_Vector squared_norm(v)
Norm of a Vector expression Norm_Vector norm(v)
Multiplication of a double and a Vector Multiplication_VectorDouble s*v and v*s
Extraction of an expression for the x-coordinate of a vector expression CoordX_Vector coord_x(v)
Extraction of an expression for the y-coordinate of a vector expression CoordY_Vector coord_y(v)
Extraction of an expression for the z-coordinate of a vector expression CoordZ_Vector coord_z(v)

For the Expression<Rotation>, the following is defined ( R,R1,R2 is of type Expression<Rotation>::Ptr, v is of type Expression<Vector>::Ptr, a is of type Expression<double>::Ptr, A is of type Vector ):

Description Node Type Function
An expression for the rotation around a fixed axis with a angle specified by a double expression Rot_Double rot(A,a)
An expression for the rotation around the X axis with a angle specified by a double expression RotX_Double rot_x(a)
An expression for the rotation around the Y axis with a angle specified by a double expression RotY_Double rot_y(a)
An expression for the rotation around the Z axis with a angle specified by a double expression RotZ_Double rot_z(a)
Composition of two rotations (R1 after R2) Composition_RotationRotation R1*R2
Transform a vector v using the rotation expression R Composition_RotationVector R*v
Extract an expression for X-axis of a rotation matrix expression (1st column) UnitX_Rotation unit_x
Extract an expression for Y-axis of a rotation matrix expression (2nd column) UnitY_Rotation unit_y
Extract an expression for Z-axis of a rotation matrix expression (2th column) UnitZ_Rotationr unit_z

For the Expression<Frame>, the following is defined F,F1 and F2 are of type Expression<Frame>::Ptr, R is of type Expression<Rotation>::Ptr, v is of type Expression<Vector>::Ptr, a is of type Expression<double>::Ptr, A is of type Vector ):

Description Node Type Function
Construction of a Frame expression out of a Rotation expression and a Vector expression. If v is not given, it is zero. If R is not given, it is the identity matrix Frame_RotationVector frame(R,v), frame(v), frame(R)
Inverse Frame transformation for an expression Inverse_Frame inv(F)
Composition of Frame transformations (F1 after F2) Compostion_FrameFrame F1*F2
Transformation of a vector v using a Frame transformations F Compostion_FrameVector F*v
Extract a Vector expression for the origin of a frame Origin_Frame origin(F)
Extract a Rotation expression for the orientation of a frame Rotation_Frame rotation(F)

For the Expression<Twist>, the following is defined ( d is of type Expression<double>::Ptr, v,omega are of type Expression<Vector>::Ptr, t, t1 and t2 are of type Expression<Twist>::Ptr, R is of type Expression<Rotation>::Ptr ):

Description Node Type Function
Construction of a twist out of an expression for the velocity and the rotational velocity Twist_VectorVector twist(v,omega)
Negation of a twist Negate_Twist - t
Extraction of the translational velocity of a twist Velocity_Twist transvel(t)
Extraction of the rotational velocity of a twist RotVelocity_Twist rotvel(t)
Addition of two twists Addition_Twist t1 + t2
Subtraction of two twists Subtraction_Twist t1 - t2
Transformation of a twist using a transformation of the orientation Composition_RotationTwist R*t
Transformation of a twist using a transformation of the reference point RefPoint_TwistVector ref_point(t,v)
Scalar multiplication of a twist with a double Multiplication_TwistDouble t*d or d*t

For the Expression<Wrench>, the following is defined: d is of type Expression<double>::Ptr, p,force, torque are of type Expression<Vector>::Ptr, w, w1 and w2 are of type Expression<Wrench>::Ptr, R is of type Expression<Rotation>::Ptr ):

Description Node Type Function
Construction of a wrench out of an expression for the torque and force Wrench_VectorVector wrench(force,torque)
Negation of a wrench Negate_Wrench - w
Extraction of the force of a wrench Force_Wrench force(t)
Extraction of the torque of a Wrench Torque_Twist torque(t)
Addition of two wrenches Addition_Wrench w1 + w2
Subtraction of two wrenches Subtraction_Wrench w1 - w2
Transformation of a wrench using a transformation of the orientation Composition_RotationWrench R*w
Transformation of a wrench using a transformation of the reference point RefPoint_WrenchVector ref_point(w,p)
Scalar multiplication of a wrench with a double Multiplication_WrenchDouble w*d or d*w

There is also a node that handles KDL's kinematic chain types and enables the use of kinematic chains in an expression ( chain is of type KDL::Chain ):

Description Node Type Function
the transformation of the end effector with respect to the base for a given kinematic chain. For a kinematic chain with n variables, input variables i ... i+n-1 will correspond to the joint angles of the kinematic chain. Expression_Chain kinematic_chain( chain, i)