Repository Summary
Description | A Fusion 360 Script to export URDF for ROS2 |
Checkout URI | https://github.com/dheena2k2/fusion2urdf-ros2.git |
VCS Type | git |
VCS Version | master |
Last Updated | 2022-06-02 |
Dev Status | UNKNOWN |
Released | UNRELEASED |
Tags | ros2 fusion360 ros2-urdf |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
Basic_Robot_description | 0.0.0 |
package_name | 0.0.0 |
README
fusion2urdf ROS2
This repository is initially forked from syuntoku14/fusion2urdf and edited to export description package suited for ROS2 ament_python type build. Check out syuntoku14/fusion2urdf for converting fusion360 model to robot description package of ROS1.
This is an Add-In script for Fusion360 to export the 3D models to a robot description package which cocntains urdf, .stl, scripts, etc.. to make it executable in ROS2.
Installation
Run the following command in your shell.
Windows (In PowerShell)
cd <path to fusion2urdf-ros2>
Copy-Item ".\URDF_Exporter_Ros2\" -Destination "${env:APPDATA}\Autodesk\Autodesk Fusion 360\API\Scripts\" -Recurse
macOS (In bash or zsh)
cd <path to fusion2urdf-ros2>
cp -r ./URDF_Exporter_Ros2 "$HOME/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Scripts/"
What is this script?
This is a fusion 360 script to export urdf from fusion 360 directly.
This exports:
- .urdf file of your model
- .launch.py files to simulate your robot on gazebo and rviz
- .stl files of your model
Sample
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.
original model
Gazebo simulation of exported .urdf and .launch.py
-
center of mass
-
collision
-
inertia
Before using this script
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”.
Complex Kinematic Loops and Spherical joints (may be fixed later):
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)
File truncated at 100 lines see the full file