YARP
Yet Another Robot Platform
IControlMode.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef YARP_DEV_ICONTROLMODE_H
7 #define YARP_DEV_ICONTROLMODE_H
8 
9 #include <yarp/os/Vocab.h>
10 #include <yarp/dev/api.h>
11 
12 namespace yarp {
13  namespace dev {
14  class IControlModeRaw;
15  class IControlMode;
16  }
17 }
18 
25 {
26 public:
27  virtual ~IControlMode(){}
28 
35  virtual bool getControlMode(int j, int *mode)=0;
36 
42  virtual bool getControlModes(int *modes)=0;
43 
56  virtual bool getControlModes(const int n_joint, const int *joints, int *modes)=0;
57 
65  virtual bool setControlMode(const int j, const int mode)=0;
66 
81  virtual bool setControlModes(const int n_joint, const int *joints, int *modes)=0;
82 
90  virtual bool setControlModes(int *modes)=0;
91 };
92 
93 
101 {
102 public:
103  virtual ~IControlModeRaw(){}
104  virtual bool getControlModeRaw(int j, int *mode)=0;
105  virtual bool getControlModesRaw(int* modes)=0;
106  virtual bool getControlModesRaw(const int n_joint, const int *joints, int *modes)=0;
107  virtual bool setControlModeRaw(const int j, const int mode)=0;
108  virtual bool setControlModesRaw(const int n_joint, const int *joints, int *modes)=0;
109  virtual bool setControlModesRaw(int *modes)=0;
110 };
111 
112 
113 // new style VOCABS
114 // Interface
116 // Methods
120 
121 // Values
122 // Read / Write
130 constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_POS = yarp::os::createVocab32('i','m','p','o'); // deprecated
131 constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_VEL = yarp::os::createVocab32('i','m','v','e'); // deprecated
132 
133 // Values
134 // Read / Write
136 
137 // Write only (only from high level toward the joint)
139 
140 // Read only (imposed by the board on special events)
142 constexpr yarp::conf::vocab32_t VOCAB_CM_CALIBRATING = yarp::os::createVocab32('c','a','l'); // the joint is calibrating
143 constexpr yarp::conf::vocab32_t VOCAB_CM_CALIB_DONE = yarp::os::createVocab32('c','a','l','d'); // calibration successfully completed
144 constexpr yarp::conf::vocab32_t VOCAB_CM_NOT_CONFIGURED = yarp::os::createVocab32('c','f','g','n'); // missing initial configuration (default value at start-up)
145 constexpr yarp::conf::vocab32_t VOCAB_CM_CONFIGURED = yarp::os::createVocab32('c','f','g','y'); // initial configuration completed, if any
146 
147 // Read only (cannot be set from user)
149 
150 #endif // YARP_DEV_ICONTROLMODE_H
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE_GROUP
Definition: IControlMode.h:118
constexpr yarp::conf::vocab32_t VOCAB_CM_UNKNOWN
Definition: IControlMode.h:148
constexpr yarp::conf::vocab32_t VOCAB_CM_MIXED
Definition: IControlMode.h:135
constexpr yarp::conf::vocab32_t VOCAB_CM_TORQUE
Definition: IControlMode.h:124
constexpr yarp::conf::vocab32_t VOCAB_CM_PWM
Definition: IControlMode.h:129
constexpr yarp::conf::vocab32_t VOCAB_CM_HW_FAULT
Definition: IControlMode.h:141
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_VEL
Definition: IControlMode.h:131
constexpr yarp::conf::vocab32_t VOCAB_CM_IDLE
Definition: IControlMode.h:123
constexpr yarp::conf::vocab32_t VOCAB_CM_CALIB_DONE
Definition: IControlMode.h:143
constexpr yarp::conf::vocab32_t VOCAB_CM_NOT_CONFIGURED
Definition: IControlMode.h:144
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION
Definition: IControlMode.h:125
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODES
Definition: IControlMode.h:119
constexpr yarp::conf::vocab32_t VOCAB_CM_CONFIGURED
Definition: IControlMode.h:145
constexpr yarp::conf::vocab32_t VOCAB_CM_CURRENT
Definition: IControlMode.h:128
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_POS
Definition: IControlMode.h:130
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE
Definition: IControlMode.h:117
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION_DIRECT
Definition: IControlMode.h:126
constexpr yarp::conf::vocab32_t VOCAB_ICONTROLMODE
Definition: IControlMode.h:115
constexpr yarp::conf::vocab32_t VOCAB_CM_VELOCITY
Definition: IControlMode.h:127
constexpr yarp::conf::vocab32_t VOCAB_CM_FORCE_IDLE
Definition: IControlMode.h:138
constexpr yarp::conf::vocab32_t VOCAB_CM_CALIBRATING
Definition: IControlMode.h:142
Interface for setting control mode in control board.
Definition: IControlMode.h:101
virtual bool getControlModeRaw(int j, int *mode)=0
virtual bool setControlModeRaw(const int j, const int mode)=0
virtual bool getControlModesRaw(const int n_joint, const int *joints, int *modes)=0
virtual bool setControlModesRaw(const int n_joint, const int *joints, int *modes)=0
virtual bool setControlModesRaw(int *modes)=0
virtual bool getControlModesRaw(int *modes)=0
Interface for setting control mode in control board.
Definition: IControlMode.h:25
virtual bool setControlMode(const int j, const int mode)=0
Set the current control mode.
virtual bool setControlModes(const int n_joint, const int *joints, int *modes)=0
Set the current control mode for a subset of axes.
virtual bool getControlModes(int *modes)=0
Get the current control mode (multiple joints).
virtual bool getControlMode(int j, int *mode)=0
Get the current control mode.
virtual bool getControlModes(const int n_joint, const int *joints, int *modes)=0
Get the current control mode for a subset of axes.
virtual bool setControlModes(int *modes)=0
Set the current control mode (multiple joints).
std::int32_t vocab32_t
Definition: numeric.h:78
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Definition: Vocab.h:28
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18