yarp-devices
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
roboticslab::PhidgetSpatial Class Reference

Implementation of a Phidgets device.

#include <PhidgetSpatial.hpp>

Inheritance diagram for roboticslab::PhidgetSpatial:

Public Member Functions

bool open (yarp::os::Searchable &config) override
 
bool close () override
 
 ~PhidgetSpatial () override=default
 
int read (yarp::sig::Vector &out) override
 
int getState (int ch) override
 
int getChannels () override
 
int calibrateSensor () override
 
int calibrateSensor (const yarp::sig::Vector &value) override
 
int calibrateChannel (int ch) override
 
int calibrateChannel (int ch, double value) override
 
int display_properties (CPhidgetSpatialHandle phid)
 

Static Public Member Functions

static int AttachHandler (CPhidgetHandle ENC, void *userptr)
 
static int DetachHandler (CPhidgetHandle ENC, void *userptr)
 
static int ErrorHandler (CPhidgetHandle ENC, void *userptr, int ErrorCode, const char *Description)
 
static int SpatialDataHandler (CPhidgetSpatialHandle spatial, void *userptr, CPhidgetSpatial_SpatialEventDataHandle *data, int count)
 

Private Attributes

CPhidgetSpatialHandle hSpatial0
 
yarp::os::Semaphore hSemaphore
 
double acceleration [3]
 
double angularRate [3]
 
double magneticField [3]
 

Constructor & Destructor Documentation

◆ ~PhidgetSpatial()

roboticslab::PhidgetSpatial::~PhidgetSpatial ( )
overridedefault

Destructor.

Member Function Documentation

◆ calibrateChannel() [1/2]

int PhidgetSpatial::calibrateChannel ( int  ch)
override

Calibrates one single channel.

Parameters
chchannel number.
Returns
status.

◆ calibrateChannel() [2/2]

int PhidgetSpatial::calibrateChannel ( int  ch,
double  value 
)
override

Calibrates one single channel, using a calibration value.

Parameters
chchannel number.
valuecalibration value.
Returns
status.

◆ calibrateSensor() [1/2]

int PhidgetSpatial::calibrateSensor ( )
override

Calibrates the whole sensor.

Returns
status.

◆ calibrateSensor() [2/2]

int PhidgetSpatial::calibrateSensor ( const yarp::sig::Vector &  value)
override

Calibrates the whole sensor, using an vector of calibration values.

Parameters
valuea vector of calibration values.
Returns
status.

◆ getChannels()

int PhidgetSpatial::getChannels ( )
override

Get the number of channels of the sensor.

Returns
number of channels (0 in case of errors).

◆ getState()

int PhidgetSpatial::getState ( int  ch)
override

Check the state value of a given channel.

Parameters
chchannel number.
Returns
status.

◆ open()

bool PhidgetSpatial::open ( yarp::os::Searchable &  config)
override

Open the DeviceDriver.

Returns
true/false upon success/failure

◆ read()

int PhidgetSpatial::read ( yarp::sig::Vector &  out)
override

Read a vector from the sensor.

Parameters
outa vector containing the sensor's last readings.
Returns
AS_OK or return code. AS_TIMEOUT if the sensor timed-out.

◆ SpatialDataHandler()

int PhidgetSpatial::SpatialDataHandler ( CPhidgetSpatialHandle  spatial,
void *  userptr,
CPhidgetSpatial_SpatialEventDataHandle *  data,
int  count 
)
static

printf("Number of Data Packets in this event: %d\n", count);

printf("---------------------------------------------\n");


The documentation for this class was generated from the following files: