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

조회 수: 39 (최근 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개)

카테고리

Help CenterFile Exchange에서 Robotics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by