YARP
Yet Another Robot Platform
IAxisInfo.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARP_DEV_IAXISINFO_H
8#define YARP_DEV_IAXISINFO_H
9
10#include <string>
11
12#include <yarp/os/Log.h>
13#include <yarp/os/Vocab.h>
14#include <yarp/dev/api.h>
15
18namespace yarp::dev {
19class IAxisInfo;
20class IAxisInfoRaw;
21
23{
27};
28} // namespace yarp::dev
29
36{
37public:
41 virtual ~IAxisInfo() {}
42
49 virtual bool getAxes(int* ax) = 0;
50
51 /* Get the name for a particular axis.
52 * @param axis joint number
53 * @param name the axis name
54 * @return true if everything goes fine, false otherwise.
55 */
56 virtual bool getAxisName(int axis, std::string& name) = 0;
57
58 /* Get the joint type (e.g. revolute/prismatic) for a particular axis.
59 * @param axis joint number
60 * @param type the joint type
61 * @return true if everything goes fine, false otherwise.
62 */
63 virtual bool getJointType(int axis, yarp::dev::JointTypeEnum& type) { yFatal("getJointType() not implemented on your device, cannot proceed further. Please report the problem on yarp issue tracker"); return false; }
64};
65
70{
71public:
75 virtual ~IAxisInfoRaw() {}
76
83 virtual bool getAxes(int* ax) = 0;
84
85 /* Get the name for a particular axis.
86 * @param axis joint number
87 * @param name the axis name
88 * @return true if everything goes fine, false otherwise.
89 */
90 virtual bool getAxisNameRaw(int axis, std::string& name) = 0;
91
92 /* Get the joint type (e.g. revolute/prismatic) for a particular axis.
93 * @param axis joint number
94 * @param type the joint type
95 * @return true if everything goes fine, false otherwise.
96 */
97 virtual bool getJointTypeRaw(int axis, yarp::dev::JointTypeEnum& type) { yFatal("getJointType() not implemented on your device, cannot proceed further. Please report the problem on yarp issue tracker"); return false; };
98};
99
100// interface IAxisInfo
103
104#endif // YARP_DEV_IAXISINFO_H
constexpr yarp::conf::vocab32_t VOCAB_INFO_TYPE
Definition: IAxisInfo.h:102
constexpr yarp::conf::vocab32_t VOCAB_INFO_NAME
Definition: IAxisInfo.h:101
#define yFatal(...)
Definition: Log.h:377
Interface for getting information about specific axes, if available.
Definition: IAxisInfo.h:70
virtual bool getAxisNameRaw(int axis, std::string &name)=0
virtual ~IAxisInfoRaw()
Destructor.
Definition: IAxisInfo.h:75
virtual bool getJointTypeRaw(int axis, yarp::dev::JointTypeEnum &type)
Definition: IAxisInfo.h:97
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
Interface for getting information about specific axes, if available.
Definition: IAxisInfo.h:36
virtual bool getAxisName(int axis, std::string &name)=0
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool getJointType(int axis, yarp::dev::JointTypeEnum &type)
Definition: IAxisInfo.h:63
virtual ~IAxisInfo()
Destructor.
Definition: IAxisInfo.h:41
std::int32_t vocab32_t
Definition: numeric.h:78
For streams capable of holding different kinds of content, check what they actually have.
@ VOCAB_JOINTTYPE_REVOLUTE
Definition: IAxisInfo.h:24
@ VOCAB_JOINTTYPE_PRISMATIC
Definition: IAxisInfo.h:25
@ VOCAB_JOINTTYPE_UNKNOWN
Definition: IAxisInfo.h:26
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