Author 
Comment/Response 
John Thornby

11/13/08 06:51am
Hi all,
I'm having a problem, which I believe is with the Manipulate function though it could be a more fundamental lack of understanding on my part  I'm hoping you can advise. Bear with me as I describe my problem.
I am using Robotica (a 3rd party addon, intended for an older version of Mathematica) with Mathematica version 6.0.3.0. I'm only using the really basic functions of Robotica as the advanced stuff has been superseded by the basic Mathematica package anyway.
In the background Robotica specifies a bunch of transformation matrices in terms of 4 parameters using delayed assignment,
i.e. A[a_,alpha_,d_,theta_]:= <some 4x4 matrix>
Each Matrix consists of a 3x3 rotation, a 1x3 translation and the bottom row is always {0,0,0,1}. This part of the code definitely works properly and everything transforms properly.
For each A matrix three of the parameters are constant (and specified) while the remaining one is variable.
Each A matrix represents a change in reference coordinate frame. In real terms I'm specifying a coordinate frame rigidly attached to each link of my robot arm. I chain them together to form an overall transformation, T[i,j], which takes me from the ith coordinate frame to the jth.
So I use the matrices to transform my World Origin {0,0,0} into each successive coordinate frame using:
Origin[n_] := TransformationFunction[T[0, n]][{0, 0, 0}];
Which moves me from the 0th coordinate frame (World Frame) to the nth one and returns a triple {Xn,Yn,Zn} representing the World Coordinates of my nth origin.
I then define a line between each successive origin using:
link[n_] := Line[{Origin[n  1], Origin[n]}];
Now what I want to do is to draw each line in a 3DGraphic using "Manipulate" to alter the free parameter from each transformation matrix.
If it worked this would draw each link of my robot arm chained together, each of which being free to rotate about an axis fixed in the reference frame of the previous link.
My Manipulate block looks like this:
Manipulate[
Graphics3D[
{Red, Thick, link[1],
Blue, Thick, link[2]
],
{{q1, 0, Angle J1}, 2 Pi, 2 Pi},
{{q2, 0, Angle J2}, 2 Pi, 2 Pi}
]
q1 and q2 are the rotation angles for my first two robot links. So I'm drawing objects which are a function of a function of the free parameters q1 and q2. But manipulate doesn't treat q1 and q2 as being variable. When I hover over the plot area it says:
"Coordinate {3Cos[q1+q2],3Sin{q1+q2],4} should be a triple of numbers, or a Scaled form."
So I'm a bit stuck. It looks like Manipulate works backwards to the definitions of the transformation matrices properly, but treats q1 and q2 as undefined algebraic quantities rather than as free parameters.
Any advice?
Apologies if my problem isn't clear. I can attach code if necessary but I think the salient information is all there.
Thanks
URL: , 
