From 9f2aa9bfbe09e70afee4d813196b1178fb5f70f5 Mon Sep 17 00:00:00 2001 From: Mattia Fussi Date: Tue, 12 Nov 2024 14:22:00 +0100 Subject: [PATCH 1/3] Add vcpkg manifest mode config --- CMakeLists.txt | 5 +++++ vcpkg.json | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 vcpkg.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e30c58..de0bf10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,11 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_C_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF) +# Automatically check for installation of dependencies with vcpkg +# When ON, vcpkg install is ran every time cmake is ran +option(VCPKG_MANIFEST_MODE ON) +option(VCPKG_MANIFEST_INSTALL ON) + if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.19) cmake_policy(SET CMP0111 NEW) endif() diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..00b5137 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,16 @@ +{ + "name": "creo2urdf", + "homepage": "https://github.com/icub-tech-iit/creo2urdf", + "documentation": "https://icub-tech-iit.github.io/creo2urdf/doc/doxygen/doc/html/index.html", + "dependencies": [ + "eigen3", + "yaml-cpp", + "libxml2", + "rapidcsv", + { + "name": "idyntree", + "version>=": "12.4.0" + } + ], + "builtin-baseline": "7a57b42f959ad138a5283477fe2e6c97a7cb852f" +} From 4c085c1cd2b913a1c3e7609ed7ace288d8355069 Mon Sep 17 00:00:00 2001 From: Mattia Fussi Date: Thu, 14 Nov 2024 10:08:14 +0100 Subject: [PATCH 2/3] Add vcpkg triplet and remove specific idyntree version --- CMakeLists.txt | 8 ++++++-- vcpkg.json | 7 +------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de0bf10..fa79f79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,11 +37,15 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_C_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF) -# Automatically check for installation of dependencies with vcpkg -# When ON, vcpkg install is ran every time cmake is ran +# Set manifest mode to use vcpkg.json to resolve dependencies option(VCPKG_MANIFEST_MODE ON) + +# When ON, vcpkg install is ran every time configure is ran option(VCPKG_MANIFEST_INSTALL ON) +# Force use of following triplet since thats the only config supported by Creo +set(VCPKG_TARGET_TRIPLET "x64-windows-static-md") + if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.19) cmake_policy(SET CMP0111 NEW) endif() diff --git a/vcpkg.json b/vcpkg.json index 00b5137..c265459 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -7,10 +7,5 @@ "yaml-cpp", "libxml2", "rapidcsv", - { - "name": "idyntree", - "version>=": "12.4.0" - } - ], - "builtin-baseline": "7a57b42f959ad138a5283477fe2e6c97a7cb852f" + "idyntree"] } From d095e8c6546ce551fdd947ce8d83ce9d2ac38699 Mon Sep 17 00:00:00 2001 From: Mattia Fussi Date: Thu, 14 Nov 2024 12:06:38 +0100 Subject: [PATCH 3/3] Add suggested changes --- CMakeLists.txt | 4 ++-- README.md | 29 ++++++++++++++--------------- vcpkg.json | 7 ++++++- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa79f79..cbc0947 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,10 +38,10 @@ set(CMAKE_C_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF) # Set manifest mode to use vcpkg.json to resolve dependencies -option(VCPKG_MANIFEST_MODE ON) +option(VCPKG_MANIFEST_MODE "Enable manifest mode to use vcpkg.json" ON) # When ON, vcpkg install is ran every time configure is ran -option(VCPKG_MANIFEST_INSTALL ON) +option(VCPKG_MANIFEST_INSTALL "Install dependencies in manifest mode" ON) # Force use of following triplet since thats the only config supported by Creo set(VCPKG_TARGET_TRIPLET "x64-windows-static-md") diff --git a/README.md b/README.md index ee00ad6..40e480e 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,12 @@ Generate URDF model from CREO Parametric mechanisms. **Since it is under development, we cannot guarantee that the user interface of `creo2urdf` will not implement breaking changes. Be aware of this if you start using the code contained in this repository** ## CREO Parametric versions supported and tested -- `9.0.2` +- `9.0.8.0` ## Assumptions & limitations -- In order to export the urdf of the robot, the relative CREO mechanism has to conform to [these guidelines](https://github.com/icub-tech-iit/cad-libraries/wiki/Prepare-PTC-Creo-Mechanism-for-URDF). -- Subassemblies are **NOT** yet supported. -- The joints are in position 0. +- To export the urdf of the robot, the CREO mechanism has to follow [these guidelines](https://github.com/icub-tech-iit/cad-libraries/wiki/Prepare-PTC-Creo-Mechanism-for-URDF). +- The joints are assumed to be in position 0. - Right now it can handle only **REVOLUTE**, **PRISMATIC** and **FIXED** joints. ## Installation from binaries @@ -19,12 +18,12 @@ Generate URDF model from CREO Parametric mechanisms. > Users are encountering issues using the dll, see https://github.com/icub-tech-iit/creo2urdf/issues/84 > [!NOTE] -> The dll provided has not been unlocked, this means that for using the Toolkit licence is required +> The provided dll has not been unlocked, therefore the Toolkit licence is required for using it > Download `creo2urdf.zip` from the assets of the [latest release](https://github.com/icub-tech-iit/creo2urdf/releases/latest), and extract it in the folder you like.
-Follow the [`Usage`](https://github.com/icub-tech-iit/creo2urdf/tree/master#usage) section instructions for completing the installation.
This archive contains the dll of the plugin and the `text` folder for running it.
+Follow the [`Usage`](https://github.com/icub-tech-iit/creo2urdf/tree/master#usage) section instructions for completing the installation.
## Installation from sources @@ -34,16 +33,16 @@ Right now the `creo2urdf` plugin needs its dependencies to be compiled and linke - Download [vcpkg](https://github.com/microsoft/vcpkg): `git clone https://github.com/microsoft/vcpkg` - Bootstrap vcpkg: `.\vcpkg\bootstrap-vcpkg.bat` -- Run `[path to vcpkg]/vcpkg install --triplet x64-windows-static-md eigen3 yaml-cpp rapidcsv libxml2 assimp idyntree` ### Build `creo2urdf` -- Export `CREO9_INSTALL_PATH` pointing to the Creo9 installation folder, e.g. `C:\Program Files\PTC\Creo 9.0.2.0\Common Files` -- Pass `-DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static-md` to the creo2urdf compilation. +- Export `CREO9_INSTALL_PATH` pointing to the Creo9 installation folder, e.g. `C:\Program Files\PTC\Creo 9.0.8.0\Common Files` +- Pass `-DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake` to the creo2urdf compilation. +- Run the CMake `configure` step, then build the project: + - Within Visual Studio, you can do: **Project > Configure creo2urdf**, then **Build > Build all** For those who use the CMake integration in Visual Studio, the `-DCMAKE_TOOLCHAIN_FILE` option should not be passed to `CMake command arguments`. Instead, the `vcpkg.cmake` file path must be passed in `CMake toolchain file`. - ## Usage - Put in your CREO working directory the `protk.dat` that is automatically generated by CMake in `${PROJECT_BINARY_DIR}` (e.g. `C:\Users\ngenesio\icub-tech-iit\creo2urdf\build\x64-Release`). @@ -54,16 +53,16 @@ name creo2urdf Startup dll Allow_stop True Delay_start False -exec_file /path/to/creo2urdf.dll -text_dir /path/to/creo2urdf/src/creo2urdf/text +exec_file \path\to\creo2urdf.dll +text_dir \path\to\creo2urdf\src\creo2urdf\text END ``` -- Open CREO Parametric and the first time you will need to accecpt to register the plugin -- Load the mechanism of which you want to export the urdf +- Open CREO Parametric: on the first time, you will need to accept the plugin registration +- Load the assembly mechanism of which you want to export the urdf - Press the button -- Select a yaml and csv configuration files with a format explained in the following sections, and the folder where the urdf and the meshes will be saved. +- Select a yaml and csv configuration files with a format explained in the following sections, and the folder where both the urdf the meshes will be saved. ### Test your installation diff --git a/vcpkg.json b/vcpkg.json index c265459..a5c943a 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -7,5 +7,10 @@ "yaml-cpp", "libxml2", "rapidcsv", - "idyntree"] + { + "name": "idyntree", + "version>=": "12.4.0" + } + ], + "builtin-baseline": "21bd538cbc3aa687d920d9399befb6c987c87942" }