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

39 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Sebastian Castro
Sebastian Castro il 5 Ott 2018
Modificato: Sebastian Castro il 5 Ott 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

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by