Ask Your Question
0

Create a urdf/xacro file from model of FreeCAD

asked 2020-06-17 07:13:20 -0500

Alessandro Melino gravatar image

Hello everyone.

I have created the following model in FreeCAD of a robot with differencial cinematic system (back wheels do the traction):

Model in FreeCAD

I would like to create the urdf/xacro files to see it navigating in Rviz from this model, but I don't know if it is possible or I have to write theese files by myself.

I am using ROS melodic version.

Any help I would be very grateful.

Best regards. Alessandro

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2020-06-19 07:02:39 -0500

Alessandro Melino gravatar image

Hello, I post a new autoanswer because finally I found a solution.

  1. In FreeCAD export the model as Collada (.dae).
  2. Copy the file into your package, in a folder called "meshes".
  3. Create an urdf file with the following content:

<robot name="your_robot_name"> <link name="base_link"> <visual> <origin rpy="0 0 0" xyz="0 0 0"/> <geometry> <mesh filename="package://your_package/meshes/model.dae"/> </geometry> </visual> </link>

(I don´t know why the format of the code is wrong)

  1. Launch the urdf file with robot_state_publisher package as normal.

With this I can use my model of FreeCAD to see it in rviz, without create a complex urdf file.

Best regards. Alessandro

edit flag offensive delete link more

Comments

This gets you a static mesh. It visualises in RViz yes, but that's not what people typically want when they ask how to convert <insert CAD program here> to URDF.

gvdhoorn gravatar image gvdhoorn  ( 2020-06-19 15:55:57 -0500 )edit

Yes, I know is a static mesh, but for my application is enough because my robot just have the wheels as mobile part, so I just want to visualize the robot. Thank you for the information by the way.

Alessandro Melino gravatar image Alessandro Melino  ( 2020-06-22 03:41:40 -0500 )edit
1

answered 2020-06-17 11:16:45 -0500

David Lu gravatar image

I'm unaware of any solutions using FreeCAD specifically, but you can check out this tutorial which links to this package. A similar approach could be made with FreeCAD.

edit flag offensive delete link more

Comments

Thank you very much for your answer. I will try and if it works I mark the answer as correct.

Best regards.

Alessandro Melino gravatar image Alessandro Melino  ( 2020-06-18 04:36:21 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2020-06-17 07:13:20 -0500

Seen: 1,106 times

Last updated: Jun 19 '20