YARP
Yet Another Robot Platform
IControlMode.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
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 
9 #ifndef YARP_DEV_ICONTROLMODE_H
10 #define YARP_DEV_ICONTROLMODE_H
11 
12 #include <yarp/os/Vocab.h>
13 #include <yarp/dev/api.h>
14 
15 namespace yarp {
16  namespace dev {
17  class IControlModeRaw;
18  class IControlMode;
19  }
20 }
21 
28 {
29 public:
30  virtual ~IControlMode(){}
31 
38  virtual bool getControlMode(int j, int *mode)=0;
39 
45  virtual bool getControlModes(int *modes)=0;
46 
59  virtual bool getControlModes(const int n_joint, const int *joints, int *modes)=0;
60 
68  virtual bool setControlMode(const int j, const int mode)=0;
69 
84  virtual bool setControlModes(const int n_joint, const int *joints, int *modes)=0;
85 
93  virtual bool setControlModes(int *modes)=0;
94 };
95 
96 
104 {
105 public:
106  virtual ~IControlModeRaw(){}
107  virtual bool getControlModeRaw(int j, int *mode)=0;
108  virtual bool getControlModesRaw(int* modes)=0;
109  virtual bool getControlModesRaw(const int n_joint, const int *joints, int *modes)=0;
110  virtual bool setControlModeRaw(const int j, const int mode)=0;
111  virtual bool setControlModesRaw(const int n_joint, const int *joints, int *modes)=0;
112  virtual bool setControlModesRaw(int *modes)=0;
113 };
114 
115 
116 // new style VOCABS
117 // Interface
119 // Methods
123 
124 // Values
125 // Read / Write
133 constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_POS = yarp::os::createVocab('i','m','p','o'); // deprecated
134 constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_VEL = yarp::os::createVocab('i','m','v','e'); // deprecated
135 
136 // Values
137 // Read / Write
139 
140 // Write only (only from high level toward the joint)
142 
143 // Read only (imposed by the board on special events)
145 constexpr yarp::conf::vocab32_t VOCAB_CM_CALIBRATING = yarp::os::createVocab('c','a','l'); // the joint is calibrating
146 constexpr yarp::conf::vocab32_t VOCAB_CM_CALIB_DONE = yarp::os::createVocab('c','a','l','d'); // calibration successfully completed
147 constexpr yarp::conf::vocab32_t VOCAB_CM_NOT_CONFIGURED = yarp::os::createVocab('c','f','g','n'); // missing initial configuration (default value at start-up)
148 constexpr yarp::conf::vocab32_t VOCAB_CM_CONFIGURED = yarp::os::createVocab('c','f','g','y'); // initial configuration completed, if any
149 
150 // Read only (cannot be set from user)
152 
153 #endif // YARP_DEV_ICONTROLMODE_H
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION_DIRECT
Definition: IControlMode.h:129
#define YARP_dev_API
Definition: api.h:19
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODES
Definition: IControlMode.h:122
constexpr yarp::conf::vocab32_t VOCAB_CM_CURRENT
Definition: IControlMode.h:131
constexpr yarp::conf::vocab32_t VOCAB_CM_PWM
Definition: IControlMode.h:132
std::int32_t vocab32_t
Definition: numeric.h:52
The main, catch-all namespace for YARP.
Definition: numeric.h:47
Interface for setting control mode in control board.
Definition: IControlMode.h:27
constexpr yarp::conf::vocab32_t VOCAB_CM_MIXED
Definition: IControlMode.h:138
constexpr yarp::conf::vocab32_t VOCAB_CM_HW_FAULT
Definition: IControlMode.h:144
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE_GROUP
Definition: IControlMode.h:121
constexpr yarp::conf::vocab32_t VOCAB_CM_UNKNOWN
Definition: IControlMode.h:151
constexpr yarp::conf::vocab32_t VOCAB_CM_TORQUE
Definition: IControlMode.h:127
constexpr yarp::conf::vocab32_t VOCAB_ICONTROLMODE
Definition: IControlMode.h:118
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_POS
Definition: IControlMode.h:133
constexpr yarp::conf::vocab32_t VOCAB_CM_VELOCITY
Definition: IControlMode.h:130
Interface for setting control mode in control board.
Definition: IControlMode.h:103
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
constexpr yarp::conf::vocab32_t VOCAB_CM_CALIBRATING
Definition: IControlMode.h:145
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_VEL
Definition: IControlMode.h:134
constexpr yarp::conf::vocab32_t VOCAB_CM_FORCE_IDLE
Definition: IControlMode.h:141
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE
Definition: IControlMode.h:120
constexpr yarp::conf::vocab32_t VOCAB_CM_CONFIGURED
Definition: IControlMode.h:148
constexpr yarp::conf::vocab32_t VOCAB_CM_CALIB_DONE
Definition: IControlMode.h:146
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION
Definition: IControlMode.h:128
constexpr yarp::conf::vocab32_t VOCAB_CM_IDLE
Definition: IControlMode.h:126
constexpr yarp::conf::vocab32_t VOCAB_CM_NOT_CONFIGURED
Definition: IControlMode.h:147