Issues with plot3d() and using .stl files with seriallink.model3d

255 views
Skip to first unread message

Jay Tailor

unread,
Jan 27, 2021, 8:41:45 AM1/27/21
to Robotics & Machine Vision Toolboxes
Hi there - 

I am a 5th year engineering student from Ontario, Canada. I am using RTB for MATLAB 10.4. (MATLAB R2020b). 

I have created 6 .stl files (link0.stl, link1.stl ... link5.stl) for a 6DOF Robot Arm using Fusion 360. Following the mdl_puma560's use of .stl files (it uses 'UNIMATE/puma560') for plot3d(), I also added the .stl files to the appropriate path location, on my local machine for my Serial Link Object to map to the .stl files. I compute the DH parameters and used them to create the serial link object. 

Code:
dh  = [ 
0  0      0        1.571 
0  0      118.7   0
0  0      0        1.571 
0  36  0        -1.571
0  0      0        1.571
0  5.5  0        0]

%L=Link ( [Th d a alph])
L(1)=Link ([0 0 0 pi/2]);
L(2)=Link ([0 0 118.7 0]);
L(3)=Link ([0 0 0 pi/2]);
L(4)=Link ([0 36 0 -pi/2]);
L(5)=Link ([0 0 0 pi/2]);
L(6)=Link ([0 5.5 0 0]);


AT03=SerialLink(L,'name','AT03Robot')

start_pos=[0,1.571/2,1.571,-1.571,-1.571/2,0];
qo = start_pos;
AT03.model3d = 'CAPSTONE/AT03'
AT03.offset=[start_pos];

AT03.plot3d([1 1.571 0 0.2 -1.571 0]);

AT03 Robot Object.PNG

Result:
Output_Jay_RTB_plot3d.PNG

My Observation:
- Seems that the stl links are being captured, however they all seem to bundle up and I'm not sure why they are not creating the Arm structure. 
-  The path is correct as the links shown in the result are correct, just not end to end. 
- The .stl files are ASCII
- I HAVE NOT used any of the optional arguments to the plot3d() function... any tips if there is a fix there for my problem? 
- If i try to zoom or rotate the view of this plot shown, the entire figure collapses inwards and becomes extremely small and non detectable. 
- I am able to perform IK trajectory planning using plot() but the facing the above issues with plot3d() as explained. 

If anyone can assist this issue - it would be greatly helpful.  I can provide .stl files if you believe there may be an issue with them. Thanks kindly! If more information is needed feel free to tag me, I will be monitoring this email chain. Thanks so much! 

Regards,
Jay Tailor (B.Eng Candidate, 2021) 


Erik van Oene

unread,
Jan 30, 2021, 2:28:44 AM1/30/21
to Robotics & Machine Vision Toolboxes
Make sure the STL file has the correct units and is exported in the correct coordinate frame. It should be in the frame of the corresponding Link in de Serial Link object / DH convention

Op woensdag 27 januari 2021 om 14:41:45 UTC+1 schreef jay.t...@ryerson.ca:

Jay Tailor

unread,
Feb 20, 2021, 6:20:33 PM2/20/21
to Robotics & Machine Vision Toolboxes
Hi Erik/Peter - 

Made some changes, tried: 
AT03.plot3d(Q,'view','y','path','C:\Users\bluet\Documents\Capstone_New\Control_System_New\robot\data\meshes\CAPSTONE\AT03','floorlevel',0);

Results:
Output_Jay_RTB_plot3d_Updated_2.PNGOutput_Jay_RTB_plot3d_Updated.PNG

Thanks - Please let me know your thoughts!
Jay Tailor

FLORES LOPEZ ALEJANDRO

unread,
Mar 22, 2021, 7:25:16 PM3/22/21
to Robotics & Machine Vision Toolboxes
Hello Jay Tailor, I have the same problem, Have you found a resoltion?
Please, this would be very helpful

Peter Corke

unread,
Mar 27, 2021, 1:35:34 AM3/27/21
to Robotics & Machine Vision Toolboxes
Erik's comment is spot on.  The mesh coordinate frame has to match the DH conventions.  

I have no idea why rotation causes scale change.
Reply all
Reply to author
Forward
0 new messages