Clear Filters
Clear Filters

Load STEP into Simscape Multibody using URDF

13 views (last 30 days)
Chris
Chris on 21 Feb 2019
Answered: Steve Miller on 25 Mar 2019
I have a standard URDF file for a robotic arm and the corresponding CAD for each link as a series of STEP files. When loading the URDF into Matlab using the smimport('file.URDF') function the URDF file declares the geometry is in the following location which is standard when using ROS:
<geometry>
<mesh filename="package://sawyer_description/meshes/sawyer_pv/base.DAE"/>
</geometry>
The line above causes the following warning message to appear in the Matlab command window after executing "smimport('file.URDF')":
Warning: Mesh file 'base.DAE' in link 'base' has an unsupported file extension and cannot be visualized. Valid file extensions include STL, STP, and STEP.
This warning is clear to me. My issue is I cannot find the correct way to alter the URDF line to locate the STEP file in the Matlab folder for a windows system.
Since I am using Windows 10 and Matlab 2018b with Simscape Multibody I would like to alter the URDF so that Matlab can import the CAD as well as build all the blocks for the links in the robotic arm when executing the smimport() function. The result, I would think, would be something like the following:
<geometry>
<mesh filename="C:/Matlab/mesh/base.STEP"/>
</geometry>
But this results in a similar warning message which means the URDF is still not directing Matlab to the STEP file.
I have already tried using the import CAD, plugin and OnShape tutorials to try to get around this issue but I run into the same issue or Matlab tries to use the CAD's generated "file.xml" to import the incorrect physical properties.
Does anyone have experience with importing geometry using a URDF in Simscape Multibody? Any help with altering the "mesh filename" line would be great!

Answers (1)

Steve Miller
Steve Miller on 25 Mar 2019
Hi,
The easiest way (I believe) to get this to work is to remove all path information from the URDF file and simply add the folders with the STEP files to your MATLAB path.
You can verify that your MATLAB installation can import URDF files that refer to STEP files by importing a URDF file that ships with Simscape Multibody.
>> smimport('sm_humanoid.urdf');
You can look at the file directly:
>> edit('sm_humanoid.urdf');
You can also see how the path should be expressed for your operating system using the which command
>> which shoulder.step
C:\Program Files\MATLAB\R2018b\examples\robotics\shoulder.step
--Steve

Products


Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!