-
Notifications
You must be signed in to change notification settings - Fork 0
Release/v1.1 #2
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
Merged
Merged
Release/v1.1 #2
Changes from 16 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
73a5a19
Add data.hpp
pzhu-flexiv de36a81
Add user_node.hpp
pzhu-flexiv cb32b60
Add Ubuntu x86_64 lib
pzhu-flexiv 1b9f018
Add thirdparty build scripts
pzhu-flexiv 3ae7039
Add cmake config files
pzhu-flexiv a5a62a8
Add root cmakelists
pzhu-flexiv 21a83f1
Add example
pzhu-flexiv ccb20e9
Fix backward compatibility
pzhu-flexiv ed55e97
Fix UserNode::connected()
pzhu-flexiv 8811a70
Add print
pzhu-flexiv b129eb8
Add error print
pzhu-flexiv 1b8e83b
Fix backward compatibility
pzhu-flexiv 3279cf0
Add python example
pzhu-flexiv 67a68b5
Complete README
pzhu-flexiv c0679a3
Merge branch 'release/v1.1' of https://github.com/flexivrobotics/flex…
pzhu-flexiv a7205d2
Add github workflows
pzhu-flexiv 01734d1
Remove unneeded script
pzhu-flexiv ce5e7b7
Merge branch 'release/v1.1' of https://github.com/flexivrobotics/flex…
pzhu-flexiv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| name: CMake | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
| BUILD_TYPE: Release | ||
|
|
||
| jobs: | ||
| build-ubuntu-22: | ||
| # GitHub-hosted Ubuntu 22.04 runner | ||
| runs-on: ubuntu-22.04 | ||
| # Use shared steps | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: ./.github/workflows/shared_steps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: "Shared Build Steps" | ||
| runs: | ||
| using: "composite" | ||
| # Note: working directory will be reset to the repo root for each new step | ||
| steps: | ||
| # Build and install all dependencies to RDK installation directory. | ||
| - name: Build and install dependencies | ||
| shell: bash | ||
| run: | | ||
| pwd | ||
| cd thirdparty | ||
| bash build_and_install_dependencies.sh ~/sim_plugin_install 4 | ||
|
|
||
| # Configure CMake, then build and install flexiv_rdk library to RDK installation directory. | ||
| - name: Build and install library | ||
| shell: bash | ||
| run: | | ||
| pwd | ||
| mkdir -p build && cd build | ||
| cmake .. -DCMAKE_INSTALL_PREFIX=~/sim_plugin_install | ||
| cmake --build . --target install --config Release | ||
|
|
||
| # Find and link to flexiv_rdk library, then build all example programs. | ||
| - name: Build examples | ||
| shell: bash | ||
| run: | | ||
| pwd | ||
| cd example | ||
| mkdir -p build && cd build | ||
| cmake .. -DCMAKE_PREFIX_PATH=~/sim_plugin_install | ||
| cmake --build . --config Release -j 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| cmake_minimum_required(VERSION 3.16.3) | ||
|
|
||
| # =================================================================== | ||
| # PROJECT SETUP | ||
| # =================================================================== | ||
| project(flexiv_sim_plugin VERSION 1.1.0) | ||
|
|
||
| # Configure build type | ||
| if(NOT CMAKE_BUILD_TYPE) | ||
| set(CMAKE_BUILD_TYPE Release CACHE STRING "CMake build type" FORCE) | ||
| endif() | ||
| set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Release" "Debug" "RelWithDebInfo") | ||
|
|
||
| # Set static library according to platform | ||
| message(STATUS "OS: ${CMAKE_SYSTEM_NAME}") | ||
| message(STATUS "Processor: ${CMAKE_SYSTEM_PROCESSOR}") | ||
| if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") | ||
| if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64") | ||
| set(SIM_PLUGIN_STATIC_LIB "libflexiv_sim_plugin.x86_64-linux-gnu.a") | ||
| else() | ||
| message(FATAL_ERROR "Linux with ${CMAKE_SYSTEM_PROCESSOR} processor is currently not supported.") | ||
| endif() | ||
| elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||
| message(FATAL_ERROR "macOS is currently not supported.") | ||
| elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||
| message(FATAL_ERROR "Windows is currently not supported.") | ||
| endif() | ||
|
|
||
| # =================================================================== | ||
| # PROJECT DEPENDENCIES | ||
| # =================================================================== | ||
| # Threads | ||
| set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
| find_package(Threads REQUIRED) | ||
| if(Threads_FOUND) | ||
| message(STATUS "Found Threads: HAVE_PTHREAD = ${THREADS_HAVE_PTHREAD_ARG}") | ||
| endif() | ||
|
|
||
| # spdlog | ||
| find_package(spdlog REQUIRED) | ||
| if(spdlog_FOUND) | ||
| message(STATUS "Found spdlog: ${spdlog_DIR}") | ||
| endif() | ||
|
|
||
| # Fast-DDS (Fast-RTPS) | ||
| find_package(fastrtps 2.6.7 REQUIRED) | ||
| if(fastrtps_FOUND) | ||
| message(STATUS "Found fastrtps: ${fastrtps_DIR}") | ||
| endif() | ||
|
|
||
| # =================================================================== | ||
| # CREATE LIBRARY | ||
| # =================================================================== | ||
| # Create an INTERFACE library with no source file to compile | ||
| add_library(${PROJECT_NAME} INTERFACE) | ||
|
|
||
| # Create an alias of the library using flexiv namespace, | ||
| # to imitate the install target which uses flexiv namespace. | ||
| add_library(flexiv::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) | ||
|
|
||
| target_include_directories(${PROJECT_NAME} INTERFACE | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
| $<INSTALL_INTERFACE:include> | ||
| ) | ||
|
|
||
| target_link_libraries(${PROJECT_NAME} INTERFACE | ||
| ${CMAKE_CURRENT_SOURCE_DIR}/lib/${SIM_PLUGIN_STATIC_LIB} | ||
| Threads::Threads | ||
| spdlog::spdlog | ||
| fastrtps | ||
| ) | ||
|
|
||
| # Use moderate compiler warning option | ||
| if(CMAKE_HOST_UNIX) | ||
| target_compile_options(${PROJECT_NAME} INTERFACE -Wall -Wextra) | ||
| else() | ||
| target_compile_options(${PROJECT_NAME} INTERFACE /W1) | ||
| endif() | ||
|
|
||
| # Install the INTERFACE library | ||
| include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FlexivInstallLibrary.cmake) | ||
| FlexivInstallLibrary() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| # This macro will install ${PROJECT_NAME} to ${CMAKE_INSTALL_PREFIX} when running make install | ||
| # | ||
| # FlexivInstallLibrary() will install all subfolders of ${CMAKE_CURRENT_SOURCE_DIR}/include | ||
| # FlexivInstallLibrary(install_directories) will install only the specified install_directories | ||
| # | ||
| # Requirements: | ||
| # 1. project structure should resemble: | ||
| # project | ||
| # - README.md | ||
| # - CMakeLists.txt that calls this macro | ||
| # - cmake/${PROJECT_NAME}-config.cmake.in | ||
| # - include/subfolder/*.h or *.hpp | ||
| # 2. build the library using cmake target functions | ||
| # - add_library(${PROJECT_NAME} ...) before calling this macro | ||
| # - target_include_directories(${PROJECT_NAME} ...) | ||
| # - target_link_libraries(${PROJECT_NAME} ...) | ||
| # - target_compile_features(${PROJECT_NAME} ...) | ||
| # - target_compile_options(${PROJECT_NAME} ...) | ||
| # | ||
| # Installed files: | ||
| # - include/subfolder/*.h or *.hpp | ||
| # - lib/lib{PROJECT_NAME} | ||
| # - lib/cmake/{PROJECT_NAME}/ | ||
|
|
||
| macro(FlexivInstallLibrary) | ||
| # copy the executables and libraries to the CMAKE_INSTALL_PREFIX DIRECTORY | ||
| # GNUInstallDirs will set CMAKE_INSTALL* to be the standard relative paths | ||
| include(GNUInstallDirs) | ||
| install(TARGETS ${PROJECT_NAME} | ||
| EXPORT "${PROJECT_NAME}-targets" | ||
| RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
| LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| ) | ||
|
|
||
| if(${ARGC} EQUAL 0) | ||
| # install all subfolders of ${CMAKE_CURRENT_SOURCE_DIR}/include | ||
| file(GLOB install_directories ${CMAKE_CURRENT_SOURCE_DIR}/include/*) | ||
| foreach(install_directory ${install_directories}) | ||
| if(IS_DIRECTORY ${install_directory}) | ||
| install(DIRECTORY ${install_directory} | ||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
| FILES_MATCHING | ||
| PATTERN "*.h" | ||
| PATTERN "*.hpp" | ||
| ) | ||
| endif() | ||
| endforeach() | ||
| elseif(${ARGC} EQUAL 1) | ||
| # install specified directories only | ||
| foreach(install_directory ${ARGV0}) | ||
| install(DIRECTORY ${install_directory} | ||
| DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
| FILES_MATCHING | ||
| PATTERN "*.h" | ||
| PATTERN "*.hpp" | ||
| ) | ||
| endforeach() | ||
| else() | ||
| message(FATAL_ERROR "FlexivInstallLibrary take 0 or 1 argument, but given ${ARGC}") | ||
| endif() | ||
|
|
||
| # Create a *config-version.cmake file so that find_package can have a version specified | ||
| include(CMakePackageConfigHelpers) | ||
| write_basic_package_version_file( | ||
| "${PROJECT_NAME}-config-version.cmake" | ||
| VERSION ${PROJECT_VERSION} | ||
| COMPATIBILITY AnyNewerVersion | ||
| ) | ||
|
|
||
| # copy the *-targets.cmake file to the CMAKE_INSTALL_PREFIX directory | ||
| install(EXPORT "${PROJECT_NAME}-targets" | ||
| FILE "${PROJECT_NAME}-targets.cmake" | ||
| NAMESPACE "flexiv::" | ||
| DESTINATION "lib/cmake/${PROJECT_NAME}" | ||
| ) | ||
|
|
||
| # copy the *.-config file to the CMAKE_INSTALL_PREFIX directory. This will specify the dependencies. | ||
| configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}-config.cmake.in" "${PROJECT_NAME}-config.cmake" @ONLY) | ||
| install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" | ||
| "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" | ||
| DESTINATION "lib/cmake/${PROJECT_NAME}" | ||
| ) | ||
|
|
||
| # Use the CPack Package Generator | ||
| set(CPACK_PACKAGE_VENDOR "Flexiv") | ||
| set(CPACK_PACKAGE_CONTACT "[email protected]") | ||
| set(CPACK_PACKAGE_DESCRIPTION "Flexiv Sim Plugin") | ||
| set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) | ||
| set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) | ||
| set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) | ||
| set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") | ||
| set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") | ||
| include(CPack) | ||
| endmacro() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| include(CMakeFindDependencyMacro) | ||
|
|
||
| # Find dependency | ||
| set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
| find_dependency(Threads REQUIRED) | ||
| find_dependency(spdlog REQUIRED) | ||
| find_dependency(fastrtps 2.6.7 REQUIRED) | ||
|
|
||
| # Add targets file | ||
| include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.