├── .bashrc ├── Dockerfile ├── LICENSE ├── README.md ├── docs └── logos │ ├── qualisys_logo.png │ └── vicon_logo.jpeg ├── mocap_base ├── CMakeLists.txt ├── include │ └── mocap_base │ │ ├── KalmanFilter.h │ │ └── MoCapDriverBase.h ├── package.xml └── src │ ├── KalmanFilter.cpp │ └── MoCapDriverBase.cpp ├── mocap_vicon ├── CMakeLists.txt ├── config │ └── model_list.yaml ├── include │ └── mocap_vicon │ │ └── ViconDriver.h ├── launch │ └── vicon_launch.py ├── package.xml └── src │ ├── ViconDriver.cpp │ ├── vicon.cpp │ └── vicon_sdk │ ├── CMakeLists.txt │ └── Vicon │ └── CrossMarket │ ├── DataStream │ ├── ViconCGStream │ │ ├── ApexHaptics.h │ │ ├── ApplicationInfo.h │ │ ├── CameraCalibrationHealth.h │ │ ├── CameraCalibrationHealthDetail.h │ │ ├── CameraCalibrationInfo.h │ │ ├── CameraInfo.h │ │ ├── CameraTimingInfo.h │ │ ├── CameraWand2d.h │ │ ├── CameraWand2dDetail.h │ │ ├── CameraWand3d.h │ │ ├── CameraWand3dDetail.h │ │ ├── CentreOfPressureFrame.h │ │ ├── CentroidTracks.h │ │ ├── CentroidTracksDetail.h │ │ ├── CentroidWeights.h │ │ ├── Centroids.h │ │ ├── CentroidsDetail.h │ │ ├── ChannelInfo.h │ │ ├── Contents.h │ │ ├── DeviceInfo.h │ │ ├── Dummy.cpp │ │ ├── EdgePairs.h │ │ ├── EdgePairsDetail.h │ │ ├── Enum.h │ │ ├── EyeTrackerFrame.h │ │ ├── EyeTrackerInfo.h │ │ ├── Filter.h │ │ ├── ForceFrame.h │ │ ├── ForcePlateInfo.h │ │ ├── FrameInfo.h │ │ ├── FrameRateInfo.h │ │ ├── GlobalSegments.h │ │ ├── GlobalSegmentsDetail.h │ │ ├── GreyscaleBlobs.h │ │ ├── GreyscaleBlobsDetail.h │ │ ├── HardwareFrameInfo.h │ │ ├── IsEqual.h │ │ ├── Item.h │ │ ├── KeepAlive.h │ │ ├── LabeledReconRayAssignments.h │ │ ├── LabeledRecons.h │ │ ├── LabeledReconsDetail.h │ │ ├── LatencyInfo.h │ │ ├── LatencyInfoDetail.h │ │ ├── LocalSegments.h │ │ ├── LocalSegmentsDetail.h │ │ ├── MomentFrame.h │ │ ├── ObjectEnums.h │ │ ├── ObjectQuality.h │ │ ├── ReconRayAssignmentsDetail.h │ │ ├── RequestFrame.h │ │ ├── ScopedReader.h │ │ ├── ScopedWriter.h │ │ ├── StartMulticastSender.h │ │ ├── StopMulticastSender.h │ │ ├── StreamInfo.h │ │ ├── SubjectHealth.h │ │ ├── SubjectInfo.h │ │ ├── SubjectInfoDetail.h │ │ ├── SubjectTopology.h │ │ ├── SubjectTopologyDetail.h │ │ ├── Timecode.h │ │ ├── UnlabeledReconRayAssignments.h │ │ ├── UnlabeledRecons.h │ │ ├── UnlabeledReconsDetail.h │ │ ├── VideoFrame.h │ │ ├── VoltageFrame.h │ │ └── makefile │ ├── ViconCGStreamClient │ │ ├── CGStreamReaderWriter.cpp │ │ ├── CGStreamReaderWriter.h │ │ ├── IViconCGStreamClientCallback.h │ │ ├── ViconCGStreamBayer.cpp │ │ ├── ViconCGStreamBayer.h │ │ ├── ViconCGStreamClient.cpp │ │ ├── ViconCGStreamClient.h │ │ └── makefile │ ├── ViconCGStreamClientSDK │ │ ├── CGClient.cpp │ │ ├── CGClient.h │ │ ├── ICGClient.h │ │ ├── ICGFrameState.h │ │ └── makefile │ ├── ViconDataStreamSDKCore │ │ ├── AxisMapping.cpp │ │ ├── AxisMapping.h │ │ ├── ClientUtils.cpp │ │ ├── ClientUtils.h │ │ ├── Constants.h │ │ ├── CoreClient.cpp │ │ ├── CoreClient.h │ │ ├── RetimerUtils.cpp │ │ ├── RetimerUtils.h │ │ ├── RetimingClient.cpp │ │ ├── RetimingClient.h │ │ ├── ViconDataStreamSDKCoreVersion.h │ │ └── makefile │ ├── ViconDataStreamSDK_C │ │ ├── CClient.cpp │ │ ├── CClient.h │ │ ├── CRetimingClient.cpp │ │ ├── CRetimingClient.h │ │ ├── CTypeDefs.h │ │ ├── VersionInfoResource.rc2 │ │ ├── ViconDataStreamSDK_C.rc │ │ ├── ViconDataStreamSDK_CVersion.h │ │ ├── makefile │ │ └── resource.h │ ├── ViconDataStreamSDK_CPP │ │ ├── CoreAdapters.h │ │ ├── DataStreamClient.cpp │ │ ├── DataStreamClient.h │ │ ├── DataStreamRetimingClient.cpp │ │ ├── DataStreamRetimingClient.h │ │ ├── IDataStreamClientBase.h │ │ ├── ReadMe.txt │ │ ├── StringFactory.h │ │ ├── VersionInfoResource.rc2 │ │ ├── ViconDataStreamSDK_CPP.rc │ │ ├── ViconDataStreamSDK_CPPVersion.h │ │ ├── makefile │ │ └── resource.h │ ├── ViconDataStreamSDK_CPPRetimerTest │ │ ├── ViconDataStreamSDK_CPPRetimerTest.cpp │ │ └── makefile │ ├── ViconDataStreamSDK_CPPTest │ │ ├── ViconDataStreamSDK_CPPTest.cpp │ │ └── makefile │ └── ViconDataStreamSDK_CTest │ │ ├── ViconDataStreamSDK_CTest.c │ │ └── makefile │ └── StreamCommon │ ├── Buffer.h │ ├── BufferDetail.h │ ├── BufferImpl.h │ ├── CGStreamAsyncReaderWriter.cpp │ ├── CGStreamAsyncReaderWriter.h │ ├── Type.h │ └── makefile └── run_ros2_docker.sh /.bashrc: -------------------------------------------------------------------------------- 1 | # ~/.bashrc: executed by bash(1) for non-login shells. 2 | # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) 3 | # for examples 4 | 5 | # If not running interactively, don't do anything 6 | [ -z "$PS1" ] && return 7 | 8 | # don't put duplicate lines in the history. See bash(1) for more options 9 | # ... or force ignoredups and ignorespace 10 | HISTCONTROL=ignoredups:ignorespace 11 | 12 | # append to the history file, don't overwrite it 13 | shopt -s histappend 14 | 15 | # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) 16 | HISTSIZE=1000 17 | HISTFILESIZE=2000 18 | 19 | # check the window size after each command and, if necessary, 20 | # update the values of LINES and COLUMNS. 21 | shopt -s checkwinsize 22 | 23 | # make less more friendly for non-text input files, see lesspipe(1) 24 | [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" 25 | 26 | # set variable identifying the chroot you work in (used in the prompt below) 27 | if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then 28 | debian_chroot=$(cat /etc/debian_chroot) 29 | fi 30 | 31 | # set a fancy prompt (non-color, unless we know we "want" color) 32 | case "$TERM" in 33 | xterm-color) color_prompt=yes;; 34 | esac 35 | 36 | # uncomment for a colored prompt, if the terminal has the capability; turned 37 | # off by default to not distract the user: the focus in a terminal window 38 | # should be on the output of commands, not on the prompt 39 | #force_color_prompt=yes 40 | 41 | if [ -n "$force_color_prompt" ]; then 42 | if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then 43 | # We have color support; assume it's compliant with Ecma-48 44 | # (ISO/IEC-6429). (Lack of such support is extremely rare, and such 45 | # a case would tend to support setf rather than setaf.) 46 | color_prompt=yes 47 | else 48 | color_prompt= 49 | fi 50 | fi 51 | 52 | if [ "$color_prompt" = yes ]; then 53 | PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' 54 | else 55 | PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' 56 | fi 57 | unset color_prompt force_color_prompt 58 | 59 | # If this is an xterm set the title to user@host:dir 60 | case "$TERM" in 61 | xterm*|rxvt*) 62 | PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" 63 | ;; 64 | *) 65 | ;; 66 | esac 67 | 68 | # enable color support of ls and also add handy aliases 69 | if [ -x /usr/bin/dircolors ]; then 70 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" 71 | alias ls='ls --color=auto' 72 | #alias dir='dir --color=auto' 73 | #alias vdir='vdir --color=auto' 74 | 75 | alias grep='grep --color=auto' 76 | alias fgrep='fgrep --color=auto' 77 | alias egrep='egrep --color=auto' 78 | fi 79 | 80 | # some more ls aliases 81 | alias ll='ls -alF' 82 | alias la='ls -A' 83 | alias l='ls -CF' 84 | 85 | # Alias definitions. 86 | # You may want to put all your additions into a separate file like 87 | # ~/.bash_aliases, instead of adding them here directly. 88 | # See /usr/share/doc/bash-doc/examples in the bash-doc package. 89 | 90 | if [ -f ~/.bash_aliases ]; then 91 | . ~/.bash_aliases 92 | fi 93 | 94 | # enable programmable completion features (you don't need to enable 95 | # this, if it's already enabled in /etc/bash.bashrc and /etc/profile 96 | # sources /etc/bash.bashrc). 97 | #if [ -f /etc/bash_completion ] && ! shopt -oq posix; then 98 | # . /etc/bash_completion 99 | #fi 100 | . /opt/ros/humble/setup.bash 101 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM osrf/ros:humble-desktop 2 | # nvidia-container-runtime 3 | ENV NVIDIA_VISIBLE_DEVICES=all 4 | ENV NVIDIA_DRIVER_CAPABILITIES=all 5 | 6 | #ROS-Domain 7 | ENV ROS_DOMAIN_ID=1 8 | LABEL maintainer="kashg@seas.upenn.edu" 9 | 10 | RUN mkdir -p /run/user/1000 11 | RUN chmod 0700 /run/user/1000 12 | 13 | RUN apt-get update && apt-get install -y \ 14 | vim \ 15 | python3-pip \ 16 | iproute2 \ 17 | ros-humble-tf2-eigen 18 | RUN mkdir -p ~/ros_ws/src/motion_capture_system/ 19 | WORKDIR /root/ros_ws/src/motion_capture_system 20 | 21 | # ROS2 Specific 22 | COPY ./mocap_base ./mocap_base 23 | COPY ./mocap_qualisys ./mocap_qualisys 24 | COPY ./mocap_vicon ./mocap_vicon 25 | 26 | # Dev Specific 27 | # COPY ./bags ../../../ 28 | COPY ./.bashrc ../../../ 29 | 30 | WORKDIR /root/ros_ws/ 31 | #RUN . /opt/ros/humble/setup.sh && colcon build 32 | 33 | 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ROS Driver for Motion Capture Systems 2 | 3 |   4 | 5 | 6 | This package contains ROS drivers for two different motion capture systems,**VICON** And **QUALISYS**. 7 | 8 | ## License 9 | For the VICON driver, we use the [offical SDK](http://www.vicon.com/products/software/datastream-sdk). 10 | 11 | For the QUALISYS driver, we use the interface from [Qualisys2Ros](https://github.com/omwdunkley/Qualisys2Ros). 12 | 13 | For the rest of the software, the license is Apache 2.0 wherever not specified. 14 | 15 | ## Compiling 16 | This is a catkin package. Make sure the package is on `ROS_PACKAGE_PATH` after cloning the package to your workspace. Drivers for different motion capture system can be independently compiled. 17 | 18 | ``` 19 | cd your_work_space 20 | catkin_make --pkg mocap_{sys} --cmake-args -DCMAKE_BUILD_TYPE=Release 21 | ``` 22 | 23 | This will compile the drivers for `{sys}` 24 | 25 | ## Example Usage 26 | 27 | **Common Parameters** 28 | 29 | `server` (`string`) 30 | 31 | Address of the server of the motion capture system to be connected. 32 | 33 | `frame_rate` (`int`, `default: 100`) 34 | 35 | The frame rate of the motion capture system 36 | 37 | `max_accel` (`double`, `default: 10.0`) 38 | 39 | The max possible acceleration which serves to construct the noise parameters. 40 | 41 | `publish_tf` (`bool`, `default: false`) 42 | 43 | If set to true, tf msgs for the subjects are published. 44 | 45 | `fixed_frame_id` (`string`, `mocap`) 46 | 47 | The fixed frame ID of the tf msgs for each subject. Note that the child frame id is automatically set to the name of the subject. 48 | 49 | `model_list` (`vector`, `default: []`) 50 | 51 | A vector of subjects of interest. Leave the vector empty if all subjects are to be tracked. 52 | 53 | **Published Topics** 54 | 55 | `/{mocap_sys}/{subject_name}/odom` (`nav_msgs/Odometry`) 56 | 57 | Odometry message for each specified subject in `model_list`. 58 | 59 | To be compatible with the name of the topics published of `vicon_odom` in [vicon repo of KumarRobotics](https://github.com/KumarRobotics/vicon), you can uncomment the following line in the launch file: 60 | `` 61 | 62 | **Node** 63 | 64 | `roslaunch {mocap_sys} {sys}.launch` 65 | 66 | For example, 67 | 68 | `roslaunch mocap_vicon vicon.launch` 69 | 70 | ## FAQ 71 | 72 | 1. Will the msgs be delayed if the driver is handling several subjects? 73 | The driver is multi-threaded. It uses different threads to process the msg from different subjects. So, emmmmm, don't worry =). 74 | 75 | 2. How to calibrate the transformation between the subject frame (centered at the centroid of the markers) and the body frame of a robot? 76 | This functionality is not provided, since few people use that now. If you really want that, please consider [vicon repo of KumarRobotics](https://github.com/KumarRobotics/vicon) or [vicon_bridge repo of ethz-asl](https://github.com/ethz-asl/vicon_bridge). 77 | 78 | ## Bug Report 79 | 80 | Prefer to open an issue. You can also send an e-mail to sunke.polyu@gmail.com. 81 | 82 | ## OSX Support 83 | 84 | You will need to compile ROS from source for OSX first. The vicon node is supported, but the qualisys node is not. There are no current plans to extend compatibility to OSX for the qualisys driver. 85 | -------------------------------------------------------------------------------- /docs/logos/qualisys_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KumarRobotics/motion_capture_system/2592b1eca1718c4eb562b462021da5486d5661ff/docs/logos/qualisys_logo.png -------------------------------------------------------------------------------- /docs/logos/vicon_logo.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KumarRobotics/motion_capture_system/2592b1eca1718c4eb562b462021da5486d5661ff/docs/logos/vicon_logo.jpeg -------------------------------------------------------------------------------- /mocap_base/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(mocap_base) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra -Wpedantic) 6 | endif() 7 | 8 | # Find dependencies 9 | find_package(ament_cmake REQUIRED) 10 | find_package(rclcpp REQUIRED) 11 | find_package(Boost REQUIRED) 12 | find_package(Eigen3 REQUIRED) 13 | find_package(geometry_msgs REQUIRED) 14 | find_package(tf2_ros REQUIRED) 15 | find_package(tf2_eigen REQUIRED) 16 | find_package(nav_msgs REQUIRED) 17 | 18 | # Include directories 19 | include_directories( 20 | include 21 | ${Eigen3_INCLUDE_DIRS} 22 | ${Boost_INCLUDE_DIRS} 23 | ) 24 | 25 | # Kalman Filter Library 26 | add_library(mocap_kalman_filter SHARED 27 | src/KalmanFilter.cpp 28 | ) 29 | 30 | target_link_libraries(mocap_kalman_filter 31 | ${Boost_LIBRARIES} 32 | Eigen3::Eigen 33 | ) 34 | ament_target_dependencies(mocap_kalman_filter Eigen3 rclcpp) 35 | 36 | # MoCap Driver Library 37 | add_library(mocap_base_driver SHARED 38 | src/MoCapDriverBase.cpp 39 | ) 40 | 41 | ament_target_dependencies(mocap_base_driver 42 | rclcpp 43 | geometry_msgs 44 | tf2_eigen 45 | tf2_ros 46 | nav_msgs 47 | ) 48 | 49 | target_link_libraries(mocap_base_driver 50 | mocap_kalman_filter 51 | ) 52 | ament_export_targets(export_mocap_base_driver HAS_LIBRARY_TARGET) 53 | ament_export_include_directories(include) 54 | 55 | install( 56 | DIRECTORY include/ 57 | DESTINATION include 58 | ) 59 | 60 | install( 61 | TARGETS mocap_base_driver mocap_kalman_filter 62 | EXPORT export_mocap_base_driver 63 | ARCHIVE DESTINATION lib 64 | LIBRARY DESTINATION lib 65 | RUNTIME DESTINATION bin 66 | INCLUDES DESTINATION include 67 | ) 68 | 69 | if(BUILD_TESTING) 70 | find_package(ament_lint_auto REQUIRED) 71 | # the following line skips the linter which checks for copyrights 72 | # comment the line when a copyright and license is added to all source files 73 | set(ament_cmake_copyright_FOUND TRUE) 74 | # the following line skips cpplint (only works in a git repo) 75 | # comment the line when this package is in a git repo and when 76 | # a copyright and license is added to all source files 77 | set(ament_cmake_cpplint_FOUND TRUE) 78 | ament_lint_auto_find_test_dependencies() 79 | endif() 80 | 81 | ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS}) 82 | ament_package() 83 | 84 | 85 | -------------------------------------------------------------------------------- /mocap_base/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | mocap_base 4 | 0.0.1 5 | Base class for different motion capture systems 6 | 7 | Ke Sun 8 | Kashsh Garg 9 | Apache-2.0 10 | Ke Sun 11 | 12 | ament_cmake 13 | geometry_msgs 14 | rclcpp 15 | eigen_conversions 16 | 17 | 18 | ament_cmake 19 | 20 | 21 | -------------------------------------------------------------------------------- /mocap_vicon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(mocap_vicon) 3 | 4 | if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | add_compile_options(-Wall -Wextra -Wpedantic) 6 | endif() 7 | 8 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L/install/mocap_base/lib/mocap_base/") 9 | 10 | find_package(ament_cmake REQUIRED) 11 | find_package(rclcpp REQUIRED) 12 | find_package(tf2_eigen REQUIRED) 13 | find_package(tf2_ros REQUIRED) 14 | find_package(mocap_base REQUIRED) 15 | find_package(geometry_msgs REQUIRED) 16 | find_package(nav_msgs REQUIRED) 17 | find_package(Boost REQUIRED COMPONENTS thread chrono) 18 | find_package(Eigen3 REQUIRED) 19 | 20 | # find_package(catkin REQUIRED COMPONENTS 21 | # roscpp 22 | # geometry_msgs 23 | # tf 24 | # tf_conversions 25 | # mocap_base 26 | # ) 27 | 28 | # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall") 29 | 30 | # Include directories 31 | include_directories( 32 | include 33 | ${Eigen3_INCLUDE_DIRS} 34 | ${Boost_INCLUDE_DIRS} 35 | ${mocap_base_INCLUDE_DIRS} 36 | ) 37 | 38 | 39 | add_subdirectory(src/vicon_sdk) 40 | 41 | add_library(mocap_vicon_driver 42 | src/ViconDriver.cpp 43 | ) 44 | 45 | target_include_directories(mocap_vicon_driver PUBLIC 46 | $ 47 | $ 48 | ) 49 | 50 | ament_target_dependencies(mocap_vicon_driver mocap_base Eigen3 rclcpp tf2_eigen geometry_msgs nav_msgs) 51 | 52 | target_link_libraries(mocap_vicon_driver 53 | ViconDataStreamSDK_CPP 54 | ${VICON_BOOST_LIBS} 55 | Eigen3::Eigen 56 | ) 57 | 58 | install(TARGETS mocap_vicon_driver 59 | DESTINATION lib 60 | ) 61 | 62 | add_executable(mocap_vicon_node 63 | src/vicon.cpp 64 | ) 65 | 66 | target_link_libraries(mocap_vicon_node 67 | mocap_vicon_driver 68 | ViconDataStreamSDK_CPP 69 | ${VICON_BOOST_LIBS} 70 | Eigen3::Eigen 71 | 72 | ) 73 | 74 | ament_target_dependencies(mocap_vicon_node mocap_base Eigen3 rclcpp tf2_eigen geometry_msgs nav_msgs) 75 | 76 | install(TARGETS mocap_vicon_node 77 | DESTINATION lib/${PROJECT_NAME}/ 78 | ) 79 | install( 80 | DIRECTORY launch/ 81 | DESTINATION share/${PROJECT_NAME}/ 82 | ) 83 | if(BUILD_TESTING) 84 | find_package(ament_lint_auto REQUIRED) 85 | # the following line skips the linter which checks for copyrights 86 | # comment the line when a copyright and license is added to all source files 87 | set(ament_cmake_copyright_FOUND TRUE) 88 | # the following line skips cpplint (only works in a git repo) 89 | # comment the line when this package is in a git repo and when 90 | # a copyright and license is added to all source files 91 | set(ament_cmake_cpplint_FOUND TRUE) 92 | ament_lint_auto_find_test_dependencies() 93 | endif() 94 | 95 | ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS}) 96 | ament_package() 97 | -------------------------------------------------------------------------------- /mocap_vicon/config/model_list.yaml: -------------------------------------------------------------------------------- 1 | model_list: ["box0"] 2 | -------------------------------------------------------------------------------- /mocap_vicon/include/mocap_vicon/ViconDriver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright [2015] 3 | * [Kartik Mohta ] 4 | * [Ke Sun ] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #ifndef VICON_DRIVER_H 20 | #define VICON_DRIVER_H 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | // #include 28 | #include "rclcpp/rclcpp.hpp" 29 | #include 30 | #include "ViconDataStreamSDK_CPP/DataStreamClient.h" // From Vicon's SDK 31 | 32 | 33 | namespace mocap{ 34 | 35 | class ViconDriver: public MoCapDriverBase { 36 | 37 | public: 38 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 39 | /* 40 | * @brief Constructor 41 | * @param nh Ros node 42 | */ 43 | ViconDriver(const std::shared_ptr n): 44 | MoCapDriverBase (n), 45 | client (new ViconDataStreamSDK::CPP::Client()), 46 | max_accel (10.0), 47 | frame_interval (0.01), 48 | process_noise (Eigen::Matrix::Zero()), 49 | measurement_noise (Eigen::Matrix::Zero()) { 50 | return; 51 | } 52 | 53 | /* 54 | * @brief Destructor 55 | */ 56 | ~ViconDriver() { 57 | disconnect(); 58 | delete client; 59 | return; 60 | } 61 | 62 | /* 63 | * @brief init Initialize the object 64 | * @return True if successfully initialized 65 | */ 66 | bool init(); 67 | 68 | /* 69 | * @brief run Start acquiring data from the server 70 | */ 71 | void run(); 72 | 73 | /* 74 | * @brief disconnect Disconnect to the server 75 | * @Note The function is called automatically when the 76 | * destructor is called. 77 | */ 78 | void disconnect(); 79 | 80 | private: 81 | // Disable the copy constructor and assign operator 82 | ViconDriver(const ViconDriver& ); 83 | ViconDriver& operator=(const ViconDriver& ); 84 | 85 | // Handle a frame which contains the info of all subjects 86 | void handleFrame(); 87 | 88 | // Handle a the info of a single subject 89 | void handleSubject(const int& sub_idx); 90 | 91 | // Portal to communicate with the server 92 | ViconDataStreamSDK::CPP::Client* client; 93 | 94 | // Max acceleration 95 | double max_accel; 96 | 97 | // Average time interval between two frames 98 | double frame_interval; 99 | 100 | // A set to hold the model names 101 | std::set model_set; 102 | 103 | // Convariance matrices for initializing kalman filters 104 | Eigen::Matrix process_noise; 105 | Eigen::Matrix measurement_noise; 106 | 107 | // For multi-threading 108 | boost::shared_mutex mtx; 109 | 110 | }; 111 | } 112 | 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /mocap_vicon/launch/vicon_launch.py: -------------------------------------------------------------------------------- 1 | from launch import LaunchDescription 2 | from launch_ros.actions import Node 3 | 4 | def generate_launch_description(): 5 | return LaunchDescription([ 6 | Node( 7 | package='mocap_vicon', 8 | executable='mocap_vicon_node', 9 | name='vicon', 10 | output='screen', 11 | parameters=[ 12 | {'server_address': 'mocap.perch'}, 13 | {'frame_rate': 100}, 14 | {'max_accel': 10.0}, 15 | {'publish_tf': False}, 16 | {'publish_pts': False}, 17 | {'fixed_frame_id': 'mocap'}, 18 | # Set to [''] to take in ALL models from Vicon 19 | {'model_list': ['']}, 20 | ], 21 | remappings=[ 22 | # Uncomment and modify the remapping if needed 23 | # ('vicon/model_name/odom', '/model_name/odom'), 24 | ] 25 | ) 26 | ]) 27 | -------------------------------------------------------------------------------- /mocap_vicon/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | mocap_vicon 4 | 0.0.1 5 | Driver for Vicon 6 | 7 | Ke Sun 8 | Kartik Mohta 9 | Kashsh Garg 10 | 11 | Apache-2.0 12 | 13 | Ke Sun 14 | 15 | ament_cmake 16 | 17 | 18 | 19 | ros2launch 20 | geometry_msgs 21 | roscpp 22 | tf 23 | tf_conversions 24 | mocap_base 25 | 26 | 27 | ament_cmake 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright [2015] 3 | * [Kartik Mohta ] 4 | * [Ke Sun ] 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | #include "rclcpp/rclcpp.hpp" 20 | #include 21 | 22 | int main(int argc, char *argv[]) { 23 | 24 | rclcpp::init(argc, argv); 25 | std::shared_ptr nh = std::make_shared("vicon_node"); 26 | 27 | mocap::ViconDriver driver(nh); 28 | if(!driver.init()) { 29 | RCLCPP_ERROR(nh->get_logger(), "Initialization of the Vicon driver failed"); 30 | return -1; 31 | } 32 | RCLCPP_INFO(nh->get_logger(), "Successfully initialize Vicon connection!"); 33 | 34 | while(rclcpp::ok()) 35 | { 36 | driver.run(); 37 | rclcpp::spin_some(nh); 38 | } 39 | 40 | // ROS_INFO("Shutting down"); 41 | driver.disconnect(); 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.12) 2 | 3 | add_library(ViconDataStreamSDK_CPP 4 | Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/DataStreamClient.cpp 5 | Vicon/CrossMarket/DataStream/ViconDataStreamSDKCore/CoreClient.cpp 6 | Vicon/CrossMarket/DataStream/ViconDataStreamSDKCore/ClientUtils.cpp 7 | Vicon/CrossMarket/DataStream/ViconDataStreamSDKCore/AxisMapping.cpp 8 | Vicon/CrossMarket/DataStream/ViconCGStreamClientSDK/CGClient.cpp 9 | Vicon/CrossMarket/DataStream/ViconCGStreamClient/ViconCGStreamClient.cpp 10 | Vicon/CrossMarket/DataStream/ViconCGStreamClient/ViconCGStreamBayer.cpp 11 | Vicon/CrossMarket/DataStream/ViconCGStreamClient/CGStreamReaderWriter.cpp 12 | ) 13 | target_include_directories(ViconDataStreamSDK_CPP 14 | PUBLIC Vicon/CrossMarket/DataStream 15 | PRIVATE Vicon/CrossMarket) 16 | target_link_libraries(ViconDataStreamSDK_CPP ${Boost_LIBRARIES}) 17 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/ApexHaptics.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Item.h" 28 | #include 29 | 30 | namespace ViconCGStream 31 | { 32 | //------------------------------------------------------------------------------------------------- 33 | 34 | /// Used by the client to enable and disable haptics on Apex device. 35 | class VApexHaptics : public VItem 36 | { 37 | public: 38 | 39 | /// List of devices with haptics feedback on 40 | std::set< unsigned int > m_OnDevicesList; 41 | 42 | 43 | /// Equality operator 44 | bool operator == ( const VApexHaptics & i_rOther ) const 45 | { 46 | return m_OnDevicesList == i_rOther.m_OnDevicesList; 47 | } 48 | 49 | /// Object type enum. 50 | virtual ViconCGStreamType::Enum TypeID() const 51 | { 52 | return ViconCGStreamEnum::ApexHaptics; 53 | } 54 | 55 | /// Filter ID 56 | virtual ViconCGStreamType::UInt32 FilterID() const 57 | { 58 | return FILTER_NA; 59 | } 60 | 61 | /// Read function. 62 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 63 | { 64 | return i_rBuffer.Read( m_OnDevicesList ); 65 | } 66 | 67 | /// Write function. 68 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 69 | { 70 | i_rBuffer.Write( m_OnDevicesList ); 71 | } 72 | 73 | }; 74 | 75 | //------------------------------------------------------------------------------------------------- 76 | }; 77 | 78 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/ApplicationInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VApplicationInfo class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Contains information about specific application settings that relate to the datastream 37 | class VApplicationInfo : public VItem 38 | { 39 | public: 40 | 41 | enum EAxisOrientation : ViconCGStreamType::Char 42 | { 43 | EZUp, 44 | EYUp 45 | }; 46 | 47 | /// Default construct this to have Z-up orientation, to maintain back compatibility with old servers 48 | VApplicationInfo() : m_AxisOrientation( EZUp ) {} 49 | 50 | /// A transformation matrix representing the axis orientation of the application 51 | EAxisOrientation m_AxisOrientation; 52 | 53 | /// Equality operator 54 | bool operator == ( const VApplicationInfo& i_rOther ) const 55 | { 56 | return m_AxisOrientation == i_rOther.m_AxisOrientation; 57 | } 58 | 59 | /// Object type enum. 60 | virtual ViconCGStreamType::Enum TypeID() const 61 | { 62 | return ViconCGStreamEnum::ApplicationInfo; 63 | } 64 | 65 | /// Filter ID 66 | virtual ViconCGStreamType::UInt32 FilterID() const 67 | { 68 | return FILTER_NA; 69 | } 70 | 71 | /// Read function. 72 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 73 | { 74 | return i_rBuffer.Read( m_AxisOrientation ) ; 75 | } 76 | 77 | /// Write function. 78 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 79 | { 80 | i_rBuffer.Write( m_AxisOrientation ); 81 | } 82 | 83 | }; 84 | 85 | //------------------------------------------------------------------------------------------------- 86 | }; 87 | 88 | namespace ViconCGStreamIO 89 | { 90 | //------------------------------------------------------------------------------------------------- 91 | 92 | template<> 93 | struct VIsPod< ViconCGStream::VApplicationInfo::EAxisOrientation > 94 | { 95 | enum 96 | { 97 | Answer = 1 98 | }; 99 | }; 100 | 101 | //------------------------------------------------------------------------------------------------- 102 | }; 103 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/CameraCalibrationHealth.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCameraCalibrationHealth class. 29 | 30 | #include "Item.h" 31 | #include "CameraCalibrationHealthDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a overall system Camera calibration health indicator as well as an individual indicator for each camera 39 | /// Camera Health indicators vary from 0.0 (bad) to 1.0 (good) 40 | class VCameraCalibrationHealth : public VItem 41 | { 42 | public: 43 | 44 | /// Calibration Health for entire system 45 | ViconCGStreamType::Double m_SystemHealth; 46 | 47 | /// Individual Calibration Health for cameras 48 | std::vector< ViconCGStreamDetail::VCameraCalibrationHealth_Camera > m_Cameras; 49 | 50 | VCameraCalibrationHealth() 51 | : m_SystemHealth( 0.0 ) 52 | { 53 | } 54 | 55 | /// Equality operator 56 | bool operator == ( const VCameraCalibrationHealth & i_rOther ) const 57 | { 58 | return m_SystemHealth == i_rOther.m_SystemHealth && 59 | m_Cameras == i_rOther.m_Cameras; 60 | } 61 | 62 | /// Object type enum. 63 | virtual ViconCGStreamType::Enum TypeID() const 64 | { 65 | return ViconCGStreamEnum::CameraCalibrationHealth; 66 | } 67 | 68 | /// Filter ID 69 | virtual ViconCGStreamType::UInt32 FilterID() const 70 | { 71 | return FILTER_NA; 72 | } 73 | 74 | /// Read function. 75 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 76 | { 77 | return i_rBuffer.Read( m_SystemHealth ) && 78 | i_rBuffer.Read( m_Cameras ); 79 | } 80 | 81 | /// Write function. 82 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 83 | { 84 | i_rBuffer.Write( m_SystemHealth ); 85 | i_rBuffer.Write( m_Cameras ); 86 | } 87 | 88 | }; 89 | 90 | //------------------------------------------------------------------------------------------------- 91 | }; 92 | 93 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/CameraTimingInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Item.h" 28 | #include 29 | 30 | namespace ViconCGStream 31 | { 32 | //------------------------------------------------------------------------------------------------- 33 | 34 | /// Contains the camera timing info. 35 | class VCameraTimingInfo : public VItem 36 | { 37 | public: 38 | 39 | /// Camera identifier 40 | ViconCGStreamType::UInt32 m_CameraID; 41 | 42 | /// Camera frame period. Defined as the numbers of ticks per frame on a 135Mhz clock. 43 | ViconCGStreamType::UInt64 m_FramePeriod; 44 | 45 | /// Camera frame offset. Tick offset in time of frame zero. 46 | ViconCGStreamType::Int64 m_FrameOffset; 47 | 48 | /// Equality function 49 | bool IsEqual( const VCameraTimingInfo & i_rOther ) const 50 | { 51 | return m_CameraID == i_rOther.m_CameraID && 52 | m_FramePeriod == i_rOther.m_FramePeriod && 53 | m_FrameOffset == i_rOther.m_FrameOffset; 54 | } 55 | 56 | /// Equality operator 57 | bool operator == ( const VCameraTimingInfo & i_rOther ) const 58 | { 59 | return IsEqual( i_rOther ); 60 | } 61 | 62 | /// Object type enum. 63 | virtual ViconCGStreamType::Enum TypeID() const 64 | { 65 | return ViconCGStreamEnum::CameraTimingInfo; 66 | } 67 | 68 | /// Filter ID 69 | virtual ViconCGStreamType::UInt32 FilterID() const 70 | { 71 | return m_CameraID; 72 | } 73 | 74 | /// Read function. 75 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 76 | { 77 | return i_rBuffer.Read( m_CameraID ) && 78 | i_rBuffer.Read( m_FramePeriod ) && 79 | i_rBuffer.Read( m_FrameOffset ); 80 | } 81 | 82 | /// Write function. 83 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 84 | { 85 | i_rBuffer.Write( m_CameraID ); 86 | i_rBuffer.Write( m_FramePeriod ); 87 | i_rBuffer.Write( m_FrameOffset ); 88 | } 89 | 90 | }; 91 | 92 | //------------------------------------------------------------------------------------------------- 93 | }; 94 | 95 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/CameraWand2d.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCameraWand2d class. 29 | 30 | #include "Item.h" 31 | #include "CameraWand2dDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a 2d wand captured in a camera during a wand wave. 39 | class VCameraWand2d : public VItem 40 | { 41 | public: 42 | 43 | /// Camera identifier 44 | ViconCGStreamType::UInt32 m_CameraID; 45 | 46 | /// Wand session 47 | ViconCGStreamType::UInt32 m_WaveSession; 48 | 49 | /// Wand points 50 | std::vector< ViconCGStreamDetail::VCameraWand2d_Point > m_WandPoints; 51 | 52 | /// Cameras with wand 53 | ViconCGStreamType::UInt32 m_CamerasWithWand; 54 | 55 | /// Moving 56 | bool m_bMoving; 57 | 58 | /// Equality operator 59 | bool operator == ( const VCameraWand2d & i_rOther ) const 60 | { 61 | return m_CameraID == i_rOther.m_CameraID && 62 | m_WaveSession == i_rOther.m_WaveSession && 63 | m_WandPoints == i_rOther.m_WandPoints && 64 | m_CamerasWithWand == i_rOther.m_CamerasWithWand && 65 | m_bMoving == i_rOther.m_bMoving; 66 | } 67 | 68 | /// Object type enum. 69 | virtual ViconCGStreamType::Enum TypeID() const 70 | { 71 | return ViconCGStreamEnum::CameraWand2d; 72 | } 73 | 74 | /// Filter ID 75 | virtual ViconCGStreamType::UInt32 FilterID() const 76 | { 77 | return m_CameraID; 78 | } 79 | 80 | /// Read function. 81 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 82 | { 83 | return i_rBuffer.Read( m_CameraID ) && 84 | i_rBuffer.Read( m_WaveSession ) && 85 | i_rBuffer.Read( m_WandPoints ) && 86 | i_rBuffer.Read( m_CamerasWithWand ) && 87 | i_rBuffer.Read( m_bMoving ); 88 | } 89 | 90 | /// Write function. 91 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 92 | { 93 | i_rBuffer.Write( m_CameraID ); 94 | i_rBuffer.Write( m_WaveSession ); 95 | i_rBuffer.Write( m_WandPoints ); 96 | i_rBuffer.Write( m_CamerasWithWand ); 97 | i_rBuffer.Write( m_bMoving ); 98 | } 99 | 100 | }; 101 | 102 | //------------------------------------------------------------------------------------------------- 103 | }; 104 | 105 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/CameraWand2dDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the Detail of the ViconCGStream::VCameraWand2d class 29 | 30 | #include "Enum.h" 31 | #include 32 | 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a wand point 39 | class VCameraWand2d_Point 40 | { 41 | public: 42 | 43 | // Position 44 | ViconCGStreamType::Double m_Position[ 2 ]; 45 | 46 | /// Equality operator 47 | bool operator == ( const VCameraWand2d_Point & i_rOther ) const 48 | { 49 | return m_Position[ 0 ] == i_rOther.m_Position[ 0 ] && 50 | m_Position[ 1 ] == i_rOther.m_Position[ 1 ]; 51 | } 52 | 53 | /// Read function. 54 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 55 | { 56 | return i_rBuffer.Read( m_Position ); 57 | } 58 | 59 | /// Write function. 60 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 61 | { 62 | i_rBuffer.Write( m_Position ); 63 | } 64 | 65 | }; 66 | 67 | //------------------------------------------------------------------------------------------------- 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/CameraWand3d.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCameraWand3d class. 29 | 30 | #include "Item.h" 31 | #include "CameraWand3dDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a 3d wand captured in a camera during a wand wave. 39 | class VCameraWand3d : public VItem 40 | { 41 | public: 42 | 43 | /// Wand session 44 | ViconCGStreamType::UInt32 m_WaveSession; 45 | 46 | /// Wand points 47 | std::vector< ViconCGStreamDetail::VCameraWand3d_Point > m_WandPoints; 48 | 49 | /// Cameras with wand 50 | ViconCGStreamType::UInt32 m_CamerasWithWand; 51 | 52 | /// Moving 53 | bool m_bMoving; 54 | 55 | /// Equality operator 56 | bool operator == ( const VCameraWand3d & i_rOther ) const 57 | { 58 | return m_WaveSession == i_rOther.m_WaveSession && 59 | m_WandPoints == i_rOther.m_WandPoints && 60 | m_CamerasWithWand == i_rOther.m_CamerasWithWand && 61 | m_bMoving == i_rOther.m_bMoving; 62 | } 63 | 64 | /// Object type enum. 65 | virtual ViconCGStreamType::Enum TypeID() const 66 | { 67 | return ViconCGStreamEnum::CameraWand3d; 68 | } 69 | 70 | /// Filter ID 71 | virtual ViconCGStreamType::UInt32 FilterID() const 72 | { 73 | return m_WaveSession; 74 | } 75 | 76 | /// Read function. 77 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 78 | { 79 | return i_rBuffer.Read( m_WaveSession ) && 80 | i_rBuffer.Read( m_WandPoints ) && 81 | i_rBuffer.Read( m_CamerasWithWand ) && 82 | i_rBuffer.Read( m_bMoving ); 83 | } 84 | 85 | /// Write function. 86 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 87 | { 88 | i_rBuffer.Write( m_WaveSession ); 89 | i_rBuffer.Write( m_WandPoints ); 90 | i_rBuffer.Write( m_CamerasWithWand ); 91 | i_rBuffer.Write( m_bMoving ); 92 | } 93 | 94 | }; 95 | 96 | //------------------------------------------------------------------------------------------------- 97 | }; 98 | 99 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/CameraWand3dDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the Detail of the ViconCGStream::VCameraWand3d class 29 | 30 | #include "Enum.h" 31 | #include 32 | 33 | namespace ViconCGStreamDetail 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a wand point 38 | class VCameraWand3d_Point 39 | { 40 | public: 41 | 42 | // Position 43 | ViconCGStreamType::Double m_Position[ 3 ]; 44 | 45 | /// Equality operator 46 | bool operator == ( const VCameraWand3d_Point & i_rOther ) const 47 | { 48 | return m_Position[ 0 ] == i_rOther.m_Position[ 0 ] && 49 | m_Position[ 1 ] == i_rOther.m_Position[ 1 ] && 50 | m_Position[ 2 ] == i_rOther.m_Position[ 2 ]; 51 | } 52 | 53 | /// Read function. 54 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 55 | { 56 | return i_rBuffer.Read( m_Position ); 57 | } 58 | 59 | /// Write function. 60 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 61 | { 62 | i_rBuffer.Write( m_Position ); 63 | } 64 | 65 | }; 66 | 67 | //------------------------------------------------------------------------------------------------- 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/CentreOfPressureFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCentreOfPressureFrame class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a frame number, device and channel identifiers, and a frame of pressure centre samples in component order (measured in mm). 38 | class VCentreOfPressureFrame : public VItem 39 | { 40 | public: 41 | 42 | /// Device frame number 43 | ViconCGStreamType::UInt32 m_FrameID; 44 | 45 | /// Device identifier 46 | ViconCGStreamType::UInt32 m_DeviceID; 47 | 48 | /// Channel identifier 49 | ViconCGStreamType::UInt32 m_ChannelID; 50 | 51 | /// Centre of pressure samples (in component order) 52 | std::vector< ViconCGStreamType::Float > m_Samples; 53 | 54 | /// Equality operator 55 | bool operator == ( const VCentreOfPressureFrame & i_rOther ) const 56 | { 57 | return m_FrameID == i_rOther.m_FrameID && 58 | m_DeviceID == i_rOther.m_DeviceID && 59 | m_ChannelID == i_rOther.m_ChannelID && 60 | m_Samples == i_rOther.m_Samples; 61 | } 62 | 63 | /// Object type enum. 64 | virtual ViconCGStreamType::Enum TypeID() const 65 | { 66 | return ViconCGStreamEnum::CentreOfPressureFrame; 67 | } 68 | 69 | /// Filter ID 70 | virtual ViconCGStreamType::UInt32 FilterID() const 71 | { 72 | return m_DeviceID; 73 | } 74 | 75 | /// Read function. 76 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 77 | { 78 | return i_rBuffer.Read( m_FrameID ) && 79 | i_rBuffer.Read( m_DeviceID ) && 80 | i_rBuffer.Read( m_ChannelID ) && 81 | i_rBuffer.Read( m_Samples ); 82 | } 83 | 84 | /// Write function. 85 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 86 | { 87 | i_rBuffer.Write( m_FrameID ); 88 | i_rBuffer.Write( m_DeviceID ); 89 | i_rBuffer.Write( m_ChannelID ); 90 | i_rBuffer.Write( m_Samples ); 91 | } 92 | 93 | }; 94 | 95 | //------------------------------------------------------------------------------------------------- 96 | }; 97 | 98 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/CentroidTracks.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCentroidTracks class. 29 | 30 | #include "Item.h" 31 | #include "CentroidTracksDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a frame of umlabeled circles, along with the camera identifier and frame number. 39 | class VCentroidTracks : public VItem 40 | { 41 | public: 42 | 43 | /// Camera frame number 44 | ViconCGStreamType::UInt32 m_FrameID; 45 | 46 | /// Camera identifier 47 | ViconCGStreamType::UInt32 m_CameraID; 48 | 49 | /// Centroid tracks 50 | std::vector< ViconCGStreamDetail::VCentroidTracks_CentroidTrack > m_CentroidTracks; 51 | 52 | /// Equality operator 53 | bool operator == ( const VCentroidTracks & i_rOther ) const 54 | { 55 | return m_FrameID == i_rOther.m_FrameID && 56 | m_CameraID == i_rOther.m_CameraID && 57 | m_CentroidTracks == i_rOther.m_CentroidTracks; 58 | } 59 | 60 | /// Object type enum. 61 | virtual ViconCGStreamType::Enum TypeID() const 62 | { 63 | return ViconCGStreamEnum::CentroidTracks; 64 | } 65 | 66 | /// Filter ID 67 | virtual ViconCGStreamType::UInt32 FilterID() const 68 | { 69 | return m_CameraID; 70 | } 71 | 72 | /// Read function. 73 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 74 | { 75 | return i_rBuffer.Read( m_FrameID ) && 76 | i_rBuffer.Read( m_CameraID ) && 77 | i_rBuffer.Read( m_CentroidTracks ); 78 | } 79 | 80 | /// Write function. 81 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 82 | { 83 | i_rBuffer.Write( m_FrameID ); 84 | i_rBuffer.Write( m_CameraID ); 85 | i_rBuffer.Write( m_CentroidTracks ); 86 | } 87 | 88 | }; 89 | 90 | //------------------------------------------------------------------------------------------------- 91 | }; 92 | 93 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/CentroidTracksDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the details declaration of the ViconCGStream::VCentroidTracks class. 29 | 30 | #include "Enum.h" 31 | #include 32 | 33 | namespace ViconCGStreamDetail 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains the centroid index, track id, track length and track quality. 38 | class VCentroidTracks_CentroidTrack 39 | { 40 | public: 41 | 42 | /// Centroid index 43 | ViconCGStreamType::UInt32 m_CentroidIndex; 44 | 45 | /// 64 bit track id. 46 | ViconCGStreamType::UInt64 m_TrackId; 47 | 48 | /// Length of track (saturates). 49 | ViconCGStreamType::UInt32 m_TrackLength; 50 | 51 | /// Track quality. 52 | ViconCGStreamType::Float m_TrackQuality; 53 | 54 | // Equality operator 55 | bool operator == ( const VCentroidTracks_CentroidTrack & i_rOther ) const 56 | { 57 | return m_CentroidIndex == i_rOther.m_CentroidIndex && 58 | m_TrackId == i_rOther.m_TrackId && 59 | m_TrackLength == i_rOther.m_TrackLength && 60 | m_TrackQuality == i_rOther.m_TrackQuality; 61 | } 62 | 63 | /// Read function. 64 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 65 | { 66 | return i_rBuffer.Read( m_CentroidIndex ) && 67 | i_rBuffer.Read( m_TrackId ) && 68 | i_rBuffer.Read( m_TrackLength ) && 69 | i_rBuffer.Read( m_TrackQuality ); 70 | } 71 | 72 | /// Write function. 73 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 74 | { 75 | i_rBuffer.Write( m_CentroidIndex ); 76 | i_rBuffer.Write( m_TrackId ); 77 | i_rBuffer.Write( m_TrackLength ); 78 | i_rBuffer.Write( m_TrackQuality ); 79 | } 80 | }; 81 | 82 | //------------------------------------------------------------------------------------------------- 83 | }; 84 | 85 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/CentroidWeights.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCentroids class. 29 | 30 | #include "Item.h" 31 | #include "CentroidsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a set of weights corresponding to unlabeled centroids, along with the camera identifier and frame number. 39 | class VCentroidWeights : public VItem 40 | { 41 | public: 42 | 43 | /// Camera frame number 44 | ViconCGStreamType::UInt32 m_FrameID; 45 | 46 | /// Camera identifier 47 | ViconCGStreamType::UInt32 m_CameraID; 48 | 49 | /// Centroids 50 | std::vector< float > m_Weights; 51 | 52 | /// Equality operator 53 | bool operator == ( const VCentroidWeights & i_rOther ) const 54 | { 55 | return m_FrameID == i_rOther.m_FrameID && 56 | m_CameraID == i_rOther.m_CameraID && 57 | m_Weights == i_rOther.m_Weights; 58 | } 59 | 60 | /// Object type enum. 61 | virtual ViconCGStreamType::Enum TypeID() const 62 | { 63 | return ViconCGStreamEnum::CentroidWeights; 64 | } 65 | 66 | /// Filter ID 67 | virtual ViconCGStreamType::UInt32 FilterID() const 68 | { 69 | return m_CameraID; 70 | } 71 | 72 | /// Read function. 73 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 74 | { 75 | return i_rBuffer.Read( m_FrameID ) && 76 | i_rBuffer.Read( m_CameraID ) && 77 | i_rBuffer.Read( m_Weights ); 78 | } 79 | 80 | /// Write function. 81 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 82 | { 83 | i_rBuffer.Write( m_FrameID ); 84 | i_rBuffer.Write( m_CameraID ); 85 | i_rBuffer.Write( m_Weights ); 86 | } 87 | 88 | }; 89 | 90 | //------------------------------------------------------------------------------------------------- 91 | }; 92 | 93 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/Centroids.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCentroids class. 29 | 30 | #include "Item.h" 31 | #include "CentroidsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a frame of unlabeled centroids, along with the camera identifier and frame number. 39 | class VCentroids : public VItem 40 | { 41 | public: 42 | 43 | /// Camera frame number 44 | ViconCGStreamType::UInt32 m_FrameID; 45 | 46 | /// Camera identifier 47 | ViconCGStreamType::UInt32 m_CameraID; 48 | 49 | /// Centroids 50 | std::vector< ViconCGStreamDetail::VCentroids_Centroid > m_Centroids; 51 | 52 | /// Equality operator 53 | bool operator == ( const VCentroids & i_rOther ) const 54 | { 55 | return m_FrameID == i_rOther.m_FrameID && 56 | m_CameraID == i_rOther.m_CameraID && 57 | m_Centroids == i_rOther.m_Centroids; 58 | } 59 | 60 | /// Object type enum. 61 | virtual ViconCGStreamType::Enum TypeID() const 62 | { 63 | return ViconCGStreamEnum::Centroids; 64 | } 65 | 66 | /// Filter ID 67 | virtual ViconCGStreamType::UInt32 FilterID() const 68 | { 69 | return m_CameraID; 70 | } 71 | 72 | /// Read function. 73 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 74 | { 75 | return i_rBuffer.Read( m_FrameID ) && 76 | i_rBuffer.Read( m_CameraID ) && 77 | i_rBuffer.Read( m_Centroids ); 78 | } 79 | 80 | /// Write function. 81 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 82 | { 83 | i_rBuffer.Write( m_FrameID ); 84 | i_rBuffer.Write( m_CameraID ); 85 | i_rBuffer.Write( m_Centroids ); 86 | } 87 | 88 | }; 89 | 90 | //------------------------------------------------------------------------------------------------- 91 | }; 92 | 93 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/CentroidsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the details declaration of the ViconCGStream::VCentroids class. 29 | 30 | #include "Enum.h" 31 | #include 32 | 33 | namespace ViconCGStreamDetail 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains the circle position, radius and accuracy 38 | class VCentroids_Centroid 39 | { 40 | public: 41 | /// Circle position 42 | ViconCGStreamType::Double m_Position[ 2 ]; 43 | 44 | /// Circle radius 45 | ViconCGStreamType::Double m_Radius; 46 | 47 | /// Circle accuracy 48 | ViconCGStreamType::Double m_Accuracy; 49 | 50 | // Equality operator 51 | bool operator == ( const VCentroids_Centroid & i_rOther ) const 52 | { 53 | return m_Position[ 0 ] == i_rOther.m_Position[ 0 ] && 54 | m_Position[ 1 ] == i_rOther.m_Position[ 1 ] && 55 | m_Radius == i_rOther.m_Radius && 56 | m_Accuracy == i_rOther.m_Accuracy; 57 | } 58 | 59 | /// Read function. 60 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 61 | { 62 | return i_rBuffer.Read( m_Position ) && 63 | i_rBuffer.Read( m_Radius ) && 64 | i_rBuffer.Read( m_Accuracy ); 65 | } 66 | 67 | /// Write function. 68 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 69 | { 70 | i_rBuffer.Write( m_Position ); 71 | i_rBuffer.Write( m_Radius ); 72 | i_rBuffer.Write( m_Accuracy ); 73 | } 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | }; 78 | 79 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/Contents.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VContents class. 29 | 30 | #include "Item.h" 31 | #include 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contents. 39 | class VContents : public VItem 40 | { 41 | public: 42 | 43 | /// Number of objects of each requested type present: 44 | /// The map contains an entry for each object type requested, along 45 | /// with a Size to indicate the number of objects present. 46 | std::map< ViconCGStreamType::Enum, ViconCGStreamType::UInt32 > m_EnumsTable; 47 | 48 | /// Set of requested types that do not contain changes: 49 | /// If all objects of a given type remain unchanged since the last object 50 | /// packet, then the type value will appear in this container. 51 | std::set< ViconCGStreamType::Enum > m_EnumsUnchanged; 52 | 53 | /// Equality operator 54 | bool operator == ( const VContents & i_rOther ) const 55 | { 56 | return m_EnumsTable == i_rOther.m_EnumsTable && m_EnumsUnchanged == i_rOther.m_EnumsUnchanged; 57 | } 58 | 59 | /// Object type enum. 60 | virtual ViconCGStreamType::Enum TypeID() const 61 | { 62 | return ViconCGStreamEnum::Contents; 63 | } 64 | 65 | /// Filter ID 66 | virtual ViconCGStreamType::UInt32 FilterID() const 67 | { 68 | return FILTER_NA; 69 | } 70 | 71 | /// Read function. 72 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 73 | { 74 | return i_rBuffer.Read( m_EnumsTable ) && 75 | i_rBuffer.Read( m_EnumsUnchanged ); 76 | } 77 | 78 | /// Write function. 79 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 80 | { 81 | i_rBuffer.Write( m_EnumsTable ); 82 | i_rBuffer.Write( m_EnumsUnchanged ); 83 | } 84 | 85 | }; 86 | 87 | //------------------------------------------------------------------------------------------------- 88 | }; 89 | 90 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/Dummy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KumarRobotics/motion_capture_system/2592b1eca1718c4eb562b462021da5486d5661ff/mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/Dummy.cpp -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/EdgePairs.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VEdgePairs class. 29 | 30 | #include "Item.h" 31 | #include "EdgePairsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a frame of edge pairs, along with the camera identifier and frame number. 39 | class VEdgePairs : public VItem 40 | { 41 | public: 42 | 43 | /// Camera frame number 44 | ViconCGStreamType::UInt32 m_FrameID; 45 | 46 | /// Camera identifier 47 | ViconCGStreamType::UInt32 m_CameraID; 48 | 49 | /// Edge pairs 50 | std::vector< ViconCGStreamDetail::VEdgePairs_EdgePair > m_EdgePairs; 51 | 52 | bool operator == ( const VEdgePairs & i_rOther ) const 53 | { 54 | return m_FrameID == i_rOther.m_FrameID && 55 | m_CameraID == i_rOther.m_CameraID && 56 | m_EdgePairs == i_rOther.m_EdgePairs; 57 | } 58 | 59 | /// Object type enum. 60 | virtual ViconCGStreamType::Enum TypeID() const 61 | { 62 | return ViconCGStreamEnum::EdgePairs; 63 | } 64 | 65 | /// Filter ID 66 | virtual ViconCGStreamType::UInt32 FilterID() const 67 | { 68 | return m_CameraID; 69 | } 70 | 71 | /// Read function. 72 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 73 | { 74 | return i_rBuffer.Read( m_FrameID ) && 75 | i_rBuffer.Read( m_CameraID ) && 76 | i_rBuffer.Read( m_EdgePairs ); 77 | } 78 | 79 | /// Write function. 80 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 81 | { 82 | i_rBuffer.Write( m_FrameID ); 83 | i_rBuffer.Write( m_CameraID ); 84 | i_rBuffer.Write( m_EdgePairs ); 85 | } 86 | 87 | }; 88 | 89 | //------------------------------------------------------------------------------------------------- 90 | }; 91 | 92 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/EdgePairsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the detail declaration of the ViconCGStream::VEdgePairs class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include "IsEqual.h" 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a frame of edge pairs, along with the camera identifier and frame number. 39 | class VEdgePairs_EdgePair 40 | { 41 | public: 42 | 43 | /// 2D position 44 | ViconCGStreamType::Int16 m_Position[ 2 ]; 45 | 46 | /// Number of pixels in the line 47 | ViconCGStreamType::UInt16 m_Length; 48 | 49 | /// Equality operator 50 | bool operator == ( const VEdgePairs_EdgePair & i_rOther ) const 51 | { 52 | return IsEqual( m_Position, i_rOther.m_Position ) && 53 | m_Length == i_rOther.m_Length; 54 | } 55 | 56 | /// Read function. 57 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 58 | { 59 | return i_rBuffer.Read( m_Position ) && 60 | i_rBuffer.Read( m_Length ); 61 | } 62 | 63 | /// Write function. 64 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 65 | { 66 | i_rBuffer.Write( m_Position ); 67 | i_rBuffer.Write( m_Length ); 68 | } 69 | }; 70 | 71 | //------------------------------------------------------------------------------------------------- 72 | }; 73 | 74 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/EyeTrackerFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VEyeTrackerFrame class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a frame number, device identifiers and a frame of eye tracker samples. 38 | class VEyeTrackerFrame : public VItem 39 | { 40 | public: 41 | 42 | /// Device frame number 43 | ViconCGStreamType::UInt32 m_FrameID; 44 | 45 | /// Device identifier 46 | ViconCGStreamType::UInt32 m_DeviceID; 47 | 48 | /// Gaze direction as a unit vector. 49 | /// In the eye coordinate system. 50 | /// See: ViconCGStream::VEyeTrackerInfo. 51 | ViconCGStreamType::Float m_GazeVector[ 3 ]; 52 | 53 | /// Equality operator 54 | bool operator == ( const VEyeTrackerFrame & i_rOther ) const 55 | { 56 | return m_FrameID == i_rOther.m_FrameID && 57 | m_DeviceID == i_rOther.m_DeviceID && 58 | ViconCGStreamDetail::IsEqual( m_GazeVector, i_rOther.m_GazeVector ); 59 | } 60 | 61 | /// Object type enum. 62 | virtual ViconCGStreamType::Enum TypeID() const 63 | { 64 | return ViconCGStreamEnum::EyeTrackerFrame; 65 | } 66 | 67 | /// Filter ID 68 | virtual ViconCGStreamType::UInt32 FilterID() const 69 | { 70 | return m_DeviceID; 71 | } 72 | 73 | /// Read function. 74 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 75 | { 76 | return i_rBuffer.Read( m_FrameID ) && 77 | i_rBuffer.Read( m_DeviceID ) && 78 | i_rBuffer.Read( m_GazeVector ); 79 | } 80 | 81 | /// Write function. 82 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 83 | { 84 | i_rBuffer.Write( m_FrameID ); 85 | i_rBuffer.Write( m_DeviceID ); 86 | i_rBuffer.Write( m_GazeVector ); 87 | } 88 | 89 | }; 90 | 91 | //------------------------------------------------------------------------------------------------- 92 | }; 93 | 94 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/ForceFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VForceFrame class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a frame number, device and channel identifiers, and a frame of force samples in component order (measured in N). 38 | class VForceFrame : public VItem 39 | { 40 | public: 41 | 42 | /// Device frame number 43 | ViconCGStreamType::UInt32 m_FrameID; 44 | 45 | /// Device identifier 46 | ViconCGStreamType::UInt32 m_DeviceID; 47 | 48 | /// Channel identifier 49 | ViconCGStreamType::UInt32 m_ChannelID; 50 | 51 | /// Force samples (in component order) 52 | std::vector< ViconCGStreamType::Float > m_Samples; 53 | 54 | /// Equality operator 55 | bool operator == ( const VForceFrame & i_rOther ) const 56 | { 57 | return m_FrameID == i_rOther.m_FrameID && 58 | m_DeviceID == i_rOther.m_DeviceID && 59 | m_ChannelID == i_rOther.m_ChannelID && 60 | m_Samples == i_rOther.m_Samples; 61 | } 62 | 63 | /// Object type enum. 64 | virtual ViconCGStreamType::Enum TypeID() const 65 | { 66 | return ViconCGStreamEnum::ForceFrame; 67 | } 68 | 69 | /// Filter ID 70 | virtual ViconCGStreamType::UInt32 FilterID() const 71 | { 72 | return m_DeviceID; 73 | } 74 | 75 | /// Read function. 76 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 77 | { 78 | return i_rBuffer.Read( m_FrameID ) && 79 | i_rBuffer.Read( m_DeviceID ) && 80 | i_rBuffer.Read( m_ChannelID ) && 81 | i_rBuffer.Read( m_Samples ); 82 | } 83 | 84 | /// Write function. 85 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 86 | { 87 | i_rBuffer.Write( m_FrameID ); 88 | i_rBuffer.Write( m_DeviceID ); 89 | i_rBuffer.Write( m_ChannelID ); 90 | i_rBuffer.Write( m_Samples ); 91 | } 92 | 93 | }; 94 | 95 | //------------------------------------------------------------------------------------------------- 96 | }; 97 | 98 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/FrameInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VFrameInfo class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Contains the master frame number for the current frame of objects. 37 | class VFrameInfo : public VItem 38 | { 39 | public: 40 | 41 | /// Stream frame number 42 | ViconCGStreamType::UInt32 m_FrameID; 43 | 44 | /// Equality operator 45 | bool operator == ( const VFrameInfo & i_rOther ) const 46 | { 47 | return m_FrameID == i_rOther.m_FrameID; 48 | } 49 | 50 | /// Object type enum. 51 | virtual ViconCGStreamType::Enum TypeID() const 52 | { 53 | return ViconCGStreamEnum::FrameInfo; 54 | } 55 | 56 | /// Filter ID 57 | virtual ViconCGStreamType::UInt32 FilterID() const 58 | { 59 | return FILTER_NA; 60 | } 61 | 62 | /// Read function. 63 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 64 | { 65 | return i_rBuffer.Read( m_FrameID ); 66 | } 67 | 68 | /// Write function. 69 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 70 | { 71 | i_rBuffer.Write( m_FrameID ); 72 | } 73 | 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | }; 78 | 79 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/FrameRateInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VLatencyInfo class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Contains the latency samples taken 37 | class VFrameRateInfo : public VItem 38 | { 39 | public: 40 | /// Samples 41 | std::map< std::string, double > m_FrameRates; 42 | 43 | /// Equality operator 44 | bool operator == ( const VFrameRateInfo& i_rOther ) const 45 | { 46 | return ( m_FrameRates == i_rOther.m_FrameRates ); 47 | } 48 | 49 | /// Object type enum. 50 | virtual ViconCGStreamType::Enum TypeID() const 51 | { 52 | return ViconCGStreamEnum::FrameRateInfo; 53 | } 54 | 55 | /// Filter ID 56 | virtual ViconCGStreamType::UInt32 FilterID() const 57 | { 58 | return FILTER_NA; 59 | } 60 | 61 | /// Read function. 62 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 63 | { 64 | return i_rBuffer.Read( m_FrameRates ); 65 | } 66 | 67 | /// Write function. 68 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 69 | { 70 | i_rBuffer.Write( m_FrameRates ); 71 | } 72 | 73 | }; 74 | 75 | //------------------------------------------------------------------------------------------------- 76 | }; 77 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/GlobalSegments.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VGlobalSegments class. 29 | 30 | #include "Item.h" 31 | #include "GlobalSegmentsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a vector of segment global poses for a single subject. 39 | class VGlobalSegments : public VItem 40 | { 41 | public: 42 | 43 | /// Subject identifier 44 | ViconCGStreamType::UInt32 m_SubjectID; 45 | 46 | /// Global segments 47 | std::vector< ViconCGStreamDetail::VGlobalSegments_Segment > m_Segments; 48 | 49 | // Equality operator 50 | bool operator == ( const VGlobalSegments & i_rOther ) const 51 | { 52 | return m_Segments == i_rOther.m_Segments; 53 | } 54 | 55 | /// Object type enum. 56 | virtual ViconCGStreamType::Enum TypeID() const 57 | { 58 | return ViconCGStreamEnum::GlobalSegments; 59 | } 60 | 61 | /// Filter ID 62 | virtual ViconCGStreamType::UInt32 FilterID() const 63 | { 64 | return m_SubjectID; 65 | } 66 | 67 | /// Read function. 68 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 69 | { 70 | return i_rBuffer.Read( m_SubjectID ) && 71 | i_rBuffer.Read( m_Segments ); 72 | } 73 | 74 | /// Write function. 75 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 76 | { 77 | i_rBuffer.Write( m_SubjectID ); 78 | i_rBuffer.Write( m_Segments ); 79 | } 80 | 81 | }; 82 | 83 | //------------------------------------------------------------------------------------------------- 84 | }; 85 | 86 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/GlobalSegmentsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the detail declaration of the ViconCGStream::VGlobalSegments class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include "IsEqual.h" 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | class VGlobalSegments_Segment 39 | { 40 | public: 41 | /// Segment identifier 42 | ViconCGStreamType::UInt32 m_SegmentID; 43 | 44 | /// Segment translation from the world origin 45 | ViconCGStreamType::Double m_Translation[ 3 ]; 46 | 47 | /// Segment rotation matrix (row major format) 48 | ViconCGStreamType::Double m_Rotation[ 9 ]; 49 | 50 | // Equality operator 51 | bool operator == ( const VGlobalSegments_Segment & i_rOther ) const 52 | { 53 | return m_SegmentID == i_rOther.m_SegmentID && 54 | ViconCGStreamDetail::IsEqual( m_Translation, i_rOther.m_Translation ) && 55 | ViconCGStreamDetail::IsEqual( m_Rotation, i_rOther.m_Rotation ); 56 | } 57 | 58 | /// Read function. 59 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 60 | { 61 | return i_rBuffer.Read( m_SegmentID ) && 62 | i_rBuffer.Read( m_Translation ) && 63 | i_rBuffer.Read( m_Rotation ); 64 | } 65 | 66 | /// Write function. 67 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 68 | { 69 | i_rBuffer.Write( m_SegmentID ); 70 | i_rBuffer.Write( m_Translation ); 71 | i_rBuffer.Write( m_Rotation ); 72 | } 73 | }; 74 | 75 | //------------------------------------------------------------------------------------------------- 76 | }; 77 | 78 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/GreyscaleBlobs.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VGreyscaleBlobs class. 29 | 30 | #include "GreyscaleBlobsDetail.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a frame of greyscale blobs, along with the camera identifier and frame number. 38 | class VGreyscaleBlobs : public VItem 39 | { 40 | public: 41 | 42 | /// Camera frame number 43 | ViconCGStreamType::UInt32 m_FrameID; 44 | 45 | /// Camera identifier 46 | ViconCGStreamType::UInt32 m_CameraID; 47 | 48 | /// Greyscale blobs 49 | std::vector< ViconCGStreamDetail::VGreyscaleBlobs_GreyscaleBlob > m_GreyscaleBlobs; 50 | 51 | /// Equality operator 52 | bool operator == ( const VGreyscaleBlobs & i_rOther ) const 53 | { 54 | return m_FrameID == i_rOther.m_FrameID && 55 | m_CameraID == i_rOther.m_CameraID && 56 | m_GreyscaleBlobs == i_rOther.m_GreyscaleBlobs; 57 | } 58 | 59 | /// Object type enum. 60 | virtual ViconCGStreamType::Enum TypeID() const 61 | { 62 | return ViconCGStreamEnum::GreyscaleBlobs; 63 | } 64 | 65 | /// Filter ID 66 | virtual ViconCGStreamType::UInt32 FilterID() const 67 | { 68 | return m_CameraID; 69 | } 70 | 71 | /// Read function. 72 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 73 | { 74 | return i_rBuffer.Read( m_FrameID ) && 75 | i_rBuffer.Read( m_CameraID ) && 76 | i_rBuffer.Read( m_GreyscaleBlobs ); 77 | } 78 | 79 | /// Write function. 80 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 81 | { 82 | i_rBuffer.Write( m_FrameID ); 83 | i_rBuffer.Write( m_CameraID ); 84 | i_rBuffer.Write( m_GreyscaleBlobs ); 85 | } 86 | 87 | }; 88 | 89 | //------------------------------------------------------------------------------------------------- 90 | }; 91 | 92 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/GreyscaleBlobsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the detail declaration of the ViconCGStream::VGreyscaleBlobs class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /** 39 | * Contains a greyscale line 40 | */ 41 | class VGreyscaleBlobs_GreyscaleLine 42 | { 43 | public: 44 | 45 | /// Greyscale values for the line pixels 46 | std::vector< ViconCGStreamType::UInt8 > m_Greyscale; 47 | 48 | /// 2D position 49 | ViconCGStreamType::Int16 m_Position[ 2 ]; 50 | 51 | /// Equality operator 52 | bool operator == ( const VGreyscaleBlobs_GreyscaleLine & i_rOther ) const 53 | { 54 | return m_Position[ 0 ] == i_rOther.m_Position[ 0 ] && 55 | m_Position[ 1 ] == i_rOther.m_Position[ 1 ] && 56 | m_Greyscale == i_rOther.m_Greyscale; 57 | } 58 | 59 | /// Read function. 60 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 61 | { 62 | return i_rBuffer.Read( m_Greyscale ) && 63 | i_rBuffer.Read( m_Position ); 64 | } 65 | 66 | /// Write function. 67 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 68 | { 69 | i_rBuffer.Write( m_Greyscale ); 70 | i_rBuffer.Write( m_Position ); 71 | } 72 | }; 73 | 74 | /** 75 | * Contains greyscale lines 76 | */ 77 | class VGreyscaleBlobs_GreyscaleBlob 78 | { 79 | public: 80 | 81 | /// Vector of lines comprising the blob 82 | std::vector< VGreyscaleBlobs_GreyscaleLine > m_GreyscaleLines; 83 | 84 | /// Equality operator 85 | bool operator == ( const VGreyscaleBlobs_GreyscaleBlob & i_rOther ) const 86 | { 87 | return m_GreyscaleLines == i_rOther.m_GreyscaleLines; 88 | } 89 | 90 | /// Read function. 91 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 92 | { 93 | return i_rBuffer.Read( m_GreyscaleLines ); 94 | } 95 | 96 | /// Write function. 97 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 98 | { 99 | i_rBuffer.Write( m_GreyscaleLines ); 100 | } 101 | }; 102 | 103 | //------------------------------------------------------------------------------------------------- 104 | }; 105 | 106 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/HardwareFrameInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VHardwareFrameInfo class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Contains the native hardware frame number for the current frame. 37 | /// This is typically for debugging purposes - most users should use VFrameInfo. 38 | class VHardwareFrameInfo : public VItem 39 | { 40 | public: 41 | 42 | /// Stream frame number 43 | ViconCGStreamType::UInt32 m_HardwareFrame; 44 | 45 | /// Equality operator 46 | bool operator == ( const VHardwareFrameInfo & i_rOther ) const 47 | { 48 | return m_HardwareFrame == i_rOther.m_HardwareFrame; 49 | } 50 | 51 | /// Object type enum. 52 | virtual ViconCGStreamType::Enum TypeID() const 53 | { 54 | return ViconCGStreamEnum::HardwareFrameInfo; 55 | } 56 | 57 | /// Filter ID 58 | virtual ViconCGStreamType::UInt32 FilterID() const 59 | { 60 | return FILTER_NA; 61 | } 62 | 63 | /// Read function. 64 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 65 | { 66 | return i_rBuffer.Read( m_HardwareFrame ); 67 | } 68 | 69 | /// Write function. 70 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 71 | { 72 | i_rBuffer.Write( m_HardwareFrame ); 73 | } 74 | 75 | }; 76 | 77 | //------------------------------------------------------------------------------------------------- 78 | }; 79 | 80 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/IsEqual.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | namespace ViconCGStreamDetail 28 | { 29 | //------------------------------------------------------------------------------------------------- 30 | 31 | template< unsigned int N > 32 | struct VDetail 33 | { 34 | template< typename T > 35 | static bool IsEqual( const T * i_pLeft, const T * i_pRight ) 36 | { 37 | return *i_pLeft == *i_pRight && VDetail< N - 1 >::IsEqual( i_pLeft + 1, i_pRight + 1 ); 38 | } 39 | }; 40 | 41 | template<> 42 | struct VDetail< 1 > 43 | { 44 | template< typename T > 45 | static bool IsEqual( const T * i_pLeft, const T * i_pRight ) 46 | { 47 | return *i_pLeft == *i_pRight; 48 | } 49 | }; 50 | 51 | template< typename T, unsigned int N > 52 | bool IsEqual( const T ( & i_rpLeft )[ N ], const T ( & i_rpRight )[ N ] ) 53 | { 54 | return VDetail< N >::IsEqual( i_rpLeft, i_rpRight ); 55 | } 56 | 57 | //------------------------------------------------------------------------------------------------- 58 | }; 59 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/Item.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Enum.h" 28 | #include 29 | #include "IsEqual.h" 30 | 31 | namespace ViconCGStream 32 | { 33 | //------------------------------------------------------------------------------------------------- 34 | 35 | const ViconCGStreamType::Int32 FILTER_NA = -1; 36 | 37 | /// This is the base class for all top level items 38 | class VItem 39 | { 40 | public: 41 | 42 | /// Type enum 43 | virtual ViconCGStreamType::Enum TypeID() const = 0; 44 | 45 | /// The value used to filter items belonging to a logical group 46 | /// Examples of return values are CameraID, DeviceID, SubjectID, etc. 47 | /// Top-level items that have no affinity with logical children should return FILTER_NA 48 | virtual ViconCGStreamType::UInt32 FilterID() const = 0; 49 | 50 | /// Read function 51 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) = 0; 52 | 53 | // Write function 54 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const = 0; 55 | 56 | // Virtual destructor 57 | virtual ~VItem() 58 | { 59 | } 60 | }; 61 | 62 | //------------------------------------------------------------------------------------------------- 63 | }; 64 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/KeepAlive.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VKeepAlive class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Keep alive object. 37 | class VKeepAlive : public VItem 38 | { 39 | public: 40 | 41 | /// Equality operator. 42 | bool operator == ( const VKeepAlive & i_rKeepAlive ) const 43 | { 44 | return true; 45 | } 46 | 47 | /// Object type enum. 48 | virtual ViconCGStreamType::Enum TypeID() const 49 | { 50 | return ViconCGStreamEnum::KeepAlive; 51 | } 52 | 53 | /// Filter ID 54 | virtual ViconCGStreamType::UInt32 FilterID() const 55 | { 56 | return FILTER_NA; 57 | } 58 | 59 | /// Read function. 60 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 61 | { 62 | return true; 63 | } 64 | 65 | /// Write function. 66 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 67 | { 68 | } 69 | 70 | }; 71 | 72 | //------------------------------------------------------------------------------------------------- 73 | }; 74 | 75 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/LabeledReconRayAssignments.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VLabeledReconRayAssignments class. 29 | 30 | #include "Item.h" 31 | #include "ReconRayAssignmentsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Labeled ray assignments 39 | class VLabeledReconRayAssignments : public VItem 40 | { 41 | public: 42 | /// Recon ray assignments. 43 | std::vector< ViconCGStreamDetail::VReconRayAssignments > m_ReconRayAssignments; 44 | 45 | /// Equality operator. 46 | bool operator == ( const VLabeledReconRayAssignments & i_rOther ) const 47 | { 48 | return m_ReconRayAssignments == i_rOther.m_ReconRayAssignments; 49 | } 50 | 51 | /// Object type enum. 52 | virtual ViconCGStreamType::Enum TypeID() const { 53 | return ViconCGStreamEnum::LabeledReconRayAssignments; 54 | } 55 | 56 | /// Filter ID 57 | virtual ViconCGStreamType::UInt32 FilterID() const 58 | { 59 | return FILTER_NA; 60 | } 61 | 62 | /// Read function. 63 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 64 | { 65 | return i_rBuffer.Read( m_ReconRayAssignments ); 66 | } 67 | 68 | /// Write function. 69 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 70 | { 71 | i_rBuffer.Write( m_ReconRayAssignments ); 72 | } 73 | 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | } 78 | 79 | 80 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/LabeledRecons.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VLabeledRecons class. 29 | 30 | #include "Item.h" 31 | #include "LabeledReconsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a frame of labeled recons, consisting of subject and marker identifiers, radii, positions and covariances. 39 | class VLabeledRecons : public VItem 40 | { 41 | public: 42 | 43 | /// Labeled recons 44 | std::vector< ViconCGStreamDetail::VLabeledRecons_LabeledRecon > m_LabeledRecons; 45 | 46 | /// Equality operator 47 | bool operator == ( const VLabeledRecons & i_rOther ) const 48 | { 49 | return m_LabeledRecons == i_rOther.m_LabeledRecons; 50 | } 51 | 52 | /// Object type enum. 53 | virtual ViconCGStreamType::Enum TypeID() const 54 | { 55 | return ViconCGStreamEnum::LabeledRecons; 56 | } 57 | 58 | /// Filter ID 59 | virtual ViconCGStreamType::UInt32 FilterID() const 60 | { 61 | return FILTER_NA; 62 | } 63 | 64 | /// Read function. 65 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 66 | { 67 | return i_rBuffer.Read( m_LabeledRecons ); 68 | } 69 | 70 | /// Write function. 71 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 72 | { 73 | i_rBuffer.Write( m_LabeledRecons ); 74 | } 75 | 76 | }; 77 | 78 | //------------------------------------------------------------------------------------------------- 79 | }; 80 | 81 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/LabeledReconsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the detail declaration of the ViconCGStream::VLabeledRecons class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include "IsEqual.h" 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /** 39 | * Contains a single labeled recon. 40 | */ 41 | class VLabeledRecons_LabeledRecon 42 | { 43 | public: 44 | 45 | /// Subject identifier 46 | ViconCGStreamType::UInt32 m_SubjectID; 47 | 48 | /// Marker identifier (for subject) 49 | ViconCGStreamType::UInt32 m_MarkerID; 50 | 51 | /// Recon radius 52 | ViconCGStreamType::Double m_Radius; 53 | 54 | /// Recon position 55 | ViconCGStreamType::Double m_Position[ 3 ]; 56 | 57 | /// Recon covariance matrix (row major format) 58 | ViconCGStreamType::Double m_Covariance[ 9 ]; 59 | 60 | /// Trajectory id 61 | ViconCGStreamType::UInt32 m_TrajectoryId; 62 | 63 | /// Equality operator 64 | bool operator == ( const VLabeledRecons_LabeledRecon & i_rOther ) const 65 | { 66 | return m_SubjectID == i_rOther.m_SubjectID && 67 | m_MarkerID == i_rOther.m_MarkerID && 68 | m_Radius == i_rOther.m_Radius && 69 | IsEqual( m_Position, i_rOther.m_Position ) && 70 | IsEqual( m_Covariance, i_rOther.m_Covariance ) && 71 | m_TrajectoryId == i_rOther.m_TrajectoryId; 72 | } 73 | 74 | /// Read function. 75 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 76 | { 77 | return i_rBuffer.Read( m_SubjectID ) && 78 | i_rBuffer.Read( m_MarkerID ) && 79 | i_rBuffer.Read( m_Radius ) && 80 | i_rBuffer.Read( m_Position ) && 81 | i_rBuffer.Read( m_Covariance ) && 82 | i_rBuffer.Read( m_TrajectoryId ); 83 | } 84 | 85 | /// Write function. 86 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 87 | { 88 | i_rBuffer.Write( m_SubjectID ); 89 | i_rBuffer.Write( m_MarkerID ); 90 | i_rBuffer.Write( m_Radius ); 91 | i_rBuffer.Write( m_Position ); 92 | i_rBuffer.Write( m_Covariance ); 93 | i_rBuffer.Write( m_TrajectoryId ); 94 | } 95 | 96 | }; 97 | 98 | //------------------------------------------------------------------------------------------------- 99 | }; 100 | 101 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/LatencyInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VLatencyInfo class. 29 | 30 | #include "Item.h" 31 | #include "LatencyInfoDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains the latency samples taken 39 | class VLatencyInfo : public VItem 40 | { 41 | public: 42 | /// Samples 43 | std::vector< ViconCGStreamDetail::VLatencyInfo_Sample > m_Samples; 44 | 45 | /// Equality operator 46 | bool operator == ( const VLatencyInfo& i_rOther ) const 47 | { 48 | return ( m_Samples == i_rOther.m_Samples ); 49 | } 50 | 51 | /// Object type enum. 52 | virtual ViconCGStreamType::Enum TypeID() const 53 | { 54 | return ViconCGStreamEnum::LatencyInfo; 55 | } 56 | 57 | /// Filter ID 58 | virtual ViconCGStreamType::UInt32 FilterID() const 59 | { 60 | return FILTER_NA; 61 | } 62 | 63 | /// Read function. 64 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 65 | { 66 | return i_rBuffer.Read( m_Samples ); 67 | } 68 | 69 | /// Write function. 70 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 71 | { 72 | i_rBuffer.Write( m_Samples ); 73 | } 74 | 75 | }; 76 | 77 | //------------------------------------------------------------------------------------------------- 78 | }; 79 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/LatencyInfoDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the details declaration of the ViconCGStream::VLatencyInfo class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include "IsEqual.h" 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a string and a duration in seconds since the previous sample was taken 39 | class VLatencyInfo_Sample 40 | { 41 | public: 42 | /// Sample name 43 | std::string m_Name; 44 | 45 | /// Duration in seconds since the previous sample was taken 46 | ViconCGStreamType::Double m_Latency; 47 | 48 | /// Equality function 49 | bool IsEqual( const VLatencyInfo_Sample & i_rOther ) const 50 | { 51 | return m_Name == i_rOther.m_Name && 52 | m_Latency == i_rOther.m_Latency; 53 | } 54 | 55 | /// Equality operator 56 | bool operator == ( const VLatencyInfo_Sample & i_rOther ) const 57 | { 58 | return IsEqual( i_rOther ); 59 | } 60 | 61 | /// Read function. 62 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 63 | { 64 | return i_rBuffer.Read( m_Name ) && 65 | i_rBuffer.Read( m_Latency ); 66 | } 67 | 68 | /// Write function. 69 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 70 | { 71 | i_rBuffer.Write( m_Name ); 72 | i_rBuffer.Write( m_Latency ); 73 | } 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | 78 | }; 79 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/LocalSegments.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VLocalSegments class. 29 | 30 | #include "Item.h" 31 | #include "LocalSegmentsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a vector of segment local poses for a single subject. 39 | class VLocalSegments : public VItem 40 | { 41 | public: 42 | 43 | /// Subject identifier 44 | ViconCGStreamType::UInt32 m_SubjectID; 45 | 46 | /// Local segments 47 | std::vector< ViconCGStreamDetail::VLocalSegments_Segment > m_Segments; 48 | 49 | // Equality operator 50 | bool operator == ( const VLocalSegments & i_rOther ) const 51 | { 52 | return m_Segments == i_rOther.m_Segments; 53 | } 54 | 55 | /// Object type enum. 56 | virtual ViconCGStreamType::Enum TypeID() const 57 | { 58 | return ViconCGStreamEnum::LocalSegments; 59 | } 60 | 61 | /// Filter ID 62 | virtual ViconCGStreamType::UInt32 FilterID() const 63 | { 64 | return m_SubjectID; 65 | } 66 | 67 | /// Read function. 68 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 69 | { 70 | if( !i_rBuffer.Read( m_SubjectID ) ) 71 | { 72 | return false; 73 | } 74 | 75 | if( !i_rBuffer.Read( m_Segments ) ) 76 | { 77 | return false; 78 | } 79 | 80 | return true; 81 | } 82 | 83 | /// Write function. 84 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 85 | { 86 | i_rBuffer.Write( m_SubjectID ); 87 | i_rBuffer.Write( m_Segments ); 88 | } 89 | 90 | }; 91 | 92 | //------------------------------------------------------------------------------------------------- 93 | }; 94 | 95 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/LocalSegmentsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the detail declaration of the ViconCGStream::VLocalSegments class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include "IsEqual.h" 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /** 39 | * Contains a segment translation from the parent origin, and rotation matrix (row major format). 40 | */ 41 | class VLocalSegments_Segment 42 | { 43 | public: 44 | /// Segment identifier 45 | ViconCGStreamType::UInt32 m_SegmentID; 46 | 47 | /// Segment translation from parent origin 48 | ViconCGStreamType::Double m_Translation[ 3 ]; 49 | 50 | /// Segment rotation matrix (row major format) 51 | ViconCGStreamType::Double m_Rotation[ 9 ]; 52 | 53 | // Equality operator 54 | bool operator == ( const VLocalSegments_Segment & i_rOther ) const 55 | { 56 | return m_SegmentID == i_rOther.m_SegmentID && 57 | IsEqual( m_Translation, i_rOther.m_Translation ) && 58 | IsEqual( m_Rotation, i_rOther.m_Rotation ); 59 | } 60 | 61 | /// Read function. 62 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 63 | { 64 | return i_rBuffer.Read( m_SegmentID ) && 65 | i_rBuffer.Read( m_Translation ) && 66 | i_rBuffer.Read( m_Rotation ); 67 | } 68 | 69 | /// Write function. 70 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 71 | { 72 | i_rBuffer.Write( m_SegmentID ); 73 | i_rBuffer.Write( m_Translation ); 74 | i_rBuffer.Write( m_Rotation ); 75 | } 76 | }; 77 | 78 | //------------------------------------------------------------------------------------------------- 79 | }; 80 | 81 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/MomentFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VMomentFrame class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a frame number, device and channel identifiers, and a frame of moment samples in component order (measured in N/mm). 38 | class VMomentFrame : public VItem 39 | { 40 | public: 41 | 42 | /// Device frame number 43 | ViconCGStreamType::UInt32 m_FrameID; 44 | 45 | /// Device identigier 46 | ViconCGStreamType::UInt32 m_DeviceID; 47 | 48 | /// Channel identifier 49 | ViconCGStreamType::UInt32 m_ChannelID; 50 | 51 | /// Moment samples (in component order) 52 | std::vector< ViconCGStreamType::Float > m_Samples; 53 | 54 | /// Equality operator 55 | bool operator == ( const VMomentFrame & i_rOther ) const 56 | { 57 | return m_FrameID == i_rOther.m_FrameID && 58 | m_DeviceID == i_rOther.m_DeviceID && 59 | m_ChannelID == i_rOther.m_ChannelID && 60 | m_Samples == i_rOther.m_Samples; 61 | } 62 | 63 | /// Object type enum. 64 | virtual ViconCGStreamType::Enum TypeID() const 65 | { 66 | return ViconCGStreamEnum::MomentFrame; 67 | } 68 | 69 | /// Filter ID 70 | virtual ViconCGStreamType::UInt32 FilterID() const 71 | { 72 | return m_DeviceID; 73 | } 74 | 75 | /// Read function. 76 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 77 | { 78 | return i_rBuffer.Read( m_FrameID ) && 79 | i_rBuffer.Read( m_DeviceID ) && 80 | i_rBuffer.Read( m_ChannelID ) && 81 | i_rBuffer.Read( m_Samples ); 82 | } 83 | 84 | /// Write function. 85 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 86 | { 87 | i_rBuffer.Write( m_FrameID ); 88 | i_rBuffer.Write( m_DeviceID ); 89 | i_rBuffer.Write( m_ChannelID ); 90 | i_rBuffer.Write( m_Samples ); 91 | } 92 | 93 | }; 94 | 95 | //------------------------------------------------------------------------------------------------- 96 | }; 97 | 98 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/ObjectEnums.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VObjectEnums class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Used by the server to declare the available object identifiers, and by the client to enable/disable objects. 38 | class VObjectEnums : public VItem 39 | { 40 | public: 41 | 42 | /// Object enums 43 | std::set< ViconCGStreamType::Enum > m_Enums; 44 | 45 | // Equality operator 46 | bool operator == ( const VObjectEnums & i_rOther ) const 47 | { 48 | return m_Enums == i_rOther.m_Enums; 49 | } 50 | 51 | /// Object type enum. 52 | virtual ViconCGStreamType::Enum TypeID() const 53 | { 54 | return ViconCGStreamEnum::ObjectEnums; 55 | } 56 | 57 | /// Filter ID 58 | virtual ViconCGStreamType::UInt32 FilterID() const 59 | { 60 | return FILTER_NA; 61 | } 62 | 63 | /// Read function. 64 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 65 | { 66 | return i_rBuffer.Read( m_Enums ); 67 | } 68 | 69 | /// Write function. 70 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 71 | { 72 | i_rBuffer.Write( m_Enums ); 73 | } 74 | 75 | }; 76 | 77 | //------------------------------------------------------------------------------------------------- 78 | }; 79 | 80 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/ObjectQuality.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VObjectQuality class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a quality estimate for a single object. 38 | class VObjectQuality : public VItem 39 | { 40 | public: 41 | 42 | /// Subject identifier 43 | ViconCGStreamType::UInt32 m_SubjectID; 44 | 45 | /// Quality estimate from 0.0 (bad) to 1.0 (excellent). 46 | ViconCGStreamType::Double m_ObjectQuality; 47 | 48 | /// Equality operator 49 | bool operator == ( const VObjectQuality& i_rOther ) const 50 | { 51 | return ( m_SubjectID == i_rOther.m_SubjectID ) && 52 | ( m_ObjectQuality == i_rOther.m_ObjectQuality ); 53 | } 54 | 55 | /// Object type enum. 56 | virtual ViconCGStreamType::Enum TypeID() const 57 | { 58 | return ViconCGStreamEnum::ObjectQuality; 59 | } 60 | 61 | /// Filter ID 62 | virtual ViconCGStreamType::UInt32 FilterID() const 63 | { 64 | return m_SubjectID; 65 | } 66 | 67 | /// Read function. 68 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 69 | { 70 | return i_rBuffer.Read( m_SubjectID ) && 71 | i_rBuffer.Read( m_ObjectQuality ); 72 | } 73 | 74 | /// Write function. 75 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 76 | { 77 | i_rBuffer.Write( m_SubjectID ); 78 | i_rBuffer.Write( m_ObjectQuality ); 79 | } 80 | 81 | }; 82 | 83 | //------------------------------------------------------------------------------------------------- 84 | }; 85 | 86 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/RequestFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Item.h" 28 | #include 29 | 30 | namespace ViconCGStream 31 | { 32 | //------------------------------------------------------------------------------------------------- 33 | 34 | /// Used by the client to request a new frame of data and to control streaming mode 35 | class VRequestFrame : public VItem 36 | { 37 | public: 38 | 39 | /// Streaming mode 40 | bool m_bStreaming; 41 | 42 | /// Equality operator 43 | bool operator == ( const VRequestFrame & i_rOther ) const 44 | { 45 | return m_bStreaming == i_rOther.m_bStreaming; 46 | } 47 | 48 | /// Object type enum. 49 | virtual ViconCGStreamType::Enum TypeID() const 50 | { 51 | return ViconCGStreamEnum::RequestFrame; 52 | } 53 | 54 | /// Filter ID 55 | virtual ViconCGStreamType::UInt32 FilterID() const 56 | { 57 | return FILTER_NA; 58 | } 59 | 60 | /// Read function. 61 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 62 | { 63 | return i_rBuffer.Read( m_bStreaming ); 64 | } 65 | 66 | /// Write function. 67 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 68 | { 69 | i_rBuffer.Write( m_bStreaming ); 70 | } 71 | 72 | }; 73 | 74 | //------------------------------------------------------------------------------------------------- 75 | }; 76 | 77 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/ScopedReader.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | #include "Enum.h" 29 | #include 30 | #include 31 | 32 | namespace ViconCGStream 33 | { 34 | class VItem; 35 | } 36 | 37 | namespace ViconCGStreamIO 38 | { 39 | //------------------------------------------------------------------------------------------------- 40 | 41 | /** \class VScopedReader 42 | This class provides functionality for reading nested blocks of data from a buffer. 43 | Each block has a header which contains a ViconCGStreamEnum identifier, and a block length. 44 | **/ 45 | 46 | class VScopedReader 47 | { 48 | public: 49 | 50 | /// Constructor taking the underlying buffer to read from. 51 | VScopedReader( VBuffer & i_rBuffer ) 52 | : m_rBuffer( i_rBuffer ) 53 | , m_Enum( 0 ) 54 | , m_Start( 0 ) 55 | , m_End( 0 ) 56 | { 57 | ViconCGStreamType::UInt32 Length; 58 | 59 | if( !m_rBuffer.Read( m_Enum ) || !m_rBuffer.Read( Length ) ) 60 | { 61 | return; 62 | } 63 | 64 | m_Start = m_rBuffer.Offset(); 65 | m_End = m_Start + Length; 66 | } 67 | 68 | /// Destructor. 69 | ~VScopedReader() 70 | { 71 | if( m_Start < m_End ) 72 | { 73 | m_rBuffer.SetOffset( m_End ); 74 | } 75 | } 76 | 77 | /// Determine if the current buffer offset is valid. 78 | bool Ok() 79 | { 80 | ViconCGStreamType::UInt32 Offset = m_rBuffer.Offset(); 81 | return Offset >= m_Start && Offset < m_End; 82 | } 83 | 84 | /// Get the Enum read from the block header. 85 | /// This function is used to determine the block type. 86 | /// If the block is valid, then the value returned will be defined in the ViconCGStreamEnum namespace. 87 | ViconCGStreamType::Enum Enum() const 88 | { 89 | return m_Enum; 90 | } 91 | 92 | /// Read a single item from the buffer. 93 | bool Read( ViconCGStream::VItem & o_rItem ) const 94 | { 95 | return m_rBuffer.Read( o_rItem ); 96 | } 97 | 98 | private: 99 | VBuffer& m_rBuffer; 100 | ViconCGStreamType::Enum m_Enum; 101 | ViconCGStreamType::UInt32 m_Start; 102 | ViconCGStreamType::UInt32 m_End; 103 | }; 104 | 105 | //------------------------------------------------------------------------------------------------- 106 | }; 107 | 108 | 109 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/ScopedWriter.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Item.h" 28 | #include 29 | #include 30 | 31 | namespace ViconCGStreamIO 32 | { 33 | //------------------------------------------------------------------------------------------------- 34 | 35 | /** \class VScopedWriter 36 | This class provides functionality for writing nested blocks of data to a buffer. 37 | Each block has a header which contains a ViconCGStreamEnum identifier, and a block length. 38 | **/ 39 | 40 | class VScopedWriter 41 | { 42 | public: 43 | 44 | /// Constructor taking the underlying buffer to write to and the enum for this block. 45 | VScopedWriter( VBuffer & i_rBuffer, ViconCGStreamType::Enum i_Enum = ViconCGStreamEnum::Objects ) 46 | : m_rBuffer( i_rBuffer ) 47 | { 48 | m_rBuffer.Write( i_Enum ); 49 | m_Start = m_rBuffer.Offset(); 50 | m_rBuffer.SetOffset( m_Start + sizeof( ViconCGStreamType::UInt32 ) ); 51 | } 52 | 53 | /// Destructor that fills out length of block in header. 54 | ~VScopedWriter() 55 | { 56 | ViconCGStreamType::UInt32 Offset = m_rBuffer.Offset(); 57 | ViconCGStreamType::UInt32 Length = ( Offset - m_Start ) - sizeof( ViconCGStreamType::UInt32 ); 58 | 59 | m_rBuffer.SetOffset( m_Start ); 60 | m_rBuffer.Write( Length ); 61 | m_rBuffer.SetOffset( Offset ); 62 | } 63 | 64 | /// Write an item and its enum type to the buffer. 65 | void Write( const ViconCGStream::VItem & i_rItem ) 66 | { 67 | VScopedWriter ScopedWriter( m_rBuffer, i_rItem.TypeID() ); 68 | m_rBuffer.Write( i_rItem ); 69 | } 70 | 71 | private: 72 | VBuffer & m_rBuffer; 73 | ViconCGStreamType::UInt32 m_Start; 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | }; 78 | 79 | 80 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/StartMulticastSender.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Item.h" 28 | #include 29 | 30 | namespace ViconCGStream 31 | { 32 | //------------------------------------------------------------------------------------------------- 33 | 34 | /// Start client multicast session 35 | class VStartMulticastSender : public VItem 36 | { 37 | public: 38 | 39 | /// Destination IP address, should be multicast or broadcast 40 | ViconCGStreamType::UInt32 m_MulticastIpAddress; 41 | 42 | // Source IP address 43 | ViconCGStreamType::UInt32 m_SourceIpAddress; 44 | 45 | // Port number 46 | ViconCGStreamType::UInt16 m_Port; 47 | 48 | /// Equality operator 49 | bool operator == ( const VStartMulticastSender & i_rOther ) const 50 | { 51 | return m_MulticastIpAddress == i_rOther.m_MulticastIpAddress 52 | && m_SourceIpAddress == i_rOther.m_SourceIpAddress 53 | && m_Port == i_rOther.m_Port; 54 | } 55 | 56 | /// Object type enum. 57 | virtual ViconCGStreamType::Enum TypeID() const 58 | { 59 | return ViconCGStreamEnum::StartMulticastSender; 60 | } 61 | 62 | /// Filter ID 63 | virtual ViconCGStreamType::UInt32 FilterID() const 64 | { 65 | return FILTER_NA; 66 | } 67 | 68 | /// Read function. 69 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 70 | { 71 | return i_rBuffer.Read( m_MulticastIpAddress ) 72 | && i_rBuffer.Read( m_SourceIpAddress ) 73 | && i_rBuffer.Read( m_Port ); 74 | } 75 | 76 | /// Write function. 77 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 78 | { 79 | i_rBuffer.Write( m_MulticastIpAddress ); 80 | i_rBuffer.Write( m_SourceIpAddress ); 81 | i_rBuffer.Write( m_Port );; 82 | } 83 | 84 | }; 85 | 86 | //------------------------------------------------------------------------------------------------- 87 | }; 88 | 89 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/StopMulticastSender.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VKeepAlive class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Stop client multicast session 37 | class VStopMulticastSender : public VItem 38 | { 39 | public: 40 | 41 | /// Equality operator. 42 | bool operator == ( const VStopMulticastSender & /*i_rVStopMulticastSender*/ ) const 43 | { 44 | return true; 45 | } 46 | 47 | /// Object type enum. 48 | virtual ViconCGStreamType::Enum TypeID() const 49 | { 50 | return ViconCGStreamEnum::StopMulticastSender; 51 | } 52 | 53 | /// Filter ID 54 | virtual ViconCGStreamType::UInt32 FilterID() const 55 | { 56 | return FILTER_NA; 57 | } 58 | 59 | /// Read function. 60 | virtual bool Read( const ViconCGStreamIO::VBuffer & /*i_rBuffer*/ ) 61 | { 62 | return true; 63 | } 64 | 65 | /// Write function. 66 | virtual void Write( ViconCGStreamIO::VBuffer & /*i_rBuffer*/ ) const 67 | { 68 | } 69 | 70 | }; 71 | 72 | //------------------------------------------------------------------------------------------------- 73 | }; 74 | 75 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/StreamInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VStreamInfo class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Contains the master frame period. 37 | class VStreamInfo : public VItem 38 | { 39 | public: 40 | 41 | /// Stream frame period. Defined as the numbers of ticks per frame on a 135Mhz clock. 42 | ViconCGStreamType::Int64 m_FramePeriod; 43 | 44 | /// Equality operator 45 | bool operator == ( const VStreamInfo& i_rOther ) const 46 | { 47 | return m_FramePeriod == i_rOther.m_FramePeriod; 48 | } 49 | 50 | /// Object type enum. 51 | virtual ViconCGStreamType::Enum TypeID() const 52 | { 53 | return ViconCGStreamEnum::StreamInfo; 54 | } 55 | 56 | /// Filter ID 57 | virtual ViconCGStreamType::UInt32 FilterID() const 58 | { 59 | return FILTER_NA; 60 | } 61 | 62 | /// Read function. 63 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 64 | { 65 | return i_rBuffer.Read( m_FramePeriod ); 66 | } 67 | 68 | /// Write function. 69 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 70 | { 71 | i_rBuffer.Write( m_FramePeriod ); 72 | } 73 | 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | }; 78 | 79 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/SubjectHealth.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VSubjectHealth class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a health estimate for a single subject. 38 | class VSubjectHealth : public VItem 39 | { 40 | public: 41 | 42 | /// Subject identifier 43 | ViconCGStreamType::UInt32 m_SubjectID; 44 | 45 | /// Residual error computed from reconstructions, in mm. 46 | ViconCGStreamType::Double m_MarkerError; 47 | 48 | /// Health estimate from 0.0 (bad) to 1.0 (excellent). 49 | ViconCGStreamType::Double m_SubjectHealth; 50 | 51 | /// Equality operator 52 | bool operator == ( const VSubjectHealth& i_rOther ) const 53 | { 54 | return ( m_SubjectID == i_rOther.m_SubjectID ) && 55 | ( m_MarkerError == i_rOther.m_MarkerError ) && 56 | ( m_SubjectHealth == i_rOther.m_SubjectHealth ); 57 | } 58 | 59 | /// Object type enum. 60 | virtual ViconCGStreamType::Enum TypeID() const 61 | { 62 | return ViconCGStreamEnum::SubjectHealth; 63 | } 64 | 65 | /// Filter ID 66 | virtual ViconCGStreamType::UInt32 FilterID() const 67 | { 68 | return m_SubjectID; 69 | } 70 | 71 | /// Read function. 72 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 73 | { 74 | return i_rBuffer.Read( m_SubjectID ) && 75 | i_rBuffer.Read( m_MarkerError ) && 76 | i_rBuffer.Read( m_SubjectHealth ); 77 | } 78 | 79 | /// Write function. 80 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 81 | { 82 | i_rBuffer.Write( m_SubjectID ); 83 | i_rBuffer.Write( m_MarkerError ); 84 | i_rBuffer.Write( m_SubjectHealth ); 85 | } 86 | 87 | }; 88 | 89 | //------------------------------------------------------------------------------------------------- 90 | }; 91 | 92 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/SubjectTopology.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VSubjectCalibrationInfo class. 29 | 30 | #include 31 | #include "SubjectTopologyDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains the static description of a single subject. 39 | class VSubjectTopology : public VItem 40 | { 41 | public: 42 | 43 | /// Subject identifier 44 | ViconCGStreamType::UInt32 m_SubjectID; 45 | 46 | /// Segments 47 | std::vector< ViconCGStreamDetail::VSubjectTopology_Segment > m_Segments; 48 | 49 | /// Equality function 50 | bool IsEqual( const VSubjectTopology & i_rOther ) const 51 | { 52 | return m_SubjectID == i_rOther.m_SubjectID && 53 | m_Segments == i_rOther.m_Segments; 54 | } 55 | 56 | /// Equality operator 57 | bool operator == ( const VSubjectTopology & i_rOther ) const 58 | { 59 | return IsEqual( i_rOther ); 60 | } 61 | 62 | /// Object type enum. 63 | virtual ViconCGStreamType::Enum TypeID() const 64 | { 65 | return ViconCGStreamEnum::SubjectTopology; 66 | } 67 | 68 | /// Filter ID 69 | virtual ViconCGStreamType::UInt32 FilterID() const 70 | { 71 | return m_SubjectID; 72 | } 73 | 74 | /// Read function. 75 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 76 | { 77 | return i_rBuffer.Read( m_SubjectID ) && 78 | i_rBuffer.Read( m_Segments ); 79 | } 80 | 81 | /// Write function. 82 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 83 | { 84 | i_rBuffer.Write( m_SubjectID ); 85 | i_rBuffer.Write( m_Segments ); 86 | } 87 | 88 | }; 89 | 90 | //------------------------------------------------------------------------------------------------- 91 | }; 92 | 93 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/SubjectTopologyDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | namespace ViconCGStreamDetail 32 | { 33 | //------------------------------------------------------------------------------------------------- 34 | 35 | /// (Member of VSubjectTopology) Contains neutral pose information 36 | class VSubjectTopology_Segment 37 | { 38 | public: 39 | /// Segment identifier 40 | ViconCGStreamType::UInt32 m_SegmentID; 41 | 42 | /// Translation in parent segment at neutral pose 43 | ViconCGStreamType::Double m_Translation[ 3 ]; 44 | 45 | /// Rotation in parent segment at neutral pose 46 | ViconCGStreamType::Double m_Rotation[ 9 ]; 47 | 48 | bool IsEqual( const VSubjectTopology_Segment & i_rOther ) const 49 | { 50 | return m_SegmentID == i_rOther.m_SegmentID && 51 | ViconCGStreamDetail::IsEqual( m_Translation, i_rOther.m_Translation ) && 52 | ViconCGStreamDetail::IsEqual( m_Rotation, i_rOther.m_Rotation ); 53 | } 54 | 55 | /// Equality operator 56 | bool operator == ( const VSubjectTopology_Segment & i_rOther ) const 57 | { 58 | return IsEqual( i_rOther ); 59 | } 60 | 61 | /// Read function. 62 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 63 | { 64 | return i_rBuffer.Read( m_SegmentID ) && 65 | i_rBuffer.Read( m_Translation ) && 66 | i_rBuffer.Read( m_Rotation ); 67 | } 68 | 69 | /// Write function. 70 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 71 | { 72 | i_rBuffer.Write( m_SegmentID ); 73 | i_rBuffer.Write( m_Translation ); 74 | i_rBuffer.Write( m_Rotation ); 75 | } 76 | }; 77 | 78 | //------------------------------------------------------------------------------------------------- 79 | }; 80 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/UnlabeledReconRayAssignments.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VUnlabeledReconRayAssignments class. 29 | 30 | #include "Item.h" 31 | #include "ReconRayAssignmentsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Unlabeled ray assignments 39 | class VUnlabeledReconRayAssignments : public VItem 40 | { 41 | public: 42 | 43 | /// Recon ray assignments. 44 | std::vector< ViconCGStreamDetail::VReconRayAssignments > m_ReconRayAssignments; 45 | 46 | /// Equality operator. 47 | bool operator == ( const VUnlabeledReconRayAssignments & i_rOther ) 48 | { 49 | return m_ReconRayAssignments == i_rOther.m_ReconRayAssignments; 50 | } 51 | 52 | /// Object type enum. 53 | virtual ViconCGStreamType::Enum TypeID() const { 54 | return ViconCGStreamEnum::UnlabeledReconRayAssignments; 55 | } 56 | 57 | /// Filter ID 58 | virtual ViconCGStreamType::UInt32 FilterID() const 59 | { 60 | return FILTER_NA; 61 | } 62 | 63 | /// Read function. 64 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 65 | { 66 | return i_rBuffer.Read( m_ReconRayAssignments ); 67 | } 68 | 69 | /// Write function. 70 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 71 | { 72 | i_rBuffer.Write( m_ReconRayAssignments ); 73 | } 74 | 75 | }; 76 | 77 | //------------------------------------------------------------------------------------------------- 78 | } 79 | 80 | 81 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/UnlabeledRecons.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VUnlabeledRecons class. 29 | 30 | #include "Item.h" 31 | #include "UnlabeledReconsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a frame of unlabeled recons, consisting of radii, positions and covariances. 39 | class VUnlabeledRecons : public VItem 40 | { 41 | public: 42 | 43 | /// Unlabeled recons 44 | std::vector< ViconCGStreamDetail::VUnlabeledRecons_UnlabeledRecon > m_UnlabeledRecons; 45 | 46 | /// Equality operator 47 | bool operator == ( const VUnlabeledRecons & i_rOther ) const 48 | { 49 | return m_UnlabeledRecons == i_rOther.m_UnlabeledRecons; 50 | } 51 | 52 | /// Object type enum. 53 | virtual ViconCGStreamType::Enum TypeID() const 54 | { 55 | return ViconCGStreamEnum::UnlabeledRecons; 56 | } 57 | 58 | /// Filter ID 59 | virtual ViconCGStreamType::UInt32 FilterID() const 60 | { 61 | return FILTER_NA; 62 | } 63 | 64 | /// Read function. 65 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 66 | { 67 | return i_rBuffer.Read( m_UnlabeledRecons ); 68 | } 69 | 70 | /// Write function. 71 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 72 | { 73 | i_rBuffer.Write( m_UnlabeledRecons ); 74 | } 75 | 76 | }; 77 | 78 | //------------------------------------------------------------------------------------------------- 79 | }; 80 | 81 | 82 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/UnlabeledReconsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the details declaration of the ViconCGStream::VUnlabeledRecons class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include "IsEqual.h" 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a single unlabeled recon. 39 | class VUnlabeledRecons_UnlabeledRecon 40 | { 41 | public: 42 | /// Recon radius 43 | ViconCGStreamType::Double m_Radius; 44 | 45 | /// Recon position 46 | ViconCGStreamType::Double m_Position[ 3 ]; 47 | 48 | /// Recon covariance matrix (row major format) 49 | ViconCGStreamType::Double m_Covariance[ 9 ]; 50 | 51 | /// Trajectory id 52 | ViconCGStreamType::UInt32 m_TrajectoryId; 53 | 54 | /// Equality operator 55 | bool operator == ( const VUnlabeledRecons_UnlabeledRecon & i_rOther ) const 56 | { 57 | return m_Radius == i_rOther.m_Radius && 58 | IsEqual( m_Position, i_rOther.m_Position ) && 59 | IsEqual( m_Covariance, i_rOther.m_Covariance ) && 60 | m_TrajectoryId == i_rOther.m_TrajectoryId; 61 | } 62 | 63 | /// Read function. 64 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 65 | { 66 | return i_rBuffer.Read( m_Radius ) && 67 | i_rBuffer.Read( m_Position ) && 68 | i_rBuffer.Read( m_Covariance ) && 69 | i_rBuffer.Read( m_TrajectoryId ); 70 | } 71 | 72 | /// Write function. 73 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 74 | { 75 | i_rBuffer.Write( m_Radius ); 76 | i_rBuffer.Write( m_Position ); 77 | i_rBuffer.Write( m_Covariance ); 78 | i_rBuffer.Write( m_TrajectoryId ); 79 | } 80 | }; 81 | 82 | //------------------------------------------------------------------------------------------------- 83 | }; 84 | 85 | 86 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStream/VoltageFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VVoltageFrame class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a frame number, device and channel identifiers, and a frame of voltages in component order (measured in V). 38 | class VVoltageFrame : public VItem 39 | { 40 | public: 41 | 42 | /// Device frame number 43 | ViconCGStreamType::UInt32 m_FrameID; 44 | 45 | /// Device iedntifier 46 | ViconCGStreamType::UInt32 m_DeviceID; 47 | 48 | /// Channel identifier 49 | ViconCGStreamType::UInt32 m_ChannelID; 50 | 51 | /// Voltage samples (in component order) 52 | std::vector< ViconCGStreamType::Float > m_Samples; 53 | 54 | /// Equality operator 55 | bool operator == ( const VVoltageFrame & i_rOther ) const 56 | { 57 | return m_FrameID == i_rOther.m_FrameID && 58 | m_DeviceID == i_rOther.m_DeviceID && 59 | m_ChannelID == i_rOther.m_ChannelID && 60 | m_Samples == i_rOther.m_Samples; 61 | } 62 | 63 | /// Object type enum. 64 | virtual ViconCGStreamType::Enum TypeID() const 65 | { 66 | return ViconCGStreamEnum::VoltageFrame; 67 | } 68 | 69 | /// Filter ID 70 | virtual ViconCGStreamType::UInt32 FilterID() const 71 | { 72 | return m_DeviceID; 73 | } 74 | 75 | /// Read function. 76 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 77 | { 78 | return i_rBuffer.Read( m_FrameID ) && 79 | i_rBuffer.Read( m_DeviceID ) && 80 | i_rBuffer.Read( m_ChannelID ) && 81 | i_rBuffer.Read( m_Samples ); 82 | } 83 | 84 | /// Write function. 85 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 86 | { 87 | i_rBuffer.Write( m_FrameID ); 88 | i_rBuffer.Write( m_DeviceID ); 89 | i_rBuffer.Write( m_ChannelID ); 90 | i_rBuffer.Write( m_Samples ); 91 | } 92 | 93 | }; 94 | 95 | //------------------------------------------------------------------------------------------------- 96 | }; 97 | 98 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStreamClient/CGStreamReaderWriter.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | // Class providing asio based socket support for the cg stream 32 | class VCGStreamReaderWriter : public ViconCGStreamIO::VBuffer 33 | { 34 | public: 35 | 36 | VCGStreamReaderWriter( std::shared_ptr< boost::asio::ip::tcp::socket > i_pSocket ); 37 | 38 | VCGStreamReaderWriter( std::shared_ptr< boost::asio::ip::udp::socket > i_pMulticastSocket ); 39 | 40 | // determine if there is data ready to read. Return value indicates if an error occured 41 | bool DataReady( bool & o_rbDataReady ) const; 42 | 43 | // Close the socket 44 | void Close(); 45 | 46 | // Determine if socket is open 47 | bool IsOpen() const; 48 | 49 | // Fill buffer from socket 50 | bool Fill(); 51 | 52 | // Flush buffer to socket 53 | bool Flush(); 54 | 55 | std::shared_ptr< boost::asio::ip::tcp::socket > m_pSocket; 56 | std::shared_ptr< boost::asio::ip::udp::socket > m_pMulticastSocket; 57 | }; 58 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStreamClient/IViconCGStreamClientCallback.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | 29 | class VStaticObjects; 30 | class VDynamicObjects; 31 | 32 | class IViconCGStreamClientCallback 33 | { 34 | public: 35 | virtual void OnConnect(); 36 | virtual void OnStaticObjects( std::shared_ptr< const VStaticObjects > i_pStaticObjects ); 37 | virtual void OnDynamicObjects( std::shared_ptr< const VDynamicObjects > i_pDynamicObjects ); 38 | virtual void OnDisconnect(); 39 | virtual ~IViconCGStreamClientCallback(); 40 | }; 41 | 42 | inline void IViconCGStreamClientCallback::OnConnect() 43 | { 44 | } 45 | 46 | 47 | inline void IViconCGStreamClientCallback::OnStaticObjects( std::shared_ptr< const VStaticObjects > i_pStaticObjects ) 48 | { 49 | } 50 | 51 | 52 | inline void IViconCGStreamClientCallback::OnDynamicObjects( std::shared_ptr< const VDynamicObjects > i_pDynamicObjects ) 53 | { 54 | } 55 | 56 | inline void IViconCGStreamClientCallback::OnDisconnect() 57 | { 58 | } 59 | 60 | inline IViconCGStreamClientCallback::~IViconCGStreamClientCallback() 61 | { 62 | } 63 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconCGStreamClient/ViconCGStreamBayer.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | class VViconCGStreamBayer 28 | { 29 | public: 30 | static void BayerGBToBGR( unsigned int i_Width, unsigned int i_Height, const unsigned char * i_pBayerData, unsigned char * o_pBGRData ); 31 | static void BayerBGToBGR( unsigned int i_Width, unsigned int i_Height, const unsigned char * i_pBayerData, unsigned char * o_pBGRData ); 32 | static void BayerRGToBGR( unsigned int i_Width, unsigned int i_Height, const unsigned char * i_pBayerData, unsigned char * o_pBGRData ); 33 | }; 34 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDKCore/AxisMapping.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Constants.h" 28 | #include 29 | 30 | namespace ViconDataStreamSDK 31 | { 32 | namespace Core 33 | { 34 | 35 | class VAxisMapping 36 | { 37 | public: 38 | virtual ~VAxisMapping(); 39 | 40 | // Create a mapper and set the transformation matrix 41 | // Returns a null shared_ptr if there is an error in the axis system 42 | static std::shared_ptr< VAxisMapping > Create( AxisMappingResult::Enum & o_rError, 43 | Direction::Enum i_XAxis, 44 | Direction::Enum i_YAxis, 45 | Direction::Enum i_ZAxis ); 46 | 47 | // Set the transform properties 48 | void GetAxisMapping( Direction::Enum & o_rXAxis, Direction::Enum & o_rYAxis, Direction::Enum & o_rZAxis ) const; 49 | 50 | // Transform world points and rotations 51 | void CopyAndTransformT( const double i_Translation[ 3 ], double ( & io_Translation )[ 3 ] ) const; 52 | void CopyAndTransformR( const double i_Rotation[ 9 ], double ( & io_Rotation )[ 9 ] ) const; 53 | 54 | void CopyAndTransformT( const double i_Translation[3], const double i_Orientation[9], double( &io_Translation )[3] ) const; 55 | void CopyAndTransformR( const double i_Rotation[9], const double i_Orientation[9], double( &io_Rotation )[9] ) const; 56 | 57 | // Get the underlying transformation matrix 58 | void GetTransformationMatrix( double( &o_Rotation )[9] ); 59 | 60 | private: 61 | VAxisMapping(); 62 | 63 | // Set the transform matrix 64 | AxisMappingResult::Enum SetAxisMapping( const Direction::Enum i_XAxis, 65 | const Direction::Enum i_YAxis, 66 | const Direction::Enum i_ZAxis ); 67 | 68 | // Raw axis mappings and equivalent transform matrix 69 | Direction::Enum m_XAxis; 70 | Direction::Enum m_YAxis; 71 | Direction::Enum m_ZAxis; 72 | double m_Transform[ 9 ]; 73 | }; 74 | 75 | } // End of namespace Core 76 | } // End of namespace ViconDataStreamSDK 77 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDKCore/RetimerUtils.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | 29 | namespace ClientUtils 30 | { 31 | typedef boost::array< double, 4 > Quaternion; 32 | typedef boost::array< double, 9 > RotationMatrix; 33 | typedef boost::array< double, 3 > Axis; 34 | typedef boost::array< double, 3 > Displacement; 35 | 36 | // Simple Quaternion and Vector operation, to remove vnl/tmv dependency 37 | Quaternion Conjugate( const Quaternion & i_rInput ); 38 | Quaternion Inverse( const Quaternion & i_rInput ); 39 | 40 | Axis Imaginary( const Quaternion & i_rInput ); 41 | double Magnitude( const Axis & i_rInput ); 42 | void Normalize( Axis & io_rInput ); 43 | 44 | bool ToAxisAngle( const Quaternion & i_rInput, Axis & o_rAxis, double & o_rAngle ); 45 | Quaternion FromAxisAngle( const Axis & i_rAxis, const double & i_rAngle ); 46 | RotationMatrix ToRotationMatrix( const Quaternion & i_rInput ); 47 | 48 | Axis operator*( const Axis & i_rLeft, double i_rVal ); 49 | Axis operator+=( Axis & i_rLeft, const Axis & i_rRight ); 50 | Quaternion operator*( const Quaternion & i_rLeft, const Quaternion & i_rRight ); 51 | 52 | /// Returns a rotation prediction at time t3 from 2 rotation r1 at time t1 and r2 and time t2 53 | /// where t3 > t2 > t1 54 | Quaternion PredictRotation( Quaternion r1, double t1, Quaternion r2, double t2, double t3 ); 55 | 56 | /// Returns a translation prediction at time t3 from 2 translations at time d1, t1; d2, t2 where t3 > t2 > t1 57 | /// Can also be used for linear interpolation where t2 > t3 > t1 58 | Displacement PredictDisplacement( const Displacement & d1, double t1, const Displacement & d2, double t2, double t3 ); 59 | } 60 | 61 | 62 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDKCore/ViconDataStreamSDKCoreVersion.h: -------------------------------------------------------------------------------- 1 | #define VICONDATASTREAMSDKCORE_VERSION_MAJOR 1 2 | #define VICONDATASTREAMSDKCORE_VERSION_MINOR 8 3 | #define VICONDATASTREAMSDKCORE_VERSION_POINT 0 4 | #define VICONDATASTREAMSDKCORE_VERSION_REVISION_CONTROL_SYSTEM "unknown" 5 | #define VICONDATASTREAMSDKCORE_VERSION_REVISION 0 6 | #define VICONDATASTREAMSDKCORE_VERSION_MONOTONIC_REVISION 0 7 | #define VICONDATASTREAMSDKCORE_VERSION_PUBLIC_REVISION_STRING "0" 8 | #define VICONDATASTREAMSDKCORE_VERSION_RELEASE "" 9 | #define VICONDATASTREAMSDKCORE_VERSION_BRANCH "unknown" 10 | #define VICONDATASTREAMSDKCORE_VERSION_REPOSITORY "unknown" 11 | #define VICONDATASTREAMSDKCORE_VERSION_CHANGESET "0" 12 | #define VICONDATASTREAMSDKCORE_VERSION_LOCAL_CHANGESET "0" 13 | #define VICONDATASTREAMSDKCORE_VERSION_LOCAL_BRANCH "unknown" 14 | 15 | #define VICONDATASTREAMSDKCORE_FULL_VERSION_STRING "1.8.0.0" 16 | #define VICONDATASTREAMSDKCORE_VERSION_STRING "1.8" 17 | #define VICONDATASTREAMSDKCORE_COMPANY "Vicon Motion Systems Ltd" 18 | #define VICONDATASTREAMSDKCORE_COPYRIGHT "Copyright \x00A9 2018 Vicon Motion Systems Ltd. All rights reserved." 19 | #define VICONDATASTREAMSDKCORE_TRADEMARK "Vicon\x00AE is a registered trademark of OMG Plc." 20 | #define VICONDATASTREAMSDKCORE_PROJECT_NAME "ViconDataStreamSDKCore" 21 | 22 | #define VICONDATASTREAMSDKCORE_FULL_VERSION_STRING_L L"1.8.0.0" 23 | #define VICONDATASTREAMSDKCORE_VERSION_STRING_L L"1.8" 24 | #define VICONDATASTREAMSDKCORE_COMPANY_L L"Vicon Motion Systems Ltd" 25 | #define VICONDATASTREAMSDKCORE_COPYRIGHT_L L"Copyright \x00A9 2018 Vicon Motion Systems Ltd. All rights reserved." 26 | #define VICONDATASTREAMSDKCORE_TRADEMARK_L L"Vicon\x00AE is a registered trademark of OMG Plc." 27 | #define VICONDATASTREAMSDKCORE_PROJECT_NAME_L L"ViconDataStreamSDKCore" 28 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDK_C/VersionInfoResource.rc2: -------------------------------------------------------------------------------- 1 | #include "ViconDataStreamSDK_CVersion.h" 2 | 3 | ///////////////////////////////////////////////////////////////////////////// 4 | // 5 | // Version 6 | // 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION VICONDATASTREAMSDK_C_VERSION_MAJOR,VICONDATASTREAMSDK_C_VERSION_MINOR,VICONDATASTREAMSDK_C_VERSION_POINT,VICONDATASTREAMSDK_C_VERSION_REVISION 10 | PRODUCTVERSION VICONDATASTREAMSDK_C_VERSION_MAJOR,VICONDATASTREAMSDK_C_VERSION_MINOR,VICONDATASTREAMSDK_C_VERSION_POINT,VICONDATASTREAMSDK_C_VERSION_REVISION 11 | FILEFLAGSMASK 0x3fL 12 | #ifdef _DEBUG 13 | FILEFLAGS 0x1L 14 | #else 15 | FILEFLAGS 0x0L 16 | #endif 17 | FILEOS 0x4L 18 | FILETYPE 0x1L 19 | FILESUBTYPE 0x0L 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "040904b0" 24 | BEGIN 25 | VALUE "CompanyName", VICONDATASTREAMSDK_C_COMPANY_L 26 | VALUE "FileDescription", "Vicon DataStream SDK for C" 27 | VALUE "FileVersion", VICONDATASTREAMSDK_C_FULL_VERSION_STRING_L 28 | VALUE "InternalName", "Vicon DataStream SDK for C" 29 | VALUE "LegalCopyright", VICONDATASTREAMSDK_C_COPYRIGHT_L 30 | VALUE "LegalTrademarks", VICONDATASTREAMSDK_C_TRADEMARK_L 31 | VALUE "OriginalFilename", "ViconDataStreamSDK_C.dll" 32 | VALUE "ProductName", "Vicon DataStream SDK" 33 | VALUE "ProductVersion", VICONDATASTREAMSDK_C_FULL_VERSION_STRING_L 34 | END 35 | END 36 | BLOCK "VarFileInfo" 37 | BEGIN 38 | VALUE "Translation", 0x409, 1200 39 | END 40 | END 41 | 42 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDK_C/ViconDataStreamSDK_C.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "windows.h" 11 | ///////////////////////////////////////////////////////////////////////////// 12 | #undef APSTUDIO_READONLY_SYMBOLS 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // English (U.S.) resources 16 | 17 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 18 | #ifdef _WIN32 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | #endif //_WIN32 22 | 23 | #ifdef APSTUDIO_INVOKED 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // TEXTINCLUDE 27 | // 28 | 29 | 1 TEXTINCLUDE 30 | BEGIN 31 | "resource.h\0" 32 | END 33 | 34 | 2 TEXTINCLUDE 35 | BEGIN 36 | "#include ""windows.h""\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "#include ""VersionInfoResource.rc2""\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | #endif // English (U.S.) resources 48 | ///////////////////////////////////////////////////////////////////////////// 49 | 50 | 51 | 52 | #ifndef APSTUDIO_INVOKED 53 | ///////////////////////////////////////////////////////////////////////////// 54 | // 55 | // Generated from the TEXTINCLUDE 3 resource. 56 | // 57 | #include "VersionInfoResource.rc2" 58 | 59 | ///////////////////////////////////////////////////////////////////////////// 60 | #endif // not APSTUDIO_INVOKED 61 | 62 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDK_C/ViconDataStreamSDK_CVersion.h: -------------------------------------------------------------------------------- 1 | #define VICONDATASTREAMSDK_C_VERSION_MAJOR 1 2 | #define VICONDATASTREAMSDK_C_VERSION_MINOR 8 3 | #define VICONDATASTREAMSDK_C_VERSION_POINT 0 4 | #define VICONDATASTREAMSDK_C_VERSION_REVISION_CONTROL_SYSTEM "unknown" 5 | #define VICONDATASTREAMSDK_C_VERSION_REVISION 0 6 | #define VICONDATASTREAMSDK_C_VERSION_MONOTONIC_REVISION 0 7 | #define VICONDATASTREAMSDK_C_VERSION_PUBLIC_REVISION_STRING "0" 8 | #define VICONDATASTREAMSDK_C_VERSION_RELEASE "" 9 | #define VICONDATASTREAMSDK_C_VERSION_BRANCH "unknown" 10 | #define VICONDATASTREAMSDK_C_VERSION_REPOSITORY "unknown" 11 | #define VICONDATASTREAMSDK_C_VERSION_CHANGESET "0" 12 | #define VICONDATASTREAMSDK_C_VERSION_LOCAL_CHANGESET "0" 13 | #define VICONDATASTREAMSDK_C_VERSION_LOCAL_BRANCH "unknown" 14 | 15 | #define VICONDATASTREAMSDK_C_FULL_VERSION_STRING "1.8.0.0" 16 | #define VICONDATASTREAMSDK_C_VERSION_STRING "1.8" 17 | #define VICONDATASTREAMSDK_C_COMPANY "Vicon Motion Systems Ltd" 18 | #define VICONDATASTREAMSDK_C_COPYRIGHT "Copyright \x00A9 2018 Vicon Motion Systems Ltd. All rights reserved." 19 | #define VICONDATASTREAMSDK_C_TRADEMARK "Vicon\x00AE is a registered trademark of OMG Plc." 20 | #define VICONDATASTREAMSDK_C_PROJECT_NAME "ViconDataStreamSDK_C" 21 | 22 | #define VICONDATASTREAMSDK_C_FULL_VERSION_STRING_L L"1.8.0.0" 23 | #define VICONDATASTREAMSDK_C_VERSION_STRING_L L"1.8" 24 | #define VICONDATASTREAMSDK_C_COMPANY_L L"Vicon Motion Systems Ltd" 25 | #define VICONDATASTREAMSDK_C_COPYRIGHT_L L"Copyright \x00A9 2018 Vicon Motion Systems Ltd. All rights reserved." 26 | #define VICONDATASTREAMSDK_C_TRADEMARK_L L"Vicon\x00AE is a registered trademark of OMG Plc." 27 | #define VICONDATASTREAMSDK_C_PROJECT_NAME_L L"ViconDataStreamSDK_C" 28 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDK_C/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KumarRobotics/motion_capture_system/2592b1eca1718c4eb562b462021da5486d5661ff/mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDK_C/resource.h -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/ReadMe.txt: -------------------------------------------------------------------------------- 1 | If you modify Client.h, please modify the copy in ViconDataStreamSDK_CPPPlugins -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/StringFactory.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | namespace ViconDataStreamSDK 28 | { 29 | namespace CPP 30 | { 31 | class VStringFactory : public IStringFactory 32 | { 33 | public: 34 | 35 | virtual char * AllocAndCopyString( const char * i_pSource ) 36 | { 37 | char * pString = new char[ strlen( i_pSource ) + 1 ]; 38 | strcpy( pString, i_pSource ); 39 | return pString; 40 | } 41 | 42 | virtual void FreeString( char * i_pString ) 43 | { 44 | delete[] i_pString; 45 | } 46 | }; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/VersionInfoResource.rc2: -------------------------------------------------------------------------------- 1 | #include "ViconDataStreamSDK_CPPVersion.h" 2 | 3 | ///////////////////////////////////////////////////////////////////////////// 4 | // 5 | // Version 6 | // 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION VICONDATASTREAMSDK_CPP_VERSION_MAJOR,VICONDATASTREAMSDK_CPP_VERSION_MINOR,VICONDATASTREAMSDK_CPP_VERSION_POINT,VICONDATASTREAMSDK_CPP_VERSION_REVISION 10 | PRODUCTVERSION VICONDATASTREAMSDK_CPP_VERSION_MAJOR,VICONDATASTREAMSDK_CPP_VERSION_MINOR,VICONDATASTREAMSDK_CPP_VERSION_POINT,VICONDATASTREAMSDK_CPP_VERSION_REVISION 11 | FILEFLAGSMASK 0x3fL 12 | #ifdef _DEBUG 13 | FILEFLAGS 0x1L 14 | #else 15 | FILEFLAGS 0x0L 16 | #endif 17 | FILEOS 0x4L 18 | FILETYPE 0x1L 19 | FILESUBTYPE 0x0L 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "040904b0" 24 | BEGIN 25 | VALUE "CompanyName", VICONDATASTREAMSDK_CPP_COMPANY_L 26 | VALUE "FileDescription", "Vicon DataStream SDK for C++" 27 | VALUE "FileVersion", VICONDATASTREAMSDK_CPP_FULL_VERSION_STRING_L 28 | VALUE "InternalName", "Vicon DataStream for C++" 29 | VALUE "LegalCopyright", VICONDATASTREAMSDK_CPP_COPYRIGHT_L 30 | VALUE "LegalTrademarks", VICONDATASTREAMSDK_CPP_TRADEMARK_L 31 | VALUE "OriginalFilename", "ViconDataStreamSDK_CPP.dll" 32 | VALUE "ProductName", "Vicon DataStream SDK" 33 | VALUE "ProductVersion", VICONDATASTREAMSDK_CPP_FULL_VERSION_STRING_L 34 | END 35 | END 36 | BLOCK "VarFileInfo" 37 | BEGIN 38 | VALUE "Translation", 0x409, 1200 39 | END 40 | END 41 | 42 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/ViconDataStreamSDK_CPP.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "windows.h" 11 | ///////////////////////////////////////////////////////////////////////////// 12 | #undef APSTUDIO_READONLY_SYMBOLS 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // English (U.S.) resources 16 | 17 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 18 | #ifdef _WIN32 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | #endif //_WIN32 22 | 23 | #ifdef APSTUDIO_INVOKED 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // TEXTINCLUDE 27 | // 28 | 29 | 1 TEXTINCLUDE 30 | BEGIN 31 | "resource.h\0" 32 | END 33 | 34 | 2 TEXTINCLUDE 35 | BEGIN 36 | "#include ""windows.h""\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "#include ""VersionInfoResource.rc2""\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | #endif // English (U.S.) resources 48 | ///////////////////////////////////////////////////////////////////////////// 49 | 50 | 51 | 52 | #ifndef APSTUDIO_INVOKED 53 | ///////////////////////////////////////////////////////////////////////////// 54 | // 55 | // Generated from the TEXTINCLUDE 3 resource. 56 | // 57 | #include "VersionInfoResource.rc2" 58 | 59 | ///////////////////////////////////////////////////////////////////////////// 60 | #endif // not APSTUDIO_INVOKED 61 | 62 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/ViconDataStreamSDK_CPPVersion.h: -------------------------------------------------------------------------------- 1 | #define VICONDATASTREAMSDK_CPP_VERSION_MAJOR 1 2 | #define VICONDATASTREAMSDK_CPP_VERSION_MINOR 8 3 | #define VICONDATASTREAMSDK_CPP_VERSION_POINT 0 4 | #define VICONDATASTREAMSDK_CPP_VERSION_REVISION_CONTROL_SYSTEM "unknown" 5 | #define VICONDATASTREAMSDK_CPP_VERSION_REVISION 0 6 | #define VICONDATASTREAMSDK_CPP_VERSION_MONOTONIC_REVISION 0 7 | #define VICONDATASTREAMSDK_CPP_VERSION_PUBLIC_REVISION_STRING "0" 8 | #define VICONDATASTREAMSDK_CPP_VERSION_RELEASE "" 9 | #define VICONDATASTREAMSDK_CPP_VERSION_BRANCH "unknown" 10 | #define VICONDATASTREAMSDK_CPP_VERSION_REPOSITORY "unknown" 11 | #define VICONDATASTREAMSDK_CPP_VERSION_CHANGESET "0" 12 | #define VICONDATASTREAMSDK_CPP_VERSION_LOCAL_CHANGESET "0" 13 | #define VICONDATASTREAMSDK_CPP_VERSION_LOCAL_BRANCH "unknown" 14 | 15 | #define VICONDATASTREAMSDK_CPP_FULL_VERSION_STRING "1.8.0.0" 16 | #define VICONDATASTREAMSDK_CPP_VERSION_STRING "1.8" 17 | #define VICONDATASTREAMSDK_CPP_COMPANY "Vicon Motion Systems Ltd" 18 | #define VICONDATASTREAMSDK_CPP_COPYRIGHT "Copyright \x00A9 2018 Vicon Motion Systems Ltd. All rights reserved." 19 | #define VICONDATASTREAMSDK_CPP_TRADEMARK "Vicon\x00AE is a registered trademark of OMG Plc." 20 | #define VICONDATASTREAMSDK_CPP_PROJECT_NAME "ViconDataStreamSDK_CPP" 21 | 22 | #define VICONDATASTREAMSDK_CPP_FULL_VERSION_STRING_L L"1.8.0.0" 23 | #define VICONDATASTREAMSDK_CPP_VERSION_STRING_L L"1.8" 24 | #define VICONDATASTREAMSDK_CPP_COMPANY_L L"Vicon Motion Systems Ltd" 25 | #define VICONDATASTREAMSDK_CPP_COPYRIGHT_L L"Copyright \x00A9 2018 Vicon Motion Systems Ltd. All rights reserved." 26 | #define VICONDATASTREAMSDK_CPP_TRADEMARK_L L"Vicon\x00AE is a registered trademark of OMG Plc." 27 | #define VICONDATASTREAMSDK_CPP_PROJECT_NAME_L L"ViconDataStreamSDK_CPP" 28 | -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KumarRobotics/motion_capture_system/2592b1eca1718c4eb562b462021da5486d5661ff/mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/resource.h -------------------------------------------------------------------------------- /mocap_vicon/src/vicon_sdk/Vicon/CrossMarket/StreamCommon/Type.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2017 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStreamType namespace. 29 | 30 | /** 31 | * This namespace defines the set of primitive types used by the protocol Readers and Writers, and 32 | * also by the objects defined in the ViconCGStream namespace. 33 | * 34 | * See ViconCGStreamIO::VReader, ViconCGStreamIO::VWriter. 35 | */ 36 | namespace ViconCGStreamType 37 | { 38 | //------------------------------------------------------------------------------------------------- 39 | 40 | /// Single 8-bit character. 41 | typedef char Char; 42 | /// 8-bit signed integer. 43 | typedef char Int8; 44 | /// 16-bit signed integer. 45 | typedef short Int16; 46 | /// 32-bit signed integer. 47 | typedef int Int32; 48 | /// 64-bit signed integer. 49 | typedef long long Int64; 50 | 51 | /// 8-bit unsigned integer. 52 | typedef unsigned char UInt8; 53 | /// 16-bit unsigned integer. 54 | typedef unsigned short UInt16; 55 | /// 32-bit unsigned integer. 56 | typedef unsigned int UInt32; 57 | /// 64-bit unsigned integer. 58 | typedef unsigned long long UInt64; 59 | 60 | /// 32-bit IEEE-format floating-point number. 61 | typedef float Float; 62 | /// 64-bit IEEE-format floating-point number. 63 | typedef double Double; 64 | 65 | /** This is a special type to distinguish members of the ViconCGStreamEnum namespace from other 66 | * primitives in the stream. 67 | */ 68 | typedef UInt32 Enum; 69 | 70 | //------------------------------------------------------------------------------------------------- 71 | }; 72 | 73 | -------------------------------------------------------------------------------- /run_ros2_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker rm ros2_qukf 4 | 5 | # XSOCK=/tmp/.X11-unix 6 | 7 | # docker run -it --rm \ 8 | # --runtime=nvidia \ 9 | # -e DISPLAY=:0 \ 10 | # -v $XSOCK:$XSOCK \ 11 | # -v $HOME/.Xauthority:/root/.Xauthority \ 12 | # --privileged \ 13 | # --net=host \ 14 | # --gpus all \ 15 | # --env="QT_X11_NO_MITSHM=1" \ 16 | # ros2 "$@" 17 | 18 | docker run -it \ 19 | --env="DISPLAY" \ 20 | --env="QT_X11_NO_MITSHM=1" \ 21 | --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \ 22 | --network host \ 23 | --name ros2_qukf \ 24 | ros2 25 | #rqt 26 | export containerId=$(docker ps -l -q) 27 | --------------------------------------------------------------------------------