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>
16
19namespace yarp::dev {
20class IAxisInfo;
21class IAxisInfoRaw;
22
29} // namespace yarp::dev
30
37{
38public:
42 virtual ~IAxisInfo() {}
43
50 virtual yarp::dev::ReturnValue getAxes(size_t& ax) = 0;
51
52 /* Get the name for a particular axis.
53 * @param axis joint number
54 * @param name the axis name
55 * @return true if everything goes fine, false otherwise.
56 */
57 virtual yarp::dev::ReturnValue getAxisName(int axis, std::string& name) = 0;
58
59 /* Get the joint type (e.g. revolute/prismatic) for a particular axis.
60 * @param axis joint number
61 * @param type the joint type
62 * @return true if everything goes fine, false otherwise.
63 */
64 virtual yarp::dev::ReturnValue 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 ReturnValue::return_code::return_value_error_method_failed; }
65};
66
73{
74public:
78 virtual ~IAxisInfoRaw() {}
79
86 virtual yarp::dev::ReturnValue getAxes(size_t& ax) = 0;
87
88 /* Get the name for a particular axis.
89 * @param axis joint number
90 * @param name the axis name
91 * @return true if everything goes fine, false otherwise.
92 */
93 virtual yarp::dev::ReturnValue getAxisNameRaw(int axis, std::string& name) = 0;
94
95 /* Get the joint type (e.g. revolute/prismatic) for a particular axis.
96 * @param axis joint number
97 * @param type the joint type
98 * @return true if everything goes fine, false otherwise.
99 */
100 virtual yarp::dev::ReturnValue 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 ReturnValue::return_code::return_value_error_method_failed; };
101};
102
103// interface IAxisInfo
106
107#endif // YARP_DEV_IAXISINFO_H
constexpr yarp::conf::vocab32_t VOCAB_INFO_TYPE
Definition IAxisInfo.h:105
constexpr yarp::conf::vocab32_t VOCAB_INFO_NAME
Definition IAxisInfo.h:104
#define yFatal(...)
Definition Log.h:382
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:73
virtual yarp::dev::ReturnValue getJointTypeRaw(int axis, yarp::dev::JointTypeEnum &type)
Definition IAxisInfo.h:100
virtual ~IAxisInfoRaw()
Destructor.
Definition IAxisInfo.h:78
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue getAxisNameRaw(int axis, std::string &name)=0
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:37
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue getJointType(int axis, yarp::dev::JointTypeEnum &type)
Definition IAxisInfo.h:64
virtual ~IAxisInfo()
Destructor.
Definition IAxisInfo.h:42
virtual yarp::dev::ReturnValue getAxisName(int axis, std::string &name)=0
@ return_value_error_method_failed
Method is deprecated.
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 Vocab32.h:27
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_dev_API
Definition api.h:18