0
$\begingroup$

I am trying to write code in MATLAB to generate a trajectory for a scara manipulator in the robot operational space with trapezoidal velocity profile for each segment passing through 5 waypoints using the formulas shown in the attached image.

They are for creating a trajectory in operational space for each segment passing through multiple points. I am not sure how to implement $p_j - p_{j-1}$ since Matlab starts from index 1 and gives error on accessing previous index. Also how should one define $s'_j(t)$ for $t_{j-1} < t < t_j$ , for $t_0$ $s'_j(t) = 0$ and for $t_f$, $s'_j(t)$ becomes $||p_j - p_{j-1}||$ when the sampling time is 0.001 seconds.

If anybody has worked on trajectory planning and coded in MATLAB please can you help me with this, this image has been taken from one of the ppts shared by my Masters Professor but it can be found in the book -

Robotics: Modelling, Planning and Control by B. Siciliano, L. Sciavicco, L. Villani, G. Oriolo, Chapter 4 Trajectory Planning. The book can be found on springer if anybody wants to check out, thank you

enter image description here

$\endgroup$

1 Answer 1

0
$\begingroup$

I am not sure how to implement pj−pj−1 since Matlab starts from index 1 and gives error on accessing previous index.

You'll have some starting state, which would be p(1). Then, for trajectory planning, you would start at j = 2 and go from there. Remember that nearly every other programming language is a zero-based index, so when you see a term like p0 in your equation, that's p(1) in Matlab, and then j=1 in your summation would be j=2 in Matlab.

$\endgroup$
1
  • $\begingroup$ Ok got it, thank you and what about my other question, how should one define s′j(t) for tj−1<t<tj , for t0 s′j(t)=0 and for tf, s′j(t) becomes ||pj−pj−1|| when the sampling time is 0.001 seconds? $\endgroup$ Nov 28, 2022 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.