Install uv, then run:
uv sync --locked
uv run pytest
uv run python -m tools.mujoco_check Example/Basic_Robot_descriptionTo open the interactive MuJoCo viewer on a desktop with a graphical display:
uv run python -m tools.mujoco_check Example/Basic_Robot_description --viewerThe viewer starts with fresh simulation state after the headless check. The robot base remains fixed. Close the viewer window to exit.
For a visible motion demonstration of the bundled robot:
uv run python -m tools.mujoco_check Example/Basic_Robot_description --demoThis adds two velocity actuators and red/blue wheel markers to an in-memory demo model. Both wheels are driven at 2 radians/second (opposite joint signs because their exported axes point in opposite directions). The base stays fixed; this is a wheel-motion demonstration, not a driving simulation. Contact is disabled in this demo because the legacy meshes produce interfering contacts; the regular validation keeps contacts enabled. In the viewer's Control panel, adjust the two drive sliders between -5 and 5 radians/second to change speed or direction. These additions do not modify the exported URDF or its meshes.
uv manages the standalone development and simulation environment. Fusion still
runs URDF_Exporter using its own Python interpreter and supplies adsk; do not
install the development dependencies into Fusion. The lockfile records the tested
dependency versions. No ROS installation, GPU, or display is needed for these tests.
To check your own exported package and save an expanded URDF:
uv run python -m tools.mujoco_check /path/to/my_robot_description \
--source urdf/my_robot.xacro --steps 1000 \
--urdf-output build/my_robot.urdf--source is relative to the package directory and also accepts a plain .urdf.
It can be omitted when the package contains one robot Xacro plus materials.xacro.
The tool expands Xacro, resolves references to the selected ROS package locally,
checks mesh existence, compiles the URDF in MuJoCo, and steps the simulation while
checking for warnings and non-finite positions, velocities, or accelerations.
External ROS package references are rejected with an error. Saved mesh paths are
absolute and refer to the original package: keep that package in place, or resolve
the paths again after moving to another machine. The saved URDF contains no added
MuJoCo compiler settings and can serve as input for a separate Isaac Sim import
test; Isaac Sim compatibility has not yet been tested.
The bundled fixture currently compiles into three robot bodies, two joints, and six geometries and runs 1,000 steps (two simulated seconds). The tests also check missing-mesh diagnostics and rejection of invalid inertia. They test existing exported output, not Fusion extraction: an end-to-end export still requires Fusion on Windows or macOS. GitHub Actions runs the same checks on Linux.
This is an import and numerical smoke test. MuJoCo fixes the URDF root to the world; this test adds no free base, floor, actuators, or controllers. It therefore does not establish locomotion, contact accuracy, or agreement with the original CAD model. MuJoCo uses convex hulls for mesh collisions, so detailed concave STL collision shapes may behave differently from their CAD geometry. The test keeps the exported mass/inertia and disables automatic inertia balancing; it does not repair bad physical properties to force an import to succeed.
See the MuJoCo compiler reference for URDF import settings and mesh collision behavior.
To update dependencies deliberately, run uv lock --upgrade, then rerun the tests
and review the lockfile changes.
This is a fork of the original syuntoku14/fusion2urdf repository.
- Python 3.12 Compatibility: Replaced the deprecated
distutils.dir_utilwithshutilfor directory operations, ensuring compatibility with Python 3.12 used by Fusion 360. - Error Handling: Improved error handling to prevent
FileExistsErrorwhen copying directories if they already exist. - Directory Operations: All directory copying is now done using
shutil.copytree.
- The script is updated for use with Python 3.12, as Fusion 360 no longer supports
distutilsin versions above Python 3.10.
-
2021/01/09: Fix xyz calculation.
- If you see that your components move arround the map center in rviz try this update
- More Infos see: https://forums.autodesk.com/t5/fusion-360-api-and-scripts/difference-of-geometryororiginone-and-geometryororiginonetwo/m-p/9837767
-
2020/11/10: README fix
- MacOS Installation command fixed in README
- Date format unified in README to yyyy/dd/mm
- Shifted Installation Upwards for better User Experience and easier to find
-
2020/01/04: Multiple updates:
- no longer a need to run a bash script to convert stls
- some cleanup around joint and transmission generation
- defines a sample material tag instead of defining a material in each link
- fusion2urdf now generates a self-contained ROS {robot_name}_description package
- now launched by roslaunch {robot_name}_description display.launch
- changed fusion2urdf output from urdf to xacro for more flexibility
- separate out material, transmissions, gazebo elements to separate files
-
2018/20/10: Fixed functions to generate launch files
-
2018/25/09: Supports joint types "Rigid", "Slider" & Supports the joints' limit(for "Revolute" and "Slider").
-
2018/19/09: Fixed the bugs about the center of the mass and the inertia.
Run the following command in your shell.
cd <path to fusion2urdf>
Copy-Item ".\URDF_Exporter\" -Destination "${env:APPDATA}\Autodesk\Autodesk Fusion 360\API\Scripts\" -Recursecd <path to fusion2urdf>
cp -r ./URDF_Exporter "$HOME/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Scripts/"This is a fusion 360 script to export urdf from fusion 360 directly.
This exports:
- .urdf file of your model
- .launch and .yaml files to simulate your robot on gazebo
- .stl files of your model
The following test model doesn't stand upright because the z axis is not upright in default fusion 360. Make sure z axis is upright in your fusion 360 model if you want.
- center of mass
- collision
- inertia
Before using this script, make sure that your model has all the "links" as components. You have to define the links by creating corresiponding components. For example, this model(https://grabcad.com/library/spotmini-robot-1) is not supported unless you define the "base_link".
In addition to that, you should be careful when define your joints. The parent links should be set as Component2 when you define the joint, not as Component1. For example, if you define the "base_link" as Component1 when you define the joints, an error saying "KeyError: base_link__1" will show up.
Also, make sure components of your model has only bodies. Nested components are not supported. For example, this works:
but this doesn't work since the "face (3):1" component contains other components. A component must contain only bodies:
Sometimes this script exports abnormal urdf without any error messages. In that case, the joints should have problems. Redefine the joints and run again.
In addition to that, make sure that this script currently supports only "Rigid", "Slider" and "Revolute".
DO NOT use Fusion 360's inbuilt joint editor dialouge for positioning joints
For example, @rohit-kumar-j had this complicated robot to assemble. There are over.. some 50 joints in all, including some forming loops within the structure like a 4-bar mechanism, also called kinematic loops.
As you can see below, when fusion initailly forms joints, it might not align where you want it to align to. In the image below, the cylinder's cap side doesn't exaclty coincide with the position of the pin where it needs to be join. The red arrow shows the mismatch in initial joint positioning by fusion.
If you were to manually drag the parts and align them as shown below, it would cause cascading problems with the visual and collision properties of certain links.
Below you can see one of the cylinders is mismatched as compared to the others (red and grey colors are cylinders) (The below urdf is visualized in pybullet)
See Also: Similar to this issue, but only for a few axes here (turns out there was a fusion API change back then, and the exporter wasn't yet updated See this commit, but it now is)
The fix for this is to leave Fusion's joint controls unedited and form joints for the robot joints (See below)
A similar issue with another set of joints at the ankle was fixed by following the above fromat. Here is the video
For spherical joints, it is better to keep them revolute and define the joints as spherical, later in the generated URDF(provided the urdf parser in your visualizer/physics engine(gazebo,webots,pybullet,mujoco,etc) supports spherical joints, in pybullet it does). The ankle joint below has 4 spherical joints and only two of them were defined as revolute while exporting from fusion 360. The other 2 spherical joints were created in pybullet using pybullet's inbuilt functions for creating kinematic loops.(see the gif below)
For preplanning the component placement when working/assembling your own robot. It is recomended to have separate names for components and save individual components in a separate folder, create a back up and, break link with the original. This folder can be later deleted after genearating the urdf. See Issue #51 for problem with "copy-paste" vs "copy-paste new".
As an example, I'll export a urdf file from this cool fusion360 robot-arm model(https://grabcad.com/library/industrial-robot-10). This was created by sanket patil
Run the installation command in your shell.
Click ADD-INS in fusion 360, then choose fusion2urdf.
This script will change your model. So before running it, copy your model to backup.
Run the script and wait a few seconds(or a few minutes). Then a folder dialog will show up. Choose where you want to save the urdf (A folder "Desktop/test" is chosen in this example"). Maybe some error will occur when you run the script. Fix them according to the instruction. In this case, something wrong with joint "Rev 7". Probably it can be solved by just redefining the joint.
You must define the base component. Rename the base component as "base_link".
In the above image, base_link is grounded. Right-click it and click "Unground".
Now you can run the script. Let's run the script. Choose the folder to save and wait for a few seconds. You will see many "old_components" in the components field, please ignore them.
You have successfully exported the urdf file. Also, you got .stl files in the "Desktop/test/mm_stl" repository. This will be required at the next step. The existing fusion CAD file is no more needed. You can delete it.
The folder "Desktop/test" will be required in the next step. Move them into your ros environment.
Place the generated _description package directory in your own ROS workspace. "catkin_ws" is used in this example. Then, run catkin_make in catkin_ws.
cd ~/catkin_ws/
catkin_make
source devel/setup.bashNow you can see your robot in rviz. You can see it by the following command.
roslaunch (whatever your robot_name is)_description display.launchIf you want to simulate your robot on gazebo, just run
roslaunch (whatever your robot_name is)_description gazebo.launchEnjoy your Fusion 360 and ROS life!
@misc{toshinori2020fusion2urdf,
author = {Toshinori Kitamura},
title = {Fusion2URDF},
year = {2020},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/syuntoku14/fusion2urdf}}
}










