7 #ifndef __CANBUSINERTIALMTB_H__
8 #define __CANBUSINERTIALMTB_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>
19 using namespace yarp::os;
60 class CanBusInertialMTB :
public PeriodicThread,
public yarp::dev::IAnalogSensor,
public DeviceDriver
66 bool validateConf(yarp::os::Searchable& config,
67 std::vector<int> & canAddresses);
69 void setPrivateBoardStatus(
int boardIndex,
short status);
70 void setPrivateBoardAccStatus(
int boardIndex,
short status);
71 void setPrivateBoardGyroStatus(
int boardIndex,
short status);
83 std::vector<MTBInertialBoardInfo>
boards;
107 virtual bool open(yarp::os::Searchable& config);
108 virtual bool close();
111 virtual int read(yarp::sig::Vector &
out);
112 virtual int getState(
int ch);
113 virtual int getChannels();
114 int calibrateSensor();
115 virtual int calibrateChannel(
int ch,
double v);
117 virtual int calibrateSensor(
const yarp::sig::Vector& v);
118 virtual int calibrateChannel(
int ch);
120 virtual bool threadInit();
121 virtual void threadRelease();
canbusinertialmtb : driver for CAN communication with inertial sensors (accelerometers,...
std::vector< short > sharedStatus
std::vector< short > privateStatus
ICanBufferFactory * pCanBufferFactory
short privateGlobalStatus
std::vector< MTBInertialBoardInfo > boards
yarp::sig::Vector privateData
CanBusInertialMTB(int period=20)
bool read(yarp::os::Searchable &cfgtotal, pc104Data &pc104data)
unsigned char enabledSensors
unsigned char sensorPeriod
unsigned int vectorOffset
offset of the board data in the output vector
unsigned int nrOfChannels
6 if extAccAndGyro, 3 if acc