3 #ifndef __PHIDGET_SPATIAL_HPP__
4 #define __PHIDGET_SPATIAL_HPP__
6 #include <yarp/os/all.h>
7 #include <yarp/dev/Drivers.h>
8 #include <yarp/dev/PolyDriver.h>
9 #include <yarp/dev/IAnalogSensor.h>
14 #include <phidget21.h>
30 public yarp::dev::IAnalogSensor
40 bool open(yarp::os::Searchable& config)
override;
41 bool close()
override;
55 int read(yarp::sig::Vector &out)
override;
109 static int AttachHandler(CPhidgetHandle ENC,
void *userptr);
110 static int DetachHandler(CPhidgetHandle ENC,
void *userptr);
111 static int ErrorHandler(CPhidgetHandle ENC,
void *userptr,
int ErrorCode,
const char *Description);
112 static int SpatialDataHandler(CPhidgetSpatialHandle spatial,
void *userptr, CPhidgetSpatial_SpatialEventDataHandle *data,
int count);
113 int display_properties(CPhidgetSpatialHandle phid);
120 CPhidgetSpatialHandle hSpatial0;
121 yarp::os::Semaphore hSemaphore;
122 double acceleration[3];
123 double angularRate[3];
124 double magneticField[3];
Implementation of a Phidgets device.
Definition: PhidgetSpatial.hpp:31
~PhidgetSpatial() override=default
bool open(yarp::os::Searchable &config) override
Definition: DeviceDriverImpl.cpp:9
int getState(int ch) override
Definition: IAnalogSensorImpl.cpp:52
int calibrateSensor() override
Definition: IAnalogSensorImpl.cpp:66
int getChannels() override
Definition: IAnalogSensorImpl.cpp:59
static int SpatialDataHandler(CPhidgetSpatialHandle spatial, void *userptr, CPhidgetSpatial_SpatialEventDataHandle *data, int count)
Definition: PhidgetSpatial.cpp:58
int read(yarp::sig::Vector &out) override
Definition: IAnalogSensorImpl.cpp:11
int calibrateChannel(int ch) override
Definition: IAnalogSensorImpl.cpp:80
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:6