7 #ifndef __CANBUSSKIN_H__
8 #define __CANBUSSKIN_H__
13 #include <yarp/os/PeriodicThread.h>
14 #include <yarp/dev/ControlBoardInterfaces.h>
15 #include <yarp/dev/IAnalogSensor.h>
16 #include <yarp/dev/PolyDriver.h>
17 #include <yarp/dev/CanBusInterface.h>
18 #include <yarp/sig/Vector.h>
19 #include <yarp/os/BufferedPort.h>
26 class CanBusSkin :
public yarp::os::PeriodicThread,
public yarp::dev::IAnalogSensor,
public yarp::dev::DeviceDriver
36 yarp::os::Bottle msg4C_Timer;
37 yarp::os::Bottle msg4C_CDCOffsetL;
38 yarp::os::Bottle msg4C_CDCOffsetH;
39 yarp::os::Bottle msg4C_TimeL;
40 yarp::os::Bottle msg4C_TimeH;
43 yarp::os::Bottle msg4E_Shift;
44 yarp::os::Bottle msg4E_Shift3_1;
45 yarp::os::Bottle msg4E_NoLoad;
46 yarp::os::Bottle msg4E_Param;
47 yarp::os::Bottle msg4E_EnaL;
48 yarp::os::Bottle msg4E_EnaH;
52 yarp::os::BufferedPort<yarp::sig::Vector> portSkinDiagnosticsOut;
63 bool _isDiagnosticPresent;
84 yarp::sig::VectorOf<iCub::skin::diagnostics::DetectedError>
errors;
90 virtual bool open(yarp::os::Searchable& config);
97 virtual int read(yarp::sig::Vector &
out);
112 bool diagnoseSkin(
void);
123 void checkParameterListLength(
const std::string &i_paramName, yarp::os::Bottle &i_paramList,
const int &i_length,
const yarp::os::Value &i_defaultValue);
128 bool sendCANMessage4C(
void);
129 bool checkFirmwareVersion(
void);
134 bool sendCANMessage4E(
void);
139 bool sendCANMessage(uint8_t destAddr, uint8_t command,
void *
data);
144 bool readOldConfiguration(yarp::os::Searchable& config);
149 bool readNewConfiguration(yarp::os::Searchable& config);
154 bool readNewSpecialConfiguration(yarp::os::Searchable& config);
virtual int getState(int ch)
yarp::sig::VectorOf< iCub::skin::diagnostics::DetectedError > errors
The detected skin errors.
virtual void threadRelease()
yarp::dev::CanBuffer inBuffer
yarp::sig::VectorOf< int > cardId
yarp::dev::CanBuffer outBuffer
yarp::dev::ICanBufferFactory * pCanBufferFactory
virtual bool threadInit()
yarp::dev::ICanBus * pCanBus
virtual int getChannels()
virtual int read(yarp::sig::Vector &out)
yarp::dev::PolyDriver driver
virtual bool open(yarp::os::Searchable &config)
virtual int calibrateSensor()
virtual int calibrateChannel(int ch, double v)