Basically I have created a trajectory in Matlab using the ctraj function and I have generated the joint angles using inverse kinematics. For example;
t q1 q2 …
0.1 0 0 …
0.2 1.5 1.5 …
Etc.
And I have put this in a Matlab function block in simulink. What the function does is; it takes a clock input and compares it with the time vector shown above…
So for each loop the program looks for a value of t = clocktime, and it outputs the value of q1 and q2 for that time.The reason is, the jtraj block seems to provide the values of q in synchronisation with the simulation. So if for example I save the generated time vector and variables to the workspace, I have a value of q at every time step, while when I do the same thing with the function I created, I get zeros for some of the time values.
Thanks.
Sorry the image didn't show. I forgot how difficult it is to post image
on here but anyways hope you get what I was trying to describe. I'll try
and post the image again below (fingers crossed):