Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Phidgets high-speed encoder ROS node #15

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
371446c
added new phidgets_high_speed_encoder package
May 24, 2016
09fcc08
deleted unnecessary print CMakeLists
May 24, 2016
4e38b30
cleaned up message generation stuff and bogus installation
May 24, 2016
c8b6c3c
removed frequency customization
May 25, 2016
05a4aa2
renamed node with phidgets_
May 25, 2016
400e92a
populate the header
May 26, 2016
cb616b5
reformatted and added print at startup
May 27, 2016
898198c
using ROS installed phidgets API
Jun 8, 2016
917b4ec
initial attempts at addressing code review
Nov 24, 2016
7e568c0
Update README: nodes, git branch is now master
jlblancoc Aug 7, 2017
bc1e340
Update README.md
jlblancoc Aug 7, 2017
df14dd6
Improvements to high-speed encoder node:
jlblancoc Aug 7, 2017
aab6055
Merge branch 'master' of github.com:ual-arm-ros-pkg/phidgets_drivers
jlblancoc Aug 7, 2017
942473e
Fix typo in ROS_INFO()
jlblancoc Aug 9, 2017
1d76543
Fix instantaneous speed must be reset to zero
jlblancoc Aug 9, 2017
f8370c7
Merge branch 'master' into kinetic
jlblancoc Aug 9, 2017
af69322
Update README.md
jlblancoc Aug 9, 2017
2a6dd93
fix catkin build deps
jlblancoc Aug 9, 2017
f1faa43
add phidgets_high_speed_encoder to metapackage
jlblancoc Aug 18, 2017
e9d8229
typo and doxygen docs
jlblancoc Aug 20, 2017
8297bed
Rewrite encoder node to use phidgets::Encoder
jlblancoc Aug 20, 2017
237d983
enable and fix -Wall warnings
jlblancoc Aug 20, 2017
12e7752
Port to use JointState msgs
jlblancoc Sep 30, 2017
e45a848
msg: "effort" should be empty if not used
jlblancoc Oct 2, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ Drivers for the Phidgets devices. This Catkin metapackage includes:
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_ir`
* `phidgets_high_speed_encoder`

Installing
---------------------------------------------
Expand All @@ -33,17 +34,18 @@ a `src/` folder within it, then execute:

cd ~/catkin_ws/src

Download the metapackage from the github repository (<ros_distro> may be `groovy`, `hydro`, `indigo`...):
#### Install ROS wrapper for Phidgets driver ####

git clone -b <ros_distro> https://github.com/ros-drivers/phidgets_drivers.git
Install dependencies:

Install dependencies using rosdep:
sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev

rosdep install phidgets_drivers
#### Build this package ####

Alternatively, if rosdep does not work, install the following packages:
Download the package from GitHub:

sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev
cd ~/catkin_ws/src
git clone -b $ROS_DISTRO https://github.com/ros-drivers/phidgets_drivers.git

Compile your catkin workspace:

Expand Down
41 changes: 41 additions & 0 deletions phidgets_high_speed_encoder/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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 ()

find_package(catkin REQUIRED COMPONENTS phidgets_api roscpp std_msgs message_generation)

add_message_files(
FILES
EncoderParams.msg
EncoderDecimatedSpeed.msg
)

generate_messages(
DEPENDENCIES
std_msgs
)

catkin_package(
CATKIN_DEPENDS phidgets_api roscpp std_msgs message_runtime
)

include_directories(${catkin_INCLUDE_DIRS})

add_executable(phidgets_high_speed_encoder src/phidgets_high_speed_encoder.cpp)
target_link_libraries(phidgets_high_speed_encoder ${catkin_LIBRARIES})
add_dependencies(phidgets_high_speed_encoder ${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 one channel in a Phidgets High-Speed Encoder board
Header header
# Averaged (sliding window) speed estimation [ticks/s]
float64 speed
7 changes: 7 additions & 0 deletions phidgets_high_speed_encoder/msg/EncoderParams.msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Encoder status for one channel in a Phidgets High-Speed Encoder board.
Header header
# Tick count (position) for this encoder channel
int32 count
# Instantaneous speed estimation [ticks/s].
# See also: EncoderDecimatedSpeed
float64 inst_vel
26 changes: 26 additions & 0 deletions phidgets_high_speed_encoder/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<package>
<name>phidgets_high_speed_encoder</name>
<version>0.2.2</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>phidgets_api</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>message_generation</build_depend>
<run_depend>phidgets_api</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>message_runtime</run_depend>

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