docs.unity3d.com
    Warning

    Warning: Unity Simulation is deprecated as of December 2023, and is no longer available.

    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

    1. Get a ROS docker container so you have the xacro utility

      docker pull ros:melodic-robot
      
    2. 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
    
    1. Run the ros entry_point from within the docker container
    /ros_entrypoint.sh
    
    1. Navigate to the usr folder and build the package
    cd /usr
    catkin_make
    source devel/setup.bash
    
    1. Navigate to the folder with the xacro in it

      cd /usr/src/urdf_folder
      
    2. Run the Xacro command (replace model with the model your converting)

      rosrun xacro xacro model.urdf.xacro >  model.urdf
      
    3. 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

    Copyright © 2023 Unity Technologies
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX.