Main Content

exportrobot

Export URDF details in file format from rigid body tree model

Since R2023b

Description

exportrobot(robotRBT) writes the unified robot description format (URDF) details in file format by parsing the rigidBodyTree object robotRBT. For more information about the rigid body tree robot model, see Rigid Body Tree Robot Model.

exportrobot(___,Name=Value) specifies options using one or more name-value arguments in addition to the input argument from the previous syntax.

example

Examples

collapse all

This example shows how to load a robot as a rigid body tree model and export the URDF details.

Load a rigidBodyTree robot model. The rigidBodyTree contains kinematic and dynamic constraints and visual meshes for the specified robot geometry.

robotModel = loadrobot("universalUR10");

Visualize the robot model.

figure;
robotModel.show();

Load gripper model.

gripperModel = loadrobot("robotiq2F85");

Visualize the gripper model.

figure;
gripperModel.show();

Add gripper to the existing robot model.

robotModel.addSubtree("tool0",gripperModel,ReplaceBase=false);

Visualize the modified robot model with the added gripper model.

figure;
robotModel.show();

Export the modified URDF details of the robot model with packaged mesh files.

exportrobot(robotModel,OutputFileName="universalUR10Gripper.urdf",ExportMesh=true);

Input Arguments

collapse all

Rigid body tree robot model, specified as a rigidBodyTree object.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: exportrobot(robotRBT,OutputFileName="abbIrb120.urdf",ExportMesh=True)

Name of the generated URDF file, specified as a string scalar or character vector. You can also specify this input as a pathname corresponding to the location at which you want to generate the URDF file.

Example: "abbIrb120.urdf", "C:/URDF/abbIrb120.urdf"

Data Types: char | string

Robot name attribute corresponding to the robot name tag in the generated URDF file, specified as a string scalar or character vector. The function returns as a valid robot model name such as "abbIrb120", "abbIrb120T", "abbIrb1600".

Example: "abbIrb120"

Data Types: char | string

Visual mesh files location corresponding to the filename attribute under the mesh tag of the visual tag in the generated URDF file, specified as a string scalar or character vector.

The default location corresponds to the path you specify in the rigidBodyTree object. You can also modify the visual mesh path from generated URDF file to a location of your preference.

Example: "C:/URDF/abb_irb120_support/meshes/"

Data Types: char | string

Collision mesh files location corresponding to the filename attribute under the mesh tag of the collision tag in the generated URDF file, specified as a string scalar or character vector.

The default location corresponds to the path you specify in the rigidBodyTree object. You can also modify the collision mesh path from generated URDF file to a location of your preference.

Example: "C:/URDF/abb_irb120_support/meshes/"

Data Types: char | string

Option to enable mesh file export, specified as a numeric or logical value of 0 (false) or 1 (true). The generated ZIP package contains the output URDF files and mesh files.

Data Types: logical | numeric

Maximum permissible difference in the values under tags in exported URDF, specified as a positive scalar. The default value is sqrt(eps), where eps returns the distance from 1.0 to the next largest double-precision number, which is equal to 2-52. For more information, see eps.

Data Types: single | double

Version History

Introduced in R2023b