Import rigid body tree model from URDF file, text, or Simscape Multibody model
returns a robot
= importrobot(filename
)rigidBodyTree
object by parsing
the Unified Robot Description Format (URDF) file specified by
filename
.
[
imports a Simscape™
Multibody™ model and returns an equivalent robot
,importInfo
] = importrobot(model
)rigidBodyTree
object and info
about the import in importInfo
. Only fixed, prismatic, and
revolute joints are supported in the output rigidBodyTree
object. Use the Simscape Multibody Model Import name-value pairs to
import a model that uses other joint types, constraint blocks, or variable
inertias.
___ = importrobot(___,Name,Value)
provides additional options specified by Name,Value
pair
arguments. Use any of the previous syntaxes. Only certain name-value pairs apply
depending on whether you convert from a URDF file or a Simscape
Multibody model.
When importing a robot model with visual meshes, the importrobot
function searches for the .stl
files to assign to each rigid body
using these rules:
The function searches the raw mesh path for a specified rigid body from
the URDF file. References to ROS packages have the
package:\\<pkg_name>
removed.
Absolute paths are checked directly with no modification.
Relative paths are checked using the following directories in order:
User-specified MeshPath
Current folder
MATLAB® path
The folder containing the URDF file
One level above the folder containing the URDF file
The file name from the mesh path in the URDF file is appended to the
MeshPath
input argument.
If the mesh file is still not found, the parser ignores the mesh file and returns a
rigidBodyTree
object without
visual.