7#ifndef __CANBUSANALOGSENSOR_H__
8#define __CANBUSANALOGSENSOR_H__
11#include <yarp/os/PeriodicThread.h>
12#include <yarp/dev/IAnalogSensor.h>
13#include <yarp/dev/PolyDriver.h>
14#include <yarp/dev/CanBusInterface.h>
15#include <yarp/sig/Vector.h>
17using namespace yarp::os;
42class CanBusAnalogSensor :
public PeriodicThread,
public yarp::dev::IAnalogSensor,
public DeviceDriver
46 ANALOG_FORMAT_ERR = 0,
47 ANALOG_FORMAT_8_BIT = 8,
48 ANALOG_FORMAT_16_BIT = 16,
55 ANALOG_NOT_RESPONDING=-1,
89 virtual bool open(yarp::os::Searchable& config);
94 virtual int read(yarp::sig::Vector &
out);
109 bool decode8 (
const unsigned char *msg,
int msg_id,
double *
data);
110 bool decode16(
const unsigned char *msg,
int msg_id,
double *
data);
111 bool sensor_start (yarp::os::Searchable& config);
113 bool readFullScaleAnalog(
int ch);
canbusanalogsensor : driver for CAN communication with IIT's analog sensor boards,...
ICanBufferFactory * pCanBufferFactory
yarp::sig::Vector scaleFactor
AnalogDataFormat dataFormat
CanBusAnalogSensor(int period=20)
virtual int getChannels()
virtual void threadRelease()
unsigned short useCalibration
virtual bool open(yarp::os::Searchable &config)
virtual bool threadInit()
virtual int getState(int ch)
virtual int calibrateChannel(int ch, double v)
virtual int read(yarp::sig::Vector &out)