YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
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
72{
73public:
77 virtual ~IAxisInfoRaw() {}
78
85 virtual bool getAxes(int* ax) = 0;
86
87 /* Get the name for a particular axis.
88 * @param axis joint number
89 * @param name the axis name
90 * @return true if everything goes fine, false otherwise.
91 */
92 virtual bool getAxisNameRaw(int axis, std::string& name) = 0;
93
94 /* Get the joint type (e.g. revolute/prismatic) for a particular axis.
95 * @param axis joint number
96 * @param type the joint type
97 * @return true if everything goes fine, false otherwise.
98 */
99 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; };
100};
101
102// interface IAxisInfo
105
106#endif // YARP_DEV_IAXISINFO_H
constexpr yarp::conf::vocab32_t VOCAB_INFO_TYPE
Definition IAxisInfo.h:104
constexpr yarp::conf::vocab32_t VOCAB_INFO_NAME
Definition IAxisInfo.h:103
#define yFatal(...)
Definition Log.h:372
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:72
virtual bool getAxisNameRaw(int axis, std::string &name)=0
virtual ~IAxisInfoRaw()
Destructor.
Definition IAxisInfo.h:77
virtual bool getJointTypeRaw(int axis, yarp::dev::JointTypeEnum &type)
Definition IAxisInfo.h:99
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