Show EOL distros:
Package Summary
This is an object oriented C++ wrapper for the Phidgets C API
- Author: Tully Foote, Ivan Dryanovski
- License: BSD
- Source: git https://github.com/ccny-ros-pkg/phidgets_drivers.git (branch: fuerte)
Package Summary
A C++ Wrapper for the Phidgets C API
- Maintainer: Murilo F. M. <muhrix AT gmail DOT com>, Ivan Dryanovski <ccnyroboticslab AT gmail DOT com>
- Author: Tully Foote, Ivan Dryanovski, Copyright (C) 2010 Phidgets Inc. <patrick AT phidgets DOT com>
- License: BSD, LGPLv3
- Source: git https://github.com/ccny-ros-pkg/phidgets_drivers.git (branch: groovy)
Package Summary
A C++ Wrapper for the Phidgets C API
- Maintainer status: maintained
- Maintainer: Murilo FM <muhrix AT gmail DOT com>
- Author: Tully Foote, Ivan Dryanovski
- License: BSD
- Source: git https://github.com/ccny-ros-pkg/phidgets_drivers.git (branch: hydro)
Package Summary
A C++ Wrapper for the Phidgets C API
- Maintainer status: maintained
- Maintainer: Martin Guenther <martin.guenther AT dfki DOT de>, Murilo FM <muhrix AT gmail DOT com>
- Author: Tully Foote, Ivan Dryanovski
- License: BSD
- Bug / feature tracker: https://github.com/ros-drivers/phidgets_drivers/issues
- Source: git https://github.com/ros-drivers/phidgets_drivers.git (branch: indigo)
Package Summary
A C++ Wrapper for the Phidgets C API
- Maintainer status: maintained
- Maintainer: Martin Guenther <martin.guenther AT dfki DOT de>, Murilo FM <muhrix AT gmail DOT com>
- Author: Tully Foote, Ivan Dryanovski
- License: BSD
- Bug / feature tracker: https://github.com/ros-drivers/phidgets_drivers/issues
- Source: git https://github.com/ros-drivers/phidgets_drivers.git (branch: jade)
Package Summary
A C++ Wrapper for the Phidgets C API
- Maintainer status: maintained
- Maintainer: Martin Günther <martin.guenther AT dfki DOT de>, Chris Lalancette <clalancette AT openrobotics DOT org>
- Author: Tully Foote, Ivan Dryanovski
- License: BSD
- Bug / feature tracker: https://github.com/ros-drivers/phidgets_drivers/issues
- Source: git https://github.com/ros-drivers/phidgets_drivers.git (branch: kinetic)
Package Summary
A C++ Wrapper for the Phidgets C API
- Maintainer status: developed
- Maintainer: Martin Guenther <martin.guenther AT dfki DOT de>, Murilo FM <muhrix AT gmail DOT com>
- Author: Tully Foote, Ivan Dryanovski
- License: BSD
- Bug / feature tracker: https://github.com/ros-drivers/phidgets_drivers/issues
- Source: git https://github.com/ros-drivers/phidgets_drivers.git (branch: lunar)
Package Summary
A C++ Wrapper for the Phidgets C API
- Maintainer status: maintained
- Maintainer: Martin Günther <martin.guenther AT dfki DOT de>, Chris Lalancette <clalancette AT openrobotics DOT org>
- Author: Tully Foote, Ivan Dryanovski
- License: BSD
- Bug / feature tracker: https://github.com/ros-drivers/phidgets_drivers/issues
- Source: git https://github.com/ros-drivers/phidgets_drivers.git (branch: melodic)
Package Summary
A C++ Wrapper for the Phidgets C API
- Maintainer status: developed
- Maintainer: Martin Günther <martin.guenther AT dfki DOT de>, Chris Lalancette <clalancette AT openrobotics DOT org>
- Author: Tully Foote, Ivan Dryanovski
- License: BSD
- Bug / feature tracker: https://github.com/ros-drivers/phidgets_drivers/issues
- Source: git https://github.com/ros-drivers/phidgets_drivers.git (branch: noetic)
Overview
The phidgets_api package contains a C++ API built on top of the phidgets_c_api package.
The package provides a base Phidget class, from which all other Phidgets inherit. Currently, we have implemented classes for the following devices:
* IMU sensor (PhidgetsSpatial 3/3/3)
* IR sensor (PhidgetIR)
Creating a class is fairly easy - feel free to request devices to be added to the stack. If you write a class for any device using the following example as reference and submit a patch, we'll add it to the package.
Example
In this example, we go through creating an IMU phidget using the C++ API.
We first define the Imu class, which is inherited from the base Phidget class:
1 class Imu: public Phidget
2 {
3 public:
4
5 Imu();
6
7 protected:
8
9 CPhidgetSpatialHandle imu_handle_;
10
11 void zero();
12 void setDataRate(int rate);
13
14 virtual void dataHandler(CPhidgetSpatial_SpatialEventDataHandle *data, int count);
15
16 private:
17
18 static int SpatialDataHandler(CPhidgetSpatialHandle spatial, void *userptr, CPhidgetSpatial_SpatialEventDataHandle *data, int count);
19 };
The Imu class has a CPhidgetSpatialHandle, which is a special handle for the Phidget Spatial device. Different devices will have different handle types.
The constructor needs to perform 4 operations:
- create the device-specific handle,
- pass the handle to the base class for intialization
- ask the base class to register common Phidget callbacks
- register IMU-specific callbacks
1 Imu::Imu(): Phidget(), imu_handle_(0)
2 {
3 // create the handle
4 CPhidgetSpatial_create(&imu_handle_);
5
6 // pass handle to base class
7 Phidget::init((CPhidgetHandle)imu_handle_);
8
9 // register base class callbacks
10 Phidget::registerHandlers();
11
12 // register imu data callback
13 CPhidgetSpatial_set_OnSpatialData_Handler(
14 imu_handle_, SpatialDataHandler, this);
15 }
The zero() and setDataRate functions implement sepcific calls to the IMU device using the C API. The data handler function receives spatial data events.
The SpatialDataHandler is a static callback function which forwards the data to the correct Imu class instance.
Finally, the virtual dataHandler function is the one which is called back when Spatial data arrives. In this example, the function just prints out a message. However, you can create a class which inherits from the Imu class and overwrites this behavior.
Bug Reports & Feature Requests
We appreciate the time and effort spent submitting bug reports and feature requests.
Please submit your tickets through github (requires github account) or by emailing the maintainers.