yarp-devices
Loading...
Searching...
No Matches
TextilesHand.hpp
1// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2
3#ifndef __TEXTILES_HAND_HPP__
4#define __TEXTILES_HAND_HPP__
5
6#include <yarp/dev/PolyDriver.h>
7#include <yarp/dev/DeviceDriver.h>
8#include <yarp/dev/IControlMode.h>
9#include <yarp/dev/IPositionDirect.h>
10#include <yarp/dev/ISerialDevice.h>
11
12#include "TextilesHand_ParamsParser.h"
13
24class TextilesHand : public yarp::dev::DeviceDriver,
25 public yarp::dev::IControlMode,
26 public yarp::dev::IPositionDirect,
28{
29public:
30 // --------- DeviceDriver Declarations. Implementation in DeviceDriverImpl.cpp ---------
31
32 bool open(yarp::os::Searchable & config) override;
33 bool close() override;
34
35 // --------- IControlMode Declarations. Implementation in IControlModeImpl.cpp ---------
36
37 bool getControlMode(int j, int * mode) override;
38 bool getControlModes(int * modes) override;
39 bool getControlModes(int n_joint, const int * joints, int * modes) override;
40 bool setControlMode(int j, int mode) override;
41 bool setControlModes(int * modes) override;
42 bool setControlModes(int n_joint, const int * joints, int * modes) override;
43
44 // ------- IPositionDirect declarations. Implementation in IPositionDirectImpl.cpp -------
45
46 bool getAxes(int * ax) override;
47 bool setPosition(int j, double ref) override;
48 bool setPositions(const double * refs) override;
49 bool setPositions(int n_joint, const int * joints, const double * refs) override;
50 bool getRefPosition(int joint, double * ref) override;
51 bool getRefPositions(double * refs) override;
52 bool getRefPositions(int n_joint, const int * joints, double * refs) override;
53
54private:
55 double lastTarget {0.0};
56
57 yarp::dev::PolyDriver serialDevice;
58 yarp::dev::ISerialDevice * iSerialDevice {nullptr};
59};
60
61#endif // __TEXTILES_HAND_HPP__
Definition TextilesHand_ParamsParser.h:42
Implementation for the custom UC3M Textiles Hand as a single CAN bus joint (control board raw interfa...
Definition TextilesHand.hpp:28