solidworks_urdf_exporter icon indicating copy to clipboard operation
solidworks_urdf_exporter copied to clipboard

Enabled to export mesh as 3dxml format

Open KenMat765 opened this issue 1 year ago • 1 comments

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 avatar Apr 26 '24 05:04 KenMat765

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

KenMat765 avatar Jun 04 '24 12:06 KenMat765

@brawner I believe this PR could be highly beneficial for all SolidWorks and ROS users. I would appreciate it if you could kindly review it.

iory avatar Oct 15 '24 06:10 iory

@iory I believe this PR is still waiting for a unit test

brawner avatar Oct 15 '24 18:10 brawner

I have modified all the points you mentioned:

  • Converted bool to enum / if to switch
  • Added instructions for converting to .dae in the README
  • Added unit tests

I would greatly appreciate it if you could kindly review the changes.

KenMat765 avatar Oct 17 '24 12:10 KenMat765