YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ImplementAxisInfo.cpp
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
8
9#include <cstdio>
10using namespace yarp::dev;
11
13// Encoder Interface Timed Implementation
19
24
25bool ImplementAxisInfo::initialize(int size, const int *amap)
26{
27 if (helper != nullptr) {
28 return false;
29 }
30
31 helper=(void *)(new ControlBoardHelper(size, amap));
32 yAssert (helper != nullptr);
33
34 return true;
35}
36
42{
43 if (helper!=nullptr)
44 {
45 delete castToMapper(helper);
46 helper=nullptr;
47 }
48
49
50
51 return true;
52}
53
55{
56 bool ret=true;
57 (*ax) = castToMapper(helper)->axes();
58 return ret;
59}
60
61bool ImplementAxisInfo::getAxisName(int axis, std::string& name)
62{
63 bool ret;
64 int k = castToMapper(helper)->toHw(axis);
65 ret = iinfo->getAxisNameRaw(k, name);
66 return ret;
67}
68
70{
71 bool ret;
72 int k = castToMapper(helper)->toHw(axis);
73 ret = iinfo->getJointTypeRaw(k, type);
74 return ret;
75}
76
77bool ret;
yarp::dev::ControlBoardHelper * castToMapper(void *p)
bool ret
#define yAssert(x)
Definition Log.h:388
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:72
virtual bool getAxisNameRaw(int axis, std::string &name)=0
virtual bool getJointTypeRaw(int axis, yarp::dev::JointTypeEnum &type)
Definition IAxisInfo.h:99
bool getJointType(int axis, yarp::dev::JointTypeEnum &type) override
bool uninitialize()
Clean up internal data and memory.
bool getAxes(int *ax) override
Get the number of controlled axes.
bool initialize(int size, const int *amap)
Initialize the internal data and alloc memory.
ImplementAxisInfo(yarp::dev::IAxisInfoRaw *y)
bool getAxisName(int axis, std::string &name) override
For streams capable of holding different kinds of content, check what they actually have.
Definition jointData.cpp:13