Skip to content

Commit

Permalink
Release/v1.1 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhipengZhang-flexiv authored Aug 13, 2024
1 parent f5c1f43 commit f431f46
Show file tree
Hide file tree
Showing 28 changed files with 740 additions and 956 deletions.
38 changes: 34 additions & 4 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,62 @@ jobs:
- uses: actions/checkout@v2

- name: Build and install dependencies
# Build and install all dependencies to flexiv_omni_teleop installation directory.
# Build and install all dependencies to flexiv_tdk installation directory.
run: |
cd ${{github.workspace}}
cd thirdparty
bash build_and_install_dependencies.sh ~/teleop_install
- name: Build and install library
# Configure CMake, then build and install the flexiv_omni_teleop INTERFACE library to flexiv_omni_teleop installation directory.
# Configure CMake, then build and install the flexiv_tdk INTERFACE library to TDK installation directory.
run: |
cd ${{github.workspace}}
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/teleop_install
make install
- name: Build examples
# Find and link to the flexiv_omni_teleop INTERFACE library, then build all examples.
# Find and link to the flexiv_tdk INTERFACE library, then build all examples.
run: |
cd ${{github.workspace}}/example
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/teleop_install
make -j$(nproc)
# - name: Build tests
# # Find and link to the flexiv_omni_teleop INTERFACE library, then build all tests.
# # Find and link to the flexiv_tdk INTERFACE library, then build all tests.
# run: |
# cd ${{github.workspace}}/test
# mkdir -p build && cd build
# cmake .. -DCMAKE_INSTALL_PREFIX=~/teleop_install
# make -j$(nproc)

build-ubuntu-20:
# Use GitHub-hosted Ubuntu 20.04 runner
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Build and install dependencies
# Build and install all dependencies to TDK installation directory.
run: |
cd ${{github.workspace}}
cd thirdparty
bash build_and_install_dependencies.sh ~/tdk_install $(nproc)
- name: Build and install library
# Configure CMake, then build and install the flexiv_tdk INTERFACE library to TDK installation directory.
run: |
cd ${{github.workspace}}
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/tdk_install
make install
- name: Build examples
# Find and link to the flexiv_tdk INTERFACE library, then build all examples.
run: |
cd ${{github.workspace}}/example
mkdir -p build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/tdk_install
make -j$(nproc)
49 changes: 10 additions & 39 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cmake_minimum_required(VERSION 3.22.1)
cmake_minimum_required(VERSION 3.16.3)

# ===================================================================
# PROJECT SETUP
# ===================================================================
project(flexiv_omni_teleop VERSION 1.0.0)
project(flexiv_tdk VERSION 1.1.0)

# Configure build type
if(NOT CMAKE_BUILD_TYPE)
Expand All @@ -17,7 +17,7 @@ message("Processor: ${CMAKE_SYSTEM_PROCESSOR}")

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
set(TELEOP_STATIC_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/lib/libflexiv_omni_teleop.x86_64-linux-gnu.a")
set(TELEOP_STATIC_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/lib/libflexiv_tdk.x86_64-linux-gnu.a")
else()
message(FATAL_ERROR "Linux with ${CMAKE_SYSTEM_PROCESSOR} processor is currently not supported.")
endif()
Expand All @@ -36,43 +36,18 @@ list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
# ===================================================================
# 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()

# Eigen3
find_package(Eigen3 REQUIRED)
if(Eigen3_FOUND)
message(STATUS "Found Eigen3: ${Eigen3_DIR}")
endif()

# Fast-CDR
find_package(fastcdr 1.0.24 REQUIRED)
if(fastcdr_FOUND)
message(STATUS "Found fastcdr: ${fastcdr_DIR}")
endif()

# Fast-DDS (Fast-RTPS)
find_package(fastrtps 2.6.2 REQUIRED)
if(fastrtps_FOUND)
message(STATUS "Found fastrtps: ${fastrtps_DIR}")
endif()

# Boost-filesystem
find_package(Boost 1.72.0 COMPONENTS filesystem REQUIRED)
if(Boost_FOUND)
message(STATUS "Found Boost: ${Boost_DIR}")
endif()

# OpenSSL
find_package(OpenSSL REQUIRED)
if(OpenSSL_FOUND)
message(STATUS "Found OpenSSL, version: ${OPENSSL_VERSION}, libraries: ${OPENSSL_LIBRARIES}")
endif()

# flexiv_rdk
find_package(flexiv_rdk REQUIRED)
if(flexiv_rdk_FOUND)
message(STATUS "Found flexiv_rdk: ${flexiv_rdk_DIR}")
endif()

# ===================================================================
# CREATE LIBRARY
Expand All @@ -82,7 +57,7 @@ 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::omni::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
add_library(flexiv::${PROJECT_NAME} ALIAS ${PROJECT_NAME})

target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
Expand All @@ -92,11 +67,7 @@ target_include_directories(${PROJECT_NAME} INTERFACE
target_link_libraries(${PROJECT_NAME} INTERFACE
${TELEOP_STATIC_LIBRARY}
${OPENSSL_LIBRARIES}
Threads::Threads
Eigen3::Eigen
fastrtps
fastcdr
Boost::filesystem
flexiv::flexiv_rdk
)

# Use moderate compiler warning option
Expand Down
69 changes: 35 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,75 @@
# Flexiv Omni Teleop
# Flexiv TDK

![CMake Badge](https://github.com/flexivrobotics/flexiv_omni_teleop/actions/workflows/cmake.yml/badge.svg) ![Version](https://img.shields.io/badge/version-1.0-blue.svg) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
![CMake Badge](https://github.com/flexivrobotics/flexiv_tdk/actions/workflows/cmake.yml/badge.svg) ![Version](https://img.shields.io/badge/version-1.1-blue.svg) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)

The Flexiv Omni Teleop is an SDK provides C++ APIs for developing complex and customized applications involving robot-robot or device-robot teleoperation. The supported devices are listed below.
Flexiv TDK (Teleoperation Development Kit) is an SDK provides C++ APIs for developing complex and customized applications involving robot-robot or device-robot teleoperation. The supported devices are listed below.

## Supported devices

| **Supported teleop type** | **Supported local machine** | **Supported remote machine** |
| **Supported teleop type** | **Supported local devices** | **Supported remote devices** |
| ------------------------- | --------------------------- | ---------------------------- |
| robot-robot | Rizon4s | Rizon4s |

## Compatibility

| **Supported OS** | **Supported processor** | **Supported language** | **Required compiler kit** |
| -------------------- | ----------------------- | ---------------------- | ------------------------- |
| Linux (Ubuntu 22.04) | x86_64 | C++ | build-essential |
| **Supported OS** | **Supported processor** | **Supported language** | **Required compiler kit** |
| -------------------------- | ----------------------- | ---------------------- | ------------------------- |
| Linux (Ubuntu 20.04/22.04) | x86_64 | C++ | build-essential |

### Compile and install for Linux
### Install on Linux

1. In a new Terminal, install C++ compiler, libssl-dev, net-tools, Git, and CMake (with GUI) using the package manager:

sudo apt install build-essential libssl-dev net-tools git cmake cmake-qt-gui -y
sudo apt install build-essential libssl-dev net-tools git cmake cmake-qt-gui -y

2. Choose a directory for installing ``flexiv_omni_teleop`` library and all its dependencies. For example, a new folder named ``teleop_install`` under the home directory.
2. Choose a directory for installing ``flexiv_tdk`` library and all its dependencies. For example, a new folder named ``tdk_install`` under the home directory.

3. Please ensure that your network connection is unobstructed. Then, in a new Terminal, run the provided script to compile and install all dependencies to the installation directory chosen in step 2:

cd flexiv_omni_teleop/thirdparty
bash build_and_install_dependencies.sh ~/teleop_install
cd flexiv_tdk/thirdparty
bash build_and_install_dependencies.sh ~/tdk_install

4. In a new Terminal, use CMake to configure `flexiv_omni_teleop`:
4. In a new Terminal, use CMake to configure `flexiv_tdk`:

cd flexiv_omni_teleop
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/teleop_install
cd flexiv_tdk
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/tdk_install

NOTE: ``-D`` followed by ``CMAKE_INSTALL_PREFIX`` is a CMake parameter specifying the path of the chosen installation directory. Alternatively, this configuration step can also be done through CMake GUI.

5. Compile and install `flexiv_omni_teleop` library:
5. Install `flexiv_tdk` library:

cd flexiv_omni_teleop/build
cmake --build . --target install --config Release
cd flexiv_tdk/build
cmake --build . --target install --config Release

NOTE: the installation of `flexiv_omni_teleop` library is complete now. The following steps show how to link to the installed library from a user project.
NOTE: the installation of `flexiv_tdk` library is complete now. The following steps show how to link to the installed library from a user project.

### Link to the installed library to a user project

1. To find and link to the installed `flexiv_omni_teleop` library to a user project, using the provided example project for instance:
1. To find and link to the installed `flexiv_tdk` library to a user project, using the provided example project for instance:

cd flexiv_omni_teleop/example
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/teleop_install
cmake --build . --config Release -j 4
cd flexiv_tdk/example
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/tdk_install
cmake --build . --config Release -j 4

NOTE: ``-D`` followed by ``CMAKE_INSTALL_PREFIX`` tells user project's CMake where to find the installed `flexiv_omni_teleop` library.
NOTE: ``-D`` followed by ``CMAKE_INSTALL_PREFIX`` tells user project's CMake where to find the installed `flexiv_tdk` library.

### Run Omni-Teleop
### Run tdk example

1. Apply for Omni license to run Omni-Teleop. See [Omni_license.md](omni_license_generator/Omni_license.md)
1. Apply for license to run tdk. See [apply_for_license.md](./license_generator/apply_for_license.md)

2. Set all the robots to `Auto/Remote Mode` via flexiv Elements, then to run the compiled example program:
2. Set all the robots to `Auto/Remote Mode` via Flexiv Elements, then to run the compiled example program:

./<program_name> [remote_robot_SN] [local_robot_SN] [path_to_omni_licenseCfg.json]
./<program_name> [local_robot_serial_number] [remote_robot_serial_number] [path_to_omni_licenseCfg.json]

### API Documentation

## API Documentation

API doc can be generated using doxygen

sudo apt install doxygen-latex graphviz
cd flexiv_omni_teleop
doxygen doc/Doxygen.in
cd flexiv_tdk
doxygen doc/Doxyfile.in

The generated API doc is under ```flexiv_omni_teleop/doc/html ```. You can open any of the html file with your web browser to view it.
The generated API doc is under ```flexiv_tdk/doc/html ```. You can open any of the html file with your web browser to view it.
10 changes: 5 additions & 5 deletions cmake/FlexivInstallLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ macro(FlexivInstallLibrary)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${PROJECT_NAME}-config-version.cmake"
VERSION ${PACKAGE_VERSION}
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::omni::"
NAMESPACE "flexiv::"
DESTINATION "lib/cmake/${PROJECT_NAME}"
)

Expand All @@ -83,13 +83,13 @@ macro(FlexivInstallLibrary)
)

# Use the CPack Package Generator
set(CPACK_PACKAGE_VENDOR "flexiv")
set(CPACK_PACKAGE_VENDOR "Flexiv")
set(CPACK_PACKAGE_CONTACT "support@flexiv.com")
set(CPACK_PACKAGE_DESCRIPTION "flexiv omni teleop ")
set(CPACK_PACKAGE_DESCRIPTION "Flexiv Teleop Development Kit (TDK)")
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")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
include(CPack)
endmacro()
12 changes: 0 additions & 12 deletions cmake/flexiv_omni_teleop-config.cmake.in

This file was deleted.

7 changes: 7 additions & 0 deletions cmake/flexiv_tdk-config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include(CMakeFindDependencyMacro)

# Find dependency
find_dependency(flexiv_rdk REQUIRED)
find_package(OpenSSL REQUIRED)
# Add targets file
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake")
Loading

0 comments on commit f431f46

Please sign in to comment.