petercorke / robotics-toolbox-matlab

Robotics Toolbox for MATLAB
GNU Lesser General Public License v2.1
1.29k stars 444 forks source link

Issue for Trailway Design #130

Closed ConanYX closed 10 months ago

ConanYX commented 10 months ago

Hi,I am trying to finish an experiment with Robotic Toolbox in Matlab. I've already created a robot and know how to creat a trailway (set the startpoint and endpoint). But when the new way is going, the line between two trailways vanishes, I want the whole each line in the whole design to be kept. Another problem is that I am not able to add a point between A and B, aiming to let the end of robot follow the trail I want. And my aim is to finish a shape of "M" Thanks for suggestions!!!!!!!! Here is my code: clc; % clear all; clc; L(1) = Link('d', 0, 'a',0,'alpha',pi/2); L(2) = Link('d', 0, 'a',20,'alpha',0);

L(3) = Link('d', 0, 'a',0,'alpha',pi/2); L(4) = Link('d', 0, 'a',10,'alpha',0); L(5) = Link('d', 0, 'a',10,'alpha',0); L(6) = Link('d', 0, 'a',10,'alpha',0); Robot = SerialLink(L,'name','BOPP');

Robot.base=transl(0,0,0); %q0 = [33/180pi,-7.2/180pi,-21.6/180pi,0]; %q1 = [22.2/180pi,21.6/180pi,-3.6/180pi,-21.6/180*pi ]; %teach(Robot);

T1=transl(-10,-15,-15)troty(180); T2=transl(-10,-15,10)troty(180); T3=transl(-10,0,-15)*troty(180); q1=Robot.ikunc(T1); q2=Robot.ikunc(T2); q3=Robot.ikunc(T3);

t1=linspace(0,2,10); t2=linspace(2,3,20);

[q1,dq1,ddq1]=jtraj(q1,q2,t1); Robot.plot(q1,'trail','b');

[q2,dq2,ddq2]=jtraj(q2,q3,t1); Robot.plot(q2,'trail','b');