How do I import XACRO files as Rigid Body Trees in Robotics System Toolbox?

43 ビュー (過去 30 日間)
I am trying to import a robot description model from a XACRO file as a Rigid Body Tree from Robotics System Toolbox.
robot = importrobot('myfile.xacro');
However, the XACRO format is not supported. Instead, I need to use a plain URDF file. How can I get around this?


Sebastian Castro
Sebastian Castro 2018 年 10 月 5 日
編集済み: Sebastian Castro 2018 年 10 月 5 日
You can use the ROS xacro utility to convert your XACRO files to URDF before importing into MATLAB.
In a ROS enabled terminal, you can enter the following command, replacing the paths and names for your input and output files:
rosrun xacro xacro --inorder -o ~/myfile.urdf ~/myfile.xacro
You can then check the generated file to see if it's valid
check_urdf ~/myfile.urdf
If this step is successful, you can copy the URDF file and its dependent meshes somewhere accessible by MATLAB. Then, you can try import your robot as follows
>> robot = importrobot('myfile.urdf');
- Sebastian

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by