YARP
Yet Another Robot Platform
IControlMode.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 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
yarp::os::createVocab
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
VOCAB_CM_HW_FAULT
constexpr yarp::conf::vocab32_t VOCAB_CM_HW_FAULT
Definition: IControlMode.h:144
yarp::dev::IControlModeRaw::getControlModesRaw
virtual bool getControlModesRaw(int *modes)=0
VOCAB_CM_TORQUE
constexpr yarp::conf::vocab32_t VOCAB_CM_TORQUE
Definition: IControlMode.h:127
yarp::dev::IControlMode::getControlMode
virtual bool getControlMode(int j, int *mode)=0
Get the current control mode.
VOCAB_CM_IMPEDANCE_VEL
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_VEL
Definition: IControlMode.h:134
yarp::dev::IControlMode::setControlModes
virtual bool setControlModes(const int n_joint, const int *joints, int *modes)=0
Set the current control mode for a subset of axes.
yarp::dev::IControlMode::getControlModes
virtual bool getControlModes(int *modes)=0
Get the current control mode (multiple joints).
VOCAB_CM_CALIBRATING
constexpr yarp::conf::vocab32_t VOCAB_CM_CALIBRATING
Definition: IControlMode.h:145
yarp::dev::IControlModeRaw::getControlModesRaw
virtual bool getControlModesRaw(const int n_joint, const int *joints, int *modes)=0
VOCAB_CM_POSITION_DIRECT
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION_DIRECT
Definition: IControlMode.h:129
VOCAB_CM_POSITION
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION
Definition: IControlMode.h:128
yarp::dev::IControlModeRaw::setControlModeRaw
virtual bool setControlModeRaw(const int j, const int mode)=0
VOCAB_CM_FORCE_IDLE
constexpr yarp::conf::vocab32_t VOCAB_CM_FORCE_IDLE
Definition: IControlMode.h:141
VOCAB_CM_CONTROL_MODE
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE
Definition: IControlMode.h:120
yarp::dev::IControlModeRaw
Interface for setting control mode in control board.
Definition: IControlMode.h:104
VOCAB_CM_CALIB_DONE
constexpr yarp::conf::vocab32_t VOCAB_CM_CALIB_DONE
Definition: IControlMode.h:146
yarp::dev::IControlMode::setControlModes
virtual bool setControlModes(int *modes)=0
Set the current control mode (multiple joints).
yarp::dev::IControlMode
Interface for setting control mode in control board.
Definition: IControlMode.h:28
VOCAB_CM_CONFIGURED
constexpr yarp::conf::vocab32_t VOCAB_CM_CONFIGURED
Definition: IControlMode.h:148
VOCAB_CM_PWM
constexpr yarp::conf::vocab32_t VOCAB_CM_PWM
Definition: IControlMode.h:132
VOCAB_CM_NOT_CONFIGURED
constexpr yarp::conf::vocab32_t VOCAB_CM_NOT_CONFIGURED
Definition: IControlMode.h:147
VOCAB_CM_IDLE
constexpr yarp::conf::vocab32_t VOCAB_CM_IDLE
Definition: IControlMode.h:126
yarp::dev::IControlMode::getControlModes
virtual bool getControlModes(const int n_joint, const int *joints, int *modes)=0
Get the current control mode for a subset of axes.
yarp::dev::IControlModeRaw::~IControlModeRaw
virtual ~IControlModeRaw()
Definition: IControlMode.h:106
YARP_dev_API
#define YARP_dev_API
Definition: api.h:19
yarp::dev::IControlModeRaw::getControlModeRaw
virtual bool getControlModeRaw(int j, int *mode)=0
VOCAB_CM_CONTROL_MODES
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODES
Definition: IControlMode.h:122
VOCAB_CM_CURRENT
constexpr yarp::conf::vocab32_t VOCAB_CM_CURRENT
Definition: IControlMode.h:131
yarp::dev::IControlMode::setControlMode
virtual bool setControlMode(const int j, const int mode)=0
Set the current control mode.
VOCAB_CM_MIXED
constexpr yarp::conf::vocab32_t VOCAB_CM_MIXED
Definition: IControlMode.h:138
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::conf::vocab32_t
std::int32_t vocab32_t
Definition: numeric.h:52
yarp::dev::IControlModeRaw::setControlModesRaw
virtual bool setControlModesRaw(const int n_joint, const int *joints, int *modes)=0
Vocab.h
VOCAB_CM_UNKNOWN
constexpr yarp::conf::vocab32_t VOCAB_CM_UNKNOWN
Definition: IControlMode.h:151
VOCAB_CM_CONTROL_MODE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE_GROUP
Definition: IControlMode.h:121
yarp::dev::IControlModeRaw::setControlModesRaw
virtual bool setControlModesRaw(int *modes)=0
VOCAB_ICONTROLMODE
constexpr yarp::conf::vocab32_t VOCAB_ICONTROLMODE
Definition: IControlMode.h:118
api.h
yarp::dev::IControlMode::~IControlMode
virtual ~IControlMode()
Definition: IControlMode.h:30
VOCAB_CM_IMPEDANCE_POS
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_POS
Definition: IControlMode.h:133
VOCAB_CM_VELOCITY
constexpr yarp::conf::vocab32_t VOCAB_CM_VELOCITY
Definition: IControlMode.h:130