Skip to content

Commit

Permalink
Merge pull request #15 from jlblancoc/kinetic
Browse files Browse the repository at this point in the history
Add Phidgets high-speed encoder ROS node.
  • Loading branch information
mintar committed Oct 4, 2017
2 parents fd1901e + 8c46114 commit 7394959
Show file tree
Hide file tree
Showing 8 changed files with 397 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ Overview

Drivers for the Phidgets devices. This Catkin metapackage includes:

* `phidgets_api`: a package which downloads and builds the Phidgets C API from
* `phidgets_api`: a package which downloads and builds the Phidgets C API from
phidgets.com (as an external project). It also implements a C++ wrapper
for the C API, providing a base Phidget class and various inherited classes
for different phidget devices.

* `phidgets_imu`: a package exposing the functionality of the phidget IMU device
using the ROS API.
* ROS nodes exposing the functionality of specific phidgets devices using:

- `phidgets_imu`
- `phidgets_high_speed_encoder`

Installing
---------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion phidgets_api/include/phidgets_api/phidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ class Phidget
int close();

/** @brief Block until the unit is attached or timeout occurs
* @param timeout Milliseconds to wait before timing out */
* @param timeout Milliseconds to wait before timing out
* @return 0 on success */
int waitForAttachment(int timeout);

/** @brief Get the device type string */
Expand Down
2 changes: 1 addition & 1 deletion phidgets_api/src/phidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void Phidget::registerHandlers()
{
CPhidget_set_OnAttach_Handler(handle_, &Phidget::AttachHandler, this);
CPhidget_set_OnDetach_Handler(handle_, &Phidget::DetachHandler, this);
CPhidget_set_OnError_Handler (handle_, &Phidget::ErrorHandler, this);
CPhidget_set_OnError_Handler (handle_, &Phidget::ErrorHandler, this);
}

void Phidget::init(CPhidgetHandle handle)
Expand Down
2 changes: 2 additions & 0 deletions phidgets_drivers/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
<author>Ivan Dryanovski</author>
<author>Martin Guenther</author>
<author>Murilo FM</author>
<author>José-Luis Blanco Claraco</author>

<buildtool_depend>catkin</buildtool_depend>
<run_depend>phidgets_api</run_depend>
<run_depend>phidgets_imu</run_depend>
<run_depend>libphidget21</run_depend>
<run_depend>phidgets_high_speed_encoder</run_depend>

<export>
<metapackage />
Expand Down
46 changes: 46 additions & 0 deletions phidgets_high_speed_encoder/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
cmake_minimum_required(VERSION 2.8.3)
project(phidgets_high_speed_encoder)

# Use C++11
if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}")
endif ()
else ()
set (CMAKE_CXX_STANDARD 11)
endif ()

# High level of warnings:
if (CMAKE_COMPILER_IS_GNUCXX)
add_compile_options(-Wall)
endif()


find_package(catkin REQUIRED COMPONENTS libphidget21 phidgets_api roscpp std_msgs message_generation sensor_msgs)

add_message_files(
FILES
EncoderDecimatedSpeed.msg
)

generate_messages(
DEPENDENCIES
std_msgs
)

catkin_package(
CATKIN_DEPENDS libphidget21 phidgets_api roscpp std_msgs message_runtime sensor_msgs
)

include_directories(${catkin_INCLUDE_DIRS})

add_executable(${PROJECT_NAME} src/phidgets_high_speed_encoder.cpp)
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES})
add_dependencies(${PROJECT_NAME} ${catkin_EXPORTED_TARGETS})
add_dependencies(phidgets_high_speed_encoder phidgets_high_speed_encoder_generate_messages)

install(TARGETS phidgets_high_speed_encoder
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
4 changes: 4 additions & 0 deletions phidgets_high_speed_encoder/msg/EncoderDecimatedSpeed.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Encoder averaged speed for a channel in a Phidgets High-Speed Encoder board
Header header
# Averaged (sliding window) speed estimation [rad/s]
float64 avr_speed
30 changes: 30 additions & 0 deletions phidgets_high_speed_encoder/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<package>
<name>phidgets_high_speed_encoder</name>
<version>0.7.3</version>
<description>Driver for the Phidgets high speed encoder devices</description>

<maintainer email="geoffrey.viola@asirobots.com">Geoff Viola</maintainer>
<maintainer email="jlblanco@ual.es">José-Luis Blanco Claraco</maintainer>

<license>BSD</license>

<author email="geoffrey.viola@asirobots.com">Geoff Viola</author>

<buildtool_depend>catkin</buildtool_depend>
<build_depend>libphidget21</build_depend>
<build_depend>phidgets_api</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>sensor_msgs</build_depend>
<run_depend>libphidget21</run_depend>
<run_depend>phidgets_api</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>message_runtime</run_depend>
<run_depend>sensor_msgs</run_depend>

<export>
</export>
</package>
Loading

0 comments on commit 7394959

Please sign in to comment.