I got two robots to plot just removing some of your lines of code:
mdl_ur5;
ur5_1=SerialLink(ur5, 'name', 'UR1');
ur5_2=SerialLink(ur5, 'name', 'UR2');
% toolPos = [0.001 -0.1836 1.164];
% base1Pos = toolPos + [0.19887 -0.066567 0.14152];
base2Pos = [-1.19887 -0.066567 0.0];
%
% angles1 = [1.9681 0.8766 1.7827];
% angles2 = [-1.8235 -0.1413 1.7072];
%
% Tb1 = SE3(rpy2r(angles1),base1Pos);
Tb2 = SE3(base2Pos);
%
% ur5_1.base = Tb1;
ur5_2.base = Tb2;
W=[-2 2 -2 2 -1.0 5];
% qz=[pi/2, -pi/2, 0, pi/2, 0, pi/2];
figure
hold on
ur5_1.plot(qz, 'workspace', W)
ur5_2.plot(qz)
Also, I added names to the robots to make them easier to identify. Your definitions of the base positions is strange to me, but if you examine the values of ur5*.base you should be able to see if the translations make sense in space, and if you would be able to see the robots in the workspace you have defined.
Note that the floor is normally drawn at z = -1, but can be changed as an option in the serialLink.plot function.
Hope that helps.
Alex
mdl_ur5;
ur5_1=SerialLink(ur5);
ur5_2=SerialLink(ur5);
toolPos = [0.001 -0.1836 1.164];
base1Pos = toolPos + [0.19887 -0.066567 0.14152];
base2Pos = toolPos + [-0.19887 -0.066567 0.14152];
angles1 = [1.9681 0.8766 1.7827]*180/pi;
angles2 = [-1.8235 -0.1413 1.7072]*180/pi;
Tb1 = SE3(rpy2r(angles1),base1Pos);
Tb2 = SE3(rpy2r(angles2),base2Pos);
ur5_1.base = Tb1;
ur5_2.base = Tb2;
W=[-1.5 1.5 -1 1 -0.5 2];
qz=[pi/2, -pi/2, 0, pi/2, 0, pi/2];
figure
ur5_1.plot(qz, 'workspace', W)
hold on
ur5_2.plot(qz, 'workspace', W)
So I just place the robots adequately, and then I plot them, and they won't show in the same figure.
On Monday, March 15, 2021 at 3:04:03 PM UTC+1 Alex Smith wrote: