-
-
Notifications
You must be signed in to change notification settings - Fork 9
Convert Fusion360 model to Webots Proto model
manx52 edited this page Nov 29, 2024
·
10 revisions
related issue: https://github.com/utra-robosoccer/soccerbot/issues/218 all of this could probably be dockerized!
Step 1:
- download this fork locally and add utility to Fusion360 https://github.com/SpaceMaster85/fusion2urdf
- this utility will generate URDF and STL files from your Fusion model
- best practice:
- keep components that are rigidly attached in the separate assembly files, then in the main assembly file use the subassemblies. The main assembly will have mostly rotational joints, the utility will only pick up the rotational joints while others will be ignored, which is good because we want fewer joints in our final urdf
- add hand markers (small rectangular prisms) at the end of the hand
- make sure bez is facing x direction
- origin should be in the middle of the torso, y-axis going through the arms
- the order of links matters! run pybullet pytest to see in what order pybullet is reading the links. That's what the control code expects. If it's not done in fusion, then the links have to be manually moved around in the URDF file
- You need to generate project in Meters (m) and Millimeters (mm). m is needed for the urdf files, Take the smaller files needed for STL files
Step 2:
- the generated collision mesh is complex
- to simplify we can use this script: https://github.com/bit-bots/simplify_urdf_collision
- the collision will be approximated to a box which will run much faster in simulation
- the script will output URDF file with modified bounding boxes
python3 simplify_urdf_collision/src/simplify_urdf_collision/simplify.py -r soccerbot/bez2_description/urdf/bez2.urdf soccerbot/bez2_description/urdf/bez2_simple.urdf
Step 3:
- simplify STL files so that simulation can render robot faster
- use open3d for that: http://www.open3d.org/docs/release/getting_started.html
- can also use this: https://github.com/MyMiniFactory/Fast-Quadric-Mesh-Simplification
Step 4:
- generate proto model
- use: https://github.com/cyberbotics/urdf2webots
- command
python3 -m urdf2webots.importer --input=bez2_description/urdf/bez2_simple.urdf --output=bez2_description/urdf/Bez2.proto
Step 5:
- Verify that the STL selected fits the visuals of the urdf
- Run
main.py
in the scripts folder to run all of the automation scripts
-
sudo snap install blender --channel=3.3lts/stable --classic
-
- download
https://github.com/dfki-ric/phobos/releases
- download
-
- https://github.com/dfki-ric/phobos/wiki/Installation follow to install addons for section 2
-
- add
"pkg_resources": "setuptools",
to line 47 in~/.config/blender/3.3/scripts/addons/phobos/__init__.py
- add
- https://github.com/dfki-ric/phobos/commit/757d7b58b41240ea4aa54e20ddd1665072e6da21#diff-7bc1bbb54dd9fdd183b2fa8fb6b3e7c6634ab992a88e5ff671cf6074fef92933R47
-
- set your models folder to
/home/manx52/catkin_ws/src/soccerbot/soccer_description/
- set your models folder to