diff --git a/.gitignore b/.gitignore index c1276d7..3325357 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,8 @@ install/ 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 +# CMake at configure time. +lib/*.a diff --git a/CMakeLists.txt b/CMakeLists.txt index 57a735e..c03b4b0 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,25 @@ 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}") +endif() + # =================================================================== # PROJECT DEPENDENCIES # =================================================================== diff --git a/cmake/FlexivInstallLibrary.cmake b/cmake/FlexivInstallLibrary.cmake index 2d64d84..4d558d4 100644 --- a/cmake/FlexivInstallLibrary.cmake +++ b/cmake/FlexivInstallLibrary.cmake @@ -85,7 +85,7 @@ macro(FlexivInstallLibrary) # 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 ${CMAKE_CURRENT_SOURCE_DIR}/lib/${SIM_PLUGIN_LIB} + install(FILES ${SIM_PLUGIN_LIB_PATH} DESTINATION ${CMAKE_INSTALL_LIBDIR} RENAME ${CMAKE_STATIC_LIBRARY_PREFIX}${PROJECT_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX} ) diff --git a/include/flexiv/sim_plugin/data.hpp b/include/flexiv/sim_plugin/data.hpp index a9e5711..f546b9c 100644 --- a/include/flexiv/sim_plugin/data.hpp +++ b/include/flexiv/sim_plugin/data.hpp @@ -48,8 +48,8 @@ struct SimRobotStates * @note This contains values for both the external axes (if any) and the robot manipulator. */ std::vector dq = {}; - /** Current wrist force sensor reading of the simulated robot: \f$ [f_x, f_y, f_z] \f$. Unit: - * \f$ [N] \f$. */ + /** Current wrist force sensor reading of the simulated robot: \f$ [f_x, f_y, f_z] \f$. Unit: \f$ + * [N] \f$. */ std::vector wrist_force = {}; /** Current wrist torque sensor reading of the simulated robot: \f$ [m_x, m_y, m_z] \f$. Unit: @@ -83,4 +83,4 @@ struct SimRobotCommands } /* namespace sim_plugin */ } /* namespace flexiv */ -#endif /* FLEXIV_SIM_PLUGIN_DATA_HPP_ */ \ No newline at end of file +#endif /* FLEXIV_SIM_PLUGIN_DATA_HPP_ */ diff --git a/lib/libflexiv_sim_plugin.x86_64-linux-gnu.a b/lib/libflexiv_sim_plugin.x86_64-linux-gnu.a deleted file mode 100644 index 75a9215..0000000 Binary files a/lib/libflexiv_sim_plugin.x86_64-linux-gnu.a and /dev/null differ diff --git a/lib/libflexiv_sim_plugin.x86_64-linux-gnu.a.sha256 b/lib/libflexiv_sim_plugin.x86_64-linux-gnu.a.sha256 new file mode 100644 index 0000000..e33d922 --- /dev/null +++ b/lib/libflexiv_sim_plugin.x86_64-linux-gnu.a.sha256 @@ -0,0 +1 @@ +d95da285eac19eac1d64e5e953a2690f26f4791b9c03d5a9896569717fae6fc0 \ No newline at end of file