Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled to export mesh as 3dxml format #154

Merged
merged 6 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ See the [ROS Wiki](http://wiki.ros.org/sw_urdf_exporter) and associated [tutoria
1. Ensure `Configuration:` is set to `Debug`
1. Ensure `Start external program:` is pointing to the SolidWorks executable. For example `C:\Program Files\SOLIDWORKS Corp\SOLIDWORKS\SLDWORKS.exe`

## Converting mesh format from 3dxml to dae

Executing the following command will convert the format of the exported mesh from 3DXML to DAE, and rewrite the URDF, allowing you to display colored meshes in visualization tools like RViz:

```bash
pip3 install scikit-robot -U
convert-urdf-mesh <URDF_PATH> --output <OUTPUT_URDF_PATH>
```

### Trouble Shooting

1. `AxImp.exe` error - Check the installation of the .Net Tools. If there is no error, install the Windows 10 SDK.
Expand Down
13 changes: 8 additions & 5 deletions SW2URDF/Test/TestExportHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ public TestExportHelper(SWTestFixture fixture) : base(fixture)
}

[Theory]
[InlineData("3_DOF_ARM", 4)]
[InlineData("4_WHEELER", 5)]
[InlineData("ORIGINAL_3_DOF_ARM", 4)]
public void TestExportRobot(string modelName, int expNumLinks)
[InlineData("3_DOF_ARM", 4, MeshExportFormat.STL)]
[InlineData("4_WHEELER", 5, MeshExportFormat.STL)]
[InlineData("ORIGINAL_3_DOF_ARM", 4, MeshExportFormat.STL)]
[InlineData("3_DOF_ARM", 4, MeshExportFormat.THREEDXML)]
[InlineData("4_WHEELER", 5, MeshExportFormat.THREEDXML)]
[InlineData("ORIGINAL_3_DOF_ARM", 4, MeshExportFormat.THREEDXML)]
public void TestExportRobot(string modelName, int expNumLinks, MeshExportFormat meshExportFormat)
{
ModelDoc2 doc = OpenSWDocument(modelName);
ExportHelper helper = new ExportHelper(SwApp);
Expand All @@ -28,7 +31,7 @@ public void TestExportRobot(string modelName, int expNumLinks)
LinkNode baseNode = ConfigurationSerialization.LoadBaseNodeFromModel(doc, out bool error);
Assert.False(error);
helper.CreateRobotFromTreeView(baseNode);
helper.ExportRobot(true);
helper.ExportRobot(true, meshExportFormat);
Assert.NotNull(helper.URDFRobot);
Assert.Equal(expNumLinks, CommonSwOperations.GetCount(helper.URDFRobot.BaseLink));
Assert.True(SwApp.CloseAllDocuments(true));
Expand Down
Loading