Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 14 additions & 25 deletions kortex_api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,37 +1,26 @@
cmake_minimum_required(VERSION 3.14)
include(FetchContent)
#include(ExternalProject)
FetchContent_Declare(
kinova_binary_api
URL https://artifactory.kinovaapps.com:443/artifactory/generic-public/kortex/API/2.5.0/linux_x86-64_x86_gcc.zip
URL_HASH MD5=64bd86e7ab8bda90ef1fc7d6a356e080
)

FetchContent_MakeAvailable(kinova_binary_api)

project(kortex_api)

#Future:
# convert API_URL components from CMAKE_SYSTEM variables.
# The kinova artifactory server artifacts have slightly different expectations and they need some transformations
# Could build something like: (URL_OS)_(URL_PROCESSOR)_(?)_(URL_COMPILER).zip
# string(REPLACE "_" "-" URL_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}) # x86_64 -> x86-64
# string(TOLOWER ${CMAKE_SYSTEM_NAME} URL_OS) # Linux -> linux
include(FetchContent)

# Select correct Kinova Binary API zip based on platform

#Current: only support Linux x86_64
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(API_URL https://artifactory.kinovaapps.com:443/artifactory/generic-public/kortex/API/2.5.0/linux_x86-64_x86_gcc.zip)
set(API_URL "https://artifactory.kinovaapps.com:443/artifactory/generic-public/kortex/API/2.7.0/linux_x86-64_x86_gcc.zip")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(API_URL "https://artifactory.kinovaapps.com:443/artifactory/generic-local-public/kortex/API/2.7.0/linux_aarch64_gcc_7.4.zip")
else()
set(API_URL "")
message(FATAL_ERROR "Unsupported System: currently support is for Linux x68_64. Detected ${CMAKE_SYSTEM_NAME} and ${CMAKE_SYSTEM_PROCESSOR}")
message(FATAL_ERROR "Unsupported System: Currently support is for Linux x68_64 or aarch64. Detected ${CMAKE_SYSTEM_NAME} and ${CMAKE_SYSTEM_PROCESSOR}")
endif()

#ExternalProject_Add(kinova_binary_api
# URL ${API_URL}
# CONFIGURE_COMMAND ""
# BUILD_COMMAND ""
# INSTALL_COMMAND ""
#)
# Download/unpack the Kinova binary API headers
FetchContent_Declare(
kinova_binary_api
URL ${API_URL}
)

FetchContent_MakeAvailable(kinova_binary_api)

find_package(ament_cmake REQUIRED)

Expand Down
29 changes: 15 additions & 14 deletions kortex_driver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
cmake_minimum_required(VERSION 3.14)
project(kortex_driver)

include(FetchContent)

# Select correct Kinova Binary API zip based on platform

if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(API_URL "https://artifactory.kinovaapps.com:443/artifactory/generic-public/kortex/API/2.5.0/linux_x86-64_x86_gcc.zip")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(API_URL "https://artifactory.kinovaapps.com:443/artifactory/generic-local-public/kortex/API/2.7.0/linux_aarch64_gcc_7.4.zip")
else()
set(API_URL "")
message(FATAL_ERROR "Unsupported System: Detected ${CMAKE_SYSTEM_NAME} and ${CMAKE_SYSTEM_PROCESSOR}")
endif()

FetchContent_Declare(
kinova_binary_api
URL https://artifactory.kinovaapps.com:443/artifactory/generic-public/kortex/API/2.5.0/linux_x86-64_x86_gcc.zip
URL_HASH MD5=64bd86e7ab8bda90ef1fc7d6a356e080
URL ${API_URL}
)
FetchContent_MakeAvailable(kinova_binary_api)

project(kortex_driver)

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
Expand All @@ -28,16 +39,6 @@ find_package(pluginlib REQUIRED)
find_package(rclcpp REQUIRED)
find_package(kortex_api REQUIRED)

#Current: only support Linux x86_64
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(API_URL https://artifactory.kinovaapps.com:443/artifactory/generic-public/kortex/API/2.5.0/linux_x86-64_x86_gcc.zip)
else()
# TODO(future) to support ARM or other builds logic could go here to fetch the precompiled libKortexApiCpp.a
# see notes in kortex_api CMakeList.txt
message(WARNING "Detected ${CMAKE_SYSTEM_NAME} and ${CMAKE_SYSTEM_PROCESSOR}")
message(FATAL_ERROR "Unsupported System: currently support is for Linux x68_64.")
endif()

# CMake does not allow IMPORTED libraries to be installed
# The package kortex_api will download and setup the include directories
add_library(KortexApiCpp STATIC IMPORTED)
Expand Down
1 change: 0 additions & 1 deletion kortex_driver/src/hardware_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ CallbackReturn KortexMultiInterfaceHardware::on_init(const hardware_interface::H
// command.set_duration = execute time (milliseconds) according to the api ->
// (not implemented yet)
// see: https://github.com/Kinovarobotics/kortex/blob/master/api_cpp/doc/markdown/messages/Base/TwistCommand.md
k_api_twist_command_.set_duration(0);
k_api_twist_ = k_api_twist_command_.mutable_twist();
}

Expand Down
Loading