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
12namespace yarp::dev {
13class IControlModeRaw;
14class IControlMode;
15}
16
23{
24public:
25 virtual ~IControlMode(){}
26
33 virtual bool getControlMode(int j, int *mode)=0;
34
40 virtual bool getControlModes(int *modes)=0;
41
54 virtual bool getControlModes(const int n_joint, const int *joints, int *modes)=0;
55
63 virtual bool setControlMode(const int j, const int mode)=0;
64
79 virtual bool setControlModes(const int n_joint, const int *joints, int *modes)=0;
80
88 virtual bool setControlModes(int *modes)=0;
89};
90
91
99{
100public:
102 virtual bool getControlModeRaw(int j, int *mode)=0;
103 virtual bool getControlModesRaw(int* modes)=0;
104 virtual bool getControlModesRaw(const int n_joint, const int *joints, int *modes)=0;
105 virtual bool setControlModeRaw(const int j, const int mode)=0;
106 virtual bool setControlModesRaw(const int n_joint, const int *joints, int *modes)=0;
107 virtual bool setControlModesRaw(int *modes)=0;
108};
109
110
111// new style VOCABS
112// Interface
114// Methods
118
119// Values
120// Read / Write
130
131// Values
132// Read / Write
134
135// Write only (only from high level toward the joint)
137
138// Read only (imposed by the board on special events)
140constexpr yarp::conf::vocab32_t VOCAB_CM_CALIBRATING = yarp::os::createVocab32('c','a','l'); // the joint is calibrating
141constexpr yarp::conf::vocab32_t VOCAB_CM_CALIB_DONE = yarp::os::createVocab32('c','a','l','d'); // calibration successfully completed
142constexpr yarp::conf::vocab32_t VOCAB_CM_NOT_CONFIGURED = yarp::os::createVocab32('c','f','g','n'); // missing initial configuration (default value at start-up)
143constexpr yarp::conf::vocab32_t VOCAB_CM_CONFIGURED = yarp::os::createVocab32('c','f','g','y'); // initial configuration completed, if any
144
145// Read only (cannot be set from user)
147
148#endif // YARP_DEV_ICONTROLMODE_H
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE_GROUP
Definition: IControlMode.h:116
constexpr yarp::conf::vocab32_t VOCAB_CM_UNKNOWN
Definition: IControlMode.h:146
constexpr yarp::conf::vocab32_t VOCAB_CM_MIXED
Definition: IControlMode.h:133
constexpr yarp::conf::vocab32_t VOCAB_CM_TORQUE
Definition: IControlMode.h:122
constexpr yarp::conf::vocab32_t VOCAB_CM_PWM
Definition: IControlMode.h:127
constexpr yarp::conf::vocab32_t VOCAB_CM_HW_FAULT
Definition: IControlMode.h:139
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_VEL
Definition: IControlMode.h:129
constexpr yarp::conf::vocab32_t VOCAB_CM_IDLE
Definition: IControlMode.h:121
constexpr yarp::conf::vocab32_t VOCAB_CM_CALIB_DONE
Definition: IControlMode.h:141
constexpr yarp::conf::vocab32_t VOCAB_CM_NOT_CONFIGURED
Definition: IControlMode.h:142
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION
Definition: IControlMode.h:123
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODES
Definition: IControlMode.h:117
constexpr yarp::conf::vocab32_t VOCAB_CM_CONFIGURED
Definition: IControlMode.h:143
constexpr yarp::conf::vocab32_t VOCAB_CM_CURRENT
Definition: IControlMode.h:126
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_POS
Definition: IControlMode.h:128
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE
Definition: IControlMode.h:115
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION_DIRECT
Definition: IControlMode.h:124
constexpr yarp::conf::vocab32_t VOCAB_ICONTROLMODE
Definition: IControlMode.h:113
constexpr yarp::conf::vocab32_t VOCAB_CM_VELOCITY
Definition: IControlMode.h:125
constexpr yarp::conf::vocab32_t VOCAB_CM_FORCE_IDLE
Definition: IControlMode.h:136
constexpr yarp::conf::vocab32_t VOCAB_CM_CALIBRATING
Definition: IControlMode.h:140
Interface for setting control mode in control board.
Definition: IControlMode.h:99
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:23
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
For streams capable of holding different kinds of content, check what they actually have.
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:27
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18