-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from MOCAP4ROS2-Project/adapt_and_package_ready
Set CI. Add Vicon SDK sources. Adapt to REP 144
- Loading branch information
Showing
189 changed files
with
42,372 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: rolling | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- rolling | ||
push: | ||
branches: | ||
- rolling | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04] | ||
fail-fast: false | ||
steps: | ||
- name: Setup ROS 2 | ||
uses: ros-tooling/[email protected] | ||
with: | ||
required-ros-distributions: humble | ||
- name: build and test | ||
uses: ros-tooling/[email protected] | ||
with: | ||
package-name: mocap4r2_vicon_driver | ||
target-ros2-distro: humble | ||
vcs-repo-file-url: https://raw.githubusercontent.com/MOCAP4ROS2-Project/mocap4ros2_vicon/rolling/dependency_repos.repos | ||
- name: Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
file: ros_ws/lcov/total_coverage.info | ||
flags: unittests | ||
name: codecov-umbrella | ||
# yml: ./codecov.yml | ||
fail_ci_if_error: false |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
repositories: | ||
mocap4r2_msgs: | ||
type: git | ||
url: https://github.com/MOCAP4ROS2-Project/mocap4r2_msgs.git | ||
version: rolling | ||
mocap4r2: | ||
type: git | ||
url: https://github.com/MOCAP4ROS2-Project/mocap4r2.git | ||
version: rolling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
project(mocap4r2_vicon_driver) | ||
|
||
# Default to C++17 | ||
if(NOT CMAKE_CXX_STANDARD) | ||
set(CMAKE_CXX_STANDARD 17) | ||
endif() | ||
|
||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
|
||
find_package(ament_cmake REQUIRED) | ||
find_package(rclcpp REQUIRED) | ||
find_package(rclcpp_lifecycle REQUIRED) | ||
find_package(mocap4r2_msgs REQUIRED) | ||
find_package(geometry_msgs REQUIRED) | ||
find_package(mocap4r2_control REQUIRED) | ||
|
||
# Used by Vicon SDK. Now we dont copy boost binaries shipped with driver. | ||
find_package(Boost REQUIRED COMPONENTS thread date_time chrono) | ||
|
||
set(dependencies | ||
rclcpp | ||
rclcpp_lifecycle | ||
mocap4r2_msgs | ||
mocap4r2_control | ||
geometry_msgs | ||
) | ||
|
||
file(GLOB_RECURSE VICON_HEADER_FILES "ThirdParty/*.h") | ||
file(GLOB_RECURSE VICON_SOURCES "ThirdParty/*.cpp") | ||
|
||
set(VICON_INCLUDE_DIRS "") | ||
foreach(HEADER ${VICON_HEADER_FILES}) | ||
get_filename_component(DIR ${HEADER} DIRECTORY) | ||
set(VICON_INCLUDE_DIRS ${VICON_INCLUDE_DIRS} ${DIR}) | ||
endforeach() | ||
list(REMOVE_DUPLICATES VICON_INCLUDE_DIRS) | ||
|
||
|
||
include_directories( | ||
include | ||
ThirdParty/DataStream | ||
ThirdParty | ||
${VICON_INCLUDE_DIRS} | ||
) | ||
|
||
add_library(vicon_sdk SHARED ${VICON_SOURCES}) | ||
target_link_libraries(vicon_sdk PUBLIC ${Boost_LIBRARIES}) | ||
|
||
|
||
add_library( | ||
${PROJECT_NAME} | ||
src/mocap4r2_vicon_driver/mocap4r2_vicon_driver.cpp) | ||
|
||
ament_target_dependencies(${PROJECT_NAME} ${dependencies}) | ||
target_compile_definitions(${PROJECT_NAME} | ||
PRIVATE "VICON_BUILDING_LIBRARY") | ||
|
||
add_executable(mocap4r2_vicon_driver_main | ||
src/mocap4r2_vicon_driver_main.cpp | ||
) | ||
ament_target_dependencies(mocap4r2_vicon_driver_main ${dependencies}) | ||
target_link_libraries(mocap4r2_vicon_driver_main | ||
${PROJECT_NAME} | ||
vicon_sdk | ||
) | ||
|
||
ament_target_dependencies(mocap4r2_vicon_driver ${dependencies}) | ||
target_link_libraries(mocap4r2_vicon_driver | ||
vicon_sdk | ||
) | ||
|
||
install(DIRECTORY include/ | ||
DESTINATION include/ | ||
) | ||
|
||
install(DIRECTORY | ||
launch | ||
config | ||
DESTINATION share/${PROJECT_NAME} | ||
) | ||
|
||
install(TARGETS | ||
mocap4r2_vicon_driver_main | ||
RUNTIME DESTINATION lib/${PROJECT_NAME} | ||
) | ||
|
||
install(TARGETS | ||
${PROJECT_NAME} vicon_sdk | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION bin | ||
) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_cmake_copyright REQUIRED) | ||
find_package(ament_cmake_cppcheck REQUIRED) | ||
find_package(ament_cmake_cpplint REQUIRED) | ||
find_package(ament_cmake_lint_cmake REQUIRED) | ||
find_package(ament_cmake_xmllint REQUIRED) | ||
find_package(ament_cmake_uncrustify REQUIRED) | ||
|
||
|
||
file(GLOB_RECURSE EXCLUDE_FILES ThirdParty/*) | ||
|
||
ament_copyright(EXCLUDE ${EXCLUDE_FILES}) | ||
ament_cppcheck( | ||
EXCLUDE ${EXCLUDE_FILES} | ||
LANGUAGE c++ | ||
) | ||
ament_cpplint(EXCLUDE ${EXCLUDE_FILES}) | ||
ament_lint_cmake() | ||
ament_uncrustify( | ||
EXCLUDE ${EXCLUDE_FILES} | ||
LANGUAGE c++ | ||
) | ||
|
||
find_package(ament_cmake_gtest REQUIRED) | ||
ament_add_gtest(test_mocap4r2_vicon_driver test/test_mocap4r2_vicon_driver.cpp) | ||
target_link_libraries(test_mocap4r2_vicon_driver ${PROJECT_NAME}) | ||
endif() | ||
|
||
ament_export_include_directories(include) | ||
ament_export_libraries(${PROJECT_NAME}) | ||
ament_export_dependencies(${dependencies}) | ||
ament_package() |
77 changes: 77 additions & 0 deletions
77
mocap4r2_vicon_driver/ThirdParty/DataStream/ViconCGStream/ApexHaptics.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
|
||
////////////////////////////////////////////////////////////////////////////////// | ||
// MIT License | ||
// | ||
// Copyright (c) 2020 Vicon Motion Systems Ltd | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
////////////////////////////////////////////////////////////////////////////////// | ||
#pragma once | ||
|
||
#include "Item.h" | ||
#include <set> | ||
|
||
namespace ViconCGStream | ||
{ | ||
//------------------------------------------------------------------------------------------------- | ||
|
||
/// Used by the client to enable and disable haptics on Apex device. | ||
class VApexHaptics : public VItem | ||
{ | ||
public: | ||
|
||
/// List of devices with haptics feedback on | ||
std::set< unsigned int > m_OnDevicesList; | ||
|
||
|
||
/// Equality operator | ||
bool operator == ( const VApexHaptics & i_rOther ) const | ||
{ | ||
return m_OnDevicesList == i_rOther.m_OnDevicesList; | ||
} | ||
|
||
/// Object type enum. | ||
virtual ViconCGStreamType::Enum TypeID() const | ||
{ | ||
return ViconCGStreamEnum::ApexHaptics; | ||
} | ||
|
||
/// Filter ID | ||
virtual ViconCGStreamType::UInt32 FilterID() const | ||
{ | ||
return FILTER_NA; | ||
} | ||
|
||
/// Read function. | ||
virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) | ||
{ | ||
return i_rBuffer.Read( m_OnDevicesList ); | ||
} | ||
|
||
/// Write function. | ||
virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const | ||
{ | ||
i_rBuffer.Write( m_OnDevicesList ); | ||
} | ||
|
||
}; | ||
|
||
//------------------------------------------------------------------------------------------------- | ||
}; | ||
|
Oops, something went wrong.