YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
constexpr yarp::conf::vocab32_t VOCAB_CM_UNKNOWN
constexpr yarp::conf::vocab32_t VOCAB_CM_MIXED
constexpr yarp::conf::vocab32_t VOCAB_CM_TORQUE
constexpr yarp::conf::vocab32_t VOCAB_CM_PWM
constexpr yarp::conf::vocab32_t VOCAB_CM_HW_FAULT
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_VEL
constexpr yarp::conf::vocab32_t VOCAB_CM_IDLE
constexpr yarp::conf::vocab32_t VOCAB_CM_CALIB_DONE
constexpr yarp::conf::vocab32_t VOCAB_CM_NOT_CONFIGURED
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODES
constexpr yarp::conf::vocab32_t VOCAB_CM_CONFIGURED
constexpr yarp::conf::vocab32_t VOCAB_CM_CURRENT
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_POS
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION_DIRECT
constexpr yarp::conf::vocab32_t VOCAB_ICONTROLMODE
constexpr yarp::conf::vocab32_t VOCAB_CM_VELOCITY
constexpr yarp::conf::vocab32_t VOCAB_CM_FORCE_IDLE
constexpr yarp::conf::vocab32_t VOCAB_CM_CALIBRATING
Interface for setting control mode in control board.
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.
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.
Definition jointData.cpp:13
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