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

40 vues (au cours des 30 derniers jours)
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?

Réponse acceptée

Sebastian Castro
Sebastian Castro le 5 Oct 2018
Modifié(e) : Sebastian Castro le 5 Oct 2018
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

Plus de réponses (0)

Catégories

En savoir plus sur Robotics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by