├── .clang-format ├── .gitattributes ├── .github └── workflows │ └── github-actions.yml ├── .gitignore ├── .pre-commit-config.yaml ├── Dockerfile-noetic ├── LICENSE ├── LICENSE.bsd ├── LICENSE.gplv3 ├── LICENSE.lgplv3 ├── README.md ├── libphidget22 ├── CHANGELOG.rst ├── CMakeLists.txt ├── cmake │ └── libphidget22-extras.cmake.in └── package.xml ├── phidgets_accelerometer ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include │ └── phidgets_accelerometer │ │ ├── accelerometer_ros_i.h │ │ └── phidgets_accelerometer_nodelet.h ├── launch │ └── accelerometer.launch ├── package.xml ├── phidgets_accelerometer_nodelet.xml └── src │ ├── accelerometer_ros_i.cpp │ └── phidgets_accelerometer_nodelet.cpp ├── phidgets_analog_inputs ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include │ └── phidgets_analog_inputs │ │ ├── analog_inputs_ros_i.h │ │ └── phidgets_analog_inputs_nodelet.h ├── launch │ └── analog_inputs.launch ├── package.xml ├── phidgets_analog_inputs_nodelet.xml └── src │ ├── analog_inputs_ros_i.cpp │ └── phidgets_analog_inputs_nodelet.cpp ├── phidgets_analog_outputs ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include │ └── phidgets_analog_outputs │ │ ├── analog_outputs_ros_i.h │ │ └── phidgets_analog_outputs_nodelet.h ├── launch │ └── analog_outputs.launch ├── package.xml ├── phidgets_analog_outputs_nodelet.xml └── src │ ├── analog_outputs_ros_i.cpp │ └── phidgets_analog_outputs_nodelet.cpp ├── phidgets_api ├── CHANGELOG.rst ├── CMakeLists.txt ├── debian │ └── udev ├── include │ └── phidgets_api │ │ ├── accelerometer.h │ │ ├── analog_input.h │ │ ├── analog_inputs.h │ │ ├── analog_output.h │ │ ├── analog_outputs.h │ │ ├── current_input.h │ │ ├── current_inputs.h │ │ ├── digital_input.h │ │ ├── digital_inputs.h │ │ ├── digital_output.h │ │ ├── digital_outputs.h │ │ ├── encoder.h │ │ ├── encoders.h │ │ ├── gyroscope.h │ │ ├── humidity.h │ │ ├── ir.h │ │ ├── magnetometer.h │ │ ├── motor.h │ │ ├── motors.h │ │ ├── phidget22.h │ │ ├── spatial.h │ │ └── temperature.h ├── package.xml └── src │ ├── accelerometer.cpp │ ├── analog_input.cpp │ ├── analog_inputs.cpp │ ├── analog_output.cpp │ ├── analog_outputs.cpp │ ├── current_input.cpp │ ├── current_inputs.cpp │ ├── digital_input.cpp │ ├── digital_inputs.cpp │ ├── digital_output.cpp │ ├── digital_outputs.cpp │ ├── encoder.cpp │ ├── encoders.cpp │ ├── gyroscope.cpp │ ├── humidity.cpp │ ├── ir.cpp │ ├── magnetometer.cpp │ ├── motor.cpp │ ├── motors.cpp │ ├── phidget22.cpp │ ├── spatial.cpp │ └── temperature.cpp ├── phidgets_current_inputs ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include │ └── phidgets_current_inputs │ │ ├── current_inputs_ros_i.h │ │ └── phidgets_current_inputs_nodelet.h ├── launch │ └── current_inputs.launch ├── package.xml ├── phidgets_current_inputs_nodelet.xml └── src │ ├── current_inputs_ros_i.cpp │ └── phidgets_current_inputs_nodelet.cpp ├── phidgets_digital_inputs ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include │ └── phidgets_digital_inputs │ │ ├── digital_inputs_ros_i.h │ │ └── phidgets_digital_inputs_nodelet.h ├── launch │ └── digital_inputs.launch ├── package.xml ├── phidgets_digital_inputs_nodelet.xml └── src │ ├── digital_inputs_ros_i.cpp │ └── phidgets_digital_inputs_nodelet.cpp ├── phidgets_digital_outputs ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include │ └── phidgets_digital_outputs │ │ ├── digital_outputs_ros_i.h │ │ └── phidgets_digital_outputs_nodelet.h ├── launch │ └── digital_outputs.launch ├── package.xml ├── phidgets_digital_outputs_nodelet.xml └── src │ ├── digital_outputs_ros_i.cpp │ └── phidgets_digital_outputs_nodelet.cpp ├── phidgets_drivers ├── CHANGELOG.rst ├── CMakeLists.txt └── package.xml ├── phidgets_gyroscope ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include │ └── phidgets_gyroscope │ │ ├── gyroscope_ros_i.h │ │ └── phidgets_gyroscope_nodelet.h ├── launch │ └── gyroscope.launch ├── package.xml ├── phidgets_gyroscope_nodelet.xml └── src │ ├── gyroscope_ros_i.cpp │ └── phidgets_gyroscope_nodelet.cpp ├── phidgets_high_speed_encoder ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include │ └── phidgets_high_speed_encoder │ │ ├── high_speed_encoder_ros_i.h │ │ └── phidgets_high_speed_encoder_nodelet.h ├── launch │ └── high_speed_encoder.launch ├── package.xml ├── phidgets_high_speed_encoder_nodelet.xml └── src │ ├── high_speed_encoder_ros_i.cpp │ └── phidgets_high_speed_encoder_nodelet.cpp ├── phidgets_humidity ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include │ └── phidgets_humidity │ │ ├── humidity_ros_i.h │ │ └── phidgets_humidity_nodelet.h ├── launch │ └── humidity.launch ├── package.xml ├── phidgets_humidity_nodelet.xml └── src │ ├── humidity_ros_i.cpp │ └── phidgets_humidity_nodelet.cpp ├── phidgets_ik ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── launch │ └── ik.launch └── package.xml ├── phidgets_magnetometer ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include │ └── phidgets_magnetometer │ │ ├── magnetometer_ros_i.h │ │ └── phidgets_magnetometer_nodelet.h ├── launch │ └── magnetometer.launch ├── package.xml ├── phidgets_magnetometer_nodelet.xml └── src │ ├── magnetometer_ros_i.cpp │ └── phidgets_magnetometer_nodelet.cpp ├── phidgets_motors ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include │ └── phidgets_motors │ │ ├── motors_ros_i.h │ │ └── phidgets_motors_nodelet.h ├── launch │ └── motors.launch ├── package.xml ├── phidgets_motors_nodelet.xml └── src │ ├── motors_ros_i.cpp │ └── phidgets_motors_nodelet.cpp ├── phidgets_msgs ├── CHANGELOG.rst ├── CMakeLists.txt ├── msg │ └── EncoderDecimatedSpeed.msg ├── package.xml └── srv │ ├── SetAnalogOutput.srv │ └── SetDigitalOutput.srv ├── phidgets_spatial ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include │ └── phidgets_spatial │ │ ├── phidgets_spatial_nodelet.h │ │ └── spatial_ros_i.h ├── launch │ └── spatial.launch ├── package.xml ├── phidgets_spatial_nodelet.xml └── src │ ├── phidgets_spatial_nodelet.cpp │ └── spatial_ros_i.cpp └── phidgets_temperature ├── CHANGELOG.rst ├── CMakeLists.txt ├── README.md ├── include └── phidgets_temperature │ ├── phidgets_temperature_nodelet.h │ └── temperature_ros_i.h ├── launch └── temperature.launch ├── package.xml ├── phidgets_temperature_nodelet.xml └── src ├── phidgets_temperature_nodelet.cpp └── temperature_ros_i.cpp /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Google 3 | Language: Cpp 4 | AccessModifierOffset: -2 5 | AllowShortFunctionsOnASingleLine: false 6 | BreakBeforeBraces: Custom 7 | BraceWrapping: 8 | AfterControlStatement: true 9 | AfterClass: true 10 | AfterFunction: true 11 | SplitEmptyFunction: true 12 | IndentWidth: 4 13 | SortIncludes: false 14 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # patch files shouldn't be merged, nor have eol normalized, but be diff-able. 2 | # This avoids problems like #77 and #113. 3 | *.patch -merge -text 4 | -------------------------------------------------------------------------------- /.github/workflows/github-actions.yml: -------------------------------------------------------------------------------- 1 | name: Build and run ROS tests 2 | on: 3 | push: 4 | pull_request: 5 | workflow_dispatch: 6 | inputs: 7 | debug_enabled: 8 | type: boolean 9 | description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' 10 | required: false 11 | default: false 12 | jobs: 13 | build: 14 | strategy: 15 | matrix: 16 | rosdistro: [noetic] 17 | runs-on: ubuntu-latest 18 | container: 19 | image: ros:${{ matrix.rosdistro }}-ros-core 20 | steps: 21 | # Enable tmate debugging of manually-triggered workflows if the input option was provided 22 | - name: Setup tmate session 23 | uses: mxschmitt/action-tmate@v3 24 | if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} 25 | with: 26 | detached: true 27 | - name: Install apt dependencies 28 | run: | 29 | sudo apt-get update 30 | sudo apt-get install -y build-essential clang-format-10 file git python3-catkin-lint python3-catkin-tools python3-pip python3-rosdep 31 | - name: Install pip dependencies 32 | run: pip install pre-commit 33 | - name: Checkout repository 34 | uses: actions/checkout@v4 35 | with: 36 | path: src/phidgets_drivers 37 | - name: Use rosdep to install remaining dependencies 38 | run: | 39 | sudo rosdep init 40 | rosdep update 41 | rosdep install --from-paths src -i -y --rosdistro ${{ matrix.rosdistro }} 42 | - name: Build 43 | run: | 44 | . /opt/ros/${{ matrix.rosdistro }}/setup.sh 45 | catkin init 46 | catkin config -j 1 -p 1 47 | catkin build --limit-status-rate 0.1 --no-notify 48 | catkin build --limit-status-rate 0.1 --no-notify --make-args tests 49 | - name: Run tests 50 | run: | 51 | . devel/setup.sh 52 | catkin run_tests 53 | catkin_test_results 54 | - name: Run pre-commit hooks 55 | run: | 56 | cd src/phidgets_drivers 57 | pre-commit run -a 58 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | build/ 3 | lib/ 4 | *~ 5 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # To use: 2 | # 3 | # pre-commit run -a 4 | # 5 | # Or: 6 | # 7 | # pre-commit install # (runs every time you commit in git) 8 | # 9 | # To update this file: 10 | # 11 | # pre-commit autoupdate 12 | # 13 | # See https://github.com/pre-commit/pre-commit 14 | 15 | repos: 16 | # Standard hooks 17 | - repo: https://github.com/pre-commit/pre-commit-hooks 18 | rev: v4.1.0 19 | hooks: 20 | - id: check-added-large-files 21 | - id: check-case-conflict 22 | - id: check-executables-have-shebangs 23 | - id: check-merge-conflict 24 | - id: check-shebang-scripts-are-executable 25 | - id: check-symlinks 26 | - id: check-vcs-permalinks 27 | - id: check-xml 28 | - id: check-yaml 29 | - id: debug-statements 30 | - id: end-of-file-fixer 31 | exclude: &excludes | 32 | (?x)^( 33 | .*\.blend| 34 | .*\.dae| 35 | .*\.mtl| 36 | .*\.obj| 37 | .*\.pgm| 38 | .*\.step| 39 | .*\.stl| 40 | .*\.patch 41 | )$ 42 | - id: fix-byte-order-marker 43 | - id: mixed-line-ending 44 | exclude: *excludes 45 | - id: trailing-whitespace 46 | exclude: *excludes 47 | 48 | - repo: local 49 | hooks: 50 | - id: clang-format 51 | name: clang-format 52 | description: Format files with ClangFormat. 53 | entry: clang-format-10 54 | language: system 55 | files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$ 56 | args: [ "-fallback-style=none", "-i" ] 57 | - id: catkin_lint 58 | name: catkin_lint 59 | description: Check package.xml and cmake files 60 | entry: catkin_lint . 61 | language: system 62 | always_run: true 63 | pass_filenames: false 64 | args: [ "--strict", "--explain", "--ignore", "undefined_target", "--ignore", "external_directory", "--ignore", "external_file" ] 65 | -------------------------------------------------------------------------------- /Dockerfile-noetic: -------------------------------------------------------------------------------- 1 | FROM ros:noetic-ros-core 2 | 3 | RUN apt-get update \ 4 | && apt-get install -y build-essential file python3-rosdep python3-catkin-tools \ 5 | && rm -rf /var/lib/apt/lists/* 6 | 7 | # Install pre-commit hooks to /root/.cache/pre-commit/ 8 | RUN apt-get update -qq \ 9 | && apt-get install -y -qq --no-install-recommends git python3-pip clang-format-10 python3-catkin-lint \ 10 | && rm -rf /var/lib/apt/lists/* 11 | RUN pip3 install pre-commit 12 | RUN mkdir -p /tmp/pre-commit 13 | COPY .pre-commit-config.yaml /tmp/pre-commit/ 14 | RUN cd /tmp/pre-commit \ 15 | && git init \ 16 | && pre-commit install-hooks \ 17 | && rm -rf /tmp/pre-commit 18 | 19 | # Create ROS workspace 20 | COPY . /ws/src/phidgets_drivers 21 | WORKDIR /ws 22 | 23 | # Use rosdep to install all dependencies (including ROS itself) 24 | RUN rosdep init && rosdep update && apt-get update -qq && rosdep install --from-paths src -i -y --rosdistro noetic \ 25 | && rm -rf /var/lib/apt/lists/* 26 | 27 | RUN /bin/bash -c "source /opt/ros/noetic/setup.bash && \ 28 | catkin init && \ 29 | catkin config --install -j 1 -p 1 && \ 30 | catkin build --limit-status-rate 0.1 --no-notify && \ 31 | catkin build --limit-status-rate 0.1 --no-notify --make-args tests && \ 32 | cd src/phidgets_drivers && pre-commit run -a" 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The libphidgets22 library is licensed under the GNU Lesser General Public Licence v3 or later. 2 | See LICENSE.gplv3 and LICENSE.lgplv3 for the text of the license. 3 | 4 | The rest of the code in this repository is licensed under the 3-clause BSD license. 5 | See LICENSE.bsd for the text of the license. 6 | -------------------------------------------------------------------------------- /LICENSE.bsd: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019, Open Source Robotics Foundation 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of the copyright holder nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /libphidget22/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package libphidget22 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.0.10 (2025-05-08) 6 | ------------------- 7 | 8 | 1.0.9 (2024-03-13) 9 | ------------------ 10 | * Update to libphidget22 1.19 (`#175 `_) 11 | * Contributors: Martin Günther 12 | 13 | 1.0.8 (2023-11-27) 14 | ------------------ 15 | 16 | 1.0.7 (2023-03-02) 17 | ------------------ 18 | * Update to libphidget22 1.13. (`#161 `_) 19 | Co-authored-by: Chris Lalancette 20 | * Contributors: Martin Günther 21 | 22 | 1.0.6 (2022-12-01) 23 | ------------------ 24 | * Merge pull request `#129 `_ from mintar/feat-pre-commit 25 | Add pre-commit, move from travis to GitHub actions, fix style 26 | * libphidget22: Use install FILES for libraries 27 | * Contributors: Martin Günther 28 | 29 | 1.0.5 (2022-02-17) 30 | ------------------ 31 | 32 | 1.0.4 (2021-10-22) 33 | ------------------ 34 | * Update to libphidget22-1.7.20210816 (`#106 `_) 35 | This is required to support new devices such as the MOT0109. 36 | Fixes `#99 `_, fixes `#105 `_. 37 | * Contributors: Martin Günther 38 | 39 | 1.0.3 (2021-09-29) 40 | ------------------ 41 | 42 | 1.0.2 (2021-03-09) 43 | ------------------ 44 | 45 | 1.0.1 (2020-06-04) 46 | ------------------ 47 | * Re-run bloom to fix the line endings in the patch file 48 | (`#77 `_) 49 | * Set cmake_policy CMP0048 to fix warning 50 | * Contributors: Martin Günther 51 | 52 | 1.0.0 (2020-06-03) 53 | ------------------ 54 | * Update to libphidget22 from 2020. 55 | * Update maintainers in package.xml 56 | * Patch warnings in libphidget22. 57 | * Fix up libphidget22 package.xml dependencies. 58 | * Add in libphidget22 package. 59 | * Contributors: Chris Lalancette, Martin Günther 60 | -------------------------------------------------------------------------------- /libphidget22/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(libphidget22) 4 | 5 | find_package(catkin REQUIRED) 6 | 7 | catkin_destinations() # set-up destination variables 8 | file(MAKE_DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_INCLUDE_DESTINATION}) 9 | 10 | set(extra_c_flags "-g -O2 -Wno-incompatible-pointer-types -Wno-deprecated-declarations -Wno-format-truncation") 11 | 12 | include(ExternalProject) 13 | ExternalProject_Add(EP_${PROJECT_NAME} 14 | URL https://www.phidgets.com/downloads/phidget22/libraries/linux/libphidget22/libphidget22-1.19.20240304.tar.gz 15 | URL_MD5 9b059eaef8cb8ce70b8abd7e4d309d1d 16 | 17 | CONFIGURE_COMMAND "./configure" 18 | SOURCE_DIR ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-src 19 | BUILD_IN_SOURCE 1 20 | BUILD_COMMAND make "CFLAGS=-g -O2 -Wno-incompatible-pointer-types -Wno-deprecated-declarations -Wno-format-truncation" 21 | # copy headers to devel space (catkin does not like headers in source space) 22 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-src/phidget22.h ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_INCLUDE_DESTINATION} 23 | # copy libs, set-up soname chain 24 | COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-src/.libs/libphidget22.so.0.0.0 ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION} 25 | COMMAND ${CMAKE_COMMAND} -E create_symlink libphidget22.so.0 ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION}/libphidget22.so 26 | COMMAND ${CMAKE_COMMAND} -E create_symlink libphidget22.so.0.0.0 ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION}/libphidget22.so.0 27 | INSTALL_COMMAND "" 28 | ) 29 | 30 | catkin_package( 31 | CFG_EXTRAS libphidget22-extras.cmake # catkin_package does not support artifacts in devel space 32 | EXPORTED_TARGETS EP_${PROJECT_NAME} 33 | ) 34 | 35 | install(DIRECTORY ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_INCLUDE_DESTINATION}/ 36 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 37 | ) 38 | 39 | install(FILES ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION}/libphidget22.so 40 | ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION}/libphidget22.so.0 41 | ${CATKIN_DEVEL_PREFIX}/${CATKIN_PACKAGE_LIB_DESTINATION}/libphidget22.so.0.0.0 42 | DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 43 | ) 44 | -------------------------------------------------------------------------------- /libphidget22/cmake/libphidget22-extras.cmake.in: -------------------------------------------------------------------------------- 1 | list(APPEND @PROJECT_NAME@_INCLUDE_DIRS "${@PROJECT_NAME@_PREFIX}/@CATKIN_GLOBAL_INCLUDE_DESTINATION@") 2 | list(APPEND @PROJECT_NAME@_LIBRARIES "${@PROJECT_NAME@_PREFIX}/@CATKIN_PACKAGE_LIB_DESTINATION@/libphidget22.so") 3 | -------------------------------------------------------------------------------- /libphidget22/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | libphidget22 4 | 1.0.10 5 | This package wraps the libphidget22 to use it as a ROS dependency 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | LGPL 11 | 12 | http://ros.org/wiki/libphidget22 13 | https://github.com/ros-drivers/phidgets_drivers.git 14 | https://github.com/ros-drivers/phidgets_drivers/issues 15 | 16 | Alexander Bubeck 17 | 18 | catkin 19 | 20 | libusb-1.0-dev 21 | libusb-1.0 22 | 23 | -------------------------------------------------------------------------------- /phidgets_accelerometer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_accelerometer) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet phidgets_api roscpp roslaunch sensor_msgs) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_accelerometer 20 | CATKIN_DEPENDS nodelet phidgets_api roscpp sensor_msgs 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_accelerometer src/accelerometer_ros_i.cpp) 26 | add_library(phidgets_accelerometer_nodelet src/phidgets_accelerometer_nodelet.cpp) 27 | 28 | add_dependencies(phidgets_accelerometer ${catkin_EXPORTED_TARGETS}) 29 | add_dependencies(phidgets_accelerometer_nodelet ${catkin_EXPORTED_TARGETS}) 30 | 31 | target_link_libraries(phidgets_accelerometer ${catkin_LIBRARIES}) 32 | target_link_libraries(phidgets_accelerometer_nodelet ${catkin_LIBRARIES} phidgets_accelerometer) 33 | 34 | install(TARGETS phidgets_accelerometer phidgets_accelerometer_nodelet 35 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 36 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 37 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 38 | ) 39 | 40 | install(DIRECTORY include/${PROJECT_NAME}/ 41 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 42 | FILES_MATCHING PATTERN "*.h" 43 | ) 44 | 45 | install(DIRECTORY launch 46 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 47 | ) 48 | 49 | install(FILES phidgets_accelerometer_nodelet.xml 50 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 51 | ) 52 | 53 | roslaunch_add_file_check(launch) 54 | -------------------------------------------------------------------------------- /phidgets_accelerometer/README.md: -------------------------------------------------------------------------------- 1 | Phidgets accelerometer ROS driver 2 | ================================= 3 | 4 | This is the ROS driver for Phidgets accelerometers. The various topics, services, and parameters that the node operates with are listed below. 5 | 6 | Topics 7 | ------ 8 | * `/imu/data_raw` (`sensor_msgs/Imu`) - The raw accelerometer data. 9 | 10 | Parameters 11 | ---------- 12 | * `serial` (int) - The serial number of the phidgets accelerometer to connect to. If -1 (the default), connects to any accelerometer phidget that can be found. 13 | * `hub_port` (int) - The phidgets VINT hub port to connect to. Only used if the accelerometer phidget is connected to a VINT hub. Defaults to 0. 14 | * `frame_id` (string) - The header frame ID to use when publishing the message. Defaults to [REP-0145](http://www.ros.org/reps/rep-0145.html) compliant `imu_link`. 15 | * `linear_acceleration_stdev` (double) - The standard deviation to use for the linear acceleration when publishing the message. Defaults to 300 ug. 16 | * `time_resynchronization_interval_ms` (int) - The number of milliseconds to wait between resynchronizing the time on the Phidgets spatial with the local time. Larger values have less "jumps", but will have more timestamp drift. Setting this to 0 disables resynchronization. Defaults to 5000 ms. 17 | * `data_interval_ms` (int) - The number of milliseconds between acquisitions of data on the device. Defaults to 8 ms. 18 | * `callback_delta_epsilon_ms` (int) - The number of milliseconds epsilon allowed between callbacks when attempting to resynchronize the time. If this is set to 1, then a difference of `data_interval_ms` plus or minus 1 millisecond will be considered viable for resynchronization. Higher values give the code more leeway to resynchronize, at the cost of potentially getting bad resynchronizations sometimes. Lower values can give better results, but can also result in never resynchronizing. Must be less than `data_interval_ms`. Defaults to 1 ms. 19 | * `publish_rate` (int) - How often the driver will publish data on the ROS topic. If 0 (the default), it will publish every time there is an update from the device (so at the `data_interval_ms`). If positive, it will publish the data at that rate regardless of the acquisition interval. 20 | -------------------------------------------------------------------------------- /phidgets_accelerometer/include/phidgets_accelerometer/phidgets_accelerometer_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_ACCELEROMETER_PHIDGETS_ACCELEROMETER_NODELET_H 31 | #define PHIDGETS_ACCELEROMETER_PHIDGETS_ACCELEROMETER_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_accelerometer/accelerometer_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsAccelerometerNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr accelerometer_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_ACCELEROMETER_PHIDGETS_ACCELEROMETER_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_accelerometer/launch/accelerometer.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### Accelerometer Driver ################################################# 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # optional param frame_id, default is "imu_link" 25 | 26 | 27 | # optional param linear_acceleration_stdev, default is 280ug 28 | 29 | 30 | # supported data rates: 4 8 16 24 32 40 ... 1000 (in ms) 31 | 32 | 33 | # optional param publish_rate, defaults to 0 34 | 35 | 36 | # optional param server_name, required to locate remote network servers 37 | 38 | 39 | # optional param server_ip, required to locate remote network servers 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /phidgets_accelerometer/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_accelerometer 4 | 1.0.10 5 | Driver for the Phidgets Accelerometer devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Chris Lalancette 13 | 14 | catkin 15 | 16 | nodelet 17 | phidgets_api 18 | roscpp 19 | roslaunch 20 | sensor_msgs 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /phidgets_accelerometer/phidgets_accelerometer_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets Accelerometer nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_accelerometer/src/phidgets_accelerometer_nodelet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "phidgets_accelerometer/accelerometer_ros_i.h" 37 | #include "phidgets_accelerometer/phidgets_accelerometer_nodelet.h" 38 | 39 | typedef phidgets::PhidgetsAccelerometerNodelet PhidgetsAccelerometerNodelet; 40 | 41 | PLUGINLIB_EXPORT_CLASS(PhidgetsAccelerometerNodelet, nodelet::Nodelet) 42 | 43 | void PhidgetsAccelerometerNodelet::onInit() 44 | { 45 | NODELET_INFO("Initializing Phidgets Accelerometer Nodelet"); 46 | 47 | // TODO: Do we want the single threaded or multithreaded NH? 48 | ros::NodeHandle nh = getMTNodeHandle(); 49 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 50 | 51 | accelerometer_ = std::make_unique(nh, nh_private); 52 | } 53 | -------------------------------------------------------------------------------- /phidgets_analog_inputs/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package phidgets_analog_inputs 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.0.10 (2025-05-08) 6 | ------------------- 7 | 8 | 1.0.9 (2024-03-13) 9 | ------------------ 10 | 11 | 1.0.8 (2023-11-27) 12 | ------------------ 13 | 14 | 1.0.7 (2023-03-02) 15 | ------------------ 16 | 17 | 1.0.6 (2022-12-01) 18 | ------------------ 19 | * Merge pull request `#129 `_ from mintar/feat-pre-commit 20 | * Don't modify CMAKE_CXX_FLAGS 21 | * Fix clang-format 22 | * Add support for VINT networkhub (`#127 `_) 23 | * Contributors: James Haley, Martin Günther 24 | 25 | 1.0.5 (2022-02-17) 26 | ------------------ 27 | 28 | 1.0.4 (2021-10-22) 29 | ------------------ 30 | 31 | 1.0.3 (2021-09-29) 32 | ------------------ 33 | 34 | 1.0.2 (2021-03-09) 35 | ------------------ 36 | 37 | 1.0.1 (2020-06-04) 38 | ------------------ 39 | * Set cmake_policy CMP0048 to fix warning 40 | * Contributors: Martin Günther 41 | 42 | 1.0.0 (2020-06-03) 43 | ------------------ 44 | * Update maintainers in package.xml 45 | * Switch to libphidget22 46 | * Add launch files for all drivers. 47 | * Add in try/catch blocks for connecting. 48 | If an error occurs, we catch it, print it, then re-throw it. 49 | This allows us to show a better error when using nodelets. 50 | * Fixes from review. 51 | * Documentation updates to README.md 52 | * Implement data interval setting for analog inputs. 53 | * Set the publish_rate to 0 by default. 54 | This means we will only publish on changes. 55 | * Add in the license files and add to the headers. 56 | * Remove nodes in favor of nodelets. 57 | * Add in support for Phidgets Analog inputs. 58 | * Contributors: Chris Lalancette, Martin Günther 59 | -------------------------------------------------------------------------------- /phidgets_analog_inputs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_analog_inputs) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet phidgets_api roscpp roslaunch std_msgs) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_analog_inputs 20 | CATKIN_DEPENDS nodelet phidgets_api roscpp std_msgs 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_analog_inputs src/analog_inputs_ros_i.cpp) 26 | add_library(phidgets_analog_inputs_nodelet src/phidgets_analog_inputs_nodelet.cpp) 27 | 28 | add_dependencies(phidgets_analog_inputs ${catkin_EXPORTED_TARGETS}) 29 | add_dependencies(phidgets_analog_inputs_nodelet ${catkin_EXPORTED_TARGETS}) 30 | 31 | target_link_libraries(phidgets_analog_inputs ${catkin_LIBRARIES}) 32 | target_link_libraries(phidgets_analog_inputs_nodelet ${catkin_LIBRARIES} phidgets_analog_inputs) 33 | 34 | install(TARGETS phidgets_analog_inputs phidgets_analog_inputs_nodelet 35 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 36 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 37 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 38 | ) 39 | 40 | install(DIRECTORY include/${PROJECT_NAME}/ 41 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 42 | FILES_MATCHING PATTERN "*.h" 43 | ) 44 | 45 | install(DIRECTORY launch 46 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 47 | ) 48 | 49 | install(FILES phidgets_analog_inputs_nodelet.xml 50 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 51 | ) 52 | 53 | roslaunch_add_file_check(launch) 54 | -------------------------------------------------------------------------------- /phidgets_analog_inputs/README.md: -------------------------------------------------------------------------------- 1 | Phidgets analog inputs ROS driver 2 | ================================= 3 | 4 | This is the ROS driver for Phidgets analog inputs. The various topics, services, and parameters that the node operates with are listed below. 5 | 6 | Topics 7 | ------ 8 | * `/analog_inputXX` (`std_msgs/Float64`) - The analog input data; one topic will be created for each analog input on the device. 9 | 10 | Parameters 11 | --------- 12 | * `serial` (int) - The serial number of the phidgets analog input to connect to. If -1 (the default), connects to any analog input phidget that can be found. 13 | * `hub_port` (int) - The phidgets VINT hub port to connect to. Only used if the analog input phidget is connected to a VINT hub. Defaults to 0. 14 | * `is_hub_port_device` (bool) - Whether this device is directly connected to VINT hub port, or whether it is connected via another widget to the hub port. Only used if the analog input phidget is connected to a VINT hub. Defaults to false. 15 | * `data_interval_ms` (int) - The number of milliseconds between acquisitions of data on the device. Defaults to 250 ms. 16 | * `publish_rate` (int) - How often the driver will publish data on the ROS topic. If 0 (the default), it will publish every time there is an update from the device (so at the `data_interval_ms`). If positive, it will publish the data at that rate regardless of the acquisition interval. 17 | -------------------------------------------------------------------------------- /phidgets_analog_inputs/include/phidgets_analog_inputs/phidgets_analog_inputs_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_ANALOG_INPUTS_PHIDGETS_ANALOG_INPUTS_NODELET_H 31 | #define PHIDGETS_ANALOG_INPUTS_PHIDGETS_ANALOG_INPUTS_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_analog_inputs/analog_inputs_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsAnalogInputsNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr ais_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_ANALOG_INPUTS_PHIDGETS_ANALOG_INPUTS_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_analog_inputs/launch/analog_inputs.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### Analog Inputs Driver ################################################# 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # optional param is_hub_port_device, used if connected to a VINT hub 25 | 26 | 27 | # optional param data_interval_ms, defaults to 250 28 | 29 | 30 | # optional param publish_rate, defaults to 0 31 | 32 | 33 | # optional param server_name, required to locate remote network servers 34 | 35 | 36 | # optional param server_ip, required to locate remote network servers 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /phidgets_analog_inputs/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_analog_inputs 4 | 1.0.10 5 | Driver for the Phidgets Analog Input devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Chris Lalancette 13 | 14 | catkin 15 | 16 | nodelet 17 | phidgets_api 18 | roscpp 19 | roslaunch 20 | std_msgs 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /phidgets_analog_inputs/phidgets_analog_inputs_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets Analog Inputs nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_analog_inputs/src/phidgets_analog_inputs_nodelet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "phidgets_analog_inputs/analog_inputs_ros_i.h" 37 | #include "phidgets_analog_inputs/phidgets_analog_inputs_nodelet.h" 38 | 39 | typedef phidgets::PhidgetsAnalogInputsNodelet PhidgetsAnalogInputsNodelet; 40 | 41 | PLUGINLIB_EXPORT_CLASS(PhidgetsAnalogInputsNodelet, nodelet::Nodelet) 42 | 43 | void PhidgetsAnalogInputsNodelet::onInit() 44 | { 45 | NODELET_INFO("Initializing Phidgets Analog Inputs Nodelet"); 46 | 47 | // TODO: Do we want the single threaded or multithreaded NH? 48 | ros::NodeHandle nh = getMTNodeHandle(); 49 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 50 | 51 | ais_ = std::make_unique(nh, nh_private); 52 | } 53 | -------------------------------------------------------------------------------- /phidgets_analog_outputs/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package phidgets_analog_outputs 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.0.10 (2025-05-08) 6 | ------------------- 7 | 8 | 1.0.9 (2024-03-13) 9 | ------------------ 10 | 11 | 1.0.8 (2023-11-27) 12 | ------------------ 13 | 14 | 1.0.7 (2023-03-02) 15 | ------------------ 16 | 17 | 1.0.6 (2022-12-01) 18 | ------------------ 19 | * Merge pull request `#129 `_ from mintar/feat-pre-commit 20 | Add pre-commit, move from travis to GitHub actions, fix style 21 | * Don't modify CMAKE_CXX_FLAGS 22 | * Fix clang-format 23 | * Add support for VINT networkhub (`#127 `_) 24 | * Contributors: James Haley, Martin Günther 25 | 26 | 1.0.5 (2022-02-17) 27 | ------------------ 28 | 29 | 1.0.4 (2021-10-22) 30 | ------------------ 31 | 32 | 1.0.3 (2021-09-29) 33 | ------------------ 34 | * Add Analog Outputs (`#103 `_) 35 | * Contributors: Carsten Plasberg 36 | -------------------------------------------------------------------------------- /phidgets_analog_outputs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_analog_outputs) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet phidgets_api phidgets_msgs roscpp roslaunch std_msgs) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_analog_outputs 20 | CATKIN_DEPENDS nodelet phidgets_api phidgets_msgs roscpp std_msgs 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_analog_outputs src/analog_outputs_ros_i.cpp) 26 | add_library(phidgets_analog_outputs_nodelet src/phidgets_analog_outputs_nodelet.cpp) 27 | 28 | add_dependencies(phidgets_analog_outputs ${catkin_EXPORTED_TARGETS}) 29 | add_dependencies(phidgets_analog_outputs_nodelet ${catkin_EXPORTED_TARGETS}) 30 | 31 | target_link_libraries(phidgets_analog_outputs ${catkin_LIBRARIES}) 32 | target_link_libraries(phidgets_analog_outputs_nodelet ${catkin_LIBRARIES} phidgets_analog_outputs) 33 | 34 | install(TARGETS phidgets_analog_outputs phidgets_analog_outputs_nodelet 35 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 36 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 37 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 38 | ) 39 | 40 | install(DIRECTORY include/${PROJECT_NAME}/ 41 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 42 | FILES_MATCHING PATTERN "*.h" 43 | ) 44 | 45 | install(DIRECTORY launch 46 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 47 | ) 48 | 49 | install(FILES phidgets_analog_outputs_nodelet.xml 50 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 51 | ) 52 | 53 | roslaunch_add_file_check(launch) 54 | -------------------------------------------------------------------------------- /phidgets_analog_outputs/README.md: -------------------------------------------------------------------------------- 1 | Phidgets analog outputs ROS driver 2 | ================================== 3 | 4 | This is the ROS driver for Phidgets analog outputs. The various topics, services, and parameters that the node operates with are listed below. 5 | 6 | Topics 7 | ------ 8 | * `/analog_outputXX` (`std_msgs/Float64`) - The voltage to set at the analog output; one topic will be created for each analog output on the device. 9 | 10 | Services 11 | -------- 12 | * `/set_analog_output` (`phidgets_msgs/SetAnalogOutput`) - A service to set the analog output `index` to the specified `voltage`. 13 | 14 | Parameters 15 | ---------- 16 | * `serial` (int) - The serial number of the phidgets analog output to connect to. If -1 (the default), connects to any analog output phidget that can be found. 17 | * `hub_port` (int) - The phidgets VINT hub port to connect to. Only used if the analog output phidget is connected to a VINT hub. Defaults to 0. 18 | * `is_hub_port_device` (bool) - Whether this device is directly connected to VINT hub port, or whether it is connected via another widget to the hub port. Only used if the analog output phidget is connected to a VINT hub. Defaults to false. 19 | -------------------------------------------------------------------------------- /phidgets_analog_outputs/include/phidgets_analog_outputs/phidgets_analog_outputs_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_ANALOG_OUTPUTS_PHIDGETS_ANALOG_OUTPUTS_NODELET_H 31 | #define PHIDGETS_ANALOG_OUTPUTS_PHIDGETS_ANALOG_OUTPUTS_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_analog_outputs/analog_outputs_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsAnalogOutputsNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr aos_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_ANALOG_OUTPUTS_PHIDGETS_ANALOG_OUTPUTS_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_analog_outputs/launch/analog_outputs.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### Digital Outputs Driver ############################################### 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # optional param is_hub_port_device, used if connected to a VINT hub 25 | 26 | 27 | # optional param server_name, required to locate remote network servers 28 | 29 | 30 | # optional param server_ip, required to locate remote network servers 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /phidgets_analog_outputs/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_analog_outputs 4 | 1.0.10 5 | Driver for the Phidgets Analog Output devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Carsten Plasberg 13 | 14 | catkin 15 | 16 | nodelet 17 | phidgets_api 18 | phidgets_msgs 19 | roscpp 20 | roslaunch 21 | std_msgs 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /phidgets_analog_outputs/phidgets_analog_outputs_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets Analog Outputs nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_analog_outputs/src/phidgets_analog_outputs_nodelet.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include "phidgets_analog_outputs/analog_outputs_ros_i.h" 8 | #include "phidgets_analog_outputs/phidgets_analog_outputs_nodelet.h" 9 | 10 | typedef phidgets::PhidgetsAnalogOutputsNodelet PhidgetsAnalogOutputsNodelet; 11 | 12 | PLUGINLIB_EXPORT_CLASS(PhidgetsAnalogOutputsNodelet, nodelet::Nodelet) 13 | 14 | void PhidgetsAnalogOutputsNodelet::onInit() 15 | { 16 | NODELET_INFO("Initializing Phidgets Analog Outputs Nodelet"); 17 | 18 | // TODO: Do we want the single threaded or multithreaded NH? 19 | ros::NodeHandle nh = getMTNodeHandle(); 20 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 21 | 22 | aos_ = std::make_unique(nh, nh_private); 23 | } 24 | -------------------------------------------------------------------------------- /phidgets_api/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_api) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS libphidget22) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_api 20 | CATKIN_DEPENDS libphidget22 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_api src/accelerometer.cpp 26 | src/analog_input.cpp 27 | src/analog_inputs.cpp 28 | src/analog_output.cpp 29 | src/analog_outputs.cpp 30 | src/current_input.cpp 31 | src/current_inputs.cpp 32 | src/digital_input.cpp 33 | src/digital_inputs.cpp 34 | src/digital_output.cpp 35 | src/digital_outputs.cpp 36 | src/encoder.cpp 37 | src/encoders.cpp 38 | src/gyroscope.cpp 39 | src/humidity.cpp 40 | src/ir.cpp 41 | src/magnetometer.cpp 42 | src/motor.cpp 43 | src/motors.cpp 44 | src/phidget22.cpp 45 | src/spatial.cpp 46 | src/temperature.cpp) 47 | 48 | add_dependencies(phidgets_api ${catkin_EXPORTED_TARGETS}) 49 | 50 | target_link_libraries(phidgets_api ${catkin_LIBRARIES}) 51 | 52 | install(TARGETS phidgets_api 53 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 54 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 55 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 56 | ) 57 | 58 | install(DIRECTORY include/${PROJECT_NAME}/ 59 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 60 | FILES_MATCHING PATTERN "*.h" 61 | ) 62 | -------------------------------------------------------------------------------- /phidgets_api/debian/udev: -------------------------------------------------------------------------------- 1 | # Very old Phidgets 2 | SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0925", ATTRS{idProduct}=="8101", MODE="666" 3 | SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0925", ATTRS{idProduct}=="8104", MODE="666" 4 | SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0925", ATTRS{idProduct}=="8201", MODE="666" 5 | 6 | # All current and future Phidgets - Vendor = 0x06c2, Product = 0x0030 - 0x00af 7 | SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="06c2", ATTRS{idProduct}=="00[3-a][0-f]", MODE="666" 8 | -------------------------------------------------------------------------------- /phidgets_api/include/phidgets_api/analog_input.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_API_ANALOG_INPUT_H 31 | #define PHIDGETS_API_ANALOG_INPUT_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_api/phidget22.h" 38 | 39 | namespace phidgets { 40 | 41 | class AnalogInput final 42 | { 43 | public: 44 | PHIDGET22_NO_COPY_NO_MOVE_NO_ASSIGN(AnalogInput) 45 | 46 | explicit AnalogInput(int32_t serial_number, int hub_port, 47 | bool is_hub_port_device, int channel, 48 | std::function input_handler); 49 | 50 | ~AnalogInput(); 51 | 52 | double getSensorValue() const; 53 | 54 | void setDataInterval(uint32_t data_interval_ms) const; 55 | 56 | void voltageChangeHandler(double sensorValue) const; 57 | 58 | private: 59 | int channel_; 60 | std::function input_handler_; 61 | PhidgetVoltageInputHandle ai_handle_; 62 | 63 | static void VoltageChangeHandler(PhidgetVoltageInputHandle input_handle, 64 | void *ctx, double sensorValue); 65 | }; 66 | 67 | } // namespace phidgets 68 | 69 | #endif // PHIDGETS_API_ANALOG_INPUT_H 70 | -------------------------------------------------------------------------------- /phidgets_api/include/phidgets_api/analog_inputs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_API_ANALOG_INPUTS_H 31 | #define PHIDGETS_API_ANALOG_INPUTS_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #include "phidgets_api/analog_input.h" 38 | #include "phidgets_api/phidget22.h" 39 | 40 | namespace phidgets { 41 | 42 | class AnalogInputs final 43 | { 44 | public: 45 | PHIDGET22_NO_COPY_NO_MOVE_NO_ASSIGN(AnalogInputs) 46 | 47 | explicit AnalogInputs(int32_t serial_number, int hub_port, 48 | bool is_hub_port_device, 49 | std::function input_handler); 50 | 51 | ~AnalogInputs(); 52 | 53 | uint32_t getInputCount() const noexcept; 54 | 55 | double getSensorValue(int index) const; 56 | 57 | void setDataInterval(int index, uint32_t data_interval_ms) const; 58 | 59 | private: 60 | uint32_t input_count_; 61 | std::vector> ais_; 62 | }; 63 | 64 | } // namespace phidgets 65 | 66 | #endif // PHIDGETS_API_ANALOG_INPUTS_H 67 | -------------------------------------------------------------------------------- /phidgets_api/include/phidgets_api/analog_output.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_API_ANALOG_OUTPUT_H 31 | #define PHIDGETS_API_ANALOG_OUTPUT_H 32 | 33 | #include 34 | 35 | #include "phidgets_api/phidget22.h" 36 | 37 | namespace phidgets { 38 | 39 | class AnalogOutput final 40 | { 41 | public: 42 | PHIDGET22_NO_COPY_NO_MOVE_NO_ASSIGN(AnalogOutput) 43 | 44 | explicit AnalogOutput(int32_t serial_number, int hub_port, 45 | bool is_hub_port_device, int channel); 46 | 47 | ~AnalogOutput(); 48 | 49 | void setOutputVoltage(double voltage) const; 50 | 51 | private: 52 | PhidgetVoltageOutputHandle ao_handle_; 53 | }; 54 | 55 | } // namespace phidgets 56 | 57 | #endif // PHIDGETS_API_ANALOG_OUTPUT_H 58 | -------------------------------------------------------------------------------- /phidgets_api/include/phidgets_api/analog_outputs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_API_ANALOG_OUTPUTS_H 31 | #define PHIDGETS_API_ANALOG_OUTPUTS_H 32 | 33 | #include 34 | #include 35 | 36 | #include "phidgets_api/analog_output.h" 37 | #include "phidgets_api/phidget22.h" 38 | 39 | namespace phidgets { 40 | 41 | class AnalogOutputs final 42 | { 43 | public: 44 | PHIDGET22_NO_COPY_NO_MOVE_NO_ASSIGN(AnalogOutputs) 45 | 46 | explicit AnalogOutputs(int32_t serial_number, int hub_port, 47 | bool is_hub_port_device); 48 | 49 | ~AnalogOutputs(); 50 | 51 | uint32_t getOutputCount() const noexcept; 52 | 53 | void setOutputVoltage(int index, double voltage) const; 54 | 55 | private: 56 | uint32_t output_count_; 57 | std::vector> aos_; 58 | }; 59 | 60 | } // namespace phidgets 61 | 62 | #endif // PHIDGETS_API_ANALOG_INPUTS_H 63 | -------------------------------------------------------------------------------- /phidgets_api/include/phidgets_api/current_inputs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_API_CURRENT_INPUTS_H 31 | #define PHIDGETS_API_CURRENT_INPUTS_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #include "phidgets_api/current_input.h" 38 | #include "phidgets_api/phidget22.h" 39 | 40 | namespace phidgets { 41 | 42 | class CurrentInputs final 43 | { 44 | public: 45 | PHIDGET22_NO_COPY_NO_MOVE_NO_ASSIGN(CurrentInputs) 46 | 47 | explicit CurrentInputs(int32_t serial_number, int hub_port, 48 | bool is_hub_port_device, 49 | std::function input_handler); 50 | 51 | ~CurrentInputs(); 52 | 53 | uint32_t getInputCount() const noexcept; 54 | 55 | double getSensorValue(int index) const; 56 | 57 | void setDataInterval(int index, uint32_t data_interval_ms) const; 58 | 59 | private: 60 | uint32_t input_count_; 61 | std::vector> cis_; 62 | }; 63 | 64 | } // namespace phidgets 65 | 66 | #endif // PHIDGETS_API_CURRENT_INPUTS_H 67 | -------------------------------------------------------------------------------- /phidgets_api/include/phidgets_api/digital_input.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_API_DIGITAL_INPUT_H 31 | #define PHIDGETS_API_DIGITAL_INPUT_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_api/phidget22.h" 38 | 39 | namespace phidgets { 40 | 41 | class DigitalInput 42 | { 43 | public: 44 | PHIDGET22_NO_COPY_NO_MOVE_NO_ASSIGN(DigitalInput) 45 | 46 | explicit DigitalInput(int32_t serial_number, int hub_port, 47 | bool is_hub_port_device, int channel, 48 | std::function input_handler); 49 | 50 | ~DigitalInput(); 51 | 52 | bool getInputValue() const; 53 | 54 | void stateChangeHandler(int state) const; 55 | 56 | private: 57 | int channel_; 58 | std::function input_handler_; 59 | PhidgetDigitalInputHandle di_handle_; 60 | 61 | static void StateChangeHandler(PhidgetDigitalInputHandle input_handle, 62 | void *ctx, int state); 63 | }; 64 | 65 | } // namespace phidgets 66 | 67 | #endif // PHIDGETS_API_DIGITAL_INPUT_H 68 | -------------------------------------------------------------------------------- /phidgets_api/include/phidgets_api/digital_inputs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_API_DIGITAL_INPUTS_H 31 | #define PHIDGETS_API_DIGITAL_INPUTS_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #include "phidgets_api/digital_input.h" 38 | #include "phidgets_api/phidget22.h" 39 | 40 | namespace phidgets { 41 | 42 | class DigitalInputs 43 | { 44 | public: 45 | PHIDGET22_NO_COPY_NO_MOVE_NO_ASSIGN(DigitalInputs) 46 | 47 | explicit DigitalInputs(int32_t serial_number, int hub_port, 48 | bool is_hub_port_device, 49 | std::function input_handler); 50 | 51 | ~DigitalInputs(); 52 | 53 | uint32_t getInputCount() const noexcept; 54 | 55 | bool getInputValue(int index) const; 56 | 57 | private: 58 | uint32_t input_count_; 59 | std::vector> dis_; 60 | }; 61 | 62 | } // namespace phidgets 63 | 64 | #endif // PHIDGETS_API_DIGITAL_INPUTS_H 65 | -------------------------------------------------------------------------------- /phidgets_api/include/phidgets_api/digital_output.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_API_DIGITAL_OUTPUT_H 31 | #define PHIDGETS_API_DIGITAL_OUTPUT_H 32 | 33 | #include 34 | 35 | #include "phidgets_api/phidget22.h" 36 | 37 | namespace phidgets { 38 | 39 | class DigitalOutput final 40 | { 41 | public: 42 | PHIDGET22_NO_COPY_NO_MOVE_NO_ASSIGN(DigitalOutput) 43 | 44 | explicit DigitalOutput(int32_t serial_number, int hub_port, 45 | bool is_hub_port_device, int channel); 46 | 47 | ~DigitalOutput(); 48 | 49 | void setOutputState(bool state) const; 50 | 51 | private: 52 | PhidgetDigitalOutputHandle do_handle_; 53 | }; 54 | 55 | } // namespace phidgets 56 | 57 | #endif // PHIDGETS_API_DIGITAL_OUTPUT_H 58 | -------------------------------------------------------------------------------- /phidgets_api/include/phidgets_api/digital_outputs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_API_DIGITAL_OUTPUTS_H 31 | #define PHIDGETS_API_DIGITAL_OUTPUTS_H 32 | 33 | #include 34 | #include 35 | 36 | #include "phidgets_api/digital_output.h" 37 | #include "phidgets_api/phidget22.h" 38 | 39 | namespace phidgets { 40 | 41 | class DigitalOutputs final 42 | { 43 | public: 44 | PHIDGET22_NO_COPY_NO_MOVE_NO_ASSIGN(DigitalOutputs) 45 | 46 | explicit DigitalOutputs(int32_t serial_number, int hub_port, 47 | bool is_hub_port_device); 48 | 49 | ~DigitalOutputs(); 50 | 51 | uint32_t getOutputCount() const noexcept; 52 | 53 | void setOutputState(int index, bool state) const; 54 | 55 | private: 56 | uint32_t output_count_; 57 | std::vector> dos_; 58 | }; 59 | 60 | } // namespace phidgets 61 | 62 | #endif // PHIDGETS_API_DIGITAL_OUTPUTS_H 63 | -------------------------------------------------------------------------------- /phidgets_api/include/phidgets_api/humidity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_API_HUMIDITY_H 31 | #define PHIDGETS_API_HUMIDITY_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_api/phidget22.h" 38 | 39 | namespace phidgets { 40 | 41 | class Humidity final 42 | { 43 | public: 44 | PHIDGET22_NO_COPY_NO_MOVE_NO_ASSIGN(Humidity) 45 | 46 | explicit Humidity(int32_t serial_number, int hub_port, 47 | bool is_hub_port_device, 48 | std::function humidity_handler); 49 | 50 | ~Humidity(); 51 | 52 | double getHumidity() const; 53 | 54 | void setDataInterval(uint32_t interval_ms) const; 55 | 56 | void humidityChangeHandler(double humidity) const; 57 | 58 | private: 59 | std::function humidity_handler_; 60 | PhidgetHumiditySensorHandle humidity_handle_; 61 | static void HumidityChangeHandler( 62 | PhidgetHumiditySensorHandle humidity_handle, void *ctx, 63 | double humidity); 64 | }; 65 | 66 | } // namespace phidgets 67 | 68 | #endif // PHIDGETS_API_HUMIDITY_H 69 | -------------------------------------------------------------------------------- /phidgets_api/include/phidgets_api/ir.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_API_IR_H 31 | #define PHIDGETS_API_IR_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_api/phidget22.h" 38 | 39 | namespace phidgets { 40 | 41 | class IR final 42 | { 43 | public: 44 | PHIDGET22_NO_COPY_NO_MOVE_NO_ASSIGN(IR) 45 | 46 | explicit IR(int32_t serial_number, 47 | std::function code_handler); 48 | 49 | ~IR(); 50 | 51 | void codeHandler(const char *code, uint32_t bit_count, int is_repeat) const; 52 | 53 | private: 54 | std::function code_handler_; 55 | PhidgetIRHandle ir_handle_; 56 | 57 | static void CodeHandler(PhidgetIRHandle ir, void *ctx, const char *code, 58 | uint32_t bit_count, int is_repeat); 59 | }; 60 | 61 | } // namespace phidgets 62 | 63 | #endif // PHIDGETS_API_IR_H 64 | -------------------------------------------------------------------------------- /phidgets_api/include/phidgets_api/phidget22.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_API_PHIDGET22_H 31 | #define PHIDGETS_API_PHIDGET22_H 32 | 33 | #include 34 | #include 35 | 36 | #include 37 | 38 | #define PHIDGET22_NO_COPY_NO_MOVE_NO_ASSIGN(Classname) \ 39 | Classname(const Classname &) = delete; \ 40 | void operator=(const Classname &) = delete; \ 41 | Classname(Classname &&) = delete; \ 42 | void operator=(Classname &&) = delete; 43 | 44 | namespace phidgets { 45 | 46 | class Phidget22Error final : public std::exception 47 | { 48 | public: 49 | explicit Phidget22Error(const std::string &msg, PhidgetReturnCode code); 50 | 51 | const char *what() const noexcept; 52 | 53 | private: 54 | std::string msg_; 55 | }; 56 | 57 | namespace helpers { 58 | 59 | void openWaitForAttachment(PhidgetHandle handle, int32_t serial_number, 60 | int hub_port, bool is_hub_port_device, int channel); 61 | 62 | void closeAndDelete(PhidgetHandle *handle) noexcept; 63 | 64 | } // namespace helpers 65 | } // namespace phidgets 66 | 67 | #endif // PHIDGETS_API_PHIDGET22_H 68 | -------------------------------------------------------------------------------- /phidgets_api/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_api 4 | 1.0.10 5 | A C++ Wrapper for the Phidgets C API 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | http://ros.org/wiki/phidgets_api 13 | https://github.com/ros-drivers/phidgets_drivers.git 14 | https://github.com/ros-drivers/phidgets_drivers/issues 15 | 16 | Tully Foote 17 | Ivan Dryanovski 18 | 19 | catkin 20 | 21 | libphidget22 22 | 23 | 24 | -------------------------------------------------------------------------------- /phidgets_current_inputs/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package phidgets_current_inputs 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.0.10 (2025-05-08) 6 | ------------------- 7 | * Add support for Phidgets Current sensors (`#148 `_) 8 | * Contributors: Martin Günther, Ben Schattinger 9 | -------------------------------------------------------------------------------- /phidgets_current_inputs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_current_inputs) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet phidgets_api roscpp roslaunch std_msgs) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_current_inputs 20 | CATKIN_DEPENDS nodelet phidgets_api roscpp std_msgs 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_current_inputs src/current_inputs_ros_i.cpp) 26 | add_library(phidgets_current_inputs_nodelet src/phidgets_current_inputs_nodelet.cpp) 27 | 28 | add_dependencies(phidgets_current_inputs ${catkin_EXPORTED_TARGETS}) 29 | add_dependencies(phidgets_current_inputs_nodelet ${catkin_EXPORTED_TARGETS}) 30 | 31 | target_link_libraries(phidgets_current_inputs ${catkin_LIBRARIES}) 32 | target_link_libraries(phidgets_current_inputs_nodelet ${catkin_LIBRARIES} phidgets_current_inputs) 33 | 34 | install(TARGETS phidgets_current_inputs phidgets_current_inputs_nodelet 35 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 36 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 37 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 38 | ) 39 | 40 | install(DIRECTORY include/${PROJECT_NAME}/ 41 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 42 | FILES_MATCHING PATTERN "*.h" 43 | ) 44 | 45 | install(DIRECTORY launch 46 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 47 | ) 48 | 49 | install(FILES phidgets_current_inputs_nodelet.xml 50 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 51 | ) 52 | 53 | roslaunch_add_file_check(launch) 54 | -------------------------------------------------------------------------------- /phidgets_current_inputs/README.md: -------------------------------------------------------------------------------- 1 | Phidgets current inputs ROS driver 2 | ================================= 3 | 4 | This is the ROS driver for Phidgets current inputs. The various topics, services, and parameters that the node operates with are listed below. 5 | 6 | Topics 7 | ------ 8 | * `/current_inputXX` (`std_msgs/Float64`) - The current input data; one topic will be created for each current input on the device. 9 | 10 | Parameters 11 | --------- 12 | * `serial` (int) - The serial number of the phidgets current input to connect to. If -1 (the default), connects to any current input phidget that can be found. 13 | * `hub_port` (int) - The phidgets VINT hub port to connect to. Only used if the current input phidget is connected to a VINT hub. Defaults to 0. 14 | * `is_hub_port_device` (bool) - Whether this device is directly connected to VINT hub port, or whether it is connected via another widget to the hub port. Only used if the current input phidget is connected to a VINT hub. Defaults to false. 15 | * `data_interval_ms` (int) - The number of milliseconds between acquisitions of data on the device. Defaults to 250 ms. 16 | * `publish_rate` (int) - How often the driver will publish data on the ROS topic. If 0 (the default), it will publish every time there is an update from the device (so at the `data_interval_ms`). If positive, it will publish the data at that rate regardless of the acquisition interval. 17 | * `server_name` (string) - The name of the Phidgets network server to connect to. If set along with `server_ip`, the node will attempt to connect to a Phidgets device over the network. 18 | * `server_ip` (string) - The IP address of the Phidgets network server to connect to. If set along with `server_name`, the node will attempt to connect to a Phidgets device over the network. 19 | -------------------------------------------------------------------------------- /phidgets_current_inputs/include/phidgets_current_inputs/phidgets_current_inputs_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_CURRENT_INPUTS_PHIDGETS_CURRENT_INPUTS_NODELET_H 31 | #define PHIDGETS_CURRENT_INPUTS_PHIDGETS_CURRENT_INPUTS_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_current_inputs/current_inputs_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsCurrentInputsNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr ais_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_CURRENT_INPUTS_PHIDGETS_CURRENT_INPUTS_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_current_inputs/launch/current_inputs.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### Current Inputs Driver ################################################# 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # optional param is_hub_port_device, used if connected to a VINT hub 25 | 26 | 27 | # optional param data_interval_ms, defaults to 250 28 | 29 | 30 | # optional param publish_rate, defaults to 0 31 | 32 | 33 | # optional param server_name, required to locate remote network servers 34 | 35 | 36 | # optional param server_ip, required to locate remote network servers 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /phidgets_current_inputs/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_current_inputs 4 | 1.0.10 5 | Driver for the Phidgets Current Input devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Martin Günther 13 | 14 | catkin 15 | 16 | nodelet 17 | phidgets_api 18 | roscpp 19 | roslaunch 20 | std_msgs 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /phidgets_current_inputs/phidgets_current_inputs_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets Current Inputs nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_current_inputs/src/phidgets_current_inputs_nodelet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2025, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "phidgets_current_inputs/current_inputs_ros_i.h" 37 | #include "phidgets_current_inputs/phidgets_current_inputs_nodelet.h" 38 | 39 | typedef phidgets::PhidgetsCurrentInputsNodelet PhidgetsCurrentInputsNodelet; 40 | 41 | PLUGINLIB_EXPORT_CLASS(PhidgetsCurrentInputsNodelet, nodelet::Nodelet) 42 | 43 | void PhidgetsCurrentInputsNodelet::onInit() 44 | { 45 | NODELET_INFO("Initializing Phidgets Current Inputs Nodelet"); 46 | 47 | // TODO: Do we want the single threaded or multithreaded NH? 48 | ros::NodeHandle nh = getMTNodeHandle(); 49 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 50 | 51 | ais_ = std::make_unique(nh, nh_private); 52 | } 53 | -------------------------------------------------------------------------------- /phidgets_digital_inputs/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package phidgets_digital_inputs 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.0.10 (2025-05-08) 6 | ------------------- 7 | 8 | 1.0.9 (2024-03-13) 9 | ------------------ 10 | 11 | 1.0.8 (2023-11-27) 12 | ------------------ 13 | 14 | 1.0.7 (2023-03-02) 15 | ------------------ 16 | 17 | 1.0.6 (2022-12-01) 18 | ------------------ 19 | * Merge pull request `#129 `_ from mintar/feat-pre-commit 20 | Add pre-commit, move from travis to GitHub actions, fix style 21 | * Don't modify CMAKE_CXX_FLAGS 22 | * Fix clang-format 23 | * Add support for VINT networkhub (`#127 `_) 24 | * Contributors: James Haley, Martin Günther 25 | 26 | 1.0.5 (2022-02-17) 27 | ------------------ 28 | 29 | 1.0.4 (2021-10-22) 30 | ------------------ 31 | 32 | 1.0.3 (2021-09-29) 33 | ------------------ 34 | * Add missing license headers 35 | * Contributors: Martin Günther 36 | 37 | 1.0.2 (2021-03-09) 38 | ------------------ 39 | 40 | 1.0.1 (2020-06-04) 41 | ------------------ 42 | * Set cmake_policy CMP0048 to fix warning 43 | * Contributors: Martin Günther 44 | 45 | 1.0.0 (2020-06-03) 46 | ------------------ 47 | * Update maintainers in package.xml 48 | * Switch to libphidget22 49 | * Add launch files for all drivers. 50 | * Add in try/catch blocks for connecting. 51 | If an error occurs, we catch it, print it, then re-throw it. 52 | This allows us to show a better error when using nodelets. 53 | * Fixes from review. 54 | * Documentation updates to README.md 55 | * Set the publish_rate to 0 by default. 56 | This means we will only publish on changes. 57 | * Add in the license files and add to the headers. 58 | * Remove nodes in favor of nodelets. 59 | * Add in support for Phidgets Digital Inputs. 60 | * Contributors: Chris Lalancette, Martin Günther 61 | -------------------------------------------------------------------------------- /phidgets_digital_inputs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_digital_inputs) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet phidgets_api roscpp roslaunch std_msgs) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_digital_inputs 20 | CATKIN_DEPENDS nodelet phidgets_api roscpp std_msgs 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_digital_inputs src/digital_inputs_ros_i.cpp) 26 | add_library(phidgets_digital_inputs_nodelet src/phidgets_digital_inputs_nodelet.cpp) 27 | 28 | add_dependencies(phidgets_digital_inputs ${catkin_EXPORTED_TARGETS}) 29 | add_dependencies(phidgets_digital_inputs_nodelet ${catkin_EXPORTED_TARGETS}) 30 | 31 | target_link_libraries(phidgets_digital_inputs ${catkin_LIBRARIES}) 32 | target_link_libraries(phidgets_digital_inputs_nodelet ${catkin_LIBRARIES} phidgets_digital_inputs) 33 | 34 | install(TARGETS phidgets_digital_inputs phidgets_digital_inputs_nodelet 35 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 36 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 37 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 38 | ) 39 | 40 | install(DIRECTORY include/${PROJECT_NAME}/ 41 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 42 | FILES_MATCHING PATTERN "*.h" 43 | ) 44 | 45 | install(DIRECTORY launch 46 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 47 | ) 48 | 49 | install(FILES phidgets_digital_inputs_nodelet.xml 50 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 51 | ) 52 | 53 | roslaunch_add_file_check(launch) 54 | -------------------------------------------------------------------------------- /phidgets_digital_inputs/README.md: -------------------------------------------------------------------------------- 1 | Phidgets digital inputs ROS driver 2 | ================================== 3 | 4 | This is the ROS driver for Phidgets digital inputs. The various topics, services, and parameters that the node operates with are listed below. 5 | 6 | Topics 7 | ------ 8 | * `/digital_inputXX` (`std_msgs/Bool`) - The digital input state; one topic will be created for each digital input on the device. 9 | 10 | Parameters 11 | ---------- 12 | * `serial` (int) - The serial number of the phidgets digital input to connect to. If -1 (the default), connects to any digital input phidget that can be found. 13 | * `hub_port` (int) - The phidgets VINT hub port to connect to. Only used if the digital input phidget is connected to a VINT hub. Defaults to 0. 14 | * `is_hub_port_device` (bool) - Whether this device is directly connected to VINT hub port, or whether it is connected via another widget to the hub port. Only used if the digital input phidget is connected to a VINT hub. Defaults to false. 15 | * `publish_rate` (int) - How often the driver will publish data on the ROS topic. If 0 (the default), it will publish every time there is an update from the device. If positive, it will publish the data at that rate regardless of the acquisition interval. 16 | -------------------------------------------------------------------------------- /phidgets_digital_inputs/include/phidgets_digital_inputs/phidgets_digital_inputs_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_DIGITAL_INPUTS_PHIDGETS_DIGITAL_INPUTS_NODELET_H 31 | #define PHIDGETS_DIGITAL_INPUTS_PHIDGETS_DIGITAL_INPUTS_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_digital_inputs/digital_inputs_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsDigitalInputsNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr dis_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_DIGITAL_INPUTS_PHIDGETS_DIGITAL_INPUTS_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_digital_inputs/launch/digital_inputs.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### Digital Inputs Driver ################################################ 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # optional param is_hub_port_device, used if connected to a VINT hub 25 | 26 | 27 | # optional param publish_rate, defaults to 0 28 | 29 | 30 | # optional param server_name, required to locate remote network servers 31 | 32 | 33 | # optional param server_ip, required to locate remote network servers 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /phidgets_digital_inputs/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_digital_inputs 4 | 1.0.10 5 | Driver for the Phidgets Digital Input devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Chris Lalancette 13 | 14 | catkin 15 | 16 | nodelet 17 | phidgets_api 18 | roscpp 19 | roslaunch 20 | std_msgs 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /phidgets_digital_inputs/phidgets_digital_inputs_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets Digital Inputs nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_digital_inputs/src/phidgets_digital_inputs_nodelet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "phidgets_digital_inputs/digital_inputs_ros_i.h" 37 | #include "phidgets_digital_inputs/phidgets_digital_inputs_nodelet.h" 38 | 39 | typedef phidgets::PhidgetsDigitalInputsNodelet PhidgetsDigitalInputsNodelet; 40 | 41 | PLUGINLIB_EXPORT_CLASS(PhidgetsDigitalInputsNodelet, nodelet::Nodelet) 42 | 43 | void PhidgetsDigitalInputsNodelet::onInit() 44 | { 45 | NODELET_INFO("Initializing Phidgets Digital Inputs Nodelet"); 46 | 47 | // TODO: Do we want the single threaded or multithreaded NH? 48 | ros::NodeHandle nh = getMTNodeHandle(); 49 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 50 | 51 | dis_ = std::make_unique(nh, nh_private); 52 | } 53 | -------------------------------------------------------------------------------- /phidgets_digital_outputs/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package phidgets_digital_outputs 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.0.10 (2025-05-08) 6 | ------------------- 7 | 8 | 1.0.9 (2024-03-13) 9 | ------------------ 10 | 11 | 1.0.8 (2023-11-27) 12 | ------------------ 13 | 14 | 1.0.7 (2023-03-02) 15 | ------------------ 16 | 17 | 1.0.6 (2022-12-01) 18 | ------------------ 19 | * Merge pull request `#129 `_ from mintar/feat-pre-commit 20 | Add pre-commit, move from travis to GitHub actions, fix style 21 | * Don't modify CMAKE_CXX_FLAGS 22 | * Fix clang-format 23 | * Add support for VINT networkhub (`#127 `_) 24 | * Contributors: James Haley, Martin Günther 25 | 26 | 1.0.5 (2022-02-17) 27 | ------------------ 28 | 29 | 1.0.4 (2021-10-22) 30 | ------------------ 31 | 32 | 1.0.3 (2021-09-29) 33 | ------------------ 34 | * Add missing license headers 35 | * Contributors: Martin Günther 36 | 37 | 1.0.2 (2021-03-09) 38 | ------------------ 39 | 40 | 1.0.1 (2020-06-04) 41 | ------------------ 42 | * Set cmake_policy CMP0048 to fix warning 43 | * Contributors: Martin Günther 44 | 45 | 1.0.0 (2020-06-03) 46 | ------------------ 47 | * Update maintainers in package.xml 48 | * Switch to libphidget22 49 | * Add launch files for all drivers. 50 | * Add in try/catch blocks for connecting. 51 | If an error occurs, we catch it, print it, then re-throw it. 52 | This allows us to show a better error when using nodelets. 53 | * Fixes from review. 54 | * Documentation updates to README.md 55 | * Add in the license files and add to the headers. 56 | * Remove nodes in favor of nodelets. 57 | * Add in support for Phidgets Digital Outputs. 58 | * Contributors: Chris Lalancette, Martin Günther 59 | -------------------------------------------------------------------------------- /phidgets_digital_outputs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_digital_outputs) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet phidgets_api phidgets_msgs roscpp roslaunch std_msgs) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_digital_outputs 20 | CATKIN_DEPENDS nodelet phidgets_api phidgets_msgs roscpp std_msgs 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_digital_outputs src/digital_outputs_ros_i.cpp) 26 | add_library(phidgets_digital_outputs_nodelet src/phidgets_digital_outputs_nodelet.cpp) 27 | 28 | add_dependencies(phidgets_digital_outputs ${catkin_EXPORTED_TARGETS}) 29 | add_dependencies(phidgets_digital_outputs_nodelet ${catkin_EXPORTED_TARGETS}) 30 | 31 | target_link_libraries(phidgets_digital_outputs ${catkin_LIBRARIES}) 32 | target_link_libraries(phidgets_digital_outputs_nodelet ${catkin_LIBRARIES} phidgets_digital_outputs) 33 | 34 | install(TARGETS phidgets_digital_outputs phidgets_digital_outputs_nodelet 35 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 36 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 37 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 38 | ) 39 | 40 | install(DIRECTORY include/${PROJECT_NAME}/ 41 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 42 | FILES_MATCHING PATTERN "*.h" 43 | ) 44 | 45 | install(DIRECTORY launch 46 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 47 | ) 48 | 49 | install(FILES phidgets_digital_outputs_nodelet.xml 50 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 51 | ) 52 | 53 | roslaunch_add_file_check(launch) 54 | -------------------------------------------------------------------------------- /phidgets_digital_outputs/README.md: -------------------------------------------------------------------------------- 1 | Phidgets digital inputs ROS driver 2 | ================================== 3 | 4 | This is the ROS driver for Phidgets digital inputs. The various topics, services, and parameters that the node operates with are listed below. 5 | 6 | Topics 7 | ------ 8 | * `/digital_outputXX` (`std_msgs/Bool`) - The state to set the digital output to; one topic will be created for each digital output on the device. 9 | 10 | Services 11 | -------- 12 | * `/set_digital_output` (`phidgets_msgs/SetDigitalOutput`) - A service to set the digital output `index` to the specified `state`. 13 | 14 | Parameters 15 | ---------- 16 | * `serial` (int) - The serial number of the phidgets digital output to connect to. If -1 (the default), connects to any digital output phidget that can be found. 17 | * `hub_port` (int) - The phidgets VINT hub port to connect to. Only used if the digital output phidget is connected to a VINT hub. Defaults to 0. 18 | * `is_hub_port_device` (bool) - Whether this device is directly connected to VINT hub port, or whether it is connected via another widget to the hub port. Only used if the digital output phidget is connected to a VINT hub. Defaults to false. 19 | -------------------------------------------------------------------------------- /phidgets_digital_outputs/include/phidgets_digital_outputs/phidgets_digital_outputs_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_DIGITAL_OUTPUTS_PHIDGETS_DIGITAL_OUTPUTS_NODELET_H 31 | #define PHIDGETS_DIGITAL_OUTPUTS_PHIDGETS_DIGITAL_OUTPUTS_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_digital_outputs/digital_outputs_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsDigitalOutputsNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr dos_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_DIGITAL_OUTPUTS_PHIDGETS_DIGITAL_OUTPUTS_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_digital_outputs/launch/digital_outputs.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### Digital Outputs Driver ############################################### 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # optional param is_hub_port_device, used if connected to a VINT hub 25 | 26 | 27 | # optional param server_name, required to locate remote network servers 28 | 29 | 30 | # optional param server_ip, required to locate remote network servers 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /phidgets_digital_outputs/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_digital_outputs 4 | 1.0.10 5 | Driver for the Phidgets Digital Output devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Chris Lalancette 13 | 14 | catkin 15 | 16 | nodelet 17 | phidgets_api 18 | phidgets_msgs 19 | roscpp 20 | roslaunch 21 | std_msgs 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /phidgets_digital_outputs/phidgets_digital_outputs_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets Digital Outputs nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_digital_outputs/src/phidgets_digital_outputs_nodelet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "phidgets_digital_outputs/digital_outputs_ros_i.h" 37 | #include "phidgets_digital_outputs/phidgets_digital_outputs_nodelet.h" 38 | 39 | typedef phidgets::PhidgetsDigitalOutputsNodelet PhidgetsDigitalOutputsNodelet; 40 | 41 | PLUGINLIB_EXPORT_CLASS(PhidgetsDigitalOutputsNodelet, nodelet::Nodelet) 42 | 43 | void PhidgetsDigitalOutputsNodelet::onInit() 44 | { 45 | NODELET_INFO("Initializing Phidgets Digital Outputs Nodelet"); 46 | 47 | // TODO: Do we want the single threaded or multithreaded NH? 48 | ros::NodeHandle nh = getMTNodeHandle(); 49 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 50 | 51 | dos_ = std::make_unique(nh, nh_private); 52 | } 53 | -------------------------------------------------------------------------------- /phidgets_drivers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | project(phidgets_drivers) 3 | find_package(catkin REQUIRED) 4 | catkin_metapackage() 5 | -------------------------------------------------------------------------------- /phidgets_drivers/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_drivers 4 | 1.0.10 5 | API and ROS drivers for Phidgets devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD, LGPL 11 | 12 | http://ros.org/wiki/phidgets_drivers 13 | https://github.com/ros-drivers/phidgets_drivers.git 14 | https://github.com/ros-drivers/phidgets_drivers/issues 15 | 16 | Phidgets Inc. 17 | Tully Foote 18 | Ivan Dryanovski 19 | Martin Günther 20 | Murilo FM 21 | José-Luis Blanco Claraco 22 | Chris Lalancette 23 | 24 | catkin 25 | 26 | libphidget22 27 | phidgets_accelerometer 28 | phidgets_api 29 | phidgets_analog_inputs 30 | phidgets_digital_inputs 31 | phidgets_digital_outputs 32 | phidgets_gyroscope 33 | phidgets_ik 34 | phidgets_high_speed_encoder 35 | phidgets_magnetometer 36 | phidgets_motors 37 | phidgets_msgs 38 | phidgets_spatial 39 | phidgets_temperature 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /phidgets_gyroscope/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_gyroscope) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet phidgets_api roscpp roslaunch sensor_msgs std_msgs std_srvs) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_gyroscope 20 | CATKIN_DEPENDS nodelet phidgets_api roscpp sensor_msgs std_msgs std_srvs 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_gyroscope src/gyroscope_ros_i.cpp) 26 | add_library(phidgets_gyroscope_nodelet src/phidgets_gyroscope_nodelet.cpp) 27 | 28 | add_dependencies(phidgets_gyroscope ${catkin_EXPORTED_TARGETS}) 29 | add_dependencies(phidgets_gyroscope_nodelet ${catkin_EXPORTED_TARGETS}) 30 | 31 | target_link_libraries(phidgets_gyroscope ${catkin_LIBRARIES}) 32 | target_link_libraries(phidgets_gyroscope_nodelet ${catkin_LIBRARIES} phidgets_gyroscope) 33 | 34 | install(TARGETS phidgets_gyroscope phidgets_gyroscope_nodelet 35 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 36 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 37 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 38 | ) 39 | 40 | install(DIRECTORY include/${PROJECT_NAME}/ 41 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 42 | FILES_MATCHING PATTERN "*.h" 43 | ) 44 | 45 | install(DIRECTORY launch 46 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 47 | ) 48 | 49 | install(FILES phidgets_gyroscope_nodelet.xml 50 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 51 | ) 52 | 53 | roslaunch_add_file_check(launch) 54 | -------------------------------------------------------------------------------- /phidgets_gyroscope/README.md: -------------------------------------------------------------------------------- 1 | Phidgets gyroscope ROS driver 2 | ================================== 3 | 4 | This is the ROS driver for Phidgets gyroscope. The various topics, services, and parameters that the node operates with are listed below. 5 | 6 | Topics 7 | ------ 8 | * `imu/is_calibrated` (`std_msgs/Bool`) - Whether the gyroscope has been calibrated; this will be done automatically at startup time, but can also be re-done at any time by calling the `imu/calibrate` service. 9 | * `imu/data_raw` (`sensor_msgs/Imu`) - The raw data coming out of the gyroscope. 10 | 11 | Services 12 | -------- 13 | * `imu/calibrate` (`std_srvs/Empty`) - Run calibration on the gyroscope. 14 | 15 | Parameters 16 | ---------- 17 | * `serial` (int) - The serial number of the phidgets gyroscope to connect to. If -1 (the default), connects to any gyroscope phidget that can be found. 18 | * `hub_port` (int) - The phidgets VINT hub port to connect to. Only used if the gyroscope phidget is connected to a VINT hub. Defaults to 0. 19 | * `frame_id` (string) - The header frame ID to use when publishing the message. Defaults to [REP-0145](http://www.ros.org/reps/rep-0145.html) compliant `imu_link`. 20 | * `angular_velocity_stdev` (double) - The standard deviation to use for the angular velocity when publishing the message. Defaults to 0.095deg/s. 21 | * `time_resynchronization_interval_ms` (int) - The number of milliseconds to wait between resynchronizing the time on the Phidgets spatial with the local time. Larger values have less "jumps", but will have more timestamp drift. Setting this to 0 disables resynchronization. Defaults to 5000 ms. 22 | * `data_interval_ms` (int) - The number of milliseconds between acquisitions of data on the device. Defaults to 8 ms. 23 | * `callback_delta_epsilon_ms` (int) - The number of milliseconds epsilon allowed between callbacks when attempting to resynchronize the time. If this is set to 1, then a difference of `data_interval_ms` plus or minus 1 millisecond will be considered viable for resynchronization. Higher values give the code more leeway to resynchronize, at the cost of potentially getting bad resynchronizations sometimes. Lower values can give better results, but can also result in never resynchronizing. Must be less than `data_interval_ms`. Defaults to 1 ms. 24 | * `publish_rate` (int) - How often the driver will publish data on the ROS topic. If 0 (the default), it will publish every time there is an update from the device (so at the `data_interval_ms`). If positive, it will publish the data at that rate regardless of the acquisition interval. 25 | -------------------------------------------------------------------------------- /phidgets_gyroscope/include/phidgets_gyroscope/phidgets_gyroscope_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_GYROSCOPE_PHIDGETS_GYROSCOPE_NODELET_H 31 | #define PHIDGETS_GYROSCOPE_PHIDGETS_GYROSCOPE_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_gyroscope/gyroscope_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsGyroscopeNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr gyroscope_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_GYROSCOPE_PHIDGETS_GYROSCOPE_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_gyroscope/launch/gyroscope.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### Gyroscope Driver ##################################################### 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # optional param frame_id, default is "imu_link" 25 | 26 | 27 | # optional param angular_velocity_stdev, default is 0.095deg/s 28 | 29 | 30 | # supported data rates: 4 8 16 24 32 40 ... 1000 (in ms) 31 | 32 | 33 | # optional param publish_rate, defaults to 0 34 | 35 | 36 | # optional param server_name, required to locate remote network servers 37 | 38 | 39 | # optional param server_ip, required to locate remote network servers 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /phidgets_gyroscope/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_gyroscope 4 | 1.0.10 5 | Driver for the Phidgets Gyroscope devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Chris Lalancette 13 | 14 | catkin 15 | 16 | nodelet 17 | phidgets_api 18 | roscpp 19 | roslaunch 20 | sensor_msgs 21 | std_msgs 22 | std_srvs 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /phidgets_gyroscope/phidgets_gyroscope_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets Gyroscope nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_gyroscope/src/phidgets_gyroscope_nodelet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "phidgets_gyroscope/gyroscope_ros_i.h" 37 | #include "phidgets_gyroscope/phidgets_gyroscope_nodelet.h" 38 | 39 | typedef phidgets::PhidgetsGyroscopeNodelet PhidgetsGyroscopeNodelet; 40 | 41 | PLUGINLIB_EXPORT_CLASS(PhidgetsGyroscopeNodelet, nodelet::Nodelet) 42 | 43 | void PhidgetsGyroscopeNodelet::onInit() 44 | { 45 | NODELET_INFO("Initializing Phidgets Gyroscope Nodelet"); 46 | 47 | // TODO: Do we want the single threaded or multithreaded NH? 48 | ros::NodeHandle nh = getMTNodeHandle(); 49 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 50 | 51 | gyroscope_ = std::make_unique(nh, nh_private); 52 | } 53 | -------------------------------------------------------------------------------- /phidgets_high_speed_encoder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_high_speed_encoder) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet phidgets_api phidgets_msgs pluginlib roscpp roslaunch sensor_msgs) 16 | 17 | catkin_package( 18 | CATKIN_DEPENDS nodelet phidgets_api phidgets_msgs pluginlib roscpp sensor_msgs 19 | ) 20 | 21 | include_directories(include ${catkin_INCLUDE_DIRS}) 22 | 23 | add_library(phidgets_high_speed_encoder src/high_speed_encoder_ros_i.cpp) 24 | add_library(phidgets_high_speed_encoder_nodelet src/phidgets_high_speed_encoder_nodelet.cpp) 25 | 26 | add_dependencies(phidgets_high_speed_encoder ${catkin_EXPORTED_TARGETS}) 27 | add_dependencies(phidgets_high_speed_encoder_nodelet ${catkin_EXPORTED_TARGETS}) 28 | 29 | target_link_libraries(phidgets_high_speed_encoder ${catkin_LIBRARIES}) 30 | target_link_libraries(phidgets_high_speed_encoder_nodelet ${catkin_LIBRARIES} phidgets_high_speed_encoder) 31 | 32 | install(TARGETS phidgets_high_speed_encoder phidgets_high_speed_encoder_nodelet 33 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 34 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 35 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 36 | ) 37 | 38 | install(DIRECTORY include/${PROJECT_NAME}/ 39 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 40 | FILES_MATCHING PATTERN "*.h" 41 | ) 42 | 43 | install(DIRECTORY launch 44 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 45 | ) 46 | 47 | install(FILES phidgets_high_speed_encoder_nodelet.xml 48 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 49 | ) 50 | 51 | roslaunch_add_file_check(launch) 52 | -------------------------------------------------------------------------------- /phidgets_high_speed_encoder/README.md: -------------------------------------------------------------------------------- 1 | Phidgets high speed encoder ROS driver 2 | ================================== 3 | 4 | This is the ROS driver for Phidgets high speed encoder. The various topics, services, and parameters that the node operates with are listed below. 5 | 6 | Topics 7 | ------ 8 | * `/joint_states` (`sensor_msgs/JointState`) - A joint state message containing the current state of all encoders. 9 | * `/joint_states_chXX_decim_speed` (`phidgets_msgs/EncoderDecimatedSpeed`) - One topic per encoder of the decimated (average) speed reading from the encoder. 10 | 11 | Parameters 12 | ---------- 13 | * `serial` (int) - The serial number of the phidgets high speed encoder to connect to. If -1 (the default), connects to any high speed encoder phidget that can be found. 14 | * `hub_port` (int) - The phidgets VINT hub port to connect to. Only used if the high speed encoder phidget is connected to a VINT hub. Defaults to 0. 15 | * `frame_id` (string) - The header frame ID to use when publishing the message. Defaults to `encoder_link`. 16 | * `speed_filter_samples_len` (int) - The number of data points over which to average the speed. Defaults to 10. 17 | * `speed_filter_idle_iter_loops_before_reset` (int) - The number of idle loops (loops with no data) before the average speed will be reset to 0. Defaults to 1. 18 | * `publish_rate` (int) - How often the driver will publish data on the ROS topic. If 0 (the default), it will publish every time there is an update from the device (so at the `data_interval_ms`). If positive, it will publish the data at that rate regardless of the acquisition interval. 19 | -------------------------------------------------------------------------------- /phidgets_high_speed_encoder/include/phidgets_high_speed_encoder/phidgets_high_speed_encoder_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_HIGH_SPEED_ENCODER_PHIDGETS_HIGH_SPEED_ENCODER_NODELET_H 31 | #define PHIDGETS_HIGH_SPEED_ENCODER_PHIDGETS_HIGH_SPEED_ENCODER_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_high_speed_encoder/high_speed_encoder_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsHighSpeedEncoderNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr enc_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_HIGH_SPEED_ENCODER_PHIDGETS_HIGH_SPEED_ENCODER_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_high_speed_encoder/launch/high_speed_encoder.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### High Speed Encoder Driver ############################################ 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # optional param frame_id, default is "encode_link" 25 | 26 | 27 | # optional param speed_filter_samples_len, default is 10 28 | 29 | 30 | # optional param speed_filter_idle_iter_loops_before_reset, default is 1 31 | 32 | 33 | # optional param publish_rate, defaults to 0 34 | 35 | 36 | # optional param data_interval_ms, defaults to device default 37 | 38 | 39 | # optional param io_mode, defaults to device default 40 | 41 | 42 | # optional param server_name, required to locate remote network servers 43 | 44 | 45 | # optional param server_ip, required to locate remote network servers 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /phidgets_high_speed_encoder/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_high_speed_encoder 4 | 1.0.10 5 | Driver for the Phidgets high speed encoder devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Geoff Viola 13 | José-Luis Blanco Claraco 14 | 15 | catkin 16 | 17 | nodelet 18 | phidgets_api 19 | phidgets_msgs 20 | pluginlib 21 | roscpp 22 | roslaunch 23 | sensor_msgs 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /phidgets_high_speed_encoder/phidgets_high_speed_encoder_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets High Speed Encoder nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_high_speed_encoder/src/phidgets_high_speed_encoder_nodelet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "phidgets_high_speed_encoder/high_speed_encoder_ros_i.h" 37 | #include "phidgets_high_speed_encoder/phidgets_high_speed_encoder_nodelet.h" 38 | 39 | typedef phidgets::PhidgetsHighSpeedEncoderNodelet 40 | PhidgetsHighSpeedEncoderNodelet; 41 | 42 | PLUGINLIB_EXPORT_CLASS(PhidgetsHighSpeedEncoderNodelet, nodelet::Nodelet) 43 | 44 | void PhidgetsHighSpeedEncoderNodelet::onInit() 45 | { 46 | NODELET_INFO("Initializing Phidgets High Speed Encoder Nodelet"); 47 | 48 | // TODO: Do we want the single threaded or multithreaded NH? 49 | ros::NodeHandle nh = getMTNodeHandle(); 50 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 51 | 52 | enc_ = std::make_unique(nh, nh_private); 53 | } 54 | -------------------------------------------------------------------------------- /phidgets_humidity/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package phidgets_humidity 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.0.10 (2025-05-08) 6 | ------------------- 7 | 8 | 1.0.9 (2024-03-13) 9 | ------------------ 10 | * Add support for Phidgets Humidity sensors (`#173 `_) 11 | I have done a find and replace on the phidgets_temperature package to get the Phidgets Humidity sensor working. Tested with a `HUM1001_0`. 12 | * Contributors: Gary Edwards 13 | -------------------------------------------------------------------------------- /phidgets_humidity/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_humidity) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet phidgets_api roscpp roslaunch std_msgs) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_humidity 20 | CATKIN_DEPENDS nodelet phidgets_api roscpp std_msgs 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_humidity src/humidity_ros_i.cpp) 26 | add_library(phidgets_humidity_nodelet src/phidgets_humidity_nodelet.cpp) 27 | 28 | add_dependencies(phidgets_humidity ${catkin_EXPORTED_TARGETS}) 29 | add_dependencies(phidgets_humidity_nodelet ${catkin_EXPORTED_TARGETS}) 30 | 31 | target_link_libraries(phidgets_humidity ${catkin_LIBRARIES}) 32 | target_link_libraries(phidgets_humidity_nodelet ${catkin_LIBRARIES} phidgets_humidity) 33 | 34 | install(TARGETS phidgets_humidity phidgets_humidity_nodelet 35 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 36 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 37 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 38 | ) 39 | 40 | install(DIRECTORY include/${PROJECT_NAME}/ 41 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 42 | FILES_MATCHING PATTERN "*.h" 43 | ) 44 | 45 | install(DIRECTORY launch 46 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 47 | ) 48 | 49 | install(FILES phidgets_humidity_nodelet.xml 50 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 51 | ) 52 | 53 | roslaunch_add_file_check(launch) 54 | -------------------------------------------------------------------------------- /phidgets_humidity/README.md: -------------------------------------------------------------------------------- 1 | Phidgets humidity ROS driver 2 | ============================ 3 | 4 | This is the ROS driver for Phidgets humidity sensor. The various topics, services, and parameters that the node operates with are listed below. 5 | 6 | Topics 7 | ------ 8 | * `/humidity` (`std_msgs/Float64`) - The current relative humidity in %. 9 | 10 | Parameters 11 | ---------- 12 | * `serial` (int) - The serial number of the phidgets humidity to connect to. If -1 (the default), connects to any humidity phidget that can be found. 13 | * `hub_port` (int) - The phidgets VINT hub port to connect to. Only used if the humidity phidget is connected to a VINT hub. Defaults to 0. 14 | * `data_interval_ms` (int) - The number of milliseconds between acquisitions of data on the device. Defaults to 500 ms. 15 | * `publish_rate` (int) - How often the driver will publish data on the ROS topic. If 0 (the default), it will publish every time there is an update from the device (so at the `data_interval_ms`). If positive, it will publish the data at that rate regardless of the acquisition interval. 16 | -------------------------------------------------------------------------------- /phidgets_humidity/include/phidgets_humidity/humidity_ros_i.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_HUMIDITY_HUMIDITY_ROS_I_H 31 | #define PHIDGETS_HUMIDITY_HUMIDITY_ROS_I_H 32 | 33 | #include 34 | #include 35 | 36 | #include 37 | 38 | #include "phidgets_api/humidity.h" 39 | 40 | namespace phidgets { 41 | 42 | class HumidityRosI final 43 | { 44 | public: 45 | explicit HumidityRosI(ros::NodeHandle nh, ros::NodeHandle nh_private); 46 | 47 | private: 48 | std::unique_ptr humidity_; 49 | std::mutex humidity_mutex_; 50 | double last_humidity_reading_; 51 | bool got_first_data_; 52 | 53 | ros::NodeHandle nh_; 54 | ros::NodeHandle nh_private_; 55 | ros::Publisher humidity_pub_; 56 | void timerCallback(const ros::TimerEvent& event); 57 | ros::Timer timer_; 58 | int publish_rate_; 59 | std::string server_name_; 60 | std::string server_ip_; 61 | 62 | void publishLatest(); 63 | 64 | void humidityChangeCallback(double humidity); 65 | }; 66 | 67 | } // namespace phidgets 68 | 69 | #endif // PHIDGETS_HUMIDITY_HUMIDITY_ROS_I_H 70 | -------------------------------------------------------------------------------- /phidgets_humidity/include/phidgets_humidity/phidgets_humidity_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_HUMIDITY_PHIDGETS_HUMIDITY_NODELET_H 31 | #define PHIDGETS_HUMIDITY_PHIDGETS_HUMIDITY_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_humidity/humidity_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsHumidityNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr humidity_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_HUMIDITY_PHIDGETS_HUMIDITY_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_humidity/launch/humidity.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### Humidity Driver ##################################################### 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # supported data rates: 50 ms - 60,000 ms 25 | 26 | 27 | # optional param publish_rate, defaults to 0 28 | 29 | 30 | # optional param server_name, required to locate remote network servers 31 | 32 | 33 | # optional param server_ip, required to locate remote network servers 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /phidgets_humidity/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_humidity 4 | 1.0.10 5 | Driver for the Phidgets Humidity devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Gary Edwards 13 | 14 | catkin 15 | 16 | nodelet 17 | phidgets_api 18 | roscpp 19 | roslaunch 20 | std_msgs 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /phidgets_humidity/phidgets_humidity_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets Humidity nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_humidity/src/phidgets_humidity_nodelet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "phidgets_humidity/phidgets_humidity_nodelet.h" 37 | #include "phidgets_humidity/humidity_ros_i.h" 38 | 39 | typedef phidgets::PhidgetsHumidityNodelet PhidgetsHumidityNodelet; 40 | 41 | PLUGINLIB_EXPORT_CLASS(PhidgetsHumidityNodelet, nodelet::Nodelet) 42 | 43 | void PhidgetsHumidityNodelet::onInit() 44 | { 45 | NODELET_INFO("Initializing Phidgets Humidity Nodelet"); 46 | 47 | // TODO: Do we want the single threaded or multithreaded NH? 48 | ros::NodeHandle nh = getMTNodeHandle(); 49 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 50 | 51 | humidity_ = std::make_unique(nh, nh_private); 52 | } 53 | -------------------------------------------------------------------------------- /phidgets_ik/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_ik) 4 | 5 | find_package(catkin REQUIRED COMPONENTS roslaunch) 6 | 7 | catkin_package() 8 | 9 | install(DIRECTORY launch 10 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 11 | ) 12 | 13 | roslaunch_add_file_check(launch) 14 | -------------------------------------------------------------------------------- /phidgets_ik/README.md: -------------------------------------------------------------------------------- 1 | Phidgets interface kit ROS driver 2 | ================================= 3 | 4 | This is the meta-ROS driver for Phidgets interface kit. Since Phidgets interface kits are composed of digital inputs, digital outputs, and analog inputs, we can compose an IK driver by just launching the individual drivers together. This package only contains a launch file that makes it convenient to launch an IK. 5 | -------------------------------------------------------------------------------- /phidgets_ik/launch/ik.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### Analog Inputs Driver ################################################# 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # optional param is_hub_port_device, used if connected to a VINT hub 25 | 26 | 27 | # optional param data_interval_ms, defaults to 250 28 | 29 | 30 | # optional param publish_rate, defaults to 0 31 | 32 | 33 | 34 | #### Digital Inputs Driver ################################################ 35 | 36 | 39 | 40 | # See README.md for more information on the parameters 41 | 42 | # optional param serial, default is -1 43 | 44 | 45 | # optional param hub_port, used if connected to a VINT hub 46 | 47 | 48 | # optional param is_hub_port_device, used if connected to a VINT hub 49 | 50 | 51 | # optional param publish_rate, defaults to 0 52 | 53 | 54 | 55 | #### Digital Outputs Driver ############################################### 56 | 57 | 60 | 61 | # See README.md for more information on the parameters 62 | 63 | # optional param serial, default is -1 64 | 65 | 66 | # optional param hub_port, used if connected to a VINT hub 67 | 68 | 69 | # optional param is_hub_port_device, used if connected to a VINT hub 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /phidgets_ik/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_ik 4 | 1.0.10 5 | Driver for the Phidgets InterfaceKit devices 6 | 7 | BSD 8 | 9 | Martin Günther 10 | Chris Lalancette 11 | 12 | 15 | 16 | James Sarrett 17 | Russel Howe 18 | 19 | 20 | catkin 21 | 22 | roslaunch 23 | 24 | nodelet 25 | phidgets_analog_inputs 26 | phidgets_digital_inputs 27 | phidgets_digital_outputs 28 | 29 | 30 | -------------------------------------------------------------------------------- /phidgets_magnetometer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_magnetometer) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet phidgets_api roscpp roslaunch sensor_msgs) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_magnetometer 20 | CATKIN_DEPENDS nodelet phidgets_api roscpp sensor_msgs 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_magnetometer src/magnetometer_ros_i.cpp) 26 | add_library(phidgets_magnetometer_nodelet src/phidgets_magnetometer_nodelet.cpp) 27 | 28 | add_dependencies(phidgets_magnetometer ${catkin_EXPORTED_TARGETS}) 29 | add_dependencies(phidgets_magnetometer_nodelet ${catkin_EXPORTED_TARGETS}) 30 | 31 | target_link_libraries(phidgets_magnetometer ${catkin_LIBRARIES}) 32 | target_link_libraries(phidgets_magnetometer_nodelet ${catkin_LIBRARIES} phidgets_magnetometer) 33 | 34 | install(TARGETS phidgets_magnetometer phidgets_magnetometer_nodelet 35 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 36 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 37 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 38 | ) 39 | 40 | install(DIRECTORY include/${PROJECT_NAME}/ 41 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 42 | FILES_MATCHING PATTERN "*.h" 43 | ) 44 | 45 | install(DIRECTORY launch 46 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 47 | ) 48 | 49 | install(FILES phidgets_magnetometer_nodelet.xml 50 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 51 | ) 52 | 53 | roslaunch_add_file_check(launch) 54 | -------------------------------------------------------------------------------- /phidgets_magnetometer/include/phidgets_magnetometer/phidgets_magnetometer_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_MAGNETOMETER_PHIDGETS_MAGNETOMETER_NODELET_H 31 | #define PHIDGETS_MAGNETOMETER_PHIDGETS_MAGNETOMETER_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_magnetometer/magnetometer_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsMagnetometerNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr magnetometer_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_MAGNETOMETER_PHIDGETS_MAGNETOMETER_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_magnetometer/launch/magnetometer.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### Magnetometer Driver ################################################## 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # optional param frame_id, default is "imu_link" 25 | 26 | 27 | # optional param magnetic_field_stdev, default is 1.1 milligauss 28 | 29 | 30 | # supported data rates: 4 8 16 24 32 40 ... 1000 (in ms) 31 | 32 | 33 | # optional param publish_rate, defaults to 0 34 | 35 | 36 | # optional param server_name, required to locate remote network servers 37 | 38 | 39 | # optional param server_ip, required to locate remote network servers 40 | 41 | 42 | # compass correction params (see http://www.phidgets.com/docs/1044_User_Guide) 43 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /phidgets_magnetometer/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_magnetometer 4 | 1.0.10 5 | Driver for the Phidgets Magnetometer devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Chris Lalancette 13 | 14 | catkin 15 | 16 | nodelet 17 | phidgets_api 18 | roscpp 19 | roslaunch 20 | sensor_msgs 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /phidgets_magnetometer/phidgets_magnetometer_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets Magnetometer nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_magnetometer/src/phidgets_magnetometer_nodelet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "phidgets_magnetometer/magnetometer_ros_i.h" 37 | #include "phidgets_magnetometer/phidgets_magnetometer_nodelet.h" 38 | 39 | typedef phidgets::PhidgetsMagnetometerNodelet PhidgetsMagnetometerNodelet; 40 | 41 | PLUGINLIB_EXPORT_CLASS(PhidgetsMagnetometerNodelet, nodelet::Nodelet) 42 | 43 | void PhidgetsMagnetometerNodelet::onInit() 44 | { 45 | NODELET_INFO("Initializing Phidgets Magnetometer Nodelet"); 46 | 47 | // TODO: Do we want the single threaded or multithreaded NH? 48 | ros::NodeHandle nh = getMTNodeHandle(); 49 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 50 | 51 | magnetometer_ = std::make_unique(nh, nh_private); 52 | } 53 | -------------------------------------------------------------------------------- /phidgets_motors/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package phidgets_motors 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.0.10 (2025-05-08) 6 | ------------------- 7 | 8 | 1.0.9 (2024-03-13) 9 | ------------------ 10 | 11 | 1.0.8 (2023-11-27) 12 | ------------------ 13 | 14 | 1.0.7 (2023-03-02) 15 | ------------------ 16 | 17 | 1.0.6 (2022-12-01) 18 | ------------------ 19 | * Merge pull request `#129 `_ from mintar/feat-pre-commit 20 | Add pre-commit, move from travis to GitHub actions, fix style 21 | * Don't modify CMAKE_CXX_FLAGS 22 | * Fix clang-format 23 | * Add support for VINT networkhub (`#127 `_) 24 | * Contributors: James Haley, Martin Günther 25 | 26 | 1.0.5 (2022-02-17) 27 | ------------------ 28 | 29 | 1.0.4 (2021-10-22) 30 | ------------------ 31 | 32 | 1.0.3 (2021-09-29) 33 | ------------------ 34 | 35 | 1.0.2 (2021-03-09) 36 | ------------------ 37 | 38 | 1.0.1 (2020-06-04) 39 | ------------------ 40 | * Set cmake_policy CMP0048 to fix warning 41 | * Contributors: Martin Günther 42 | 43 | 1.0.0 (2020-06-03) 44 | ------------------ 45 | * Update maintainers in package.xml 46 | * Switch to libphidget22 47 | * Add launch files for all drivers. 48 | * Add in try/catch blocks for connecting. 49 | If an error occurs, we catch it, print it, then re-throw it. 50 | This allows us to show a better error when using nodelets. 51 | * Fixes from review. 52 | * Documentation updates to README.md 53 | * Set the publish_rate to 0 by default. 54 | This means we will only publish on changes. 55 | * Add in the license files and add to the headers. 56 | * Remove nodes in favor of nodelets. 57 | * Rewrite Motor Phidget to use libphidget22. 58 | Also implement a new motor node. 59 | * Contributors: Chris Lalancette, Martin Günther 60 | -------------------------------------------------------------------------------- /phidgets_motors/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_motors) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet phidgets_api phidgets_msgs roscpp roslaunch std_msgs) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_motors 20 | CATKIN_DEPENDS nodelet phidgets_api phidgets_msgs roscpp std_msgs 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_motors src/motors_ros_i.cpp) 26 | add_library(phidgets_motors_nodelet src/phidgets_motors_nodelet.cpp) 27 | 28 | add_dependencies(phidgets_motors ${catkin_EXPORTED_TARGETS}) 29 | add_dependencies(phidgets_motors_nodelet ${catkin_EXPORTED_TARGETS}) 30 | 31 | target_link_libraries(phidgets_motors ${catkin_LIBRARIES}) 32 | target_link_libraries(phidgets_motors_nodelet ${catkin_LIBRARIES} phidgets_motors) 33 | 34 | install(TARGETS phidgets_motors phidgets_motors_nodelet 35 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 36 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 37 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 38 | ) 39 | 40 | install(DIRECTORY include/${PROJECT_NAME}/ 41 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 42 | FILES_MATCHING PATTERN "*.h" 43 | ) 44 | 45 | install(DIRECTORY launch 46 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 47 | ) 48 | 49 | install(FILES phidgets_motors_nodelet.xml 50 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 51 | ) 52 | 53 | roslaunch_add_file_check(launch) 54 | -------------------------------------------------------------------------------- /phidgets_motors/README.md: -------------------------------------------------------------------------------- 1 | Phidgets motor ROS driver 2 | ========================= 3 | 4 | This is the ROS driver for Phidgets motor. The various topics, services, and parameters that the node operates with are listed below. 5 | 6 | Topics 7 | ------ 8 | * `/set_motor_duty_cycleXX` (`std_msgs/Float64`) - Set the motor duty cycle. One topic is created for each motor attached. 9 | * `/motor_duty_cycleXX` (`std_msgs/Float64`) - Get the motor duty cycle. One topic is created for each motor attached. 10 | * `/motor_back_emfXX` (`std_msgs/Float64`) - Get the motor back EMF value. One topic is created for each motor attached. 11 | 12 | Parameters 13 | ---------- 14 | * `serial` (int) - The serial number of the phidgets motor to connect to. If -1 (the default), connects to any motor phidget that can be found. 15 | * `hub_port` (int) - The phidgets VINT hub port to connect to. Only used if the motor phidget is connected to a VINT hub. Defaults to 0. 16 | * `braking_strength` (double) - The braking strength to apply when the duty cycle is 0. Defaults to 0.0. 17 | * `data_interval_ms` (int) - The number of milliseconds between acquisitions of data on the device. Defaults to 250 ms. 18 | * `publish_rate` (int) - How often the driver will publish data on the ROS topic. If 0 (the default), it will publish every time there is an update from the device (so at the `data_interval_ms`). If positive, it will publish the data at that rate regardless of the acquisition interval. 19 | -------------------------------------------------------------------------------- /phidgets_motors/include/phidgets_motors/phidgets_motors_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_MOTORS_PHIDGETS_MOTORS_NODELET_H 31 | #define PHIDGETS_MOTORS_PHIDGETS_MOTORS_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_motors/motors_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsMotorsNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr motors_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_MOTORS_PHIDGETS_MOTORS_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_motors/launch/motors.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### Motors Driver ######################################################## 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # optional param braking_strength, default is 0.0 25 | 26 | 27 | # supported data rates: 4 8 16 24 32 40 ... 1000 (in ms) 28 | 29 | 30 | # optional param publish_rate, defaults to 0 31 | 32 | 33 | # optional param server_name, required to locate remote network servers 34 | 35 | 36 | # optional param server_ip, required to locate remote network servers 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /phidgets_motors/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_motors 4 | 1.0.10 5 | Driver for the Phidgets Motor devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Chris Lalancette 13 | 14 | catkin 15 | 16 | nodelet 17 | phidgets_api 18 | phidgets_msgs 19 | roscpp 20 | roslaunch 21 | std_msgs 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /phidgets_motors/phidgets_motors_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets Motors nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_motors/src/phidgets_motors_nodelet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "phidgets_motors/motors_ros_i.h" 37 | #include "phidgets_motors/phidgets_motors_nodelet.h" 38 | 39 | typedef phidgets::PhidgetsMotorsNodelet PhidgetsMotorsNodelet; 40 | 41 | PLUGINLIB_EXPORT_CLASS(PhidgetsMotorsNodelet, nodelet::Nodelet) 42 | 43 | void PhidgetsMotorsNodelet::onInit() 44 | { 45 | NODELET_INFO("Initializing Phidgets Motors Nodelet"); 46 | 47 | // TODO: Do we want the single threaded or multithreaded NH? 48 | ros::NodeHandle nh = getMTNodeHandle(); 49 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 50 | 51 | motors_ = std::make_unique(nh, nh_private); 52 | } 53 | -------------------------------------------------------------------------------- /phidgets_msgs/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package phidgets_msgs 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.0.10 (2025-05-08) 6 | ------------------- 7 | 8 | 1.0.9 (2024-03-13) 9 | ------------------ 10 | 11 | 1.0.8 (2023-11-27) 12 | ------------------ 13 | 14 | 1.0.7 (2023-03-02) 15 | ------------------ 16 | 17 | 1.0.6 (2022-12-01) 18 | ------------------ 19 | * Merge pull request `#129 `_ from mintar/feat-pre-commit 20 | Add pre-commit, move from travis to GitHub actions, fix style 21 | * Fix trailing whitespace 22 | * Don't modify CMAKE_CXX_FLAGS 23 | * Contributors: Martin Günther 24 | 25 | 1.0.5 (2022-02-17) 26 | ------------------ 27 | 28 | 1.0.4 (2021-10-22) 29 | ------------------ 30 | 31 | 1.0.3 (2021-09-29) 32 | ------------------ 33 | * Add Analog Outputs (`#103 `_) 34 | * Contributors: Carsten Plasberg 35 | 36 | 1.0.2 (2021-03-09) 37 | ------------------ 38 | 39 | 1.0.1 (2020-06-04) 40 | ------------------ 41 | * Set cmake_policy CMP0048 to fix warning 42 | * Contributors: Martin Günther 43 | 44 | 1.0.0 (2020-06-03) 45 | ------------------ 46 | * Split custom messages into their own package. 47 | * Contributors: Chris Lalancette, Martin Günther 48 | -------------------------------------------------------------------------------- /phidgets_msgs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_msgs) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS message_generation std_msgs) 16 | 17 | add_message_files( 18 | DIRECTORY msg 19 | FILES 20 | EncoderDecimatedSpeed.msg 21 | ) 22 | 23 | add_service_files( 24 | DIRECTORY srv 25 | FILES 26 | SetAnalogOutput.srv 27 | SetDigitalOutput.srv 28 | ) 29 | 30 | generate_messages( 31 | DEPENDENCIES 32 | std_msgs 33 | ) 34 | 35 | catkin_package( 36 | CATKIN_DEPENDS message_runtime std_msgs 37 | ) 38 | -------------------------------------------------------------------------------- /phidgets_msgs/msg/EncoderDecimatedSpeed.msg: -------------------------------------------------------------------------------- 1 | # Encoder averaged speed for a channel in a Phidgets High-Speed Encoder board 2 | Header header 3 | # Averaged (sliding window) speed estimation [rad/s] 4 | float64 avr_speed 5 | -------------------------------------------------------------------------------- /phidgets_msgs/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_msgs 4 | 1.0.10 5 | Custom ROS messages for Phidgets drivers 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Chris Lalancette 13 | 14 | catkin 15 | 16 | std_msgs 17 | 18 | message_generation 19 | 20 | message_runtime 21 | 22 | -------------------------------------------------------------------------------- /phidgets_msgs/srv/SetAnalogOutput.srv: -------------------------------------------------------------------------------- 1 | # Sets the state of a digital output. 2 | 3 | uint16 index # index of the output to be set 4 | float64 voltage 5 | --- 6 | bool success 7 | -------------------------------------------------------------------------------- /phidgets_msgs/srv/SetDigitalOutput.srv: -------------------------------------------------------------------------------- 1 | # Sets the state of a digital output. 2 | 3 | uint16 index # index of the output to be set 4 | bool state 5 | --- 6 | bool success 7 | -------------------------------------------------------------------------------- /phidgets_spatial/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_spatial) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet pluginlib phidgets_api roscpp roslaunch sensor_msgs std_msgs std_srvs) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_spatial 20 | CATKIN_DEPENDS nodelet pluginlib phidgets_api roscpp sensor_msgs std_msgs std_srvs 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_spatial src/spatial_ros_i.cpp) 26 | add_library(phidgets_spatial_nodelet src/phidgets_spatial_nodelet.cpp) 27 | 28 | add_dependencies(phidgets_spatial ${catkin_EXPORTED_TARGETS}) 29 | add_dependencies(phidgets_spatial_nodelet ${catkin_EXPORTED_TARGETS}) 30 | 31 | target_link_libraries(phidgets_spatial ${catkin_LIBRARIES}) 32 | target_link_libraries(phidgets_spatial_nodelet ${catkin_LIBRARIES} phidgets_spatial) 33 | 34 | install(TARGETS phidgets_spatial phidgets_spatial_nodelet 35 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 36 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 37 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 38 | ) 39 | 40 | install(DIRECTORY include/${PROJECT_NAME}/ 41 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 42 | FILES_MATCHING PATTERN "*.h" 43 | ) 44 | 45 | install(DIRECTORY launch 46 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 47 | ) 48 | 49 | install(FILES phidgets_spatial_nodelet.xml 50 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 51 | ) 52 | 53 | roslaunch_add_file_check(launch) 54 | -------------------------------------------------------------------------------- /phidgets_spatial/include/phidgets_spatial/phidgets_spatial_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_SPATIAL_PHIDGETS_SPATIAL_NODELET_H 31 | #define PHIDGETS_SPATIAL_PHIDGETS_SPATIAL_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_spatial/spatial_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsSpatialNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr spatial_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_SPATIAL_PHIDGETS_SPATIAL_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_spatial/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_spatial 4 | 1.0.10 5 | Driver for the Phidgets Spatial 3/3/3 devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | http://ros.org/wiki/phidgets_spatial 13 | https://github.com/ros-drivers/phidgets_drivers.git 14 | https://github.com/ros-drivers/phidgets_drivers/issues 15 | 16 | Ivan Dryanovski 17 | 18 | catkin 19 | 20 | nodelet 21 | phidgets_api 22 | pluginlib 23 | roscpp 24 | roslaunch 25 | sensor_msgs 26 | std_msgs 27 | std_srvs 28 | 29 | imu_filter_madgwick 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /phidgets_spatial/phidgets_spatial_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets Spatial nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_spatial/src/phidgets_spatial_nodelet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "phidgets_spatial/phidgets_spatial_nodelet.h" 37 | #include "phidgets_spatial/spatial_ros_i.h" 38 | 39 | typedef phidgets::PhidgetsSpatialNodelet PhidgetsSpatialNodelet; 40 | 41 | PLUGINLIB_EXPORT_CLASS(PhidgetsSpatialNodelet, nodelet::Nodelet) 42 | 43 | void PhidgetsSpatialNodelet::onInit() 44 | { 45 | NODELET_INFO("Initializing Phidgets SPATIAL Nodelet"); 46 | 47 | // TODO: Do we want the single threaded or multithreaded NH? 48 | ros::NodeHandle nh = getMTNodeHandle(); 49 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 50 | 51 | spatial_ = std::make_unique(nh, nh_private); 52 | } 53 | -------------------------------------------------------------------------------- /phidgets_temperature/CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 | Changelog for package phidgets_temperature 3 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 4 | 5 | 1.0.10 (2025-05-08) 6 | ------------------- 7 | 8 | 1.0.9 (2024-03-13) 9 | ------------------ 10 | 11 | 1.0.8 (2023-11-27) 12 | ------------------ 13 | 14 | 1.0.7 (2023-03-02) 15 | ------------------ 16 | 17 | 1.0.6 (2022-12-01) 18 | ------------------ 19 | * Merge pull request `#129 `_ from mintar/feat-pre-commit 20 | Add pre-commit, move from travis to GitHub actions, fix style 21 | * Don't modify CMAKE_CXX_FLAGS 22 | * Fix clang-format 23 | * Add support for VINT networkhub (`#127 `_) 24 | * Contributors: James Haley, Martin Günther 25 | 26 | 1.0.5 (2022-02-17) 27 | ------------------ 28 | 29 | 1.0.4 (2021-10-22) 30 | ------------------ 31 | 32 | 1.0.3 (2021-09-29) 33 | ------------------ 34 | 35 | 1.0.2 (2021-03-09) 36 | ------------------ 37 | 38 | 1.0.1 (2020-06-04) 39 | ------------------ 40 | * Set cmake_policy CMP0048 to fix warning 41 | * Contributors: Martin Günther 42 | 43 | 1.0.0 (2020-06-03) 44 | ------------------ 45 | * Update maintainers in package.xml 46 | * Switch to libphidget22 47 | * Add launch files for all drivers. 48 | * Add in try/catch blocks for connecting. 49 | If an error occurs, we catch it, print it, then re-throw it. 50 | This allows us to show a better error when using nodelets. 51 | * Documentation updates to README.md 52 | * Set the publish_rate to 0 by default. 53 | This means we will only publish on changes. 54 | * Add in the license files and add to the headers. 55 | * Remove nodes in favor of nodelets. 56 | * Add in support for Phidgets Temperature sensors. 57 | * Contributors: Chris Lalancette, Martin Günther 58 | -------------------------------------------------------------------------------- /phidgets_temperature/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5.1) 2 | cmake_policy(SET CMP0048 NEW) 3 | project(phidgets_temperature) 4 | 5 | # Default to C++14 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | endif() 9 | 10 | # High level of warnings: 11 | if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") 12 | add_compile_options(-Wall -Wextra) 13 | endif() 14 | 15 | find_package(catkin REQUIRED COMPONENTS nodelet phidgets_api roscpp roslaunch std_msgs) 16 | 17 | catkin_package( 18 | INCLUDE_DIRS include 19 | LIBRARIES phidgets_temperature 20 | CATKIN_DEPENDS nodelet phidgets_api roscpp std_msgs 21 | ) 22 | 23 | include_directories(include ${catkin_INCLUDE_DIRS}) 24 | 25 | add_library(phidgets_temperature src/temperature_ros_i.cpp) 26 | add_library(phidgets_temperature_nodelet src/phidgets_temperature_nodelet.cpp) 27 | 28 | add_dependencies(phidgets_temperature ${catkin_EXPORTED_TARGETS}) 29 | add_dependencies(phidgets_temperature_nodelet ${catkin_EXPORTED_TARGETS}) 30 | 31 | target_link_libraries(phidgets_temperature ${catkin_LIBRARIES}) 32 | target_link_libraries(phidgets_temperature_nodelet ${catkin_LIBRARIES} phidgets_temperature) 33 | 34 | install(TARGETS phidgets_temperature phidgets_temperature_nodelet 35 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 36 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 37 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 38 | ) 39 | 40 | install(DIRECTORY include/${PROJECT_NAME}/ 41 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 42 | FILES_MATCHING PATTERN "*.h" 43 | ) 44 | 45 | install(DIRECTORY launch 46 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 47 | ) 48 | 49 | install(FILES phidgets_temperature_nodelet.xml 50 | DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 51 | ) 52 | 53 | roslaunch_add_file_check(launch) 54 | -------------------------------------------------------------------------------- /phidgets_temperature/README.md: -------------------------------------------------------------------------------- 1 | Phidgets temperature ROS driver 2 | =========================== 3 | 4 | This is the ROS driver for Phidgets temperature. The various topics, services, and parameters that the node operates with are listed below. 5 | 6 | Topics 7 | ------ 8 | * `/temperature` (`std_msgs/Float64`) - The current temperature in degrees Celsius. 9 | 10 | Parameters 11 | ---------- 12 | * `serial` (int) - The serial number of the phidgets gyroscope to connect to. If -1 (the default), connects to any gyroscope phidget that can be found. 13 | * `hub_port` (int) - The phidgets VINT hub port to connect to. Only used if the gyroscope phidget is connected to a VINT hub. Defaults to 0. 14 | * `thermocouple_type` (int) - The type of thermocouple that is connected. Allowed values are 0 (for not a thermocouple, the default), 1 (for a J-Type), 2 (for a K-Type), 3 (for an E-Type), or 4 (for a T-Type). See https://www.phidgets.com/docs/Thermocouple_Primer for more information. 15 | * `data_interval_ms` (int) - The number of milliseconds between acquisitions of data on the device. Defaults to 250 ms. 16 | * `publish_rate` (int) - How often the driver will publish data on the ROS topic. If 0 (the default), it will publish every time there is an update from the device (so at the `data_interval_ms`). If positive, it will publish the data at that rate regardless of the acquisition interval. 17 | -------------------------------------------------------------------------------- /phidgets_temperature/include/phidgets_temperature/phidgets_temperature_nodelet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_TEMPERATURE_PHIDGETS_TEMPERATURE_NODELET_H 31 | #define PHIDGETS_TEMPERATURE_PHIDGETS_TEMPERATURE_NODELET_H 32 | 33 | #include 34 | 35 | #include 36 | 37 | #include "phidgets_temperature/temperature_ros_i.h" 38 | 39 | namespace phidgets { 40 | 41 | class PhidgetsTemperatureNodelet : public nodelet::Nodelet 42 | { 43 | public: 44 | virtual void onInit(); 45 | 46 | private: 47 | std::unique_ptr temperature_; 48 | }; 49 | 50 | } // namespace phidgets 51 | 52 | #endif // PHIDGETS_TEMPERATURE_PHIDGETS_TEMPERATURE_NODELET_H 53 | -------------------------------------------------------------------------------- /phidgets_temperature/include/phidgets_temperature/temperature_ros_i.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef PHIDGETS_TEMPERATURE_TEMPERATURE_ROS_I_H 31 | #define PHIDGETS_TEMPERATURE_TEMPERATURE_ROS_I_H 32 | 33 | #include 34 | #include 35 | 36 | #include 37 | 38 | #include "phidgets_api/temperature.h" 39 | 40 | namespace phidgets { 41 | 42 | class TemperatureRosI final 43 | { 44 | public: 45 | explicit TemperatureRosI(ros::NodeHandle nh, ros::NodeHandle nh_private); 46 | 47 | private: 48 | std::unique_ptr temperature_; 49 | std::mutex temperature_mutex_; 50 | double last_temperature_reading_; 51 | bool got_first_data_; 52 | 53 | ros::NodeHandle nh_; 54 | ros::NodeHandle nh_private_; 55 | ros::Publisher temperature_pub_; 56 | void timerCallback(const ros::TimerEvent& event); 57 | ros::Timer timer_; 58 | int publish_rate_; 59 | std::string server_name_; 60 | std::string server_ip_; 61 | 62 | void publishLatest(); 63 | 64 | void temperatureChangeCallback(double temperature); 65 | }; 66 | 67 | } // namespace phidgets 68 | 69 | #endif // PHIDGETS_TEMPERATURE_TEMPERATURE_ROS_I_H 70 | -------------------------------------------------------------------------------- /phidgets_temperature/launch/temperature.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | #### Nodelet manager ###################################################### 6 | 7 | 9 | 10 | #### Gyroscope Driver ##################################################### 11 | 12 | 15 | 16 | # See README.md for more information on the parameters 17 | 18 | # optional param serial, default is -1 19 | 20 | 21 | # optional param hub_port, used if connected to a VINT hub 22 | 23 | 24 | # optional param thermocouple_type, defaults is 0 25 | 26 | 27 | # supported data rates: 4 8 16 24 32 40 ... 1000 (in ms) 28 | 29 | 30 | # optional param publish_rate, defaults to 0 31 | 32 | 33 | # optional param server_name, required to locate remote network servers 34 | 35 | 36 | # optional param server_ip, required to locate remote network servers 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /phidgets_temperature/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | phidgets_temperature 4 | 1.0.10 5 | Driver for the Phidgets Temperature devices 6 | 7 | Martin Günther 8 | Chris Lalancette 9 | 10 | BSD 11 | 12 | Chris Lalancette 13 | 14 | catkin 15 | 16 | nodelet 17 | phidgets_api 18 | roscpp 19 | roslaunch 20 | std_msgs 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /phidgets_temperature/phidgets_temperature_nodelet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | Phidgets Temperature nodelet publisher. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phidgets_temperature/src/phidgets_temperature_nodelet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019, Open Source Robotics Foundation 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * * Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * * Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * * Neither the name of the copyright holder nor the names of its 14 | * contributors may be used to endorse or promote products derived from 15 | * this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "phidgets_temperature/phidgets_temperature_nodelet.h" 37 | #include "phidgets_temperature/temperature_ros_i.h" 38 | 39 | typedef phidgets::PhidgetsTemperatureNodelet PhidgetsTemperatureNodelet; 40 | 41 | PLUGINLIB_EXPORT_CLASS(PhidgetsTemperatureNodelet, nodelet::Nodelet) 42 | 43 | void PhidgetsTemperatureNodelet::onInit() 44 | { 45 | NODELET_INFO("Initializing Phidgets Temperature Nodelet"); 46 | 47 | // TODO: Do we want the single threaded or multithreaded NH? 48 | ros::NodeHandle nh = getMTNodeHandle(); 49 | ros::NodeHandle nh_private = getMTPrivateNodeHandle(); 50 | 51 | temperature_ = std::make_unique(nh, nh_private); 52 | } 53 | --------------------------------------------------------------------------------