ros / solidworks_urdf_exporter

SolidWorks to URDF Exporter
http://wiki.ros.org/sw_urdf_exporter
MIT License
370 stars 103 forks source link

Enabled to export mesh as 3dxml format #154

Open KenMat765 opened 5 months ago

KenMat765 commented 5 months ago

This PR allows the URDF exporter to output mesh files not only in STL format but also in 3DXML format. This enables the export of models with color information. This does not destroy the original functions.

This solves this issue. https://github.com/ros/solidworks_urdf_exporter/issues/114

image

Exported in STL (no color)

grayscale

Exported in 3dxml (with color)

color

How to convert to .dae format for ros

pip3 install scikit-robot -U
convert-urdf-mesh <URDF_PATH> --output <OUTPUT_URDF_PATH>
KenMat765 commented 3 months ago

I'm sorry for the late reply.

I've changed the bool to an enum of the export format. I've also added a section in the README to explain converting meshes to DAE

Although, I had a problem with the unit test.

Problem

When I exported ORIGINAL_3_DOF_ARM, the links of the arm were shown in the wrong position in Rviz. This might be related to these issues: https://github.com/ros/solidworks_urdf_exporter/issues/130, https://github.com/ros/solidworks_urdf_exporter/issues/116 I tried with the released code, but it still didn't work.

Temporary solution

When I created the same coordinates and axis of each link at the top-assembly, and selected those in the export menu instead of those in the sub-assemblies, the links were shown in the correct position. This worked on both STL and 3DXML formats.

As discussed in https://github.com/ros/solidworks_urdf_exporter/issues/116, I believe this issue can occur with SolidWorks later than 2018, but is this supposed to function correctly originally?

wrong position in STL correct position in STL correct position in 3DXML
ORIGINAL_3_DOF_ARM_STL ORIGINAL_3_DOF_ARM_STL_TOPASSEM ORIGINAL_3_DOF_ARM_3DXML_TOPASSEM

Environment

Solidworks version: 2022 urdf_exporter: 1.6.1