Skip to content

Commit 6ff4790

Browse files
authored
1 parent 8137e3d commit 6ff4790

File tree

65 files changed

+1953
-1479
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1953
-1479
lines changed

.github/workflows/cmake.yml

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ env:
1313

1414
jobs:
1515
build-ubuntu-22:
16-
# The CMake configure and build commands are platform agnostic and should work equally
17-
# well on Windows or Mac. You can convert this to a matrix build if you need
18-
# cross-platform coverage.
19-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
16+
# Use Ubuntu 22.04 runner
2017
runs-on: ubuntu-22.04
2118

2219
steps:
@@ -27,7 +24,7 @@ jobs:
2724
run: |
2825
cd ${{github.workspace}}
2926
cd thirdparty
30-
bash build_and_install_dependencies.sh ~/rdk_install
27+
bash build_and_install_dependencies.sh ~/rdk_install $(nproc)
3128
3229
- name: Build and install library
3330
# Configure CMake, then build and install the flexiv_rdk INTERFACE library to RDK installation directory.
@@ -54,10 +51,7 @@ jobs:
5451
make -j$(nproc)
5552
5653
build-ubuntu-20:
57-
# The CMake configure and build commands are platform agnostic and should work equally
58-
# well on Windows or Mac. You can convert this to a matrix build if you need
59-
# cross-platform coverage.
60-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
54+
# Use Ubuntu 20.04 runner
6155
runs-on: ubuntu-20.04
6256

6357
steps:
@@ -68,7 +62,7 @@ jobs:
6862
run: |
6963
cd ${{github.workspace}}
7064
cd thirdparty
71-
bash build_and_install_dependencies.sh ~/rdk_install
65+
bash build_and_install_dependencies.sh ~/rdk_install $(nproc)
7266
7367
- name: Build and install library
7468
# Configure CMake, then build and install the flexiv_rdk INTERFACE library to RDK installation directory.
@@ -94,12 +88,9 @@ jobs:
9488
cmake .. -DCMAKE_INSTALL_PREFIX=~/rdk_install
9589
make -j$(nproc)
9690
97-
build-windows-2022:
98-
# The CMake configure and build commands are platform agnostic and should work equally
99-
# well on Windows or Mac. You can convert this to a matrix build if you need
100-
# cross-platform coverage.
101-
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
102-
runs-on: windows-2022
91+
build-macos-12:
92+
# Use self-hosted macOS 12 runner with arm64 processor
93+
runs-on: [self-hosted, macos-12, ARM64]
10394

10495
steps:
10596
- uses: actions/checkout@v2
@@ -109,7 +100,45 @@ jobs:
109100
run: |
110101
cd ${{github.workspace}}
111102
cd thirdparty
112-
bash build_and_install_dependencies.sh ~/rdk_install
103+
bash build_and_install_dependencies.sh ~/rdk_install $(sysctl -n hw.ncpu)
104+
105+
- name: Build and install library
106+
# Configure CMake, then build and install the flexiv_rdk INTERFACE library to RDK installation directory.
107+
run: |
108+
cd ${{github.workspace}}
109+
mkdir -p build && cd build
110+
cmake .. -DCMAKE_INSTALL_PREFIX=~/rdk_install
111+
make install
112+
113+
- name: Build examples
114+
# Find and link to the flexiv_rdk INTERFACE library, then build all examples.
115+
run: |
116+
cd ${{github.workspace}}/example
117+
mkdir -p build && cd build
118+
cmake .. -DCMAKE_INSTALL_PREFIX=~/rdk_install
119+
make -j$(sysctl -n hw.ncpu)
120+
121+
- name: Build tests
122+
# Find and link to the flexiv_rdk INTERFACE library, then build all tests.
123+
run: |
124+
cd ${{github.workspace}}/test
125+
mkdir -p build && cd build
126+
cmake .. -DCMAKE_INSTALL_PREFIX=~/rdk_install
127+
make -j$(sysctl -n hw.ncpu)
128+
129+
build-windows-2019:
130+
# Use Windows 2019 runner because the 2022 runner uses a MSVC version that's too new for one of the dependencies
131+
runs-on: windows-2019
132+
133+
steps:
134+
- uses: actions/checkout@v2
135+
136+
- name: Build and install dependencies
137+
# Build and install all dependencies to RDK installation directory.
138+
run: |
139+
cd ${{github.workspace}}
140+
cd thirdparty
141+
bash build_and_install_dependencies.sh ~/rdk_install $(nproc)
113142
114143
- name: Build and install library
115144
# Configure CMake, then build and install the flexiv_rdk INTERFACE library to RDK installation directory.

CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
cmake_minimum_required(VERSION 3.18.6)
1+
cmake_minimum_required(VERSION 3.16.3)
22

33
# ===================================================================
44
# PROJECT SETUP
55
# ===================================================================
6-
project(flexiv_rdk VERSION 1.1.0)
6+
project(flexiv_rdk VERSION 1.2.0)
77

88
# Configure build type
99
if(NOT CMAKE_BUILD_TYPE)
@@ -16,21 +16,21 @@ message("OS: ${CMAKE_SYSTEM_NAME}")
1616
message("Processor: ${CMAKE_SYSTEM_PROCESSOR}")
1717
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
1818
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
19-
set(RDK_STATIC_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/lib/libflexiv_rdk.linux-gnu-x86_64.a")
19+
set(RDK_STATIC_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/lib/libflexiv_rdk.x86_64-linux-gnu.a")
2020
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
21-
set(RDK_STATIC_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/lib/libflexiv_rdk.linux-gnu-aarch64.a")
21+
set(RDK_STATIC_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/lib/libflexiv_rdk.aarch64-linux-gnu.a")
2222
else()
2323
message(FATAL_ERROR "Linux with ${CMAKE_SYSTEM_PROCESSOR} processor is currently not supported.")
2424
endif()
2525
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
2626
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64")
27-
set(RDK_STATIC_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/lib/libflexiv_rdk.darwin-arm64.a")
27+
set(RDK_STATIC_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/lib/libflexiv_rdk.arm64-darwin.a")
2828
else()
2929
message(FATAL_ERROR "Mac with ${CMAKE_SYSTEM_PROCESSOR} processor is currently not supported.")
3030
endif()
3131
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
3232
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "AMD64")
33-
set(RDK_STATIC_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/lib/flexiv_rdk.win-amd64.lib")
33+
set(RDK_STATIC_LIBRARY "${CMAKE_CURRENT_SOURCE_DIR}/lib/flexiv_rdk.win_amd64.lib")
3434
else()
3535
message(FATAL_ERROR "Windows with ${CMAKE_SYSTEM_PROCESSOR} processor is currently not supported.")
3636
endif()
@@ -47,19 +47,19 @@ if(Threads_FOUND)
4747
endif()
4848

4949
# Eigen3
50-
find_package(Eigen3 REQUIRED HINTS ${CMAKE_INSTALL_PREFIX})
50+
find_package(Eigen3 REQUIRED)
5151
if(Eigen3_FOUND)
5252
message(STATUS "Found Eigen3: ${Eigen3_DIR}")
5353
endif()
5454

5555
# Fast-CDR
56-
find_package(fastcdr 1.0.24 REQUIRED HINTS ${CMAKE_INSTALL_PREFIX})
56+
find_package(fastcdr 1.0.24 REQUIRED)
5757
if(fastcdr_FOUND)
5858
message(STATUS "Found fastcdr: ${fastcdr_DIR}")
5959
endif()
6060

6161
# Fast-DDS (Fast-RTPS)
62-
find_package(fastrtps 2.6.2 REQUIRED HINTS ${CMAKE_INSTALL_PREFIX})
62+
find_package(fastrtps 2.6.2 REQUIRED)
6363
if(fastrtps_FOUND)
6464
message(STATUS "Found fastrtps: ${fastrtps_DIR}")
6565
endif()
@@ -70,11 +70,11 @@ endif()
7070
# Create an INTERFACE library with no source file to compile
7171
add_library(${PROJECT_NAME} INTERFACE)
7272

73-
# Create an alias of the library using flexiv namespace,
73+
# Create an alias of the library using flexiv namespace,
7474
# to imitate the install target which uses flexiv namespace.
7575
add_library(flexiv::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
7676

77-
target_include_directories(${PROJECT_NAME} INTERFACE
77+
target_include_directories(${PROJECT_NAME} INTERFACE
7878
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
7979
$<INSTALL_INTERFACE:include>
8080
)
@@ -87,7 +87,7 @@ target_link_libraries(${PROJECT_NAME} INTERFACE
8787
fastcdr
8888
)
8989

90-
# Use moderate compiler warning option
90+
# Use moderate compiler warning option
9191
if(CMAKE_HOST_UNIX)
9292
target_compile_options(${PROJECT_NAME} INTERFACE -Wall -Wextra)
9393
else()

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ Flexiv RDK (Robotic Development Kit), a key component of the Flexiv Robotic Soft
1111

1212
## Compatibility Overview
1313

14-
| **Supported OS** | **Supported processor** | **Supported language** | **Required compiler kit** |
15-
| ------------------------------ | ----------------------- | ---------------------- | ------------------------- |
16-
| Linux (Ubuntu 18/20/22 tested) | x86_64, arm64 | C++, Python | build-essential |
17-
| macOS 12 (Monterey) | arm64 | C++, Python | Xcode Command Line Tools |
18-
| Windows 10 | x86_64 | C++, Python | MSVC 14.0+ |
14+
| **Supported OS** | **Supported processor** | **Supported language** | **Required compiler kit** |
15+
| -------------------------- | ----------------------- | ---------------------- | ------------------------- |
16+
| Linux (Ubuntu 20.04/22.04) | x86_64, arm64 | C++, Python | build-essential |
17+
| macOS 12 (Monterey) | arm64 | C++, Python | Xcode Command Line Tools |
18+
| Windows 10 | x86_64 | C++, Python | MSVC 14.0+ |
1919

2020
## Quick Start
2121

@@ -34,7 +34,7 @@ NOTE: if you will only be using Python RDK, you can skip this section and jump t
3434
sudo apt install build-essential git cmake cmake-qt-gui -y
3535

3636
2. Choose a directory for installing ``flexiv_rdk`` library and all its dependencies. For example, a new folder named ``rdk_install`` under the home directory.
37-
3. In a new Terminal, run the provided script to compile and install all dependencies to the installation directory chosen in step 1:
37+
3. In a new Terminal, run the provided script to compile and install all dependencies to the installation directory chosen in step 2:
3838

3939
cd flexiv_rdk/thirdparty
4040
bash build_and_install_dependencies.sh ~/rdk_install
@@ -82,10 +82,14 @@ NOTE: if you will only be using Python RDK, you can skip this section and jump t
8282

8383
#### Compile and install for Windows
8484

85-
1. Install Microsoft Visual Studio with version 2015 or above (MSVC 14.0+). Choose the "Desktop development with C++" package during installation.
86-
2. Download ``cmake-3.x.x-windows-x86_64.msi`` from [CMake download page](https://cmake.org/download/) and install the msi file. The minimum required version is 3.16.3. **Add CMake to system PATH** when prompted, so that ``cmake`` and ``cmake-gui`` command can be used from Command Prompt or a bash emulator.
87-
3. Install a bash emulator. Git Bash that comes with Git (for Windows) installation is recommended.
88-
4. Within the bash emulator, the rest steps are the same as [Compile and install for Linux](#compile-and-install-for-linux), beginning from step 2.
85+
1. Install Microsoft Visual Studio with version 2015 or above (MSVC 14.0+). Choose "Desktop development with C++" under the *Workloads* tab during installation. You only need to keep the following components for the selected workload:
86+
* MSVC ... C++ x64/x86 build tools (Latest)
87+
* C++ CMake tools for Windows
88+
* Windows 10 SDK or Windows 11 SDK, depending on your actual Windows version
89+
2. Due to compatibility issue from one of the dependencies, the maximum compatible MSVC version is v14.36. Thus if the above selected "Latest" MSVC is higher than v14.36, an **additional** compatible MSVC needs to be installed. To do so, go to the *Individual components* tab (next to *Workloads*), and search for "MSVC x64/x86 build tools", then select a MSVC with version <= 14.36 to install. Note: you need to also **keep** the "Latest" selection of MSVC that comes with the "Desktop development with C++" workload so that the "C++ CMake tools for Windows" component can work properly.
90+
3. Download ``cmake-3.x.x-windows-x86_64.msi`` from [CMake download page](https://cmake.org/download/) and install the msi file. The minimum required version is 3.16.3. **Add CMake to system PATH** when prompted, so that ``cmake`` and ``cmake-gui`` command can be used from Command Prompt or a bash emulator.
91+
4. Install a bash emulator. Git Bash that comes with Git (for Windows) installation is recommended.
92+
5. Within the bash emulator, the rest steps are the same as [Compile and install for Linux](#compile-and-install-for-linux), beginning from step 2.
8993

9094
### Python RDK
9195

doc/Doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "Flexiv RDK APIs"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = "1.1"
41+
PROJECT_NUMBER = "1.2"
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

example/CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.18.6)
1+
cmake_minimum_required(VERSION 3.16.3)
22
project(flexiv_rdk-examples)
33

44
# Show verbose build info
@@ -21,10 +21,11 @@ set(EXAMPLE_LIST
2121
basics5_zero_force_torque_sensors
2222
basics6_gripper_control
2323
basics7_auto_recovery
24+
basics8_update_robot_tool
25+
intermediate6_robot_dynamics
2426
intermediate7_teach_by_demonstration
2527
)
2628

27-
2829
# Additional examples for Linux and Mac
2930
if(CMAKE_HOST_UNIX)
3031
list(APPEND EXAMPLE_LIST
@@ -33,7 +34,6 @@ if(CMAKE_HOST_UNIX)
3334
intermediate3_realtime_joint_floating
3435
intermediate4_realtime_cartesian_pure_motion_control
3536
intermediate5_realtime_cartesian_motion_force_control
36-
intermediate6_robot_dynamics
3737
)
3838
endif()
3939

@@ -44,8 +44,9 @@ find_package(flexiv_rdk REQUIRED)
4444
foreach(example ${EXAMPLE_LIST})
4545
add_executable(${example} ${example}.cpp)
4646
target_link_libraries(${example} flexiv::flexiv_rdk)
47+
4748
# C++17 required
48-
set_target_properties(${example} PROPERTIES
49+
set_target_properties(${example} PROPERTIES
4950
CXX_STANDARD 17
5051
CXX_STANDARD_REQUIRED ON)
5152
endforeach()

example/basics1_display_robot_states.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @example basics1_display_robot_states.cpp
33
* This tutorial does the very first thing: check connection with the robot server and print
44
* received robot states.
5-
* @copyright Copyright (C) 2016-2021 Flexiv Ltd. All Rights Reserved.
5+
* @copyright Copyright (C) 2016-2023 Flexiv Ltd. All Rights Reserved.
66
* @author Flexiv
77
*/
88

@@ -37,16 +37,12 @@ void printHelp()
3737
/** @brief Print robot states data @ 1Hz */
3838
void printRobotStates(flexiv::Robot& robot, flexiv::Log& log)
3939
{
40-
// Data struct storing robot states
41-
flexiv::RobotStates robotStates;
42-
4340
while (true) {
44-
// Get the latest robot states
45-
robot.getRobotStates(robotStates);
46-
4741
// Print all robot states in JSON format using the built-in ostream operator overloading
42+
// Note: because this is not a performance-critical loop, we can use the
43+
// return-by-value-copy version of getRobotStates()
4844
log.info("Current robot states:");
49-
std::cout << robotStates << std::endl;
45+
std::cout << robot.getRobotStates() << std::endl;
5046
std::this_thread::sleep_for(std::chrono::seconds(1));
5147
}
5248
}
@@ -95,14 +91,8 @@ int main(int argc, char* argv[])
9591
robot.enable();
9692

9793
// Wait for the robot to become operational
98-
int secondsWaited = 0;
9994
while (!robot.isOperational()) {
10095
std::this_thread::sleep_for(std::chrono::seconds(1));
101-
if (++secondsWaited == 10) {
102-
log.warn(
103-
"Still waiting for robot to become operational, please check that the robot 1) "
104-
"has no fault, 2) is in [Auto (remote)] mode");
105-
}
10696
}
10797
log.info("Robot is now operational");
10898

example/basics2_clear_fault.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @example basics2_clear_fault.cpp
33
* This tutorial clears minor faults from the robot server if any. Note that critical faults cannot
44
* be cleared, see RDK manual for more details.
5-
* @copyright Copyright (C) 2016-2021 Flexiv Ltd. All Rights Reserved.
5+
* @copyright Copyright (C) 2016-2023 Flexiv Ltd. All Rights Reserved.
66
* @author Flexiv
77
*/
88

example/basics3_primitive_execution.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @example basics3_primitive_execution.cpp
33
* This tutorial executes several basic robot primitives (unit skills). For detailed documentation
44
* on all available primitives, please see [Flexiv Primitives](https://www.flexiv.com/primitives/).
5-
* @copyright Copyright (C) 2016-2021 Flexiv Ltd. All Rights Reserved.
5+
* @copyright Copyright (C) 2016-2023 Flexiv Ltd. All Rights Reserved.
66
* @author Flexiv
77
*/
88

@@ -79,14 +79,8 @@ int main(int argc, char* argv[])
7979
robot.enable();
8080

8181
// Wait for the robot to become operational
82-
int secondsWaited = 0;
8382
while (!robot.isOperational()) {
8483
std::this_thread::sleep_for(std::chrono::seconds(1));
85-
if (++secondsWaited == 10) {
86-
log.warn(
87-
"Still waiting for robot to become operational, please check that the robot 1) "
88-
"has no fault, 2) is in [Auto (remote)] mode");
89-
}
9084
}
9185
log.info("Robot is now operational");
9286

0 commit comments

Comments
 (0)