From d42fc6a46e0b075eab639033bb61be6eed32000d Mon Sep 17 00:00:00 2001 From: Brian Soe <6686625+bsoe-flexiv@users.noreply.github.com> Date: Thu, 8 Oct 2026 17:15:15 +0200 Subject: [PATCH] Release v2.1.0: ship a self-contained shared library for Elements Studio v3E.1 The 2.1 line is 2.2.0 for Elements Studio v3E.1: the same self-contained shared library, libflexiv_sim_plugin.x86_64-linux-gnu.so, attached to the GitHub release and verified against the committed .sha256 at configure time, and the same C++ and Python API, but on the Fast-DDS transport and messages that Elements Studio v3E.1 uses instead of Zenoh. The library embeds Fast-DDS, Fast-CDR, foonathan_memory, tinyxml2, flexiv_middleware and spdlog and exports only the flexiv::sim_plugin API, so it no longer collides with a program's own Fast-DDS or spdlog (e.g. ROS 2), and the repo has no thirdparty dependencies left to build: the thirdparty folder is removed and only Threads is required. - CMakeLists.txt and FlexivInstallLibrary.cmake follow flexiv_rdk: a SHARED dummy target replaced at install time by the downloaded library. - The examples log with std::cout and Python's logging module instead of spdlog, so they need nothing beyond the plugin. - CI follows flexiv_rdk's CI-Cpp and CI-Python workflows, runs on v2.1.x too, and installs flexivsimplugin 2.1.x. - README: Ubuntu 22.04+ and GCC 11.4+, which plugin line works with which Elements Studio, and the Fast-DDS multicast discovery. Elements Studio v3E.1 does not receive the wrist force/torque, which the plugin drops. - docs/elements_studio_setup.md: on a newer Ubuntu, run Elements Studio in isaac_sim_ws's Ubuntu 22.04 container. --- .github/scripts/check_artifacts.sh | 324 ++++++++++++++++++ .github/workflows/ci-cpp.yml | 30 ++ .github/workflows/ci-python.yml | 34 ++ .github/workflows/cmake.yml | 21 -- .github/workflows/shared_cpp_steps/action.yml | 43 +++ .../workflows/shared_python_steps/action.yml | 44 +++ .github/workflows/shared_steps/action.yml | 31 -- .gitignore | 6 +- CMakeLists.txt | 79 ++--- README.md | 33 +- cmake/FlexivInstallLibrary.cmake | 13 +- cmake/flexiv_sim_plugin-config.cmake.in | 6 +- doc/Doxyfile.in | 2 +- docs/elements_studio_setup.md | 2 + example/CMakeLists.txt | 4 +- example/mock_external_simulator.cpp | 15 +- example_py/mock_external_simulator.py | 7 +- include/flexiv/sim_plugin/data.hpp | 1 + include/flexiv/sim_plugin/user_node.hpp | 7 +- lib/dummy.cpp | 2 +- ...lexiv_sim_plugin.x86_64-linux-gnu.a.sha256 | 1 - ...exiv_sim_plugin.x86_64-linux-gnu.so.sha256 | 1 + thirdparty/build_and_install_dependencies.sh | 49 --- thirdparty/scripts/install_Fast-CDR.sh | 24 -- thirdparty/scripts/install_Fast-DDS.sh | 31 -- .../scripts/install_foonathan_memory.sh | 24 -- thirdparty/scripts/install_spdlog.sh | 25 -- thirdparty/scripts/install_tinyxml2.sh | 24 -- 28 files changed, 567 insertions(+), 316 deletions(-) create mode 100755 .github/scripts/check_artifacts.sh create mode 100644 .github/workflows/ci-cpp.yml create mode 100644 .github/workflows/ci-python.yml delete mode 100644 .github/workflows/cmake.yml create mode 100644 .github/workflows/shared_cpp_steps/action.yml create mode 100644 .github/workflows/shared_python_steps/action.yml delete mode 100644 .github/workflows/shared_steps/action.yml delete mode 100644 lib/libflexiv_sim_plugin.x86_64-linux-gnu.a.sha256 create mode 100644 lib/libflexiv_sim_plugin.x86_64-linux-gnu.so.sha256 delete mode 100644 thirdparty/build_and_install_dependencies.sh delete mode 100644 thirdparty/scripts/install_Fast-CDR.sh delete mode 100644 thirdparty/scripts/install_Fast-DDS.sh delete mode 100644 thirdparty/scripts/install_foonathan_memory.sh delete mode 100644 thirdparty/scripts/install_spdlog.sh delete mode 100644 thirdparty/scripts/install_tinyxml2.sh diff --git a/.github/scripts/check_artifacts.sh b/.github/scripts/check_artifacts.sh new file mode 100755 index 0000000..a14e82c --- /dev/null +++ b/.github/scripts/check_artifacts.sh @@ -0,0 +1,324 @@ +#!/usr/bin/env bash +# ================================================================================================== +# Release guard: a shipped Sim Plugin library must depend on nothing but the OS C/C++ runtime. +# +# The Sim Plugin is distributed as a self-contained shared library that statically embeds every +# thirdparty dependency, so the only runtime dependencies left should be the compiler runtime and +# the loader. Anything else is a leak from the build machine, and it does not fail at build time on +# ours: it links, installs, passes every static check, then aborts at process startup on the user's +# machine. That is how RDK v1.9.4's macOS artifact shipped with +# /opt/homebrew/opt/openssl@3/lib/libssl.3.dylib recorded in its load commands. +# +# Checks, per artifact: +# ELF - DT_NEEDED limited to the C/C++ runtime and the loader; no DT_RPATH/DT_RUNPATH other +# than $ORIGIN-relative ones. +# Mach-O - every dependent library and LC_RPATH entry under @rpath/@loader_path/@executable_path, +# /usr/lib/ or /System/Library/. +# PE - imported DLLs limited to the Windows system DLLs and the MSVC C/C++ runtime, and +# API set contracts, which the loader resolves internally and which are never files. +# Reading an import table needs one of dumpbin, llvm-readobj, llvm-objdump or objdump; +# dumpbin is located through vswhere when Visual Studio has not put it on PATH. +# Skipped, not failed, when none of them is available. +# +# Usage: check_artifacts.sh [ ...] +# +# Platforms whose runtime is not glibc (QNX) can extend the allowed dependency set, for ELF and +# for PE alike: +# SIM_PLUGIN_EXTRA_ALLOWED_LIBS="libc.so.4 libcpp.so.5" check_artifacts.sh +# ================================================================================================== +set -eu + +# Shared objects that belong to the OS toolchain runtime and are therefore present on every target +# machine. Nothing else may appear in DT_NEEDED. +ALLOWED_ELF_LIBS=" +libc.so.6 +libm.so.6 +libdl.so.2 +librt.so.1 +libpthread.so.0 +libstdc++.so.6 +libgcc_s.so.1 +libatomic.so.1 +ld-linux-x86-64.so.2 +ld-linux-aarch64.so.1 +${SIM_PLUGIN_EXTRA_ALLOWED_LIBS:-} +" + +# Path prefixes a Mach-O load command may use: the SDK's own @-relative paths, plus the two system +# locations guaranteed to exist on every macOS install. +ALLOWED_MACHO_PREFIXES="@rpath/ @loader_path/ @executable_path/ /usr/lib/ /System/Library/" + +# DLLs that ship with Windows itself, plus the MSVC C/C++ runtime, which is the Windows counterpart +# of libstdc++/libgcc: redistributable, and already present wherever a consumer builds against the +# plugin with MSVC. Matched case-insensitively, since an import table preserves whatever case the +# linker recorded. Nothing else may be imported. +ALLOWED_PE_LIBS=" +kernel32.dll +kernelbase.dll +ntdll.dll +user32.dll +advapi32.dll +shell32.dll +shlwapi.dll +ole32.dll +oleaut32.dll +rpcrt4.dll +version.dll +psapi.dll +dbghelp.dll +winmm.dll +powrprof.dll +userenv.dll +iphlpapi.dll +ws2_32.dll +mswsock.dll +crypt32.dll +secur32.dll +bcrypt.dll +ncrypt.dll +msvcrt.dll +ucrtbase.dll +vcruntime140.dll +vcruntime140_1.dll +msvcp140.dll +msvcp140_1.dll +msvcp140_2.dll +concrt140.dll +${SIM_PLUGIN_EXTRA_ALLOWED_LIBS:-} +" + +# Import table reader, resolved once on the first PE artifact. +PE_READER="" +PE_READER_KIND="" + +failures=0 +inspected=0 + +fail() { + echo " FAIL: $*" + failures=$((failures + 1)) +} + +# Identify the object file format from its magic number, so one script covers every artifact we +# publish without being told which platform produced it. +file_format() { + local magic + magic=$(od -An -N4 -tx1 "$1" | tr -d ' \n') + case "$magic" in + 7f454c46) echo elf ;; + cffaedfe|cefaedfe|feedfacf|feedface) echo macho ;; # thin Mach-O, either endianness + cafebabe|bebafeca) echo macho ;; # universal ("fat") binary + 4d5a*) echo pe ;; + *) echo unknown ;; + esac +} + +check_elf() { + local lib=$1 reader needed entry search_path + + if command -v readelf > /dev/null 2>&1; then + reader="readelf -d" + elif command -v objdump > /dev/null 2>&1; then + reader="objdump -p" + else + echo " ERROR: neither readelf nor objdump found, cannot inspect an ELF artifact" + exit 2 + fi + + needed=$($reader "$lib" | awk '/\(?NEEDED\)?/ {gsub(/[][]/, "", $NF); print $NF}') + for entry in $needed; do + echo " NEEDED $entry" + case " $(echo $ALLOWED_ELF_LIBS) " in + *" $entry "*) ;; + *) fail "$entry is not part of the OS C/C++ runtime" ;; + esac + done + + # A run path baked into the artifact points at a directory on the build machine unless it is + # relative to the artifact itself. + for search_path in $($reader "$lib" \ + | awk '/\(?R(UN)?PATH\)?/ {gsub(/[][]/, "", $NF); gsub(/:/, " ", $NF); print $NF}'); do + echo " RPATH $search_path" + case "$search_path" in + '$ORIGIN'*) ;; + *) fail "run path $search_path is absolute, it will not exist on the user's machine" ;; + esac + done +} + +check_macho() { + local lib=$1 entry prefix allowed + + if ! command -v otool > /dev/null 2>&1; then + echo " ERROR: otool not found, cannot inspect a Mach-O artifact" + exit 2 + fi + + # Dependent libraries are the tab-indented lines of otool -L; skipping the un-indented ones also + # skips the per-architecture headers of a universal binary. + # LC_RPATH entries are printed as a "path (offset N)" line after each LC_RPATH command. + for entry in \ + $(otool -L "$lib" | grep -E '^[[:space:]]' | awk '{print $1}') \ + $(otool -l "$lib" | awk '/LC_RPATH/ {f = 1} f && /^ *path /{print $2; f = 0}'); do + echo " LOADS $entry" + allowed=0 + for prefix in $ALLOWED_MACHO_PREFIXES; do + case "$entry" in "$prefix"*) allowed=1; break ;; esac + done + if [ $allowed -eq 0 ]; then + fail "$entry is outside the SDK and outside the OS, it will not exist on the user's machine" + fi + done +} + +# Visual Studio ships dumpbin but does not put it on PATH; vswhere does sit at a fixed location on +# every install, so the toolchain can be found without the caller having entered a VS developer +# shell. The LLVM and binutils readers are accepted as fallbacks: any of them can list an import +# table, and a runner that has one but not the other should still check rather than skip. +find_pe_reader() { + local vswhere vs_path candidate tool + + if [ -n "$PE_READER" ]; then + return 0 + fi + + if command -v dumpbin > /dev/null 2>&1; then + PE_READER=dumpbin + PE_READER_KIND=dumpbin + return 0 + fi + + vswhere="/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe" + if [ -x "$vswhere" ]; then + vs_path=$("$vswhere" -latest -products '*' -property installationPath 2> /dev/null | tr -d '\r') + if [ -n "$vs_path" ]; then + if command -v cygpath > /dev/null 2>&1; then + vs_path=$(cygpath -u "$vs_path") + fi + for candidate in "$vs_path"/VC/Tools/MSVC/*/bin/Host*/*/dumpbin.exe; do + if [ -x "$candidate" ]; then + PE_READER=$candidate + PE_READER_KIND=dumpbin + return 0 + fi + done + fi + fi + + for tool in llvm-readobj; do + if command -v "$tool" > /dev/null 2>&1; then + PE_READER=$tool + PE_READER_KIND=readobj + return 0 + fi + done + + for tool in llvm-objdump objdump; do + if command -v "$tool" > /dev/null 2>&1; then + PE_READER=$tool + PE_READER_KIND=objdump + return 0 + fi + done + + return 1 +} + +# Print one imported DLL name per line. dumpbin lists both the ordinary and the delay-load +# dependencies, and both are loaded on the user's machine, so both are collected. +pe_imports() { + local lib=$1 target=$1 raw + + case "$PE_READER_KIND" in + dumpbin) + if command -v cygpath > /dev/null 2>&1; then + target=$(cygpath -w "$lib") + fi + raw=$("$PE_READER" /nologo /dependents "$target") || return 1 + echo "$raw" \ + | awk '/following.*dependencies/ {f = 1; next} /^ *Summary/ {f = 0} f && NF == 1 {print $1}' + ;; + readobj) + raw=$("$PE_READER" --coff-imports "$lib") || return 1 + echo "$raw" | awk '/^ *Name: / {print $2}' + ;; + objdump) + raw=$("$PE_READER" -p "$lib") || return 1 + echo "$raw" | awk '/DLL Name: / {print $NF}' + ;; + esac +} + +# Returns non-zero when the artifact could not be inspected, so the caller does not count it. +check_pe() { + local lib=$1 imports entry name + + if ! find_pe_reader; then + echo " SKIP: no import table reader found (dumpbin, llvm-readobj, llvm-objdump, objdump)" + return 1 + fi + + if ! imports=$(pe_imports "$lib"); then + fail "$PE_READER could not read the import table, so this artifact was not verified" + return 0 + fi + + # Every real PE links against the OS runtime, so an empty import table means the reader + # understood the file but found nothing -- a silent pass is exactly what must not happen here. + if [ -z "$imports" ]; then + fail "no imported DLLs were found, so this artifact was not verified" + return 0 + fi + + for entry in $imports; do + echo " IMPORTS $entry" + name=$(echo "$entry" | tr '[:upper:]' '[:lower:]') + case "$name" in + # API set contracts: resolved inside the loader, never present as files on disk. + api-ms-win-*.dll | ext-ms-win-*.dll) continue ;; + esac + case " $(echo $ALLOWED_PE_LIBS | tr '[:upper:]' '[:lower:]') " in + *" $name "*) ;; + *) fail "$entry is not part of the OS C/C++ runtime" ;; + esac + done + return 0 +} + +if [ $# -eq 0 ]; then + echo "Usage: $0 [ ...]" + echo "No artifact was given, so nothing was checked. This is a failure: the build step that" + echo "produces or downloads the library did not leave it where this guard expected it." + exit 2 +fi + +for lib in "$@"; do + if [ ! -f "$lib" ]; then + echo "$lib" + echo " ERROR: no such file" + exit 2 + fi + + echo "$lib" + case "$(file_format "$lib")" in + elf) check_elf "$lib"; inspected=$((inspected + 1)) ;; + macho) check_macho "$lib"; inspected=$((inspected + 1)) ;; + pe) if check_pe "$lib"; then inspected=$((inspected + 1)); fi ;; + *) echo " ERROR: unrecognized object file format"; exit 2 ;; + esac +done + +if [ $failures -ne 0 ]; then + echo "" + echo "$failures dependency violation(s). A released Sim Plugin library must load nothing but the OS" + echo "C/C++ runtime. A dependency listed above came from the build machine and would abort the" + echo "user's process at startup, so it has to be removed from the build rather than shipped." + exit 1 +fi + +echo "" +if [ $inspected -eq 0 ]; then + echo "Nothing was inspected: every artifact given was skipped." +else + echo "$inspected artifact(s) depend only on the OS C/C++ runtime." +fi diff --git a/.github/workflows/ci-cpp.yml b/.github/workflows/ci-cpp.yml new file mode 100644 index 0000000..72bf00c --- /dev/null +++ b/.github/workflows/ci-cpp.yml @@ -0,0 +1,30 @@ +name: CI-Cpp + +on: + push: + branches: [v2.x, v2.1.x] + pull_request: + branches: [v2.x, v2.1.x] + workflow_dispatch: + +permissions: + contents: read + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + ci-cpp: + name: CI-Cpp @ ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-22.04 + - ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - uses: ./.github/workflows/shared_cpp_steps diff --git a/.github/workflows/ci-python.yml b/.github/workflows/ci-python.yml new file mode 100644 index 0000000..ef89385 --- /dev/null +++ b/.github/workflows/ci-python.yml @@ -0,0 +1,34 @@ +name: CI-Python + +on: + push: + branches: [v2.x, v2.1.x] + pull_request: + branches: [v2.x, v2.1.x] + workflow_dispatch: + +permissions: + contents: read + +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" + +jobs: + ci-python: + name: CI-Python @ ${{ matrix.os }} (${{ matrix.python-version }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-22.04 + - ubuntu-24.04 + python-version: + - "3.10" + - "3.12" + - "3.14" + steps: + - uses: actions/checkout@v6 + - uses: ./.github/workflows/shared_python_steps + with: + python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index f268a8c..0000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,21 +0,0 @@ -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 diff --git a/.github/workflows/shared_cpp_steps/action.yml b/.github/workflows/shared_cpp_steps/action.yml new file mode 100644 index 0000000..1f1fc26 --- /dev/null +++ b/.github/workflows/shared_cpp_steps/action.yml @@ -0,0 +1,43 @@ +name: "Shared Check Steps for C++" +runs: + using: "composite" + # Note: working directory will be reset to the repo root for each new step + steps: + # Use a fixed CMake version + - name: Set up CMake + uses: jwlawson/actions-setup-cmake@v2 + with: + cmake-version: '3.28.3' + + # Configure CMake, then build and install flexiv_sim_plugin library to the installation + # directory. The library has no dependencies to build first: everything it uses is embedded. + - name: Build and install library + shell: bash + run: | + cmake --version + mkdir -p build && cd build + cmake .. -DCMAKE_INSTALL_PREFIX=~/sim_plugin_install + cmake --build . --target install --config Release + + # Guard the prebuilt library that was just downloaded: Sim Plugin ships as a self-contained + # shared library, so anything it loads beyond the OS C/C++ runtime is a dependency left over + # from the machine that built it. That kind of leak passes every build-time check and only shows + # up as a loader failure on the user's machine, which is why it is asserted here rather than + # trusted. + - name: Check dependencies of prebuilt library + shell: bash + run: | + shopt -s nullglob + # The .-. asset, not the dummy libflexiv_sim_plugin. CMake target + # output. + artifacts=(build/libflexiv_sim_plugin.*-*.*) + bash .github/scripts/check_artifacts.sh "${artifacts[@]}" + + # Find and link to flexiv_sim_plugin library, then build all examples. + - name: Build examples + shell: bash + run: | + cd example + mkdir -p build && cd build + cmake .. -DCMAKE_PREFIX_PATH=~/sim_plugin_install + cmake --build . --config Release -j 4 diff --git a/.github/workflows/shared_python_steps/action.yml b/.github/workflows/shared_python_steps/action.yml new file mode 100644 index 0000000..718ba69 --- /dev/null +++ b/.github/workflows/shared_python_steps/action.yml @@ -0,0 +1,44 @@ +name: "Shared Check Steps for Python" +inputs: + python-version: + description: "Python version used for example compilation checks" + required: true +runs: + using: "composite" + steps: + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: ${{ inputs.python-version }} + + - name: Install the latest flexivsimplugin 2.1.x + shell: bash + run: | + python -m pip install --upgrade pip + python -m pip install "flexivsimplugin==2.1.*" + + - name: Byte-compile Python examples + shell: bash + run: | + python - <<'PY' + from pathlib import Path + import py_compile + + for path in sorted(Path('example_py').glob('*.py')): + py_compile.compile(str(path), doraise=True) + print(f'py_compile OK: {path}') + PY + + # Import the installed package and construct a node. Nothing serves this serial number, so the + # node must come up and report that it is not connected. + - name: Smoke test the installed package + shell: bash + run: | + python - <<'PY' + import time + import flexivsimplugin + node = flexivsimplugin.UserNode("Rizon4-CI0000") + time.sleep(1.5) + assert node.connected() is False + print("flexivsimplugin", flexivsimplugin.__version__, "OK") + PY diff --git a/.github/workflows/shared_steps/action.yml b/.github/workflows/shared_steps/action.yml deleted file mode 100644 index 90defda..0000000 --- a/.github/workflows/shared_steps/action.yml +++ /dev/null @@ -1,31 +0,0 @@ -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 diff --git a/.gitignore b/.gitignore index 3325357..5baec52 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ cloned/ html/ __pycache__ -# Pre-built static libraries are attached to GitHub releases as assets, not -# committed. Only the .sha256 checksum is tracked; the .a is downloaded by +# The pre-built shared library is attached to GitHub releases as an asset, not +# committed. Only the .sha256 checksum is tracked; the .so is downloaded by # CMake at configure time. -lib/*.a +lib/*.so diff --git a/CMakeLists.txt b/CMakeLists.txt index c03b4b0..c26c6b8 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ -cmake_minimum_required(VERSION 3.16.3) +cmake_minimum_required(VERSION 3.22.1) # =================================================================== # PROJECT SETUP # =================================================================== -project(flexiv_sim_plugin VERSION 1.3.0) +project(flexiv_sim_plugin VERSION 2.1.0 LANGUAGES CXX) # Configure build type if(NOT CMAKE_BUILD_TYPE) @@ -11,40 +11,40 @@ if(NOT CMAKE_BUILD_TYPE) endif() set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Release" "Debug" "RelWithDebInfo" "MinSizeRel") -# Set static library according to platform +# Select the prebuilt library for this platform. Sim Plugin is shipped as a self-contained shared +# library. 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_LIB "libflexiv_sim_plugin.x86_64-linux-gnu.a") + set(SIM_PLUGIN_LIB "libflexiv_sim_plugin.x86_64-linux-gnu.so") 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() - -# Download the pre-built static library from the matching GitHub release and -# verify it against the committed checksum. The .a itself is not tracked in -# this repo, only lib/${SIM_PLUGIN_LIB}.sha256. -file(READ ${CMAKE_CURRENT_SOURCE_DIR}/lib/${SIM_PLUGIN_LIB}.sha256 EXPECTED_HASH) -set(SIM_PLUGIN_LIB_URL https://github.com/flexivrobotics/flexiv_sim_plugin/releases/download/v${PROJECT_VERSION}/${SIM_PLUGIN_LIB}) -set(SIM_PLUGIN_LIB_PATH ${CMAKE_CURRENT_BINARY_DIR}/${SIM_PLUGIN_LIB}) -message(STATUS "Downloading ${SIM_PLUGIN_LIB_URL} ...") -file(DOWNLOAD ${SIM_PLUGIN_LIB_URL} ${SIM_PLUGIN_LIB_PATH} - SHOW_PROGRESS - TLS_VERIFY ON - EXPECTED_HASH SHA256=${EXPECTED_HASH} - STATUS status) -list(GET status 0 code) -if(code EQUAL 0) - message(STATUS "Download finished") else() - message(FATAL_ERROR "Download failed: ${status}") + message(FATAL_ERROR "${CMAKE_SYSTEM_NAME} is currently not supported.") endif() +# Download a release asset by file name, verifying its SHA256 against the +# checked-in .sha256 placeholder. +function(sim_plugin_download_release_asset asset_name) + file(READ ${CMAKE_CURRENT_SOURCE_DIR}/lib/${asset_name}.sha256 expected_hash) + set(asset_url https://github.com/flexivrobotics/flexiv_sim_plugin/releases/download/v${PROJECT_VERSION}/${asset_name}) + message(STATUS "Downloading ${asset_url} ...") + file(DOWNLOAD ${asset_url} ${CMAKE_CURRENT_BINARY_DIR}/${asset_name} + SHOW_PROGRESS + TLS_VERIFY ON + EXPECTED_HASH SHA256=${expected_hash} + STATUS status) + list(GET status 0 code) + if(NOT code EQUAL 0) + message(FATAL_ERROR "Download failed: ${status}") + endif() + message(STATUS "Download finished: ${asset_name}") +endfunction() + +sim_plugin_download_release_asset(${SIM_PLUGIN_LIB}) + # =================================================================== # PROJECT DEPENDENCIES # =================================================================== @@ -53,23 +53,12 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) message(STATUS "Found Threads") -# spdlog -find_package(spdlog REQUIRED) -message(STATUS "Found spdlog v${spdlog_VERSION}: ${spdlog_DIR}") - -# Fast-DDS (Fast-RTPS) -find_package(fastrtps REQUIRED) -message(STATUS "Found fastrtps v${fastrtps_VERSION}: ${fastrtps_DIR}") - -# Fast-CDR -find_package(fastcdr REQUIRED) -message(STATUS "Found fastcdr v${fastcdr_VERSION}: ${fastcdr_DIR}") - # =================================================================== # CREATE LIBRARY # =================================================================== -# Create static library target with dummy source -add_library(${PROJECT_NAME} STATIC ${CMAKE_CURRENT_SOURCE_DIR}/lib/dummy.cpp) +# Create the library target with a dummy source. The dummy output is replaced at +# install time by the downloaded prebuilt shared library (see FlexivInstallLibrary). +add_library(${PROJECT_NAME} SHARED ${CMAKE_CURRENT_SOURCE_DIR}/lib/dummy.cpp) # Create an alias of the target with flexiv namespace add_library(flexiv::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) @@ -80,12 +69,10 @@ target_include_directories(${PROJECT_NAME} PUBLIC $ ) -# Link to dependencies +# Link to dependencies. Every thirdparty dependency (Fast-DDS, spdlog, ...) is embedded in the prebuilt +# library and hidden, so only Threads leaks through the public API. target_link_libraries(${PROJECT_NAME} PUBLIC Threads::Threads - spdlog::spdlog - fastrtps - fastcdr ) # Use moderate compiler warning option @@ -95,6 +82,8 @@ else() target_compile_options(${PROJECT_NAME} PUBLIC /W1) endif() -# Install the library +# =================================================================== +# LIBRARY INSTALLATION +# =================================================================== include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FlexivInstallLibrary.cmake) FlexivInstallLibrary() diff --git a/README.md b/README.md index 6644f11..4dbae51 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Flexiv Sim Plugin -![CMake Badge](https://github.com/flexivrobotics/flexiv_sim_plugin/actions/workflows/cmake.yml/badge.svg) +![Cpp Badge](https://github.com/flexivrobotics/flexiv_sim_plugin/actions/workflows/ci-cpp.yml/badge.svg) +![Python Badge](https://github.com/flexivrobotics/flexiv_sim_plugin/actions/workflows/ci-python.yml/badge.svg) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) @@ -45,7 +46,19 @@ In theory, any simulator that meets the following criteria should work: | **OS** | **Platform** | **C++ compiler kit** | **Python interpreter** | | --------------------- | ------------ | -------------------- | ---------------------- | -| Linux (Ubuntu 20.04+) | x86_64 | GCC v9.4+ | 3.10, 3.12, 3.14 | +| Linux (Ubuntu 22.04+) | x86_64 | GCC v11.4+ | 3.10, 3.12, 3.14 | + +Each release line of Flexiv Sim Plugin works with one release line of Flexiv Elements Studio, because the two must use the same transport and messages: + +| **flexiv_sim_plugin** | **Elements Studio** | **Transport** | **Branch** | +| --------------------- | ------------------- | ------------- | ---------- | +| 2.2.x | v3E.2 | Zenoh | `v2.x` | +| 2.1.x | v3E.1 | Fast-DDS | `v2.1.x` | +| 1.3.0 | v3.11.2 | Fast-DDS | `v1.x` | + +This branch, `v2.1.x`, is the 2.1 line for Elements Studio v3E.1. It finds Elements Studio by Fast-DDS discovery, which multicasts to `239.255.0.1` on UDP port 14900 (DDS domain 30), so the external simulator and Elements Studio must be on a network that passes multicast. A VPN, or Docker's default bridge network, can prevent the connection; run a container on the host network. + +`SimRobotStates::wrist_force` and `wrist_torque` are accepted, so the same code builds against every 2.x release, but Elements Studio v3E.1 doesn't receive them: the plugin logs a warning once and drops them. ## Quick Start - Python @@ -78,7 +91,6 @@ An example script that mocks an external simulator is provided and can be used t 2. Start the mock program: cd flexiv_sim_plugin/example_py - python3 -m pip install spdlog python3 ./mock_external_simulator.py [robot_serial_number] NOTE: the robot serial number provided to the program is the same one you noted down when creating the simulated robot in Flexiv Elements Studio. @@ -104,14 +116,11 @@ An example script that mocks an external simulator is provided and can be used t The following steps are identical on all supported platforms. -1. Choose a directory for installing the C++ library of Sim Plugin and its dependencies. This directory can be under system path or not, depending on whether you want Sim Plugin to be globally discoverable by CMake. For example, a new folder named ``sim_plugin_install`` under the home directory. - -2. In a new Terminal, run the provided script to compile and install all dependencies to the installation directory chosen in step 1: +The C++ library is a self-contained shared library: its dependencies are built in, so there is nothing else to install first. - cd flexiv_sim_plugin/thirdparty - bash build_and_install_dependencies.sh ~/sim_plugin_install +1. Choose a directory for installing the C++ library of Sim Plugin. This directory can be under system path or not, depending on whether you want Sim Plugin to be globally discoverable by CMake. For example, a new folder named ``sim_plugin_install`` under the home directory. -3. In a new Terminal, configure the ``flexiv_sim_plugin`` CMake project: +2. In a new Terminal, configure the ``flexiv_sim_plugin`` CMake project. This downloads the prebuilt library from the matching GitHub release and verifies its checksum: cd flexiv_sim_plugin mkdir build && cd build @@ -119,7 +128,7 @@ The following steps are identical on all supported platforms. NOTE: ``-D`` followed by ``CMAKE_INSTALL_PREFIX`` sets the absolute path of the installation directory, which should be the one chosen in step 1. -4. Install ``flexiv_sim_plugin`` C++ library to ``CMAKE_INSTALL_PREFIX`` path, which may or may not be globally discoverable by CMake: +3. Install ``flexiv_sim_plugin`` C++ library to ``CMAKE_INSTALL_PREFIX`` path, which may or may not be globally discoverable by CMake: cd flexiv_sim_plugin/build cmake --build . --target install --config Release @@ -133,7 +142,7 @@ After the library is installed as ``flexiv_sim_plugin`` CMake target, it can be cmake .. -DCMAKE_PREFIX_PATH=~/sim_plugin_install cmake --build . --config Release -j 4 -NOTE: ``-D`` followed by ``CMAKE_PREFIX_PATH`` tells the user project's CMake where to find the installed C++ library. This argument can be skipped if the Sim Plugin library and its dependencies are installed to a globally discoverable location. +NOTE: ``-D`` followed by ``CMAKE_PREFIX_PATH`` tells the user project's CMake where to find the installed C++ library. This argument can be skipped if the Sim Plugin library is installed to a globally discoverable location. ### Run the example C++ program @@ -141,7 +150,7 @@ An example program that mocks an external simulator is provided and can be used 1. Setup and run Flexiv Elements Studio simulation. See [docs/elements_studio_setup.md](docs/elements_studio_setup.md). -2. Start the mock program: +2. Start the mock program. The install location of the Sim Plugin shared library is baked into the executable as an RPATH, so it is found automatically at runtime with no extra setup: cd flexiv_sim_plugin/example/build ./mock_external_simulator [robot_serial_number] diff --git a/cmake/FlexivInstallLibrary.cmake b/cmake/FlexivInstallLibrary.cmake index 4d558d4..5d32466 100644 --- a/cmake/FlexivInstallLibrary.cmake +++ b/cmake/FlexivInstallLibrary.cmake @@ -82,12 +82,15 @@ macro(FlexivInstallLibrary) DESTINATION "lib/cmake/${PROJECT_NAME}" ) - # Replace the dummy static lib with the actual static lib - install(CODE - "file(REMOVE ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${PROJECT_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX})") - install(FILES ${SIM_PLUGIN_LIB_PATH} + # Replace the dummy library built above with the actual prebuilt library + # that was downloaded: a single shared-library artifact (.so on Linux). + set(_sim_plugin_installed_lib + "${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}") + install(CODE + "file(REMOVE ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${_sim_plugin_installed_lib})") + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${SIM_PLUGIN_LIB} DESTINATION ${CMAKE_INSTALL_LIBDIR} - RENAME ${CMAKE_STATIC_LIBRARY_PREFIX}${PROJECT_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX} + RENAME ${_sim_plugin_installed_lib} ) # Use the CPack Package Generator diff --git a/cmake/flexiv_sim_plugin-config.cmake.in b/cmake/flexiv_sim_plugin-config.cmake.in index 4dad5dd..6deff9a 100644 --- a/cmake/flexiv_sim_plugin-config.cmake.in +++ b/cmake/flexiv_sim_plugin-config.cmake.in @@ -1,11 +1,9 @@ include(CMakeFindDependencyMacro) -# Find dependency +# Find dependencies. Sim Plugin is a self-contained shared library: every thirdparty dependency is +# embedded and hidden, so only Threads is needed. set(THREADS_PREFER_PTHREAD_FLAG ON) find_dependency(Threads REQUIRED) -find_dependency(spdlog REQUIRED) -find_dependency(fastrtps REQUIRED) -find_dependency(fastcdr REQUIRED) # Add targets file include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 1c26f3c..1976be7 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -38,7 +38,7 @@ PROJECT_NAME = "Flexiv Sim Plugin APIs" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.2.0 +PROJECT_NUMBER = 2.1.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/docs/elements_studio_setup.md b/docs/elements_studio_setup.md index a4933d4..39e373b 100644 --- a/docs/elements_studio_setup.md +++ b/docs/elements_studio_setup.md @@ -5,6 +5,8 @@ Set it up once before running any external-simulator workspace. ## Install Elements Studio on Ubuntu +Elements Studio runs on Ubuntu 22.04. On a newer Ubuntu, run it in an Ubuntu 22.04 container instead of installing it: [isaac_sim_ws](https://github.com/flexivrobotics/isaac_sim_ws/tree/v2.1.x#run-elements-studio-in-a-container) provides `launch_elements_studio.sh` for that. Then skip step 3 below, and run step 4 from the container's shell. + 1. [Contact Flexiv](https://www.flexiv.com/contact) to obtain the installation package of Elements Studio. 2. Extract the package to a non-root directory. 3. Install Elements Studio: diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index ca19629..5eb1dca 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16.3) +cmake_minimum_required(VERSION 3.22.1) project(flexiv_sim_plugin-examples) # Show verbose build info @@ -17,7 +17,7 @@ set(EXAMPLE_LIST mock_external_simulator ) -# Find flexiv_sim_plugin INTERFACE library +# Find flexiv_sim_plugin library find_package(flexiv_sim_plugin REQUIRED) # Build all selected examples diff --git a/example/mock_external_simulator.cpp b/example/mock_external_simulator.cpp index c2d2c7e..caba0f6 100644 --- a/example/mock_external_simulator.cpp +++ b/example/mock_external_simulator.cpp @@ -7,7 +7,6 @@ */ #include -#include #include #include @@ -78,7 +77,7 @@ void StepPhysics(sim_plugin::UserNode& user_node) // Step 2: send robot states to Flexiv Elements Studio // ============================================================================================= if (!user_node.SendRobotStates(robot_states)) { - spdlog::error("Failed to send robot states data"); + std::cerr << "[error] Failed to send robot states data" << std::endl; } // Step 3: wait for Elements Studio to calculate and deliver new robot commands @@ -86,7 +85,7 @@ void StepPhysics(sim_plugin::UserNode& user_node) // Must set a timeout value to avoid deadlock constexpr unsigned int kWaitTimeoutMs = 100; if (!user_node.WaitForRobotCommands(kWaitTimeoutMs)) { - spdlog::error("WaitForRobotCommands() timeout"); + std::cerr << "[error] WaitForRobotCommands() timeout" << std::endl; } // Step 4: apply joint torques command to the simulated robot in the external simulator @@ -112,19 +111,19 @@ int main(int argc, char* argv[]) std::string robot_sn = argv[1]; // Print description - spdlog::info( - ">>> Tutorial description <<<\nA simple example demonstrating how to use Flexiv Sim Plugin " - "in an external simulator.\n"); + std::cout << ">>> Tutorial description <<<\nA simple example demonstrating how to use Flexiv Sim " + "Plugin in an external simulator.\n" + << std::endl; // Create user node sim_plugin::UserNode user_node(robot_sn); // Wait for connected while (!user_node.connected()) { - spdlog::warn("Waiting for connection with Flexiv Elements Studio"); + std::cerr << "[warn] Waiting for connection with Flexiv Elements Studio" << std::endl; std::this_thread::sleep_for(std::chrono::seconds(1)); } - spdlog::info("Connected with Flexiv Elements Studio, starting mocked physics loop"); + std::cout << "Connected with Flexiv Elements Studio, starting mocked physics loop" << std::endl; // Run mocked physics loop while (user_node.connected()) { diff --git a/example_py/mock_external_simulator.py b/example_py/mock_external_simulator.py index 29a60d3..75669e3 100644 --- a/example_py/mock_external_simulator.py +++ b/example_py/mock_external_simulator.py @@ -12,7 +12,7 @@ import time import math import argparse -import spdlog # pip install +import logging import flexivsimplugin # pip install # Frequency of the external simulator's physics loop [Hz] @@ -104,7 +104,8 @@ def main(): args = argparser.parse_args() # Create logger - logger = spdlog.ConsoleLogger("Example") + logging.basicConfig(level=logging.INFO, format="[%(levelname)s] %(message)s") + logger = logging.getLogger("Example") # Print description logger.info( @@ -117,7 +118,7 @@ def main(): # Wait for connected while not user_node.connected(): - logger.warn("Waiting for connection with Flexiv Elements Studio") + logger.warning("Waiting for connection with Flexiv Elements Studio") time.sleep(1) logger.info("Connected with Flexiv Elements Studio, starting mocked physics loop") diff --git a/include/flexiv/sim_plugin/data.hpp b/include/flexiv/sim_plugin/data.hpp index f546b9c..ee2cd2c 100644 --- a/include/flexiv/sim_plugin/data.hpp +++ b/include/flexiv/sim_plugin/data.hpp @@ -8,6 +8,7 @@ #define FLEXIV_SIM_PLUGIN_DATA_HPP_ #include +#include #include #include diff --git a/include/flexiv/sim_plugin/user_node.hpp b/include/flexiv/sim_plugin/user_node.hpp index 1d69b49..e636939 100644 --- a/include/flexiv/sim_plugin/user_node.hpp +++ b/include/flexiv/sim_plugin/user_node.hpp @@ -22,8 +22,11 @@ class UserNode final public: /** * @brief Create the node. - * @param[in] robot_sn Serial number of the simulated robot created in Flexiv Elements Studio. - * The accepted formats are: "Rizon 4-123456" and "Rizon4-123456". + * @param[in] robot_sn Serial number of the simulated robot created in Flexiv Elements Studio, + * as Elements Studio displays it, e.g. "Rizon 4-123456". The node finds the robot by the + * sequence number at its end, "123456", which is unique to each robot: the model name before + * it is not used, because some Elements Studio versions advertise a different one. The node + * connects once Elements Studio starts the simulated robot. * @param[in] debug_print Print debug info. */ UserNode(const std::string& robot_sn, bool debug_print = false); diff --git a/lib/dummy.cpp b/lib/dummy.cpp index 6299cc5..ca2c0bc 100644 --- a/lib/dummy.cpp +++ b/lib/dummy.cpp @@ -1,5 +1,5 @@ /** * @file dummy.cpp - * @brief A dummy source file to add portability to the installed flexiv_rdk library + * @brief A dummy source file to add portability to the installed flexiv_sim_plugin library */ void dummy() { } diff --git a/lib/libflexiv_sim_plugin.x86_64-linux-gnu.a.sha256 b/lib/libflexiv_sim_plugin.x86_64-linux-gnu.a.sha256 deleted file mode 100644 index e33d922..0000000 --- a/lib/libflexiv_sim_plugin.x86_64-linux-gnu.a.sha256 +++ /dev/null @@ -1 +0,0 @@ -d95da285eac19eac1d64e5e953a2690f26f4791b9c03d5a9896569717fae6fc0 \ No newline at end of file diff --git a/lib/libflexiv_sim_plugin.x86_64-linux-gnu.so.sha256 b/lib/libflexiv_sim_plugin.x86_64-linux-gnu.so.sha256 new file mode 100644 index 0000000..ddf6d2e --- /dev/null +++ b/lib/libflexiv_sim_plugin.x86_64-linux-gnu.so.sha256 @@ -0,0 +1 @@ +6ee9e0486a18fc765b9d50b0bc62ba7a0ed9d14c32048f340054a81d01bf08dc \ No newline at end of file diff --git a/thirdparty/build_and_install_dependencies.sh b/thirdparty/build_and_install_dependencies.sh deleted file mode 100644 index a0c4413..0000000 --- a/thirdparty/build_and_install_dependencies.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# This script builds from source and installs all dependencies of flexiv_sim_plugin. - -# Absolute path of this script -SCRIPTPATH="$(dirname $(readlink -f $0))" -set -e - -# Check script arguments -if [ "$#" -lt 1 ]; then - echo "Error: invalid script argument" - echo "Required argument: [install_directory_path]" - echo " install_directory_path: directory to install all dependencies, should be the same as the install directory of flexiv_sim_plugin" - echo "Optional argument: [num_parallel_jobs]" - echo " num_parallel_jobs: number of parallel jobs used to build, use 4 if not specified" - exit -fi - -# Get dependencies install directory from script argument, should be the same as the install directory of flexiv_sim_plugin -INSTALL_DIR=$1 -echo "Dependencies will be installed to: $INSTALL_DIR" - -# Use specified number for parallel build jobs, otherwise use 4 -if [ -n "$2" ] ;then - export NUM_JOBS=$2 -else - export NUM_JOBS=4 -fi -echo "Number of parallel build jobs: $NUM_JOBS" - -# Set shared cmake arguments -SHARED_CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=OFF \ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ - -DCMAKE_PREFIX_PATH=$INSTALL_DIR \ - -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR \ - -DBUILD_TESTING=OFF" - -# Clone all dependencies in a subfolder -mkdir -p cloned && cd cloned -export SHARED_CMAKE_ARGS - -# Build and install all dependencies to INSTALL_DIR -bash $SCRIPTPATH/scripts/install_spdlog.sh -bash $SCRIPTPATH/scripts/install_tinyxml2.sh -bash $SCRIPTPATH/scripts/install_foonathan_memory.sh -bash $SCRIPTPATH/scripts/install_Fast-CDR.sh -bash $SCRIPTPATH/scripts/install_Fast-DDS.sh - -echo ">>>>>>>>>> Finished <<<<<<<<<<" diff --git a/thirdparty/scripts/install_Fast-CDR.sh b/thirdparty/scripts/install_Fast-CDR.sh deleted file mode 100644 index 0e93f81..0000000 --- a/thirdparty/scripts/install_Fast-CDR.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -e -echo "Installing Fast-CDR" - -# Use a specific version -VER_TAG=v1.0.28 - -# Clone source code -if [ ! -d Fast-CDR ] ; then - git clone https://github.com/eProsima/Fast-CDR.git --branch $VER_TAG - cd Fast-CDR -else - cd Fast-CDR - git checkout $VER_TAG -fi - -# Configure CMake -mkdir -p build && cd build -cmake .. $SHARED_CMAKE_ARGS -DCOMPILE_EXAMPLES=OFF - -# Build and install -cmake --build . --target install --config Release -j $NUM_JOBS - -echo "Installed Fast-CDR" diff --git a/thirdparty/scripts/install_Fast-DDS.sh b/thirdparty/scripts/install_Fast-DDS.sh deleted file mode 100644 index c0204e1..0000000 --- a/thirdparty/scripts/install_Fast-DDS.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# Depends on: foonathan_memory, tinyxml2, Fast-CDR -set -e -echo "Installing Fast-DDS" - -# Use a specific version -VER_TAG=v2.6.10 - -# Clone source code -if [ ! -d Fast-DDS ] ; then - git clone https://github.com/eProsima/Fast-DDS.git --branch $VER_TAG - cd Fast-DDS -else - cd Fast-DDS - git checkout $VER_TAG -fi - -# Initialize submodules -git submodule update --init --recursive - -# Configure CMake -mkdir -p build && cd build -cmake .. $SHARED_CMAKE_ARGS \ - -DTHIRDPARTY_Asio=ON \ - -DCOMPILE_EXAMPLES=OFF \ - -DSQLITE3_SUPPORT=OFF - -# Build and install -cmake --build . --target install --config Release -j $NUM_JOBS - -echo "Installed Fast-DDS" diff --git a/thirdparty/scripts/install_foonathan_memory.sh b/thirdparty/scripts/install_foonathan_memory.sh deleted file mode 100644 index d0d794e..0000000 --- a/thirdparty/scripts/install_foonathan_memory.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -e -echo "Installing foonathan_memory" - -# Use a specific version -VER_TAG=v1.3.1 - -# Clone source code -if [ ! -d foonathan_memory_vendor ] ; then - git clone https://github.com/eProsima/foonathan_memory_vendor.git --branch $VER_TAG - cd foonathan_memory_vendor -else - cd foonathan_memory_vendor - git checkout $VER_TAG -fi - -# Configure CMake -mkdir -p build && cd build -cmake .. $SHARED_CMAKE_ARGS - -# Build and install -cmake --build . --target install --config Release -j $NUM_JOBS - -echo "Installed foonathan_memory" diff --git a/thirdparty/scripts/install_spdlog.sh b/thirdparty/scripts/install_spdlog.sh deleted file mode 100644 index abd0f9e..0000000 --- a/thirdparty/scripts/install_spdlog.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -set -e - -# Use a specific version -VER_TAG=v1.14.1 - -# Clone source code -if [ ! -d spdlog ] ; then - git clone https://github.com/gabime/spdlog.git --branch $VER_TAG - cd spdlog -else - cd spdlog - git checkout $VER_TAG -fi - -# Configure CMake -mkdir -p build && cd build -cmake .. $SHARED_CMAKE_ARGS \ - -DSPDLOG_BUILD_EXAMPLE=OFF \ - -DSPDLOG_BUILD_TESTS=OFF - -# Build and install -cmake --build . --target install --config Release -j $NUM_JOBS - -echo "Installed spdlog" diff --git a/thirdparty/scripts/install_tinyxml2.sh b/thirdparty/scripts/install_tinyxml2.sh deleted file mode 100644 index e443ef8..0000000 --- a/thirdparty/scripts/install_tinyxml2.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -e -echo "Installing tinyxml2" - -# Use a specific version -VER_TAG=8.0.0 - -# Clone source code -if [ ! -d tinyxml2 ] ; then - git clone https://github.com/leethomason/tinyxml2.git --branch $VER_TAG - cd tinyxml2 -else - cd tinyxml2 - git checkout $VER_TAG -fi - -# Configure CMake -mkdir -p build && cd build -cmake .. $SHARED_CMAKE_ARGS - -# Build and install -cmake --build . --target install --config Release -j $NUM_JOBS - -echo "Installed tinyxml2"