iCub-main
embObjFTsensor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  * Author: Valentina Gaggero
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
23 #ifndef __embObjFTsensor_h__
24 #define __embObjFTsensor_h__
25 
26 #include <yarp/dev/DeviceDriver.h>
27 #include "IethResource.h"
28 
29 #include <yarp/dev/MultipleAnalogSensorsInterfaces.h>
30 
31 
32 namespace yarp {
33  namespace dev {
34  class embObjFTsensor;
35  }
36 }
37 
38 
39 #define EMBOBJSTRAIN_USESERVICEPARSER
40 
41 // -- class embObjFTsensor
42 
43 class yarp::dev::embObjFTsensor: public yarp::dev::DeviceDriver,
44  public eth::IethResource,
45  public yarp::dev::ITemperatureSensors,
46  public yarp::dev::ISixAxisForceTorqueSensors
47 {
48 public:
49 
52 
53  // An open function yarp factory compatible
54  bool open(yarp::os::Searchable &config);
55  bool close();
56 
57  // IethResource interface
58  virtual bool initialised();
59  virtual eth::iethresType_t type();
60  virtual bool update(eOprotID32_t id32, double timestamp, void* rxdata);
61 
62  // ITemperatureSensors
63  virtual size_t getNrOfTemperatureSensors() const override;
64  virtual yarp::dev::MAS_status getTemperatureSensorStatus(size_t sens_index) const override;
65  virtual bool getTemperatureSensorName(size_t sens_index, std::string &name) const override;
66  virtual bool getTemperatureSensorFrameName(size_t sens_index, std::string &frameName) const override;
67  virtual bool getTemperatureSensorMeasure(size_t sens_index, double& out, double& timestamp) const override;
68  virtual bool getTemperatureSensorMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
69 
70  // ISixAxisForceTorqueSensors
71  virtual size_t getNrOfSixAxisForceTorqueSensors() const override;
72  virtual yarp::dev::MAS_status getSixAxisForceTorqueSensorStatus(size_t sens_index) const override;
73  virtual bool getSixAxisForceTorqueSensorName(size_t sens_index, std::string &name) const override;
74  virtual bool getSixAxisForceTorqueSensorFrameName(size_t sens_index, std::string &frameName) const override;
75  virtual bool getSixAxisForceTorqueSensorMeasure(size_t sens_index, yarp::sig::Vector& out, double& timestamp) const override;
76 
77 
78 private:
79  void *mPriv;
80 
81  void cleanup(void);
82  std::string getBoardInfo(void) const;
83  bool updateStrainValues(eOprotID32_t id32, double timestamp, void* rxdata);
84  bool updateTemperatureValues(eOprotID32_t id32, double timestamp, void* rxdata);
85 
86  void resetCounters();
87  void getCounters(unsigned int &saturations, unsigned int &errors, unsigned int &timeouts);
88  bool enableTemperatureTransmission(bool enable);
89 };
90 
91 
92 #endif
93 
virtual bool getTemperatureSensorFrameName(size_t sens_index, std::string &frameName) const override
bool open(yarp::os::Searchable &config)
virtual size_t getNrOfTemperatureSensors() const override
virtual size_t getNrOfSixAxisForceTorqueSensors() const override
virtual bool update(eOprotID32_t id32, double timestamp, void *rxdata)
virtual eth::iethresType_t type()
virtual bool getSixAxisForceTorqueSensorFrameName(size_t sens_index, std::string &frameName) const override
virtual bool getTemperatureSensorName(size_t sens_index, std::string &name) const override
virtual yarp::dev::MAS_status getSixAxisForceTorqueSensorStatus(size_t sens_index) const override
virtual bool getTemperatureSensorMeasure(size_t sens_index, double &out, double &timestamp) const override
virtual bool getSixAxisForceTorqueSensorName(size_t sens_index, std::string &name) const override
virtual yarp::dev::MAS_status getTemperatureSensorStatus(size_t sens_index) const override
virtual bool getSixAxisForceTorqueSensorMeasure(size_t sens_index, yarp::sig::Vector &out, double &timestamp) const override
iethresType_t
Definition: IethResource.h:62
Copyright (C) 2008 RobotCub Consortium.
out
Definition: sine.m:8