Convert a xacro file
Some files have .xacro
as an extension.
What is Xacro?
[TODO brief explanation of xacro]
How to convert xacro
files?
how to convert xacro to URDF
Get a ROS docker container so you have the xacro utility
docker pull ros:melodic-robot
From the folder with the Xacro file in it - mount the docker
on mac:
docker run -it --volume ${PWD}:/usr/src/urdf_folder ros:melodic-robot
- Run the ros entry_point from within the docker container
/ros_entrypoint.sh
- Navigate to the usr folder and build the package
cd /usr
catkin_make
source devel/setup.bash
Navigate to the folder with the xacro in it
cd /usr/src/urdf_folder
Run the Xacro command (replace model with the model your converting)
rosrun xacro xacro model.urdf.xacro > model.urdf
To follow the Unity convention - be sure to rearrange the folders a little bit
Open up the urdf file: you should see a bunch of xml that highlights which geometry is connected and with which meshes etc. you need to ensure Unity is able to find the meshes appropriately in the directory tree
You should see some xml tags that look like this in your urdf.
<geometry>
<mesh filename="package://mir_description/meshes/visual/mir_100_base.stl"/>
</geometry>
make sure the .urdf file is at the top level folder and all paths to .stl files and associated geometry is beneath it with a relative path. For the above line we would expect the folder structure as follows:
```text robot_descriptioon |-- mir_description | |-- meshes | | |-- visual | | | |-- mir_100_base.stl | +-- mir_robot.urdf